GNUstep packages

First, thanks to the folks who submitted the gnustep packages to nixpkgs. I have a nice little NeXT thing going with windomaker.

I’m trying to build GNUMail.app with nix. I created a package here, along with a couple of additional dependencies. I can build and install these packages just fine. However, when I go to actually run GNUMail, I get a segmentation fault.

$ GNUMail 
2020-06-30 23:02:41.853 .GNUMail-wrapped[6177:6177] styleoffsets ... guessing offsets
2020-06-30 23:02:41.853 .GNUMail-wrapped[6177:6177] styleoffsets ... guessing offsets
Segmentation fault (core dumped)

I’ve tried to debug further, but I’ve been having trouble getting debug symbols. I tried doing this:

$ nix-build -E 'with import <nixos> {}; enableDebugging gnumail'
$ result/bin/GNUMail; sudo coredumpctl debug -1

However, I still don’t have any symbols. I am new to nix and not sure I did this correctly. I had to modify the parameter list of the gnumail function to accept stdenv, but I don’t use it, and gnustep’s version of callPackage appears to use its own clang-based stdenv, so I think that has something to do with it.

Speaking a bit more broadly, I think the current framework could handle the GNUstep directory better. I’d like to get the openapp and debugapp commands to work; currently, these are provided by the gnustep.make package, but they only search the GNUstep/Applications directory of that derivation. With the way nix works, I have an almost perfect GNUstep directory in ~/.nix-profile/lib/GNUstep. I say almost because some of the symlinks are a level too high:

$ cd ~/.nix-profile/lib; for dir in GNUstep/*; do printf '%s -> ' "$dir"; readlink -f $dir; done
GNUstep/Applications -> /nix/store/sf7ry0zyjilr3gb101kwdl258alqfa2b-user-environment/lib/GNUstep/Applications
GNUstep/ApplicationSupport -> /nix/store/31xpsi4270vwp00m12qs5ld134w4r5bn-gnumail-1.3.0/lib/GNUstep/ApplicationSupport
GNUstep/Bundles -> /nix/store/83gd5khihqplc8zf0fvig2rp6hrinkiq-gnustep-back-0.27.0/lib/GNUstep/Bundles
GNUstep/Fonts -> /nix/store/83gd5khihqplc8zf0fvig2rp6hrinkiq-gnustep-back-0.27.0/lib/GNUstep/Fonts
GNUstep/Frameworks -> /nix/store/sf7ry0zyjilr3gb101kwdl258alqfa2b-user-environment/lib/GNUstep/Frameworks

Some of the links, like the one for Bundles, should be pointing to a profile, that can be populated by multiple packages, similar to how bin is handled. If it’s possible to enforce that, and provide a system I think the current solution with wrapping each binary would no longer be necessary and openapp will just work. What’s a good way to go about implementing this?

This will happen automatically if more than one package containing the GNUstep/Bundles directory is installed — the way the symlinks are created is generic, and will create as few symlinks as possible. That way, nix doesn’t need to know anything about specific directory layout conventions.

(I don’t know anything about GNUstep so I can’t really provide much feedback on the rest of this.)