summary refs log tree commit diff
path: root/pkgs/os-specific/bsd/netbsd
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2018-04-27 20:50:15 -0500
committerMatthew Bauer <mjbauer95@gmail.com>2018-04-27 21:05:42 -0500
commit5f419f3df7f71b9dd88e513fcdd1303a5d5b99dd (patch)
tree4a595eb5c98e77a0318fd42062c2ab063cdb889a /pkgs/os-specific/bsd/netbsd
parentd11f290f670d04071f893deea891a373e1548821 (diff)
downloadnixpkgs-5f419f3df7f71b9dd88e513fcdd1303a5d5b99dd.tar
nixpkgs-5f419f3df7f71b9dd88e513fcdd1303a5d5b99dd.tar.gz
nixpkgs-5f419f3df7f71b9dd88e513fcdd1303a5d5b99dd.tar.bz2
nixpkgs-5f419f3df7f71b9dd88e513fcdd1303a5d5b99dd.tar.lz
nixpkgs-5f419f3df7f71b9dd88e513fcdd1303a5d5b99dd.tar.xz
nixpkgs-5f419f3df7f71b9dd88e513fcdd1303a5d5b99dd.tar.zst
nixpkgs-5f419f3df7f71b9dd88e513fcdd1303a5d5b99dd.zip
netbsd: improve darwin support
Diffstat (limited to 'pkgs/os-specific/bsd/netbsd')
-rw-r--r--pkgs/os-specific/bsd/netbsd/default.nix10
1 files changed, 6 insertions, 4 deletions
diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix
index 0cd2b4ffc6e..343b61bab38 100644
--- a/pkgs/os-specific/bsd/netbsd/default.nix
+++ b/pkgs/os-specific/bsd/netbsd/default.nix
@@ -68,10 +68,10 @@ let
 
     HOST_SH = "${bash}/bin/sh";
 
-    # not using bsd binutils
     SHLIB_WARNTEXTREL = "no";
     SHLIB_MKMAP = "no";
     PRESERVE = "-p";
+    OBJCOPY = if stdenv.isDarwin then "true" else "objcopy";
 
     MACHINE_ARCH = hostPlatform.parsed.cpu.name;
     MACHINE_CPU = hostPlatform.parsed.cpu.name;
@@ -393,7 +393,7 @@ in rec {
         --replace rogue "" \
         --replace sail "" \
         --replace trek "" \
-	--replace dab ""
+        --replace dab ""
       substituteInPlace Makefile.inc \
         --replace 2555 555 \
         --replace 2550 550
@@ -469,6 +469,7 @@ in rec {
     version = "7.1.2";
     sha256 = "06plg0bjqgbb0aghpb9qlk8wkp1l2izdlr64vbr5laqyw8jg84zq";
     buildInputs = [ compat tic nbperf ];
+    MKPIC = if stdenv.isDarwin then "no" else "yes";
     extraPaths = [
       (fetchNetBSD "share/terminfo" "7.1.2" "1z5vzq8cw24j05r6df4vd6r57cvdbv7vbm4h962kplp14xrbg2h3")
     ];
@@ -483,10 +484,11 @@ in rec {
       "-D__scanflike(a,b)="
       "-D__va_list=va_list"
       "-D__warn_references(a,b)="
-    ];
+    ] ++ lib.optional stdenv.isDarwin "-D__strong_alias(a,b)=";
     propagatedBuildInputs = [ compat ];
     MKDOC = "no"; # missing vfontedpr
-    patchPhase = ''
+    MKPIC = if stdenv.isDarwin then "no" else "yes";
+    patchPhase = lib.optionalString (!stdenv.isDarwin) ''
       substituteInPlace printw.c \
         --replace "funopen(win, NULL, __winwrite, NULL, NULL)" NULL \
         --replace "__strong_alias(vwprintw, vw_printw)" 'extern int vwprintw(WINDOW*, const char*, va_list) __attribute__ ((alias ("vw_printw")));'