From 2a99b51390e9f8b5dfd1629ff51c2951cb94f563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A4in=C3=B6=20J=C3=A4rvel=C3=A4?= Date: Tue, 20 Feb 2018 12:11:05 +0200 Subject: [PATCH 1/3] nspr: link libraries with absolute paths on Darwin --- pkgs/development/libraries/nspr/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/libraries/nspr/default.nix b/pkgs/development/libraries/nspr/default.nix index 2930de508e9..ccb04024f64 100644 --- a/pkgs/development/libraries/nspr/default.nix +++ b/pkgs/development/libraries/nspr/default.nix @@ -16,6 +16,9 @@ stdenv.mkDerivation { preConfigure = '' cd nspr + '' + stdenv.lib.optionalString stdenv.isDarwin '' + substituteInPlace configure --replace '@executable_path/' "$out/lib/" + substituteInPlace configure.in --replace '@executable_path/' "$out/lib/" ''; configureFlags = [ From aacd3e526799516e46e229e05ee25518063d3419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A4in=C3=B6=20J=C3=A4rvel=C3=A4?= Date: Tue, 20 Feb 2018 12:12:24 +0200 Subject: [PATCH 2/3] nss: link libraries with absolute paths on Darwin --- pkgs/development/libraries/nss/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/nss/default.nix b/pkgs/development/libraries/nss/default.nix index 8d799e2c13a..a8f36af5df5 100644 --- a/pkgs/development/libraries/nss/default.nix +++ b/pkgs/development/libraries/nss/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, nspr, perl, zlib, sqlite }: +{ stdenv, fetchurl, nspr, perl, zlib, sqlite, fixDarwinDylibNames }: let @@ -16,7 +16,8 @@ in stdenv.mkDerivation rec { sha256 = "186x33wsk4mzjz7dzbn8p0py9a0nzkgzpfkdv4rlyy5gghv5vhd3"; }; - buildInputs = [ perl zlib sqlite ]; + buildInputs = [ perl zlib sqlite ] + ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames; propagatedBuildInputs = [ nspr ]; @@ -33,6 +34,10 @@ in stdenv.mkDerivation rec { patchFlags = "-p0"; + postPatch = stdenv.lib.optionalString stdenv.isDarwin '' + substituteInPlace nss/coreconf/Darwin.mk --replace '@executable_path/$(notdir $@)' "$out/lib/\$(notdir \$@)" + ''; + outputs = [ "out" "dev" "tools" ]; preConfigure = "cd nss"; From 2a532e2496f5b5637598847955cf005689be2bab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A4in=C3=B6=20J=C3=A4rvel=C3=A4?= Date: Sun, 18 Feb 2018 21:19:52 +0200 Subject: [PATCH 3/3] rpm: Add Darwin support --- pkgs/tools/package-management/rpm/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/package-management/rpm/default.nix b/pkgs/tools/package-management/rpm/default.nix index 57581091f92..3a56db1e0d3 100644 --- a/pkgs/tools/package-management/rpm/default.nix +++ b/pkgs/tools/package-management/rpm/default.nix @@ -18,7 +18,8 @@ stdenv.mkDerivation rec { buildInputs = [ cpio zlib bzip2 file libarchive nspr nss db xz python lua ]; # rpm/rpmlib.h includes popt.h, and then the pkg-config file mentions these as linkage requirements - propagatedBuildInputs = [ popt elfutils nss db bzip2 libarchive libbfd ]; + propagatedBuildInputs = [ popt nss db bzip2 libarchive libbfd ] + ++ stdenv.lib.optional stdenv.isLinux elfutils; NIX_CFLAGS_COMPILE = "-I${nspr.dev}/include/nspr -I${nss.dev}/include/nss"; @@ -59,6 +60,6 @@ stdenv.mkDerivation rec { license = licenses.gpl2; description = "The RPM Package Manager"; maintainers = with maintainers; [ copumpkin ]; - platforms = platforms.linux; + platforms = platforms.linux ++ platforms.darwin; }; }