Merge pull request #35142 from Kaali/master

rpm: Add Darwin support

Changed files
+13 -4
pkgs
development
libraries
tools
package-management
+3
pkgs/development/libraries/nspr/default.nix
···
preConfigure = ''
cd nspr
+
'' + stdenv.lib.optionalString stdenv.isDarwin ''
+
substituteInPlace configure --replace '@executable_path/' "$out/lib/"
+
substituteInPlace configure.in --replace '@executable_path/' "$out/lib/"
'';
configureFlags = [
+7 -2
pkgs/development/libraries/nss/default.nix
···
-
{ stdenv, fetchurl, nspr, perl, zlib, sqlite }:
+
{ stdenv, fetchurl, nspr, perl, zlib, sqlite, fixDarwinDylibNames }:
let
···
sha256 = "186x33wsk4mzjz7dzbn8p0py9a0nzkgzpfkdv4rlyy5gghv5vhd3";
};
-
buildInputs = [ perl zlib sqlite ];
+
buildInputs = [ perl zlib sqlite ]
+
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
propagatedBuildInputs = [ nspr ];
···
];
patchFlags = "-p0";
+
+
postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
+
substituteInPlace nss/coreconf/Darwin.mk --replace '@executable_path/$(notdir $@)' "$out/lib/\$(notdir \$@)"
+
'';
outputs = [ "out" "dev" "tools" ];
+3 -2
pkgs/tools/package-management/rpm/default.nix
···
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";
···
license = licenses.gpl2;
description = "The RPM Package Manager";
maintainers = with maintainers; [ copumpkin ];
-
platforms = platforms.linux;
+
platforms = platforms.linux ++ platforms.darwin;
};
}