-
-
Notifications
You must be signed in to change notification settings - Fork 27
Building on Mac
The build and install is described in detail, in case it assists someone.
A fairly unmodified non-developer's Macbook Air, running Mojave 10.14.6, Nov 2020.
Download nedit-ng-master.zip
from the green button labelled "Code" at https://github.com/eteran/nedit-ng. Unzip into any convenient location. This creates nedit-ng-master
.
You will need the base set of Xcode command-line tools. To get these, in a Terminal shell type xcode-select --install
A basic check that they have installed ok is: make
and make --help
.
Next we install Homebrew. For background, see https://brew.sh/ and https://osxdaily.com/2018/03/07/how-install-homebrew-mac-os/ This is a very reputable repository of all sorts of Mac/Linux tools.
To install Homebrew, use:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
You may need your system administrator password. This will take a few minutes to download and build.
Type brew
to be sure you have it, and can find it in your search PATH. For good measure type brew update
to be sure it's up-to-date. My brew --version
was 2.5.8.
Next install cmake with brew install cmake
. Type cmake
, cmake --version
, to check all is good. My version was 3.19.0-rc2.
Now install bison with brew install bison
. The install may end with a suggested command to ensure that this bison (and not some older one you may already have) is found first in your search PATH. Example:
echo 'export PATH="/usr/local/opt/bison/bin:$PATH"' >> /Users/myusername/.bash_profile
Issue that command in the Terminal, start a new Terminal tab with Cmd-T (to force a new shell to start and use the new PATH), and check all good with bison --version
. Mine was 3.7. You can check your PATH environment variable with printenv PATH
. These are the locations the bash or zsh shell searches for commands.
(Note, Mac OS has an older version of Bison installed as standard, Bison 2.3 from 2005. This used to work for building nedit-ng but doesn't any longer, you will need to install a newer version).
Next install the Boost C++ library with brew install boost
. Again there may be an addition to your PATH suggested. brew info boost
said 1.74.0.
Next install the latest Qt5 library with brew install qt5
. There may be an addition to PATH suggested. brew info qt
said 5.15.1.
Now we have all the tools and libaries. Build and install nedit-ng with ..
cd nedit-ng-master
mkdir build
cd build
cmake ..
make // There may be a number of "deprecated" and "cast" warnings, these are ok
make install // Optional. Copies the binaries to /usr/local/bin
Copy the binaries nedit-ng
, nc-ng
, nedit-import
to where you would like them, perhaps $HOME/mybin
, or /usr/local/bin
. Make sure that location is in your PATH.
- Import your old nedit settings and macros with
nedit-import nedit.rc
- Set preferred font and size from the Nedit-ng Preferences menu.
- Set preferred colour schemes from the Nedit-ng Preferences menu.
All done !
Macbook Pro with MacOS Catalina 10.15.7, Xcode already installed and multitudes of software and tools. Nov 2020.
Xcode Command-Line tools were already installed.
Download the nedit-ng source as above, and unzip.
Cmake was already installed as a full Gui aplication from https://cmake.org/ We only need the command-line tools here. Add these to your path in $HOME/.bash_profile
with a line like:
PATH=/Applications/CMake.app/Contents/bin:$PATH:
This will put the tools in front of any older version that may already be on your PATH.
Install Homebrew as above.
Install Bison (optional), Boost, Qt5 as above with the brew
command.
Build nedit-ng as above.
Note, as per Issue 174 ( https://github.com/eteran/nedit-ng/issues/174 ) if the build fails, you may need to set some env vars before you run cmake. This is based on Boost and QT5 having been installed by Homebrew. Adjust the paths as needed.
export BOOST_ROOT=/usr/local/Cellar/boost/1.74.0/
export Qt5_DIR=/usr/local/Cellar/qt/5.15.1
The same Macbook Pro upgraded to MacOS Big Sur 11.1, 11.2, 11.3.1, 11.5
11.5 build, 23 July 21.
The process is the same as Catalina above. Versions of tools/libs (at MacOS 11.5):
brew 3.2.3 ( brew --version )
cmake 3.19.0-rc2 ( cmake --version )
bison 3.7.6 ( bison --version )
boost 1.76.0 ( brew info boost )
Qt 5.15.2 ( brew info Qt5 )
XCode 12.5.1 ( system_profiler SPDeveloperToolsDataType )
To do: Put the whole sequence as one list, just for reference. But don't recommend wildly running it in one blast !
The Makefile below can be used instead of having to set the above environment variables or edit your PATH to build, although suitable versions of the same software packages (cmake, bison, boost and Qt5) must be installed as described above. Copy the text below into a file named Makefile
in the top of the nedit-ng source tree, making sure that you use real tab characters to indent the lines below the # Build Rules
comment. Adjust the PREFIX
variable as desired, the setting given below will install into /usr/local/bin
. Then run make
to build and/or make install
to install the results.
# Build configuration
# Install location
PREFIX = /usr/local
# Dependencies, from Homebrew:
ENVS += BOOST_ROOT=/usr/local/opt/boost
ENVS += Qt5_DIR=/usr/local/opt/qt@5
export PATH := /usr/local/opt/bison/bin:$(PATH)
CMAKE = /usr/local/bin/cmake
# Build path
BUILD = Build
CMAKE_TARGETS = all install
CMAKE_OPTIONS += -DCMAKE_INSTALL_PREFIX=$(PREFIX)
default: all
# Build Rules
$(BUILD):
mkdir $@
$(BUILD)/Makefile: $(BUILD)
cd $(BUILD) && \
export $(ENVS) && \
$(CMAKE) $(CMAKE_OPTIONS) ..
$(CMAKE_TARGETS): %: $(BUILD)/Makefile
$(MAKE) -C $(BUILD) -j3 $@
clean:
test -f $(BUILD)/Makefile && \
$(MAKE) -C $(BUILD) $@
distclean:
rm -rf $(BUILD)
.PHONY: $(CMAKE_TARGETS) clean distclean