about 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.nix40
1 files changed, 18 insertions, 22 deletions
diff --git a/pkgs/tools/system/plan9port/default.nix b/pkgs/tools/system/plan9port/default.nix
index b3909a79d942..1f5c6814e393 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
 }:
 
@@ -17,6 +21,12 @@ stdenv.mkDerivation rec {
     sha256 = "1lp17948q7vpl8rc2bf5a45bc8jqyj0s3zffmks9r25ai42vgb43";
   };
 
+  patches = [
+    ./tmpdir.patch
+    ./darwin-sw_vers.patch
+    ./darwin-cfframework.patch
+  ];
+
   postPatch = ''
     #hardcoded path
     substituteInPlace src/cmd/acme/acme.c \
@@ -35,30 +45,16 @@ stdenv.mkDerivation rec {
   '';
 
   buildInputs = [
-    which perl libX11 fontconfig xorgproto libXt libXext
+    which 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 = ''