···250:::
251252::: {.note}
253-If one explores Nixpkgs, they will see derivations with names like `gccCross`. Such `*Cross` derivations is a holdover from before we properly distinguished between the host and target platforms—the derivation with “Cross” in the name covered the `build = host != target` case, while the other covered the `host = target`, with build platform the same or not based on whether one was using its `.nativeDrv` or `.crossDrv`. This ugliness will disappear soon.
254:::
···250:::
251252::: {.note}
253+If one explores Nixpkgs, they will see derivations with names like `gccCross`. Such `*Cross` derivations is a holdover from before we properly distinguished between the host and target platforms—the derivation with “Cross” in the name covered the `build = host != target` case, while the other covered the `host = target`, with build platform the same or not based on whether one was using its `.__spliced.buildHost` or `.__spliced.hostTarget`.
254:::
+9-6
lib/customisation.nix
···38 //
39 (drv.passthru or {})
40 //
41- (if (drv ? crossDrv && drv ? nativeDrv)
42- then {
43- crossDrv = overrideDerivation drv.crossDrv f;
44- nativeDrv = overrideDerivation drv.nativeDrv f;
45- }
46- else { }));
000474849 /* `makeOverridable` takes a function from attribute set to attribute set and
···38 //
39 (drv.passthru or {})
40 //
41+ # TODO(@Artturin): remove before release 23.05 and only have __spliced.
42+ (lib.optionalAttrs (drv ? crossDrv && drv ? nativeDrv) {
43+ crossDrv = overrideDerivation drv.crossDrv f;
44+ nativeDrv = overrideDerivation drv.nativeDrv f;
45+ })
46+ //
47+ lib.optionalAttrs (drv ? __spliced) {
48+ __spliced = {} // (lib.mapAttrs (_: sDrv: overrideDerivation sDrv f) drv.__spliced);
49+ });
505152 /* `makeOverridable` takes a function from attribute set to attribute set and
···34stdenv.mkDerivation rec {
5 pname = "threema-desktop";
6- version = "1.2.13";
78 src = fetchurl {
9 # As Threema only offers a Latest Release url, the plan is to upload each
10 # new release url to web.archive.org until their Github releases page gets populated.
11- url = "https://web.archive.org/web/20220621152620id_/https://releases.threema.ch/web-electron/v1/release/Threema-Latest.deb";
12- sha256 = "sha256-X16GMxUIKUloj0FxhzWQKUBf4zwfSBVg0cwLgGxHPHE=";
13 };
1415 nativeBuildInputs = [
···34stdenv.mkDerivation rec {
5 pname = "threema-desktop";
6+ version = "1.2.21";
78 src = fetchurl {
9 # As Threema only offers a Latest Release url, the plan is to upload each
10 # new release url to web.archive.org until their Github releases page gets populated.
11+ url = "https://web.archive.org/web/20220915175906if_/https://releases.threema.ch/web-electron/v1/release/Threema-Latest.deb";
12+ sha256 = "0icxn5whsvwmdmfbkfk4xnl3dn4iif5s5yw5hsimmyx066fq0qhb";
13 };
1415 nativeBuildInputs = [
···1-{ lib, makeSetupHook, nodejs, srcOnly, diffutils, jq, makeWrapper }:
23{
4 npmConfigHook = makeSetupHook
···910 # Specify the stdenv's `diff` and `jq` by abspath to ensure that the user's build
11 # inputs do not cause us to find the wrong binaries.
12- # The `.nativeDrv` stanza works like nativeBuildInputs and ensures cross-compiling has the right version available.
13- diff = "${diffutils.nativeDrv or diffutils}/bin/diff";
14- jq = "${jq.nativeDrv or jq}/bin/jq";
1516 nodeVersion = nodejs.version;
17 nodeVersionMajor = lib.versions.major nodejs.version;
···29 deps = [ makeWrapper ];
30 substitutions = {
31 hostNode = "${nodejs}/bin/node";
32- jq = "${jq.nativeDrv or jq}/bin/jq";
33 };
34 } ./npm-install-hook.sh;
35}
···1+{ lib, makeSetupHook, nodejs, srcOnly, buildPackages, makeWrapper }:
23{
4 npmConfigHook = makeSetupHook
···910 # Specify the stdenv's `diff` and `jq` by abspath to ensure that the user's build
11 # inputs do not cause us to find the wrong binaries.
12+ diff = "${buildPackages.diffutils}/bin/diff";
13+ jq = "${buildPackages.jq}/bin/jq";
01415 nodeVersion = nodejs.version;
16 nodeVersionMajor = lib.versions.major nodejs.version;
···28 deps = [ makeWrapper ];
29 substitutions = {
30 hostNode = "${nodejs}/bin/node";
31+ jq = "${buildPackages.jq}/bin/jq";
32 };
33 } ./npm-install-hook.sh;
34}
+1-3
pkgs/build-support/rust/hooks/default.nix
···2, callPackage
3, cargo
4, clang
5-, diffutils
6, lib
7, makeSetupHook
8, maturin
···6566 # Specify the stdenv's `diff` by abspath to ensure that the user's build
67 # inputs do not cause us to find the wrong `diff`.
68- # The `.nativeDrv` stanza works like nativeBuildInputs and ensures cross-compiling has the right version available.
69- diff = "${diffutils.nativeDrv or diffutils}/bin/diff";
7071 # We want to specify the correct crt-static flag for both
72 # the build and host platforms. This is important when the wanted
···2, callPackage
3, cargo
4, clang
05, lib
6, makeSetupHook
7, maturin
···6465 # Specify the stdenv's `diff` by abspath to ensure that the user's build
66 # inputs do not cause us to find the wrong `diff`.
67+ diff = "${lib.getBin buildPackages.diffutils}/bin/diff";
06869 # We want to specify the correct crt-static flag for both
70 # the build and host platforms. This is important when the wanted
-51
pkgs/development/libraries/gsl/gsl-1_16.nix
···1-{ fetchurl, fetchpatch, lib, stdenv }:
2-3-stdenv.mkDerivation rec {
4- pname = "gsl";
5- version = "1.16";
6-7- src = fetchurl {
8- url = "mirror://gnu/gsl/gsl-${version}.tar.gz";
9- sha256 = "0lrgipi0z6559jqh82yx8n4xgnxkhzj46v96dl77hahdp58jzg3k";
10- };
11-12- # do not let -march=skylake to enable FMA (https://lists.gnu.org/archive/html/bug-gsl/2011-11/msg00019.html)
13- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isx86_64 "-mno-fma";
14-15- patches = [
16- (fetchpatch {
17- name = "bug-39055.patch";
18- url = "https://git.savannah.gnu.org/cgit/gsl.git/patch/?id=9cc12d";
19- sha256 = "1bmrmihi28cly9g9pq54kkix2jy59y7cd7h5fw4v1c7h5rc2qvs8";
20- })
21-22- (fetchpatch {
23- name = "fix-parallel-test.patch";
24- url = "https://git.savannah.gnu.org/cgit/gsl.git/patch/?id=12654373c3b60541230921aae81f93b484ec5eaf";
25- sha256 = "1flzpbsfj7gjywv6v9qvm8wpdrkbpj7shryinfdpb40y7si9njdw";
26- })
27- ];
28-29- enableParallelBuilding = true;
30- doCheck = true;
31-32- meta = {
33- description = "The GNU Scientific Library, a large numerical library";
34- homepage = "https://www.gnu.org/software/gsl/";
35- license = lib.licenses.gpl3Plus;
36-37- longDescription = ''
38- The GNU Scientific Library (GSL) is a numerical library for C
39- and C++ programmers. It is free software under the GNU General
40- Public License.
41-42- The library provides a wide range of mathematical routines such
43- as random number generators, special functions and least-squares
44- fitting. There are over 1000 functions in total with an
45- extensive test suite.
46- '';
47- platforms = lib.platforms.unix;
48- # Failing "eigen" tests on aarch64.
49- badPlatforms = [ "aarch64-linux" ];
50- };
51-}
···107 } ./hooks/qmake-hook.sh;
108 };
109110+ # TODO(@Artturin): convert to makeScopeWithSplicing
111+ # simple example of how to do that in 5568a4d25ca406809530420996d57e0876ca1a01
112 self = lib.makeScope newScope addPackages;
113in
114self
+1-1
pkgs/development/libraries/qt-6/qtModule.nix
···61 if [[ -z "$dontSyncQt" && -f sync.profile ]]; then
62 # FIXME: this probably breaks crosscompiling as it's not from nativeBuildInputs
63 # I don't know how to get /libexec from nativeBuildInputs to work, it's not under /bin
64- ${self.qtbase.dev.nativeDrv or self.qtbase.dev}/libexec/syncqt.pl -version "''${version%%-*}"
65 fi
66 '';
67
···61 if [[ -z "$dontSyncQt" && -f sync.profile ]]; then
62 # FIXME: this probably breaks crosscompiling as it's not from nativeBuildInputs
63 # I don't know how to get /libexec from nativeBuildInputs to work, it's not under /bin
64+ ${lib.getDev self.qtbase}/libexec/syncqt.pl -version "''${version%%-*}"
65 fi
66 '';
67
···582 gr-rds = gnuradio3_7.pkgs.rds; # Added 2019-05-27, changed 2020-10-16
583 grv = throw "grv has been dropped due to the lack of maintanence from upstream since 2019"; # Added 2022-06-01
584 gsettings_desktop_schemas = throw "'gsettings_desktop_schemas' has been renamed to/replaced by 'gsettings-desktop-schemas'"; # Converted to throw 2022-02-22
0585 gtk_doc = throw "'gtk_doc' has been renamed to/replaced by 'gtk-doc'"; # Converted to throw 2022-02-22
586 gtklick = throw "gtklick has been removed from nixpkgs as the project is stuck on python2"; # Added 2022-01-01
587 gtmess = throw "gtmess has been removed, because it was a MSN client."; # add 2021-12-15
···756 libgpgerror = libgpg-error; # Added 2021-09-04
757 libgroove = throw "libgroove has been removed, because it depends on an outdated and insecure version of ffmpeg"; # Added 2022-01-21
758 libgumbo = throw "'libgumbo' has been renamed to/replaced by 'gumbo'"; # Converted to throw 2022-02-22
0759 libintlOrEmpty = lib.optional (!stdenv.isLinux || stdenv.hostPlatform.libc != "glibc") gettext; # Added 2018-03-14
760 libixp_hg = libixp;
761 libjpeg_drop = libjpeg_original; # Added 2020-06-05
···582 gr-rds = gnuradio3_7.pkgs.rds; # Added 2019-05-27, changed 2020-10-16
583 grv = throw "grv has been dropped due to the lack of maintanence from upstream since 2019"; # Added 2022-06-01
584 gsettings_desktop_schemas = throw "'gsettings_desktop_schemas' has been renamed to/replaced by 'gsettings-desktop-schemas'"; # Converted to throw 2022-02-22
585+ gsl_1 = throw "'gsl_1' has been renamed to/replaced by 'gsl'"; # Added 2022-11-19
586 gtk_doc = throw "'gtk_doc' has been renamed to/replaced by 'gtk-doc'"; # Converted to throw 2022-02-22
587 gtklick = throw "gtklick has been removed from nixpkgs as the project is stuck on python2"; # Added 2022-01-01
588 gtmess = throw "gtmess has been removed, because it was a MSN client."; # add 2021-12-15
···757 libgpgerror = libgpg-error; # Added 2021-09-04
758 libgroove = throw "libgroove has been removed, because it depends on an outdated and insecure version of ffmpeg"; # Added 2022-01-21
759 libgumbo = throw "'libgumbo' has been renamed to/replaced by 'gumbo'"; # Converted to throw 2022-02-22
760+ libheimdal = heimdal; # Added 2022-11-18
761 libintlOrEmpty = lib.optional (!stdenv.isLinux || stdenv.hostPlatform.libc != "glibc") gettext; # Added 2018-03-14
762 libixp_hg = libixp;
763 libjpeg_drop = libjpeg_original; # Added 2020-06-05
+2-4
pkgs/top-level/all-packages.nix
···790 mysql-shell = callPackage ../development/tools/mysql-shell {
791 inherit (darwin) cctools developer_cmds DarwinTools;
792 inherit (darwin.apple_sdk.frameworks) CoreServices;
0793 boost = boost177; # Configure checks for specific version.
794 protobuf = protobuf3_19;
795 icu = icu69;
···18579 cypress = callPackage ../development/web/cypress { };
1858018581 cyrus_sasl = callPackage ../development/libraries/cyrus-sasl {
18582- libkrb5 = if stdenv.isFreeBSD then libheimdal else libkrb5;
18583 };
1858418585 # Make bdb5 the default as it is the last release under the custom
···1931719318 gsl = callPackage ../development/libraries/gsl { };
1931919320- gsl_1 = callPackage ../development/libraries/gsl/gsl-1_16.nix { };
19321-19322 gsl-lite = callPackage ../development/libraries/gsl-lite { };
1932319324 gsm = callPackage ../development/libraries/gsm {};
···19496 inherit (darwin.apple_sdk.frameworks) CoreFoundation Security SystemConfiguration;
19497 autoreconfHook = buildPackages.autoreconfHook269;
19498 };
19499- libheimdal = heimdal;
1950019501 harfbuzz = callPackage ../development/libraries/harfbuzz {
19502 inherit (darwin.apple_sdk.frameworks) ApplicationServices CoreText;
···790 mysql-shell = callPackage ../development/tools/mysql-shell {
791 inherit (darwin) cctools developer_cmds DarwinTools;
792 inherit (darwin.apple_sdk.frameworks) CoreServices;
793+ antlr = antlr4_10;
794 boost = boost177; # Configure checks for specific version.
795 protobuf = protobuf3_19;
796 icu = icu69;
···18580 cypress = callPackage ../development/web/cypress { };
1858118582 cyrus_sasl = callPackage ../development/libraries/cyrus-sasl {
18583+ libkrb5 = if stdenv.isFreeBSD then heimdal else libkrb5;
18584 };
1858518586 # Make bdb5 the default as it is the last release under the custom
···1931819319 gsl = callPackage ../development/libraries/gsl { };
193200019321 gsl-lite = callPackage ../development/libraries/gsl-lite { };
1932219323 gsm = callPackage ../development/libraries/gsm {};
···19495 inherit (darwin.apple_sdk.frameworks) CoreFoundation Security SystemConfiguration;
19496 autoreconfHook = buildPackages.autoreconfHook269;
19497 };
01949819499 harfbuzz = callPackage ../development/libraries/harfbuzz {
19500 inherit (darwin.apple_sdk.frameworks) ApplicationServices CoreText;
+6-11
pkgs/top-level/splice.nix
···8# The solution is to splice the package sets together as we do below, so every
9# `callPackage`d expression in fact gets both versions. Each# derivation (and
10# each derivation's outputs) consists of the run-time version, augmented with a
11-# `nativeDrv` field for the build-time version, and `crossDrv` field for the
12# run-time version.
13-#
14-# We could have used any names we want for the disambiguated versions, but
15-# `crossDrv` and `nativeDrv` were somewhat similarly used for the old
16-# cross-compiling infrastructure. The names are mostly invisible as
17-# `mkDerivation` knows how to pull out the right ones for `buildDepends` and
18-# friends, but a few packages use them directly, so it seemed efficient (to
19-# @Ericson2314) to reuse those names, at least initially, to minimize breakage.
20#
21# For performance reasons, rather than uniformally splice in all cases, we only
22# do so when `pkgs` and `buildPackages` are distinct. The `actuallySplice`
···46 valueHostTarget = pkgsHostTarget.${name} or {};
47 valueTargetTarget = pkgsTargetTarget.${name} or {};
48 augmentedValue = defaultValue
49- # TODO(@Ericson2314): Stop using old names after transition period
50- // (lib.optionalAttrs (pkgsBuildHost ? ${name}) { nativeDrv = valueBuildHost; })
51- // (lib.optionalAttrs (pkgsHostTarget ? ${name}) { crossDrv = valueHostTarget; })
52 // {
53 __spliced =
54 (lib.optionalAttrs (pkgsBuildBuild ? ${name}) { buildBuild = valueBuildBuild; })
055 // (lib.optionalAttrs (pkgsBuildTarget ? ${name}) { buildTarget = valueBuildTarget; })
56 // (lib.optionalAttrs (pkgsHostHost ? ${name}) { hostHost = valueHostHost; })
057 // (lib.optionalAttrs (pkgsTargetTarget ? ${name}) { targetTarget = valueTargetTarget;
58 });
59 };
···8# The solution is to splice the package sets together as we do below, so every
9# `callPackage`d expression in fact gets both versions. Each# derivation (and
10# each derivation's outputs) consists of the run-time version, augmented with a
11+# `__spliced.buildHost` field for the build-time version, and `__spliced.hostTarget` field for the
12# run-time version.
000000013#
14# For performance reasons, rather than uniformally splice in all cases, we only
15# do so when `pkgs` and `buildPackages` are distinct. The `actuallySplice`
···39 valueHostTarget = pkgsHostTarget.${name} or {};
40 valueTargetTarget = pkgsTargetTarget.${name} or {};
41 augmentedValue = defaultValue
42+ # TODO(@Artturin): remove before release 23.05 and only have __spliced.
43+ // (lib.optionalAttrs (pkgsBuildHost ? ${name}) { nativeDrv = lib.warn "use ${name}.__spliced.buildHost instead of ${name}.nativeDrv" valueBuildHost; })
44+ // (lib.optionalAttrs (pkgsHostTarget ? ${name}) { crossDrv = lib.warn "use ${name}.__spliced.hostTarget instead of ${name}.crossDrv" valueHostTarget; })
45 // {
46 __spliced =
47 (lib.optionalAttrs (pkgsBuildBuild ? ${name}) { buildBuild = valueBuildBuild; })
48+ // (lib.optionalAttrs (pkgsBuildHost ? ${name}) { buildHost = valueBuildHost; })
49 // (lib.optionalAttrs (pkgsBuildTarget ? ${name}) { buildTarget = valueBuildTarget; })
50 // (lib.optionalAttrs (pkgsHostHost ? ${name}) { hostHost = valueHostHost; })
51+ // (lib.optionalAttrs (pkgsHostTarget ? ${name}) { hostTarget = valueHostTarget; })
52 // (lib.optionalAttrs (pkgsTargetTarget ? ${name}) { targetTarget = valueTargetTarget;
53 });
54 };