summary refs log tree commit diff
path: root/pkgs/tools/system/plan9port/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/system/plan9port/default.nix')
-rw-r--r--pkgs/tools/system/plan9port/default.nix44
1 files changed, 22 insertions, 22 deletions
diff --git a/pkgs/tools/system/plan9port/default.nix b/pkgs/tools/system/plan9port/default.nix
index 21487e66bcd..9776960327e 100644
--- a/pkgs/tools/system/plan9port/default.nix
+++ b/pkgs/tools/system/plan9port/default.nix
@@ -1,7 +1,11 @@
-{ stdenv, fetchFromGitHub, which, libX11, libXt, fontconfig, freetype
+{ stdenv, fetchFromGitHub, which
+, darwin ? null
 , xorgproto ? null
+, libX11
 , libXext ? null
-, zlib ? null
+, libXt ? null
+, fontconfig ? null
+, freetype ? null
 , perl ? null  # For building web manuals
 }:
 
@@ -16,14 +20,24 @@ stdenv.mkDerivation {
     sha256 = "1lp17948q7vpl8rc2bf5a45bc8jqyj0s3zffmks9r25ai42vgb43";
   };
 
+  patches = [
+    ./tmpdir.patch
+    ./darwin-sw_vers.patch
+    ./darwin-cfframework.patch
+  ];
+
   postPatch = ''
     #hardcoded path
     substituteInPlace src/cmd/acme/acme.c \
       --replace /lib/font/bit $out/plan9/font
+
     #deprecated flags
     find . -type f \
       -exec sed -i -e 's/_SVID_SOURCE/_DEFAULT_SOURCE/g' {} \; \
       -exec sed -i -e 's/_BSD_SOURCE/_DEFAULT_SOURCE/g' {} \;
+
+    substituteInPlace bin/9c \
+      --replace 'which uniq' '${which}/bin/which uniq'
   '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
     #add missing ctrl+c\z\x\v keybind for non-Darwin
     substituteInPlace src/cmd/acme/text.c \
@@ -34,30 +48,16 @@ stdenv.mkDerivation {
   '';
 
   buildInputs = [
-    which perl libX11 fontconfig xorgproto libXt libXext
+    perl
+  ] ++ stdenv.lib.optionals (!stdenv.isDarwin) [
+    xorgproto libX11 libXext libXt fontconfig
     freetype # fontsrv wants ft2build.h provides system fonts for acme and sam.
-  ];
+  ] ++ stdenv.lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
+    darwin.cf-private Carbon Cocoa IOKit Metal QuartzCore
+  ]);
 
   builder = ./builder.sh;
-
-  libX11_dev = libX11.dev;
   libXt_dev = libXt.dev;
-  libXext_dev = libXext.dev;
-  fontconfig_dev = fontconfig.dev;
-  freetype_dev = freetype.dev;
-  zlib_dev = zlib.dev;
-
-  xorgproto_exp = xorgproto;
-  libX11_exp = libX11;
-  libXt_exp = libXt;
-  libXext_exp = libXext;
-  freetype_exp = freetype;
-  zlib_exp = zlib;
-
-  fontconfig_lib = fontconfig.lib;
-
-  NIX_LDFLAGS="-lgcc_s";
-  enableParallelBuilding = true;
 
   doInstallCheck = true;
   installCheckPhase = ''