nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 buildPackages,
6 nixosTests,
7}:
8
9stdenv.mkDerivation rec {
10 pname = "nspr";
11 version = "4.37";
12
13 src = fetchurl {
14 url = "mirror://mozilla/nspr/releases/v${version}/src/nspr-${version}.tar.gz";
15 hash = "sha256-X5NE7Q4xhVvTj4izPJ2auU9wzlR+8yE+SI0VIPYYQPo=";
16 };
17
18 patches = [
19 ./0001-Makefile-use-SOURCE_DATE_EPOCH-for-reproducibility.patch
20 ];
21
22 outputs = [
23 "out"
24 "dev"
25 ];
26 outputBin = "dev";
27
28 preConfigure = ''
29 cd nspr
30 ''
31 + lib.optionalString stdenv.hostPlatform.isDarwin ''
32 substituteInPlace configure --replace '@executable_path/' "$out/lib/"
33 substituteInPlace configure.in --replace '@executable_path/' "$out/lib/"
34 '';
35
36 HOST_CC = "cc";
37 depsBuildBuild = [ buildPackages.stdenv.cc ];
38 configureFlags = [
39 "--enable-optimize"
40 "--disable-debug"
41 ]
42 ++ lib.optional stdenv.hostPlatform.is64bit "--enable-64bit";
43
44 postInstall = ''
45 find $out -name "*.a" -delete
46 moveToOutput share "$dev" # just aclocal
47 '';
48
49 enableParallelBuilding = true;
50
51 passthru.tests = {
52 inherit (nixosTests) firefox firefox-esr;
53 };
54
55 meta = with lib; {
56 homepage = "https://firefox-source-docs.mozilla.org/nspr/index.html";
57 description = "Netscape Portable Runtime, a platform-neutral API for system-level and libc-like functions";
58 maintainers = with maintainers; [
59 ajs124
60 hexa
61 ];
62 platforms = platforms.all;
63 license = licenses.mpl20;
64 };
65}