From 26aef37424aa1791777715d3c3a48bd799b7ffef Mon Sep 17 00:00:00 2001 From: Jason Felice Date: Tue, 11 Jun 2019 11:48:57 -0400 Subject: [PATCH] plan9port: build everything on Darwin A commit in 2014 (see #2266) disabled building parts which depended on X11 on Mac OS. There's no explanation given in the pull request. In any case, many people install plan9port on Darwin specifically to use the UI components. Aside from this, the derivation was broken on Mac OS, probably because people put the `which` and `perl` dependencies inside the !isDarwin conditional. Some programs worked, however the static libraries did not build, so this could not be used as a buildInput to build programs which need the libraries. This fixes that. --- pkgs/tools/system/plan9port/default.nix | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/system/plan9port/default.nix b/pkgs/tools/system/plan9port/default.nix index c14fbc49e0d..b3909a79d94 100644 --- a/pkgs/tools/system/plan9port/default.nix +++ b/pkgs/tools/system/plan9port/default.nix @@ -34,7 +34,7 @@ stdenv.mkDerivation rec { --replace "case Kcmd+'v':" "case 0x16: case Kcmd+'v':" ''; - buildInputs = stdenv.lib.optionals (!stdenv.isDarwin) [ + buildInputs = [ which perl libX11 fontconfig xorgproto libXt libXext freetype # fontsrv wants ft2build.h provides system fonts for acme and sam. ]; @@ -60,6 +60,27 @@ stdenv.mkDerivation rec { NIX_LDFLAGS="-lgcc_s"; enableParallelBuilding = true; + doInstallCheck = true; + installCheckPhase = '' + $out/bin/9 rc -c 'echo rc is working.' + + # 9l can find and use its libs + cd $TMP + cat >test.c < + #include + #include + void + threadmain(int argc, char **argv) + { + threadexitsall(nil); + } + EOF + $out/bin/9 9c -o test.o test.c + $out/bin/9 9l -o test test.o + ./test + ''; + meta = with stdenv.lib; { homepage = https://9fans.github.io/plan9port/; description = "Plan 9 from User Space";