Skip to content
Andrew Johnson edited this page Apr 21, 2022 · 35 revisions

Several builds are described below in detail, in case they assist someone.

Once nedit-ng is installed, you will want to change Apple's ⌘H key-binding to be able to use "Find Selection" in Nedit-ng, otherwise your window disappears every time you try to do a search! In System Preferences go to Keyboard, Shortcuts, App Shortcuts and add an All Applications shortcut for Hide nedit-ng. I set it to Shift+Option+Command+H ⌥⇧⌘H but I never normally use these OS "Hide " keystrokes anyway so almost anything obscure would work for me.

Mojave 10.14.6

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 !


Catalina 10.15.7

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

Big Sur 11.1, 11.2, 11.3.1, 11.5

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 !


Monterey 12.3.1 on an Apple M1 CPU

The only difference with this combination seems to be that Homebrew is now installed into /home/homebrew instead of /usr/local (that might be configurable, I didn't check). After installing the usual packages I updated the Makefile below to make that path switch easier to do, and the result builds and runs fine on the ARM64 M1 CPU.

Versions used on 2022-04-17:

  • cmake version 3.23.1
  • bison (GNU Bison) 2.3
  • boost: stable 1.78.0 (bottled)
  • qt@5: stable 5.15.3 (bottled)

Makefile

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 using Homebrew 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. Point the HOMEBREW variable at your Homebrew installation (older versions may be in /usr/local) and 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

# Where Homebrew is installed
HOMEBREW=/opt/homebrew

# Where to install programs (to $(PREFIX)/bin)
PREFIX = /usr/local

# Dependencies, from Homebrew:
ENVS += BOOST_ROOT=$(HOMEBREW)/opt/boost
ENVS += Qt5_DIR=$(HOMEBREW)/opt/qt@5
export PATH := $(HOMEBREW)/opt/bison/bin:$(PATH)
CMAKE = $(HOMEBREW)/bin/cmake

# Build path
BUILD = Build

CMAKE_TARGETS = all install

CMAKE_OPTIONS += -DCMAKE_INSTALL_PREFIX=$(PREFIX)

default: all

# NB: $(BUILD) is a real directory
$(BUILD):
	mkdir $@

$(BUILD)/Makefile: | $(BUILD)
	cd $(BUILD) && \
	    export $(ENVS) && \
	    $(CMAKE) $(CMAKE_OPTIONS) ..

$(CMAKE_TARGETS): %: $(BUILD)/Makefile
	$(MAKE) -C $(BUILD) -j8 $@

clean:
	test -f $(BUILD)/Makefile && \
	    $(MAKE) -C $(BUILD) $@

distclean:
	rm -rf $(BUILD)

.PHONY: $(CMAKE_TARGETS) clean distclean
Clone this wiki locally