···72Per the instructions in the [Cargo Book](https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html)
73best practices guide, Rust applications should always commit the `Cargo.lock`
74file in git to ensure a reproducible build. However, a few packages do not, and
75-Nix depends on this file, so if it missing you can use `cargoPatches` to apply
76-it in the `patchPhase`. Consider sending a PR upstream with a note to the
77maintainer describing why it's important to include in the application.
7879The fetcher will verify that the `Cargo.lock` file is in sync with the `src`
···146 rustc.platform = { foo = ""; bar = ""; };
147 };
148 }
00149 will result in:
150 ```shell
151 --target /nix/store/asdfasdfsadf-thumb-crazy.json # contains {"foo":"","bar":""}
···156157```nix
158pkgs.rustPlatform.buildRustPackage {
159- (...)
160 target = "x86_64-fortanix-unknown-sgx";
161}
162```
···191Please note that the code will be compiled twice here: once in `release` mode
192for the `buildPhase`, and again in `debug` mode for the `checkPhase`.
1930000000194#### Tests relying on the structure of the `target/` directory
195196Some tests may rely on the structure of the `target/` directory. Those tests
···320 variable `buildAndTestSubdir` can be used to build a crate in a
321 Cargo workspace. Additional maturin flags can be passed through
322 `maturinBuildFlags`.
323-* `cargoCheckHook`: run tests using Cargo. Additional flags can be
324- passed to Cargo using `checkFlags` and `checkFlagsArray`. By
325- default, tests are run in parallel. This can be disabled by setting
0326 `dontUseCargoParallelTests`.
327* `cargoInstallHook`: install binaries and static/shared libraries
328 that were built using `cargoBuildHook`.
···72Per the instructions in the [Cargo Book](https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html)
73best practices guide, Rust applications should always commit the `Cargo.lock`
74file in git to ensure a reproducible build. However, a few packages do not, and
75+Nix depends on this file, so if it is missing you can use `cargoPatches` to
76+apply it in the `patchPhase`. Consider sending a PR upstream with a note to the
77maintainer describing why it's important to include in the application.
7879The fetcher will verify that the `Cargo.lock` file is in sync with the `src`
···146 rustc.platform = { foo = ""; bar = ""; };
147 };
148 }
149+ ```
150+151 will result in:
152 ```shell
153 --target /nix/store/asdfasdfsadf-thumb-crazy.json # contains {"foo":"","bar":""}
···158159```nix
160pkgs.rustPlatform.buildRustPackage {
161+ /* ... */
162 target = "x86_64-fortanix-unknown-sgx";
163}
164```
···193Please note that the code will be compiled twice here: once in `release` mode
194for the `buildPhase`, and again in `debug` mode for the `checkPhase`.
195196+Test flags, e.g., `--features xxx/yyy`, can be passed to `cargo test` via the
197+`cargoTestFlags` attribute.
198+199+Another attribute, called `checkFlags`, is used to pass arguments to the test
200+binary itself, as stated
201+(here)[https://doc.rust-lang.org/cargo/commands/cargo-test.html].
202+203#### Tests relying on the structure of the `target/` directory
204205Some tests may rely on the structure of the `target/` directory. Those tests
···329 variable `buildAndTestSubdir` can be used to build a crate in a
330 Cargo workspace. Additional maturin flags can be passed through
331 `maturinBuildFlags`.
332+* `cargoCheckHook`: run tests using Cargo. The build type for checks
333+ can be set using `cargoCheckType`. Additional flags can be passed to
334+ the tests using `checkFlags` and `checkFlagsArray`. By default,
335+ tests are run in parallel. This can be disabled by setting
336 `dontUseCargoParallelTests`.
337* `cargoInstallHook`: install binaries and static/shared libraries
338 that were built using `cargoBuildHook`.
···58 comment = "The bridge between designers and developers";
59 };
6061- nativeBuildInputs = [makeWrapper wrapGAppsHook];
62- buildInputs = [ unzip gtk3 gnome3.adwaita-icon-theme ];
6364 # src is producing multiple folder on unzip so we must
65 # override unpackCmd to extract it into newly created folder
···58 comment = "The bridge between designers and developers";
59 };
6061+ nativeBuildInputs = [makeWrapper wrapGAppsHook unzip];
62+ buildInputs = [ gtk3 gnome3.adwaita-icon-theme ];
6364 # src is producing multiple folder on unzip so we must
65 # override unpackCmd to extract it into newly created folder
+1-2
pkgs/applications/graphics/imagej/default.nix
···15 url = "https://wsr.imagej.net/distros/cross-platform/ij150.zip";
16 sha256 = "97aba6fc5eb908f5160243aebcdc4965726693cb1353d9c0d71b8f5dd832cb7b";
17 };
18- nativeBuildInputs = [ makeWrapper ];
19- buildInputs = [ unzip ];
20 inherit jre;
2122 # JAR files that are intended to be used by other packages
···15 url = "https://wsr.imagej.net/distros/cross-platform/ij150.zip";
16 sha256 = "97aba6fc5eb908f5160243aebcdc4965726693cb1353d9c0d71b8f5dd832cb7b";
17 };
18+ nativeBuildInputs = [ makeWrapper unzip ];
019 inherit jre;
2021 # JAR files that are intended to be used by other packages
···8 sha256 = "12aql6svkplxq5fjycar18863hcq84c5kx8g6f4rj0lcvigw24di";
9 };
100000011 outputs = [ "out" "doc" ]; # headers are just two and very small
1213 preConfigure = if stdenv.isDarwin then ''
···8 sha256 = "12aql6svkplxq5fjycar18863hcq84c5kx8g6f4rj0lcvigw24di";
9 };
1011+ patches = [
12+ # Remove once https://sourceforge.net/p/soxr/code/merge-requests/5/ is merged.
13+ ./arm64-check.patch
14+ ];
15+16 outputs = [ "out" "doc" ]; # headers are just two and very small
1718 preConfigure = if stdenv.isDarwin then ''
···3}:
45mkDerivation rec {
6- version = "2.3.6";
7 pname = "lyx";
89 src = fetchurl {
10 url = "ftp://ftp.lyx.org/pub/lyx/stable/2.3.x/${pname}-${version}.tar.xz";
11- sha256 = "160whjwwrmxizdakjlkf9xc86bhqfnslw47fixgqq4qhbapcxxkg";
12 };
1314 # LaTeX is used from $PATH, as people often want to have it with extra pkgs
···3}:
45mkDerivation rec {
6+ version = "2.3.6.1";
7 pname = "lyx";
89 src = fetchurl {
10 url = "ftp://ftp.lyx.org/pub/lyx/stable/2.3.x/${pname}-${version}.tar.xz";
11+ sha256 = "sha256-xr7SYzQZiY4Bp8w1AxDX2TS/WRyrcln8JYGqTADq+ng=";
12 };
1314 # LaTeX is used from $PATH, as people often want to have it with extra pkgs
···2122 inherit python; # pass it so that the same version can be used in hg2git
2324- nativeBuildInputs = [ makeWrapper ];
25- buildInputs = [ docutils unzip ]
26 ++ lib.optionals stdenv.isDarwin [ ApplicationServices ];
2728 propagatedBuildInputs = [ hg-git dulwich ];
···2122 inherit python; # pass it so that the same version can be used in hg2git
2324+ nativeBuildInputs = [ makeWrapper unzip ];
25+ buildInputs = [ docutils ]
26 ++ lib.optionals stdenv.isDarwin [ ApplicationServices ];
2728 propagatedBuildInputs = [ hg-git dulwich ];
···1920 passthru = { inherit python; }; # pass it so that the same version can be used in hg2git
2122- nativeBuildInputs = [ makeWrapper ];
23- buildInputs = [ docutils unzip ]
24 ++ lib.optionals stdenv.isDarwin [ ApplicationServices ];
2526 makeFlags = [ "PREFIX=$(out)" ];
···1920 passthru = { inherit python; }; # pass it so that the same version can be used in hg2git
2122+ nativeBuildInputs = [ makeWrapper unzip ];
23+ buildInputs = [ docutils ]
24 ++ lib.optionals stdenv.isDarwin [ ApplicationServices ];
2526 makeFlags = [ "PREFIX=$(out)" ];
···29 EOF
30 '';
3132- nativeBuildInputs = [ pkg-config ];
33- buildInputs = [ unzip libixp_hg txt2tags dash python which
34 libX11 libXrender libXext libXinerama libXrandr libXft ];
3536 # For some reason including mercurial in buildInputs did not help
···29 EOF
30 '';
3132+ nativeBuildInputs = [ pkg-config unzip ];
33+ buildInputs = [ libixp_hg txt2tags dash python which
34 libX11 libXrender libXext libXinerama libXrandr libXft ];
3536 # For some reason including mercurial in buildInputs did not help
+4
pkgs/build-support/bintools-wrapper/default.nix
···306 done
307 ''
3080000309 + ''
310 for flags in "$out/nix-support"/*flags*; do
311 substituteInPlace "$flags" --replace $'\n' ' '
···36, # Shell commands to run after building the symlink tree.
37 postBuild ? ""
3839-, # Additional inputs. Handy e.g. if using makeWrapper in `postBuild`.
40- buildInputs ? []
04142, passthru ? {}
43, meta ? {}
···53runCommand name
54 rec {
55 inherit manifest ignoreCollisions checkCollisionContents passthru
56- meta pathsToLink extraPrefix postBuild buildInputs;
057 pkgs = builtins.toJSON (map (drv: {
58 paths =
59 # First add the usual output(s): respect if user has chosen explicitly,
···36, # Shell commands to run after building the symlink tree.
37 postBuild ? ""
3839+# Additional inputs
40+, nativeBuildInputs ? [] # Handy e.g. if using makeWrapper in `postBuild`.
41+, buildInputs ? []
4243, passthru ? {}
44, meta ? {}
···54runCommand name
55 rec {
56 inherit manifest ignoreCollisions checkCollisionContents passthru
57+ meta pathsToLink extraPrefix postBuild
58+ nativeBuildInputs buildInputs;
59 pkgs = builtins.toJSON (map (drv: {
60 paths =
61 # First add the usual output(s): respect if user has chosen explicitly,
+12-4
pkgs/build-support/cc-wrapper/cc-wrapper.sh
···198199PATH="$path_backup"
200# Old bash workaround, see above.
201-exec @prog@ \
202- ${extraBefore+"${extraBefore[@]}"} \
203- ${params+"${params[@]}"} \
204- ${extraAfter+"${extraAfter[@]}"}
00000000
···3--- plasma-desktop-5.8.5.orig/kcms/dateandtime/helper.cpp
4+++ plasma-desktop-5.8.5/kcms/dateandtime/helper.cpp
5@@ -48,10 +48,6 @@
6- #include <sys/stat.h>
7 #endif
8-9-// We cannot rely on the $PATH environment variable, because D-Bus activation
10-// clears it. So we have to use a reasonable default.
11-static const QString exePath = QStringLiteral("/usr/sbin:/usr/bin:/sbin:/bin");
12-
13- int ClockHelper::ntp( const QStringList& ntpServers, bool ntpEnabled )
14 {
15 int ret = 0;
16@@ -227,7 +223,7 @@ int ClockHelper::tzreset()
···3--- plasma-desktop-5.8.5.orig/kcms/dateandtime/helper.cpp
4+++ plasma-desktop-5.8.5/kcms/dateandtime/helper.cpp
5@@ -48,10 +48,6 @@
6+ #include <sys/types.h>
7 #endif
8+9-// We cannot rely on the $PATH environment variable, because D-Bus activation
10-// clears it. So we have to use a reasonable default.
11-static const QString exePath = QStringLiteral("/usr/sbin:/usr/bin:/sbin:/bin");
12-
13+ int ClockHelper::ntp(const QStringList &ntpServers, bool ntpEnabled)
14 {
15 int ret = 0;
16@@ -227,7 +223,7 @@ int ClockHelper::tzreset()
···1-# New rust versions should first go to staging.
2-# Things to check after updating:
3-# 1. Rustc should produce rust binaries on x86_64-linux, aarch64-linux and x86_64-darwin:
4-# i.e. nix-shell -p fd or @GrahamcOfBorg build fd on github
5-# This testing can be also done by other volunteers as part of the pull
6-# request review, in case platforms cannot be covered.
7-# 2. The LLVM version used for building should match with rust upstream.
8-# Check the version number in the src/llvm-project git submodule in:
9-# https://github.com/rust-lang/rust/blob/<version-tag>/.gitmodules
10-# 3. Firefox and Thunderbird should still build on x86_64-linux.
11-12-{ stdenv, lib
13-, buildPackages
14-, newScope, callPackage
15-, CoreFoundation, Security
16-, pkgsBuildTarget, pkgsBuildBuild, pkgsBuildHost
17-, makeRustPlatform
18-, llvmPackages_5, llvm_11
19-} @ args:
20-21-import ./default.nix {
22- rustcVersion = "1.49.0";
23- rustcSha256 = "0yf7kll517398dgqsr7m3gldzj0iwsp3ggzxrayckpqzvylfy2mm";
24-25- llvmSharedForBuild = pkgsBuildBuild.llvm_11.override { enableSharedLibraries = true; };
26- llvmSharedForHost = pkgsBuildHost.llvm_11.override { enableSharedLibraries = true; };
27- llvmSharedForTarget = pkgsBuildTarget.llvm_11.override { enableSharedLibraries = true; };
28-29- llvmBootstrapForDarwin = llvmPackages_5;
30-31- # For use at runtime
32- llvmShared = llvm_11.override { enableSharedLibraries = true; };
33-34- # Note: the version MUST be one version prior to the version we're
35- # building
36- bootstrapVersion = "1.48.0";
37-38- # fetch hashes by running `print-hashes.sh ${bootstrapVersion}`
39- bootstrapHashes = {
40- i686-unknown-linux-gnu = "7fdb8836a1f0427d5b47e6a2d496f67ebff04350407411f57cf20c9b3544e26f";
41- x86_64-unknown-linux-gnu = "950420a35b2dd9091f1b93a9ccd5abc026ca7112e667f246b1deb79204e2038b";
42- x86_64-unknown-linux-musl = "4ed9627f57b4e0b9807fc5e7513d9731f4791668b7f875b9e44e65e21072c56f";
43- arm-unknown-linux-gnueabihf = "e68a81eebd4570343a0fc35cb8ee24cad911d6cee2e374f284b76546ca6636d5";
44- armv7-unknown-linux-gnueabihf = "3aed4a63ebdd57690a31d11afbe95e6407edc224a6769be5694a1ed43bf899cb";
45- aarch64-unknown-linux-gnu = "c4769418d8d89f432e4a3a21ad60f99629e4b13bbfc29aef7d9d51c4e8ee8a8a";
46- aarch64-unknown-linux-musl = "ac4de580a28e45a9773b389b296d13bfeeb08263cb1f8343859577a54940dae9";
47- x86_64-apple-darwin = "20e727cad10f43e3abcedb2a80979ae26923038e0e8a855e8a783da255054113";
48- powerpc64le-unknown-linux-gnu = "e6457a0214f3b1b04bd5b2618bba7e3826e254216420dede2971b571a1c13bb1";
49- };
50-51- selectRustPackage = pkgs: pkgs.rust_1_49;
52-53- rustcPatches = [
54- ];
55-}
56-57-(builtins.removeAttrs args [ "fetchpatch" "pkgsBuildHost" "llvmPackages_5" "llvm_11"])
···1+# New rust versions should first go to staging.
2+# Things to check after updating:
3+# 1. Rustc should produce rust binaries on x86_64-linux, aarch64-linux and x86_64-darwin:
4+# i.e. nix-shell -p fd or @GrahamcOfBorg build fd on github
5+# This testing can be also done by other volunteers as part of the pull
6+# request review, in case platforms cannot be covered.
7+# 2. The LLVM version used for building should match with rust upstream.
8+# Check the version number in the src/llvm-project git submodule in:
9+# https://github.com/rust-lang/rust/blob/<version-tag>/.gitmodules
10+# 3. Firefox and Thunderbird should still build on x86_64-linux.
11+12+{ stdenv, lib
13+, buildPackages
14+, newScope, callPackage
15+, CoreFoundation, Security
16+, pkgsBuildTarget, pkgsBuildBuild, pkgsBuildHost
17+, makeRustPlatform
18+, llvmPackages_5, llvm_11
19+} @ args:
20+21+import ./default.nix {
22+ rustcVersion = "1.50.0";
23+ rustcSha256 = "0pjs7j62maiyvkmhp9zrxl528g2n0fphp4rq6ap7aqdv0a6qz5wm";
24+25+ llvmSharedForBuild = pkgsBuildBuild.llvm_11.override { enableSharedLibraries = true; };
26+ llvmSharedForHost = pkgsBuildHost.llvm_11.override { enableSharedLibraries = true; };
27+ llvmSharedForTarget = pkgsBuildTarget.llvm_11.override { enableSharedLibraries = true; };
28+29+ llvmBootstrapForDarwin = llvmPackages_5;
30+31+ # For use at runtime
32+ llvmShared = llvm_11.override { enableSharedLibraries = true; };
33+34+ # Note: the version MUST be one version prior to the version we're
35+ # building
36+ bootstrapVersion = "1.49.0";
37+38+ # fetch hashes by running `print-hashes.sh ${bootstrapVersion}`
39+ bootstrapHashes = {
40+ i686-unknown-linux-gnu = "5371bfa2c8e566aa283acdfa93d24b981c789d7c040ac1ca74e76bff1c7f6598";
41+ x86_64-unknown-linux-gnu = "8b14446df82f3707d69cf58fed92f18e0bff91621c62baf89288ef70e3e92981";
42+ x86_64-unknown-linux-musl = "f92a5a4adcfac4206a223d089a364a8375d1b6f112f3f2efa3f6d53d08a61904";
43+ arm-unknown-linux-gnueabihf = "e5d93576eef874a9b22be9aa157cac5c8cdebebde8b57f0693248d4a589df42c";
44+ armv7-unknown-linux-gnueabihf = "34ba3c979b144ef27d3c71d177cc1774551edf26e79d36719c86a51d9b9e34c0";
45+ aarch64-unknown-linux-gnu = "b551bd482041307fa3373a687d6d6a2c4c0931c2e0a68b8b75dc80bc5cf5f002";
46+ aarch64-unknown-linux-musl = "0a43d96a508c720520328112d609916d062f866a5c35f1db8f906284035d6d98";
47+ x86_64-apple-darwin = "fe3e248bc4b0ee0a2595693687ad845c8a8bda824a56c9321520bcca02433716";
48+ powerpc64le-unknown-linux-gnu = "365d7721dd2521e5dad12aa73651bad2be375e798e443636d2c523cad5b54359";
49+ };
50+51+ selectRustPackage = pkgs: pkgs.rust_1_50;
52+53+ rustcPatches = [
54+ ];
55+}
56+57+(builtins.removeAttrs args [ "fetchpatch" "pkgsBuildHost" "llvmPackages_5" "llvm_11"])
···20 inherit ignoreCollisions;
21 extraOutputsToInstall = [ "out" ] ++ extraOutputsToInstall;
2223- buildInputs = [ makeWrapper texinfo wrapOctave ];
02425 # During "build" we must first unlink the /share symlink to octave's /share
26 # Then, we can re-symlink the all of octave/share, except for /share/octave
27 # in env/share/octave, re-symlink everything from octave/share/octave and then
28 # perform the pkg install.
29 postBuild = ''
30- . "${makeWrapper}/nix-support/setup-hook"
31- # The `makeWrapper` used here is the one defined in
32- # ${makeWrapper}/nix-support/setup-hook
33-34 if [ -L "$out/bin" ]; then
35 unlink $out/bin
36 mkdir -p "$out/bin"
···20 inherit ignoreCollisions;
21 extraOutputsToInstall = [ "out" ] ++ extraOutputsToInstall;
2223+ nativeBuildInputs = [ makeWrapper ];
24+ buildInputs = [ texinfo wrapOctave ];
2526 # During "build" we must first unlink the /share symlink to octave's /share
27 # Then, we can re-symlink the all of octave/share, except for /share/octave
28 # in env/share/octave, re-symlink everything from octave/share/octave and then
29 # perform the pkg install.
30 postBuild = ''
000031 if [ -L "$out/bin" ]; then
32 unlink $out/bin
33 mkdir -p "$out/bin"
···1+diff --git a/hints/darwin.sh b/hints/darwin.sh
2+index 0a91bc083c0..fdfbdd4a3b9 100644
3+--- a/hints/darwin.sh
4++++ b/hints/darwin.sh
5+@@ -301,7 +301,7 @@ case "$osvers" in # Note: osvers is the kernel version, not the 10.x
6+ # We now use MACOSX_DEPLOYMENT_TARGET, if set, as an override by
7+ # capturing its value and adding it to the flags.
8+ case "$MACOSX_DEPLOYMENT_TARGET" in
9+- 10.*)
10++ [1-9][0-9].*)
11+ add_macosx_version_min ccflags $MACOSX_DEPLOYMENT_TARGET
12+ add_macosx_version_min ldflags $MACOSX_DEPLOYMENT_TARGET
13+ ;;
14+@@ -313,7 +313,7 @@ case "$osvers" in # Note: osvers is the kernel version, not the 10.x
15+16+ *** Unexpected MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET
17+ ***
18+-*** Please either set it to 10.something, or to empty.
19++*** Please either set it to a valid macOS version number (e.g., 10.15) or to empty.
20+21+ EOM
22+ exit 1
23+@@ -327,7 +327,7 @@ EOM
24+ # "ProductVersion: 10.11" "10.11"
25+ prodvers=`sw_vers|awk '/^ProductVersion:/{print $2}'|awk -F. '{print $1"."$2}'`
26+ case "$prodvers" in
27+- 10.*)
28++ [1-9][0-9].*)
29+ add_macosx_version_min ccflags $prodvers
30+ add_macosx_version_min ldflags $prodvers
31+ ;;
32+@@ -342,11 +342,10 @@ EOM
33+ exit 1
34+ esac
35+36+- # The X in 10.X
37+- prodvers_minor=$(echo $prodvers|awk -F. '{print $2}')
38++ darwin_major=$(echo $osvers|awk -F. '{print $1}')
39+40+- # macOS (10.12) deprecated syscall().
41+- if [ "$prodvers_minor" -ge 12 ]; then
42++ # macOS 10.12 (darwin 16.0.0) deprecated syscall().
43++ if [ "$darwin_major" -ge 16 ]; then
44+ d_syscall='undef'
45+ # If deploying to pre-10.12, suppress Time::HiRes's detection of the system clock_gettime()
46+ case "$MACOSX_DEPLOYMENT_TARGET" in
+4-1
pkgs/development/interpreters/perl/default.nix
···41 ]
42 ++ optional stdenv.isSunOS ./ld-shared.patch
43 ++ optionals stdenv.isDarwin [ ./cpp-precomp.patch ./sw_vers.patch ]
44- ++ optional crossCompiling ./MakeMaker-cross.patch;
0004546 # This is not done for native builds because pwd may need to come from
47 # bootstrap tools when building bootstrap perl.
···41 ]
42 ++ optional stdenv.isSunOS ./ld-shared.patch
43 ++ optionals stdenv.isDarwin [ ./cpp-precomp.patch ./sw_vers.patch ]
44+ ++ optional crossCompiling ./MakeMaker-cross.patch
45+ # Backporting https://github.com/Perl/perl5/pull/17946, can be
46+ # removed if there's ever a 5.30.x release with it included.
47+ ++ optional (versionOlder version "5.32.1") ./aarch64-darwin.patch;
4849 # This is not done for native builds because pwd may need to come from
50 # bootstrap tools when building bootstrap perl.
+2-3
pkgs/development/interpreters/perl/wrapper.nix
···17 inherit ignoreCollisions;
18 extraOutputsToInstall = [ "out" ] ++ extraOutputsToInstall;
190020 # we create wrapper for the binaries in the different packages
21 postBuild = ''
22-23- . "${makeWrapper}/nix-support/setup-hook"
24-25 if [ -L "$out/bin" ]; then
26 unlink "$out/bin"
27 fi
···17 inherit ignoreCollisions;
18 extraOutputsToInstall = [ "out" ] ++ extraOutputsToInstall;
1920+ nativeBuildInputs = [ makeWrapper ];
21+22 # we create wrapper for the binaries in the different packages
23 postBuild = ''
00024 if [ -L "$out/bin" ]; then
25 unlink "$out/bin"
26 fi
···106107 ./CVE-2021-3177.patch
108109+ # The workaround is for unittests on Win64, which we don't support.
110+ # It does break aarch64-darwin, which we do support. See:
111+ # * https://bugs.python.org/issue35523
112+ # * https://github.com/python/cpython/commit/e6b247c8e524
113+ ../3.7/no-win64-workaround.patch
114+115 ] ++ optionals (x11Support && stdenv.isDarwin) [
116 ./use-correct-tcl-tk-on-darwin.patch
117 ] ++ optionals stdenv.isLinux [
···185 # Backport a fix for discovering `rpmbuild` command when doing `python setup.py bdist_rpm` to 3.5, 3.6, 3.7.
186 # See: https://bugs.python.org/issue11122
187 ./3.7/fix-hardcoded-path-checking-for-rpmbuild.patch
00000188 ] ++ optionals (isPy37 || isPy38 || isPy39) [
189 # Fix darwin build https://bugs.python.org/issue34027
190 ./3.7/darwin-libutil.patch
···185 # Backport a fix for discovering `rpmbuild` command when doing `python setup.py bdist_rpm` to 3.5, 3.6, 3.7.
186 # See: https://bugs.python.org/issue11122
187 ./3.7/fix-hardcoded-path-checking-for-rpmbuild.patch
188+ # The workaround is for unittests on Win64, which we don't support.
189+ # It does break aarch64-darwin, which we do support. See:
190+ # * https://bugs.python.org/issue35523
191+ # * https://github.com/python/cpython/commit/e6b247c8e524
192+ ./3.7/no-win64-workaround.patch
193 ] ++ optionals (isPy37 || isPy38 || isPy39) [
194 # Fix darwin build https://bugs.python.org/issue34027
195 ./3.7/darwin-libutil.patch
···1+Do not regenerate revision.h
2+3+Ruby's makefile compares the shipped version with the git revision to regenerate
4+revision.h [1], but since we don't include git in buildInputs, this comparison
5+fails and it can't find $(REVISION_H).
6+7+[1] https://github.com/ruby/ruby/commit/97a5af62a318fcd93a4e5e4428d576c0280ddbae
8+9+diff -Naur ruby.old/defs/gmake.mk ruby.new/defs/gmake.mk
10+--- ruby.old/defs/gmake.mk
11++++ ruby.new/defs/gmake.mk
12+@@ -325,11 +325,9 @@
13+14+ REVISION_IN_HEADER := $(shell sed -n 's/^\#define RUBY_FULL_REVISION "\(.*\)"/\1/p' $(srcdir)/revision.h 2>/dev/null)
15+ REVISION_LATEST := $(shell $(CHDIR) $(srcdir) && git log -1 --format=%H 2>/dev/null)
16+-ifneq ($(REVISION_IN_HEADER),$(REVISION_LATEST))
17+ # GNU make treat the target as unmodified when its dependents get
18+ # updated but it is not updated, while others may not.
19+ $(srcdir)/revision.h: $(REVISION_H)
20+-endif
21+22+ # Query on the generated rdoc
23+ #
···246247 # this should go away in the next release
248 patches = [
249- (fetchpatch {
250- url = "https://git.videolan.org/?p=ffmpeg.git;a=patch;h=7c59e1b0f285cd7c7b35fcd71f49c5fd52cf9315";
251- sha256 = "sha256-dqpmpDFETTuWHWolMoLaubU4BeDEuQaBNA0wmzL1f8o=";
252- name = "fix_libsrt.patch";
253- })
254 # Patch ffmpeg for svt-av1 until version 4.4
255 (fetchpatch {
256 url = "https://raw.githubusercontent.com/AOMediaCodec/SVT-AV1/v0.8.4/ffmpeg_plugin/0001-Add-ability-for-ffmpeg-to-run-svt-av1.patch";
···246247 # this should go away in the next release
248 patches = [
00000249 # Patch ffmpeg for svt-av1 until version 4.4
250 (fetchpatch {
251 url = "https://raw.githubusercontent.com/AOMediaCodec/SVT-AV1/v0.8.4/ffmpeg_plugin/0001-Add-ability-for-ffmpeg-to-run-svt-av1.patch";
···1+# shellcheck shell=bash
2+3+fixupOutputHooks+=(_gtkCleanImmodulesCache)
4+5+# Clean comments that link to generator of the file
6+_gtkCleanImmodulesCache() {
7+ # gtk_module_path is where the modules are installed
8+ # https://gitlab.gnome.org/GNOME/gtk/-/blob/3.24.24/gtk/gtkmodules.c#L68
9+ # gtk_binary_version can be retrived with:
10+ # pkg-config --variable=gtk_binary_version gtk+-3.0
11+ local f="${prefix:?}/lib/@gtk_module_path@/@gtk_binary_version@/immodules.cache"
12+ if [ -f "$f" ]; then
13+ sed 's|Created by .*bin/gtk-query-|Created by bin/gtk-query-|' -i "$f"
14+ fi
15+}
···1-# shellcheck shell=bash
2-3-fixupOutputHooks+=(_gtk2CleanComments)
4-5-# Clean comments that link to generator of the file
6-_gtk2CleanComments() {
7- local f="${prefix:?}/lib/gtk-2.0/2.10.0/immodules.cache"
8- if [ -f "$f" ]; then
9- sed 's|Created by .*bin/gtk-query-|Created by bin/gtk-query-|' -i "$f"
10- fi
11-}
12-
···1-# shellcheck shell=bash
2-3-fixupOutputHooks+=(_gtk3CleanComments)
4-5-# Clean comments that link to generator of the file
6-_gtk3CleanComments() {
7- local f="${prefix:?}/lib/gtk-3.0/3.0.0/immodules.cache"
8- if [ -f "$f" ]; then
9- sed 's|Created by .*bin/gtk-query-|Created by bin/gtk-query-|' -i "$f"
10- fi
11-}
···1-# shellcheck shell=bash
2-3-fixupOutputHooks+=(_gtk4CleanComments)
4-5-# Clean comments that link to generator of the file
6-_gtk4CleanComments() {
7- local f="${prefix:?}/lib/gtk-4.0/4.0.0/immodules.cache"
8- if [ -f "$f" ]; then
9- sed 's|Created by .*bin/gtk-query-|Created by bin/gtk-query-|' -i "$f"
10- fi
11-}
···1718 static QString findDaemon()
19 {
20-- QString daemon = QFile::decodeName(CMAKE_INSTALL_FULL_LIBEXECDIR_KF5 "/kdesud");
21- if (!QFile::exists(daemon)) { // if not in libexec, find it in PATH
22- daemon = QStandardPaths::findExecutable(QStringLiteral("kdesud"));
23- if (daemon.isEmpty()) {
24- qCWarning(KSU_LOG) << "kdesud daemon not found.";
25+ QString daemon = QFile::decodeName("/run/wrappers/bin/kdesud");
26+ if (!QFile::exists(daemon)) { // if not in wrappers
27-+ daemon = QFile::decodeName(CMAKE_INSTALL_FULL_LIBEXECDIR_KF5 "/kdesud");
28+ if (!QFile::exists(daemon)) { // if not in libexec, find it in PATH
29+ daemon = QStandardPaths::findExecutable(QStringLiteral("kdesud"));
30+ if (daemon.isEmpty()) {
···1718 static QString findDaemon()
19 {
20+- QString daemon = QFile::decodeName(KDE_INSTALL_FULL_LIBEXECDIR_KF5 "/kdesud");
21- if (!QFile::exists(daemon)) { // if not in libexec, find it in PATH
22- daemon = QStandardPaths::findExecutable(QStringLiteral("kdesud"));
23- if (daemon.isEmpty()) {
24- qCWarning(KSU_LOG) << "kdesud daemon not found.";
25+ QString daemon = QFile::decodeName("/run/wrappers/bin/kdesud");
26+ if (!QFile::exists(daemon)) { // if not in wrappers
27++ daemon = QFile::decodeName(KDE_INSTALL_FULL_LIBEXECDIR_KF5 "/kdesud");
28+ if (!QFile::exists(daemon)) { // if not in libexec, find it in PATH
29+ daemon = QStandardPaths::findExecutable(QStringLiteral("kdesud"));
30+ if (daemon.isEmpty()) {
···18 # It will rebuild itself using the version of this package (NSS) and if
19 # an update is required do the required changes to the expression.
20 # Example: nix-shell ./maintainers/scripts/update.nix --argstr package cacert
21- version = "3.60";
22 underscoreVersion = builtins.replaceStrings ["."] ["_"] version;
2324in stdenv.mkDerivation rec {
···2728 src = fetchurl {
29 url = "mirror://mozilla/security/nss/releases/NSS_${underscoreVersion}_RTM/src/${pname}-${version}.tar.gz";
30- sha256 = "0ggyj3ax3kal65sl1vl4nfhx2s08blg4dg8iwlxcax5qb9bxbaw4";
31 };
3233 depsBuildBuild = [ buildPackages.stdenv.cc ];
···18 # It will rebuild itself using the version of this package (NSS) and if
19 # an update is required do the required changes to the expression.
20 # Example: nix-shell ./maintainers/scripts/update.nix --argstr package cacert
21+ version = "3.61";
22 underscoreVersion = builtins.replaceStrings ["."] ["_"] version;
2324in stdenv.mkDerivation rec {
···2728 src = fetchurl {
29 url = "mirror://mozilla/security/nss/releases/NSS_${underscoreVersion}_RTM/src/${pname}-${version}.tar.gz";
30+ sha256 = "0w0k1v6pn2mv1vim7pv0xn63z1dcss6cymqbqzzg1k1l9f02sbii";
31 };
3233 depsBuildBuild = [ buildPackages.stdenv.cc ];
···9 sha256 = "08h1vnqsv22js9v3pyim5yb80z87baxb7s2g5gsvvjax07j7w8h5";
10 };
1112- buildInputs = [ unzip ];
1314 # We only need the header files. The library files are
15 # in the nvidia_x11 driver.
···9 sha256 = "08h1vnqsv22js9v3pyim5yb80z87baxb7s2g5gsvvjax07j7w8h5";
10 };
1112+ nativeBuildInputs = [ unzip ];
1314 # We only need the header files. The library files are
15 # in the nvidia_x11 driver.
···1{ lib, stdenv, buildPythonPackage, fetchPypi, isPy27, python
2, darwin
3-, pytest
4, mock
5, ipaddress
6, unittest2
···18 # arch doesn't report frequency is the same way
19 # tests segfaults on darwin https://github.com/giampaolo/psutil/issues/1715
20 doCheck = !stdenv.isDarwin && stdenv.isx86_64;
21- checkInputs = [ pytest ]
22 ++ lib.optionals isPy27 [ mock ipaddress unittest2 ];
23- # out must be referenced as test import paths are relative
0024 # disable tests which don't work in sandbox
25 # cpu_times is flakey on darwin
26- checkPhase = ''
27- pytest $out/${python.sitePackages}/psutil/tests/test_system.py \
28- -k 'not user and not disk_io_counters and not sensors_battery and not cpu_times'
29- '';
0003031 buildInputs = lib.optionals stdenv.isDarwin [ darwin.IOKit ];
32
···1{ lib, stdenv, buildPythonPackage, fetchPypi, isPy27, python
2, darwin
3+, pytestCheckHook
4, mock
5, ipaddress
6, unittest2
···18 # arch doesn't report frequency is the same way
19 # tests segfaults on darwin https://github.com/giampaolo/psutil/issues/1715
20 doCheck = !stdenv.isDarwin && stdenv.isx86_64;
21+ checkInputs = [ pytestCheckHook ]
22 ++ lib.optionals isPy27 [ mock ipaddress unittest2 ];
23+ pytestFlagsArray = [
24+ "$out/${python.sitePackages}/psutil/tests/test_system.py"
25+ ];
26 # disable tests which don't work in sandbox
27 # cpu_times is flakey on darwin
28+ disabledTests = [
29+ "user"
30+ "disk_io_counters"
31+ "sensors_battery"
32+ "cpu_times"
33+ "cpu_freq"
34+ ];
3536 buildInputs = lib.optionals stdenv.isDarwin [ darwin.IOKit ];
37
···2, buildPythonPackage
3, fetchFromGitHub
4, stdenv
5-, pytest
6}:
78buildPythonPackage rec {
9 pname = "simplejson";
10- version = "3.17.0";
11 doCheck = !stdenv.isDarwin;
1213 src = fetchFromGitHub {
14 owner = pname;
15 repo = pname;
16 rev = "v${version}";
17- sha256 = "1b1hhh1dia673vhq3jl2br1iqwb9yjii6iak56w96s9972vjbz3z";
18 };
1920- # Package does not need pytest, but its a bit easier debugging.
21- checkInputs = [ pytest ];
22- # Ignore warnings because test does not expect them in stderr
23- # See https://github.com/simplejson/simplejson/issues/241
24- checkPhase = ''
25- PYTHONWARNINGS="ignore" pytest simplejson/tests
26- '';
2728- meta = {
29- description = "A simple, fast, extensible JSON encoder/decoder for Python";
0030 longDescription = ''
31- simplejson is compatible with Python 2.4 and later with no
32- external dependencies. It covers the full JSON specification
33- for both encoding and decoding, with unicode support. By
34- default, encoding is done in an encoding neutral fashion (plain
35- ASCII with \uXXXX escapes for unicode characters).
36 '';
37 homepage = "https://github.com/simplejson/simplejson";
38- license = with lib.licenses; [ mit afl21 ];
039 };
40}
···2, buildPythonPackage
3, fetchFromGitHub
4, stdenv
5+, pytestCheckHook
6}:
78buildPythonPackage rec {
9 pname = "simplejson";
10+ version = "3.17.2";
11 doCheck = !stdenv.isDarwin;
1213 src = fetchFromGitHub {
14 owner = pname;
15 repo = pname;
16 rev = "v${version}";
17+ sha256 = "sha256-2ZC7aKyUUcth43Ce0j6JdjrJ4gb4QfJDlY2M5TLMQ+o=";
18 };
1920+ checkInputs = [ pytestCheckHook ];
0000002122+ pythonImportsCheck = [ "simplejson" ];
23+24+ meta = with lib; {
25+ description = "Extensible JSON encoder/decoder for Python";
26 longDescription = ''
27+ simplejson covers the full JSON specification for both encoding
28+ and decoding, with unicode support. By default, encoding is done
29+ in an encoding neutral fashion (plain ASCII with \uXXXX escapes
30+ for unicode characters).
031 '';
32 homepage = "https://github.com/simplejson/simplejson";
33+ license = with licenses; [ mit afl21 ];
34+ maintainers = with maintainers; [ fab ];
35 };
36}
···50 # because we usually do not package the framework
51 cmakeFlags="-DCMAKE_FIND_FRAMEWORK=LAST $cmakeFlags"
5253- # on macOS i686 was only relevant for 10.5 or earlier.
54- cmakeFlags="-DCMAKE_OSX_ARCHITECTURES=x86_64 $cmakeFlags"
55-56 # we never want to use the global macOS SDK
57 cmakeFlags="-DCMAKE_OSX_SYSROOT= $cmakeFlags"
58
···50 # because we usually do not package the framework
51 cmakeFlags="-DCMAKE_FIND_FRAMEWORK=LAST $cmakeFlags"
5200053 # we never want to use the global macOS SDK
54 cmakeFlags="-DCMAKE_OSX_SYSROOT= $cmakeFlags"
55
···1--- a/mesonbuild/coredata.py
2+++ b/mesonbuild/coredata.py
3-@@ -491,7 +491,6 @@ class CoreData:
4 return value
5- if option.endswith('dir') and value.is_absolute() and \
6- option not in builtin_dir_noprefix_options:
7- # Value must be a subdir of the prefix
8 # commonpath will always return a path in the native format, so we
9 # must use pathlib.PurePath to do the same conversion before
10 # comparing.
11-@@ -503,7 +502,7 @@ class CoreData:
12 try:
13 value = value.relative_to(prefix)
14 except ValueError:
···1--- a/mesonbuild/coredata.py
2+++ b/mesonbuild/coredata.py
3+@@ -506,7 +506,6 @@ class CoreData:
4 return value
5+ if option.name.endswith('dir') and value.is_absolute() and \
6+ option not in BULITIN_DIR_NOPREFIX_OPTIONS:
7- # Value must be a subdir of the prefix
8 # commonpath will always return a path in the native format, so we
9 # must use pathlib.PurePath to do the same conversion before
10 # comparing.
11+@@ -518,7 +517,7 @@ class CoreData:
12 try:
13 value = value.relative_to(prefix)
14 except ValueError:
···1-diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py
2-index 219b62ec8..e3ceaddbd 100644
3---- a/mesonbuild/envconfig.py
4-+++ b/mesonbuild/envconfig.py
5-@@ -94,7 +94,7 @@ def get_env_var_pair(for_machine: MachineChoice,
6 # compiling we fall back on the unprefixed host version. This
7 # allows native builds to never need to worry about the 'BUILD_*'
8 # ones.
···1+diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
2+index 756dd8193..a5cc6ef8b 100644
3+--- a/mesonbuild/environment.py
4++++ b/mesonbuild/environment.py
5+@@ -151,7 +151,7 @@ def _get_env_var(for_machine: MachineChoice, is_cross: bool, var_name: str) -> T
6 # compiling we fall back on the unprefixed host version. This
7 # allows native builds to never need to worry about the 'BUILD_*'
8 # ones.
···12 ./jsfalse_to_null.patch
13 ];
1415- buildInputs = [ autoconf makedepend perl python unzip zip ];
01617 # It works without MOZ_FIX_LINK_PATHS, circumventing an impurity
18 # issue. Maybe we could kick js/ (spidermonkey) completely and
···12 ./jsfalse_to_null.patch
13 ];
1415+ nativeBuildInputs = [ unzip ];
16+ buildInputs = [ autoconf makedepend perl python zip ];
1718 # It works without MOZ_FIX_LINK_PATHS, circumventing an impurity
19 # issue. Maybe we could kick js/ (spidermonkey) completely and
···15 phases = "unpackPhase buildPhase";
16 inherit src srcDir tagSuffix;
17 name = "${name}-source-with-tags";
18- buildInputs = [ unzip ];
19 # using separate tag directory so that you don't have to glob that much files when starting your editor
20 # is this a good choice?
21 buildPhase =
···15 phases = "unpackPhase buildPhase";
16 inherit src srcDir tagSuffix;
17 name = "${name}-source-with-tags";
18+ nativeBuildInputs = [ unzip ];
19 # using separate tag directory so that you don't have to glob that much files when starting your editor
20 # is this a good choice?
21 buildPhase =
···17 patchShebangs test
18 '';
190020 # You probably shouldn't ever run these! They will reconfigure Linux
21 # NUMA settings, which on my build machine makes the rest of package
22 # building ~5% slower until reboot. Ugh!
···26 description = "Library and tools for non-uniform memory access (NUMA) machines";
27 homepage = "https://github.com/numactl/numactl";
28 license = with licenses; [ gpl2 lgpl21 ]; # libnuma is lgpl21
29- platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" ];
30 };
31}
···17 patchShebangs test
18 '';
1920+ LDFLAGS = lib.optionalString stdenv.hostPlatform.isRiscV "-latomic";
21+22 # You probably shouldn't ever run these! They will reconfigure Linux
23 # NUMA settings, which on my build machine makes the rest of package
24 # building ~5% slower until reboot. Ugh!
···28 description = "Library and tools for non-uniform memory access (NUMA) machines";
29 homepage = "https://github.com/numactl/numactl";
30 license = with licenses; [ gpl2 lgpl21 ]; # libnuma is lgpl21
31+ platforms = platforms.linux;
32 };
33}
···21 # Work around the "unpacker appears to have produced no directories"
22 # case that happens when the archive doesn't have a subdirectory.
23 setSourceRoot = "sourceRoot=$(pwd)";
24- buildInputs = [ unzip ];
25 meta = a.meta // {
26 platforms = elasticsearch.meta.platforms;
27 maintainers = (a.meta.maintainers or []) ++ (with lib.maintainers; [ offline ]);
···21 # Work around the "unpacker appears to have produced no directories"
22 # case that happens when the archive doesn't have a subdirectory.
23 setSourceRoot = "sourceRoot=$(pwd)";
24+ nativeBuildInputs = [ unzip ];
25 meta = a.meta // {
26 platforms = elasticsearch.meta.platforms;
27 maintainers = (a.meta.maintainers or []) ++ (with lib.maintainers; [ offline ]);
···12 # case that happens when the archive doesn't have a subdirectory.
13 setSourceRoot = "sourceRoot=`pwd`";
1415- buildInputs = [ unzip ];
1617 buildFlags = lib.optional stdenv.cc.isClang "CC=clang";
18
···12 # case that happens when the archive doesn't have a subdirectory.
13 setSourceRoot = "sourceRoot=`pwd`";
1415+ nativeBuildInputs = [ unzip ];
1617 buildFlags = lib.optional stdenv.cc.isClang "CC=clang";
18