2

I have an old MacBook which cannot be upgraded to anything higher than Catalina (at least officially) and I had been using Homebrew but since now it's not supported it tries to compile every package and that takes a very long time, so I switched to MacPorts.

I'm trying to install the ncdu port but it depends on zig, MacPorts fetches zig-0.11.0_0.darwin_19.x86_64 but the build fails with error: command execution failed.

I checked here https://ports.macports.org/port/zig/details/ and noticed that indeed it doesn't work with Catalina because it requires darwin >= 20. I manually downloaded zig 0.10.1 and it works fine so my question is: Is there a way to make MacPorts use the zig version that I installed manually and take that one as a dependency for installing ncdu (a previous version if possible).

It's my first time using MacPorts so any help is really appreciated, thanks.

1
  • Make a local portfile and install that. Commented Aug 28, 2023 at 14:47

2 Answers 2

2

There's a ncdu1 port https://ports.macports.org/port/ncdu1/details/ which works from Snow Leopard to Sonoma.

1

I have a Mac Pro with High Sierra 10.13 and use the Homebrew package manager. I have found the latest ncdu build for a higher macOS version can run in my old machine after re-linking to the correct libncurse library. I think MacPorts builds are similar.


## download the latest build for the closest macOS to local.
brew fetch --os monterey ncdu
## untar it and move it to the homebrew software database.
tar xf balabala...
cp -r balabala...
## homebrew command to link it to its apposite path(i.e. /usr/local, /usr/local/lib etc.).
brew link ncdu
## Now, executing ncdu will report Library not loaded
## Use "otool" to check the wrong linking and change it, make sure the correct libncurse is installed.
otool -L /usr/local/bin/ncdu
## re-link it to correct one, it should work. An example in my machine
sudo install_name_tool -change @@HOMEBREW_PREFIX@@/opt/ncurses/lib/libncursesw.6.dylib /usr/local/opt/ncurses/lib/libncursesw.6.dylib /usr/local/bin/ncdu
1
  • By the way, gdu provides similar functions and can be compiled in deprecated in old MacOS.
    – niu541412
    Commented Nov 10 at 8:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .