···250250:::
251251252252::: {.note}
253253-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.
253253+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`.
254254:::
+9-6
lib/customisation.nix
···3838 //
3939 (drv.passthru or {})
4040 //
4141- (if (drv ? crossDrv && drv ? nativeDrv)
4242- then {
4343- crossDrv = overrideDerivation drv.crossDrv f;
4444- nativeDrv = overrideDerivation drv.nativeDrv f;
4545- }
4646- else { }));
4141+ # TODO(@Artturin): remove before release 23.05 and only have __spliced.
4242+ (lib.optionalAttrs (drv ? crossDrv && drv ? nativeDrv) {
4343+ crossDrv = overrideDerivation drv.crossDrv f;
4444+ nativeDrv = overrideDerivation drv.nativeDrv f;
4545+ })
4646+ //
4747+ lib.optionalAttrs (drv ? __spliced) {
4848+ __spliced = {} // (lib.mapAttrs (_: sDrv: overrideDerivation sDrv f) drv.__spliced);
4949+ });
475048514952 /* `makeOverridable` takes a function from attribute set to attribute set and
···11-{ lib, makeSetupHook, nodejs, srcOnly, diffutils, jq, makeWrapper }:
11+{ lib, makeSetupHook, nodejs, srcOnly, buildPackages, makeWrapper }:
2233{
44 npmConfigHook = makeSetupHook
···991010 # Specify the stdenv's `diff` and `jq` by abspath to ensure that the user's build
1111 # inputs do not cause us to find the wrong binaries.
1212- # The `.nativeDrv` stanza works like nativeBuildInputs and ensures cross-compiling has the right version available.
1313- diff = "${diffutils.nativeDrv or diffutils}/bin/diff";
1414- jq = "${jq.nativeDrv or jq}/bin/jq";
1212+ diff = "${buildPackages.diffutils}/bin/diff";
1313+ jq = "${buildPackages.jq}/bin/jq";
15141615 nodeVersion = nodejs.version;
1716 nodeVersionMajor = lib.versions.major nodejs.version;
···2928 deps = [ makeWrapper ];
3029 substitutions = {
3130 hostNode = "${nodejs}/bin/node";
3232- jq = "${jq.nativeDrv or jq}/bin/jq";
3131+ jq = "${buildPackages.jq}/bin/jq";
3332 };
3433 } ./npm-install-hook.sh;
3534}
+1-3
pkgs/build-support/rust/hooks/default.nix
···22, callPackage
33, cargo
44, clang
55-, diffutils
65, lib
76, makeSetupHook
87, maturin
···65646665 # Specify the stdenv's `diff` by abspath to ensure that the user's build
6766 # inputs do not cause us to find the wrong `diff`.
6868- # The `.nativeDrv` stanza works like nativeBuildInputs and ensures cross-compiling has the right version available.
6969- diff = "${diffutils.nativeDrv or diffutils}/bin/diff";
6767+ diff = "${lib.getBin buildPackages.diffutils}/bin/diff";
70687169 # We want to specify the correct crt-static flag for both
7270 # the build and host platforms. This is important when the wanted
-51
pkgs/development/libraries/gsl/gsl-1_16.nix
···11-{ fetchurl, fetchpatch, lib, stdenv }:
22-33-stdenv.mkDerivation rec {
44- pname = "gsl";
55- version = "1.16";
66-77- src = fetchurl {
88- url = "mirror://gnu/gsl/gsl-${version}.tar.gz";
99- sha256 = "0lrgipi0z6559jqh82yx8n4xgnxkhzj46v96dl77hahdp58jzg3k";
1010- };
1111-1212- # do not let -march=skylake to enable FMA (https://lists.gnu.org/archive/html/bug-gsl/2011-11/msg00019.html)
1313- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isx86_64 "-mno-fma";
1414-1515- patches = [
1616- (fetchpatch {
1717- name = "bug-39055.patch";
1818- url = "https://git.savannah.gnu.org/cgit/gsl.git/patch/?id=9cc12d";
1919- sha256 = "1bmrmihi28cly9g9pq54kkix2jy59y7cd7h5fw4v1c7h5rc2qvs8";
2020- })
2121-2222- (fetchpatch {
2323- name = "fix-parallel-test.patch";
2424- url = "https://git.savannah.gnu.org/cgit/gsl.git/patch/?id=12654373c3b60541230921aae81f93b484ec5eaf";
2525- sha256 = "1flzpbsfj7gjywv6v9qvm8wpdrkbpj7shryinfdpb40y7si9njdw";
2626- })
2727- ];
2828-2929- enableParallelBuilding = true;
3030- doCheck = true;
3131-3232- meta = {
3333- description = "The GNU Scientific Library, a large numerical library";
3434- homepage = "https://www.gnu.org/software/gsl/";
3535- license = lib.licenses.gpl3Plus;
3636-3737- longDescription = ''
3838- The GNU Scientific Library (GSL) is a numerical library for C
3939- and C++ programmers. It is free software under the GNU General
4040- Public License.
4141-4242- The library provides a wide range of mathematical routines such
4343- as random number generators, special functions and least-squares
4444- fitting. There are over 1000 functions in total with an
4545- extensive test suite.
4646- '';
4747- platforms = lib.platforms.unix;
4848- # Failing "eigen" tests on aarch64.
4949- badPlatforms = [ "aarch64-linux" ];
5050- };
5151-}
+2
pkgs/development/libraries/qt-6/default.nix
···107107 } ./hooks/qmake-hook.sh;
108108 };
109109110110+ # TODO(@Artturin): convert to makeScopeWithSplicing
111111+ # simple example of how to do that in 5568a4d25ca406809530420996d57e0876ca1a01
110112 self = lib.makeScope newScope addPackages;
111113in
112114self
+1-1
pkgs/development/libraries/qt-6/qtModule.nix
···6161 if [[ -z "$dontSyncQt" && -f sync.profile ]]; then
6262 # FIXME: this probably breaks crosscompiling as it's not from nativeBuildInputs
6363 # I don't know how to get /libexec from nativeBuildInputs to work, it's not under /bin
6464- ${self.qtbase.dev.nativeDrv or self.qtbase.dev}/libexec/syncqt.pl -version "''${version%%-*}"
6464+ ${lib.getDev self.qtbase}/libexec/syncqt.pl -version "''${version%%-*}"
6565 fi
6666 '';
6767
···582582 gr-rds = gnuradio3_7.pkgs.rds; # Added 2019-05-27, changed 2020-10-16
583583 grv = throw "grv has been dropped due to the lack of maintanence from upstream since 2019"; # Added 2022-06-01
584584 gsettings_desktop_schemas = throw "'gsettings_desktop_schemas' has been renamed to/replaced by 'gsettings-desktop-schemas'"; # Converted to throw 2022-02-22
585585+ gsl_1 = throw "'gsl_1' has been renamed to/replaced by 'gsl'"; # Added 2022-11-19
585586 gtk_doc = throw "'gtk_doc' has been renamed to/replaced by 'gtk-doc'"; # Converted to throw 2022-02-22
586587 gtklick = throw "gtklick has been removed from nixpkgs as the project is stuck on python2"; # Added 2022-01-01
587588 gtmess = throw "gtmess has been removed, because it was a MSN client."; # add 2021-12-15
···756757 libgpgerror = libgpg-error; # Added 2021-09-04
757758 libgroove = throw "libgroove has been removed, because it depends on an outdated and insecure version of ffmpeg"; # Added 2022-01-21
758759 libgumbo = throw "'libgumbo' has been renamed to/replaced by 'gumbo'"; # Converted to throw 2022-02-22
760760+ libheimdal = heimdal; # Added 2022-11-18
759761 libintlOrEmpty = lib.optional (!stdenv.isLinux || stdenv.hostPlatform.libc != "glibc") gettext; # Added 2018-03-14
760762 libixp_hg = libixp;
761763 libjpeg_drop = libjpeg_original; # Added 2020-06-05
+2-4
pkgs/top-level/all-packages.nix
···790790 mysql-shell = callPackage ../development/tools/mysql-shell {
791791 inherit (darwin) cctools developer_cmds DarwinTools;
792792 inherit (darwin.apple_sdk.frameworks) CoreServices;
793793+ antlr = antlr4_10;
793794 boost = boost177; # Configure checks for specific version.
794795 protobuf = protobuf3_19;
795796 icu = icu69;
···1857918580 cypress = callPackage ../development/web/cypress { };
18580185811858118582 cyrus_sasl = callPackage ../development/libraries/cyrus-sasl {
1858218582- libkrb5 = if stdenv.isFreeBSD then libheimdal else libkrb5;
1858318583+ libkrb5 = if stdenv.isFreeBSD then heimdal else libkrb5;
1858318584 };
18584185851858518586 # Make bdb5 the default as it is the last release under the custom
···19317193181931819319 gsl = callPackage ../development/libraries/gsl { };
19319193201932019320- gsl_1 = callPackage ../development/libraries/gsl/gsl-1_16.nix { };
1932119321-1932219321 gsl-lite = callPackage ../development/libraries/gsl-lite { };
19323193221932419323 gsm = callPackage ../development/libraries/gsm {};
···1949619495 inherit (darwin.apple_sdk.frameworks) CoreFoundation Security SystemConfiguration;
1949719496 autoreconfHook = buildPackages.autoreconfHook269;
1949819497 };
1949919499- libheimdal = heimdal;
19500194981950119499 harfbuzz = callPackage ../development/libraries/harfbuzz {
1950219500 inherit (darwin.apple_sdk.frameworks) ApplicationServices CoreText;
+6-11
pkgs/top-level/splice.nix
···88# The solution is to splice the package sets together as we do below, so every
99# `callPackage`d expression in fact gets both versions. Each# derivation (and
1010# each derivation's outputs) consists of the run-time version, augmented with a
1111-# `nativeDrv` field for the build-time version, and `crossDrv` field for the
1111+# `__spliced.buildHost` field for the build-time version, and `__spliced.hostTarget` field for the
1212# run-time version.
1313-#
1414-# We could have used any names we want for the disambiguated versions, but
1515-# `crossDrv` and `nativeDrv` were somewhat similarly used for the old
1616-# cross-compiling infrastructure. The names are mostly invisible as
1717-# `mkDerivation` knows how to pull out the right ones for `buildDepends` and
1818-# friends, but a few packages use them directly, so it seemed efficient (to
1919-# @Ericson2314) to reuse those names, at least initially, to minimize breakage.
2013#
2114# For performance reasons, rather than uniformally splice in all cases, we only
2215# do so when `pkgs` and `buildPackages` are distinct. The `actuallySplice`
···4639 valueHostTarget = pkgsHostTarget.${name} or {};
4740 valueTargetTarget = pkgsTargetTarget.${name} or {};
4841 augmentedValue = defaultValue
4949- # TODO(@Ericson2314): Stop using old names after transition period
5050- // (lib.optionalAttrs (pkgsBuildHost ? ${name}) { nativeDrv = valueBuildHost; })
5151- // (lib.optionalAttrs (pkgsHostTarget ? ${name}) { crossDrv = valueHostTarget; })
4242+ # TODO(@Artturin): remove before release 23.05 and only have __spliced.
4343+ // (lib.optionalAttrs (pkgsBuildHost ? ${name}) { nativeDrv = lib.warn "use ${name}.__spliced.buildHost instead of ${name}.nativeDrv" valueBuildHost; })
4444+ // (lib.optionalAttrs (pkgsHostTarget ? ${name}) { crossDrv = lib.warn "use ${name}.__spliced.hostTarget instead of ${name}.crossDrv" valueHostTarget; })
5245 // {
5346 __spliced =
5447 (lib.optionalAttrs (pkgsBuildBuild ? ${name}) { buildBuild = valueBuildBuild; })
4848+ // (lib.optionalAttrs (pkgsBuildHost ? ${name}) { buildHost = valueBuildHost; })
5549 // (lib.optionalAttrs (pkgsBuildTarget ? ${name}) { buildTarget = valueBuildTarget; })
5650 // (lib.optionalAttrs (pkgsHostHost ? ${name}) { hostHost = valueHostHost; })
5151+ // (lib.optionalAttrs (pkgsHostTarget ? ${name}) { hostTarget = valueHostTarget; })
5752 // (lib.optionalAttrs (pkgsTargetTarget ? ${name}) { targetTarget = valueTargetTarget;
5853 });
5954 };