diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2018-07-05 18:05:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-05 18:05:57 -0400 |
commit | bb0febf575bb847e632a507e2c3b75eb0ec63b01 (patch) | |
tree | dc8a3b53df11785addab6ae283af7fac6a402ad8 | |
parent | cdebd1c61f9dc713406ced66923bf9dd678d813c (diff) | |
parent | ad20a4a1c328967c7e4abe211f3dd63bb68bf966 (diff) | |
download | nixlib-bb0febf575bb847e632a507e2c3b75eb0ec63b01.tar nixlib-bb0febf575bb847e632a507e2c3b75eb0ec63b01.tar.gz nixlib-bb0febf575bb847e632a507e2c3b75eb0ec63b01.tar.bz2 nixlib-bb0febf575bb847e632a507e2c3b75eb0ec63b01.tar.lz nixlib-bb0febf575bb847e632a507e2c3b75eb0ec63b01.tar.xz nixlib-bb0febf575bb847e632a507e2c3b75eb0ec63b01.tar.zst nixlib-bb0febf575bb847e632a507e2c3b75eb0ec63b01.zip |
Merge pull request #43079 from matthewbauer/rework-extra-pkgs
Rework stage.nix's extraPkgs
-rw-r--r-- | pkgs/applications/science/programming/scyther/default.nix | 6 | ||||
-rw-r--r-- | pkgs/development/pharo/vm/default.nix | 6 | ||||
-rw-r--r-- | pkgs/misc/cups/drivers/canon/default.nix | 8 | ||||
-rw-r--r-- | pkgs/misc/emulators/wine/packages.nix | 5 | ||||
-rw-r--r-- | pkgs/os-specific/gnu/default.nix | 4 | ||||
-rw-r--r-- | pkgs/os-specific/linux/nvidia-x11/generic.nix | 4 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 58 | ||||
-rw-r--r-- | pkgs/top-level/stage.nix | 60 |
8 files changed, 83 insertions, 68 deletions
diff --git a/pkgs/applications/science/programming/scyther/default.nix b/pkgs/applications/science/programming/scyther/default.nix index beef26c6032a..e0993a580193 100644 --- a/pkgs/applications/science/programming/scyther/default.nix +++ b/pkgs/applications/science/programming/scyther/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, buildEnv, callPackage_i686, fetchFromGitHub, python27Packages, graphviz +{ stdenv, lib, buildEnv, pkgsi686Linux, fetchFromGitHub, python27Packages, graphviz , includeGUI ? true , includeProtocols ? true }: @@ -20,7 +20,7 @@ let platforms = platforms.linux; }; - cli = callPackage_i686 ./cli.nix { + cli = pkgsi686Linux.callPackage ./cli.nix { inherit version src meta; }; @@ -47,7 +47,7 @@ let python27Packages.wxPython graphviz ]; - + installPhase = '' mkdir -p "$out"/gui "$out"/bin cp -r gui/* "$out"/gui diff --git a/pkgs/development/pharo/vm/default.nix b/pkgs/development/pharo/vm/default.nix index e6269503a4c4..b995e0e2540a 100644 --- a/pkgs/development/pharo/vm/default.nix +++ b/pkgs/development/pharo/vm/default.nix @@ -1,7 +1,7 @@ -{ stdenv, callPackage, callPackage_i686, makeWrapper, ...} @pkgs: +{ stdenv, callPackage, pkgsi686Linux, makeWrapper, ...} @pkgs: let - i686 = callPackage_i686 ./vms.nix {}; + i686 = pkgsi686Linux.callPackage ./vms.nix {}; native = callPackage ./vms.nix {}; in @@ -11,5 +11,3 @@ rec { spur64 = if stdenv.is64bit then native.spur else "none"; multi-vm-wrapper = callPackage ../wrapper { inherit cog32 spur32 spur64; }; } - - diff --git a/pkgs/misc/cups/drivers/canon/default.nix b/pkgs/misc/cups/drivers/canon/default.nix index 351a64abd331..1c0b8e13ab0b 100644 --- a/pkgs/misc/cups/drivers/canon/default.nix +++ b/pkgs/misc/cups/drivers/canon/default.nix @@ -1,10 +1,10 @@ -{stdenv, fetchurl, unzip, autoreconfHook, libtool, makeWrapper, cups, ghostscript, callPackage_i686 }: +{stdenv, fetchurl, unzip, autoreconfHook, libtool, makeWrapper, cups, ghostscript, pkgsi686Linux }: let - i686_NIX_GCC = callPackage_i686 ({gcc}: gcc) {}; - i686_libxml2 = callPackage_i686 ({libxml2}: libxml2) {}; - i686_glibc = callPackage_i686 ({glibc}: glibc) {}; + i686_NIX_GCC = pkgsi686Linux.callPackage ({gcc}: gcc) {}; + i686_libxml2 = pkgsi686Linux.callPackage ({libxml2}: libxml2) {}; + i686_glibc = pkgsi686Linux.callPackage ({glibc}: glibc) {}; src_canon = fetchurl { url = "https://files.canon-europe.com/files/soft45378/software/o147jen_linuxufrII_0290.zip"; diff --git a/pkgs/misc/emulators/wine/packages.nix b/pkgs/misc/emulators/wine/packages.nix index d2305aa37ba6..156db148435e 100644 --- a/pkgs/misc/emulators/wine/packages.nix +++ b/pkgs/misc/emulators/wine/packages.nix @@ -1,11 +1,11 @@ -{ system, stdenv, stdenv_32bit, lib, pkgs, pkgsi686Linux, callPackage, callPackage_i686, +{ system, stdenv, stdenv_32bit, lib, pkgs, pkgsi686Linux, callPackage, wineRelease ? "stable", supportFlags }: let src = lib.getAttr wineRelease (callPackage ./sources.nix {}); in with src; { - wine32 = callPackage_i686 ./base.nix { + wine32 = pkgsi686Linux.callPackage ./base.nix { name = "wine-${version}"; inherit src version supportFlags; pkgArches = [ pkgsi686Linux ]; @@ -33,4 +33,3 @@ in with src; { platforms = [ "x86_64-linux" ]; }; } - diff --git a/pkgs/os-specific/gnu/default.nix b/pkgs/os-specific/gnu/default.nix index 478040132b82..5dc52c766f18 100644 --- a/pkgs/os-specific/gnu/default.nix +++ b/pkgs/os-specific/gnu/default.nix @@ -3,7 +3,7 @@ args@{ fetchgit, stdenv, autoconf, automake, automake111x, libtool , texinfo, glibcCross, hurdPartedCross, libuuid, samba , gccCrossStageStatic, gcc -, forceSystem, newScope, platform, config +, pkgsi686Linux, newScope, platform, config , targetPlatform, buildPlatform , overrides ? {} , buildPackages, pkgs @@ -90,7 +90,7 @@ let mig = callPackage ./mig { # Build natively, but force use of a 32-bit environment because we're # targeting `i586-pc-gnu'. - stdenv = (forceSystem "i686-linux" "i386").stdenv; + stdenv = pkgsi686Linux.stdenv; }; # XXX: Use this one for its `.crossDrv'. Using the one above from diff --git a/pkgs/os-specific/linux/nvidia-x11/generic.nix b/pkgs/os-specific/linux/nvidia-x11/generic.nix index 0fe0f3d92c92..b5435f23e71b 100644 --- a/pkgs/os-specific/linux/nvidia-x11/generic.nix +++ b/pkgs/os-specific/linux/nvidia-x11/generic.nix @@ -12,7 +12,7 @@ , patches ? [] }: -{ stdenv, callPackage, callPackage_i686, fetchurl, fetchpatch +{ stdenv, callPackage, pkgsi686Linux, fetchurl, fetchpatch , kernel ? null, xorg, zlib, perl, nukeReferences , # Whether to build the libraries only (i.e. not the kernel module or # nvidia-settings). Used to support 32-bit binaries on 64-bit @@ -70,7 +70,7 @@ let disallowedReferences = optional (!libsOnly) [ kernel.dev ]; passthru = { - settings = (if settings32Bit then callPackage_i686 else callPackage) (import ./settings.nix self settingsSha256) { + settings = (if settings32Bit then pkgsi686Linux.callPackage else callPackage) (import ./settings.nix self settingsSha256) { withGtk2 = preferGtk2; withGtk3 = !preferGtk2; }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 34609c6bdc51..b5260e94739b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2393,7 +2393,7 @@ with pkgs; flamerobin = callPackage ../applications/misc/flamerobin { }; - flashtool = callPackage_i686 ../development/mobile/flashtool { + flashtool = pkgsi686Linux.callPackage ../development/mobile/flashtool { platformTools = androidenv.platformTools; }; @@ -2407,7 +2407,7 @@ with pkgs; flvstreamer = callPackage ../tools/networking/flvstreamer { }; - hmetis = callPackage_i686 ../applications/science/math/hmetis { }; + hmetis = pkgsi686Linux.callPackage ../applications/science/math/hmetis { }; libbsd = callPackage ../development/libraries/libbsd { }; @@ -2803,13 +2803,13 @@ with pkgs; groonga = callPackage ../servers/search/groonga { }; - grub = callPackage_i686 ../tools/misc/grub { + grub = pkgsi686Linux.callPackage ../tools/misc/grub { buggyBiosCDSupport = config.grub.buggyBiosCDSupport or true; }; - trustedGrub = callPackage_i686 ../tools/misc/grub/trusted.nix { }; + trustedGrub = pkgsi686Linux.callPackage ../tools/misc/grub/trusted.nix { }; - trustedGrub-for-HP = callPackage_i686 ../tools/misc/grub/trusted.nix { for_HP_laptop = true; }; + trustedGrub-for-HP = pkgsi686Linux.callPackage ../tools/misc/grub/trusted.nix { for_HP_laptop = true; }; grub2 = grub2_full; @@ -3289,7 +3289,7 @@ with pkgs; kbdd = callPackage ../applications/window-managers/kbdd { }; - kdbplus = callPackage_i686 ../applications/misc/kdbplus { }; + kdbplus = pkgsi686Linux.callPackage ../applications/misc/kdbplus { }; kde2-decoration = libsForQt5.callPackage ../misc/themes/kde2 { }; @@ -3408,7 +3408,7 @@ with pkgs; kippo = callPackage ../servers/kippo { }; - kzipmix = callPackage_i686 ../tools/compression/kzipmix { }; + kzipmix = pkgsi686Linux.callPackage ../tools/compression/kzipmix { }; mailcatcher = callPackage ../development/web/mailcatcher { }; @@ -6181,7 +6181,7 @@ with pkgs; cmdstan = callPackage ../development/compilers/cmdstan { }; - cmucl_binary = callPackage_i686 ../development/compilers/cmucl/binary.nix { }; + cmucl_binary = pkgsi686Linux.callPackage ../development/compilers/cmucl/binary.nix { }; compcert = callPackage ../development/compilers/compcert { }; @@ -6488,25 +6488,25 @@ with pkgs; gcl_2_6_13_pre = callPackage ../development/compilers/gcl/2.6.13-pre.nix { }; - gcc-arm-embedded-4_7 = callPackage_i686 ../development/compilers/gcc-arm-embedded { + gcc-arm-embedded-4_7 = pkgsi686Linux.callPackage ../development/compilers/gcc-arm-embedded { version = "4.7-2013q3-20130916"; releaseType = "update"; sha256 = "1bd9bi9q80xn2rpy0rn1vvj70rh15kb7dmah0qs4q2rv78fqj40d"; ncurses = pkgsi686Linux.ncurses5; }; - gcc-arm-embedded-4_8 = callPackage_i686 ../development/compilers/gcc-arm-embedded { + gcc-arm-embedded-4_8 = pkgsi686Linux.callPackage ../development/compilers/gcc-arm-embedded { version = "4.8-2014q1-20140314"; releaseType = "update"; sha256 = "ce92859550819d4a3d1a6e2672ea64882b30afa2c08cf67fa8e1d93788c2c577"; ncurses = pkgsi686Linux.ncurses5; }; - gcc-arm-embedded-4_9 = callPackage_i686 ../development/compilers/gcc-arm-embedded { + gcc-arm-embedded-4_9 = pkgsi686Linux.callPackage ../development/compilers/gcc-arm-embedded { version = "4.9-2015q1-20150306"; releaseType = "update"; sha256 = "c5e0025b065750bbd76b5357b4fc8606d88afbac9ff55b8a82927b4b96178154"; ncurses = pkgsi686Linux.ncurses5; }; - gcc-arm-embedded-5 = pkgs.callPackage_i686 ../development/compilers/gcc-arm-embedded { + gcc-arm-embedded-5 = pkgs.pkgsi686Linux.callPackage ../development/compilers/gcc-arm-embedded { dirName = "5.0"; subdirName = "5-2016-q2-update"; version = "5.4-2016q2-20160622"; @@ -6872,7 +6872,7 @@ with pkgs; manticore = callPackage ../development/compilers/manticore { }; mentorToolchains = recurseIntoAttrs ( - callPackage_i686 ../development/compilers/mentor {} + pkgsi686Linux.callPackage ../development/compilers/mentor {} ); mercury = callPackage ../development/compilers/mercury { }; @@ -7059,7 +7059,7 @@ with pkgs; smlnjBootstrap = callPackage ../development/compilers/smlnj/bootstrap.nix { }; smlnj = if stdenv.isDarwin then callPackage ../development/compilers/smlnj { } - else callPackage_i686 ../development/compilers/smlnj { }; + else pkgsi686Linux.callPackage ../development/compilers/smlnj { }; solc = callPackage ../development/compilers/solc { }; @@ -7570,7 +7570,7 @@ with pkgs; scheme48 = callPackage ../development/interpreters/scheme48 { }; - self = callPackage_i686 ../development/interpreters/self { }; + self = pkgsi686Linux.callPackage ../development/interpreters/self { }; spark = spark_22; spark_22 = callPackage ../applications/networking/cluster/spark { version = "2.2.1"; }; @@ -15014,7 +15014,7 @@ with pkgs; requests requests_toolbelt sqlalchemy fusepy; }; - adobe-reader = callPackage_i686 ../applications/misc/adobe-reader { }; + adobe-reader = pkgsi686Linux.callPackage ../applications/misc/adobe-reader { }; masterpdfeditor = libsForQt5.callPackage ../applications/misc/masterpdfeditor { }; @@ -16685,7 +16685,7 @@ with pkgs; # Impressive, formerly known as "KeyJNote". impressive = callPackage ../applications/office/impressive { }; - inferno = callPackage_i686 ../applications/inferno { }; + inferno = pkgsi686Linux.callPackage ../applications/inferno { }; inginious = callPackage ../servers/inginious {}; @@ -16808,7 +16808,7 @@ with pkgs; keepnote = callPackage ../applications/office/keepnote { }; - kega-fusion = callPackage_i686 ../misc/emulators/kega-fusion { }; + kega-fusion = pkgsi686Linux.callPackage ../misc/emulators/kega-fusion { }; kermit = callPackage ../tools/misc/kermit { }; @@ -17609,7 +17609,7 @@ with pkgs; ffmpeg = ffmpeg_2; }; - pcsx2 = callPackage_i686 ../misc/emulators/pcsx2 { }; + pcsx2 = pkgsi686Linux.callPackage ../misc/emulators/pcsx2 { }; pekwm = callPackage ../applications/window-managers/pekwm { }; @@ -19846,7 +19846,7 @@ with pkgs; terraria-server = callPackage ../games/terraria-server { }; - tibia = callPackage_i686 ../games/tibia { }; + tibia = pkgsi686Linux.callPackage ../games/tibia { }; tintin = callPackage ../games/tintin { }; @@ -19915,7 +19915,7 @@ with pkgs; vectoroids = callPackage ../games/vectoroids { }; - vessel = callPackage_i686 ../games/vessel { }; + vessel = pkgsi686Linux.callPackage ../games/vessel { }; vms-empire = callPackage ../games/vms-empire { }; @@ -20905,7 +20905,7 @@ with pkgs; bootil = callPackage ../development/libraries/bootil { }; - brgenml1lpr = callPackage_i686 ../misc/cups/drivers/brgenml1lpr {}; + brgenml1lpr = pkgsi686Linux.callPackage ../misc/cups/drivers/brgenml1lpr {}; brgenml1cupswrapper = callPackage ../misc/cups/drivers/brgenml1cupswrapper {}; @@ -20954,10 +20954,10 @@ with pkgs; cups-bjnp = callPackage ../misc/cups/drivers/cups-bjnp { }; - cups-brother-hl1110 = callPackage_i686 ../misc/cups/drivers/hl1110 { }; + cups-brother-hl1110 = pkgsi686Linux.callPackage ../misc/cups/drivers/hl1110 { }; # this driver ships with pre-compiled 32-bit binary libraries - cnijfilter_2_80 = callPackage_i686 ../misc/cups/drivers/cnijfilter_2_80 { }; + cnijfilter_2_80 = pkgsi686Linux.callPackage ../misc/cups/drivers/cnijfilter_2_80 { }; cnijfilter_4_00 = callPackage ../misc/cups/drivers/cnijfilter_4_00 { libusb = libusb1; @@ -21047,7 +21047,7 @@ with pkgs; gammu = callPackage ../applications/misc/gammu { }; - gensgs = callPackage_i686 ../misc/emulators/gens-gs { }; + gensgs = pkgsi686Linux.callPackage ../misc/emulators/gens-gs { }; ghostscript = callPackage ../misc/ghostscript rec { cupsSupport = config.ghostscript.cups or (!stdenv.isDarwin); @@ -21386,13 +21386,13 @@ with pkgs; hll2390dw-cups = callPackage ../misc/cups/drivers/hll2390dw-cups { }; mfcj470dw-cupswrapper = callPackage ../misc/cups/drivers/mfcj470dwcupswrapper { }; - mfcj470dwlpr = callPackage_i686 ../misc/cups/drivers/mfcj470dwlpr { }; + mfcj470dwlpr = pkgsi686Linux.callPackage ../misc/cups/drivers/mfcj470dwlpr { }; mfcj6510dw-cupswrapper = callPackage ../misc/cups/drivers/mfcj6510dwcupswrapper { }; - mfcj6510dwlpr = callPackage_i686 ../misc/cups/drivers/mfcj6510dwlpr { }; + mfcj6510dwlpr = pkgsi686Linux.callPackage ../misc/cups/drivers/mfcj6510dwlpr { }; mfcl2700dncupswrapper = callPackage ../misc/cups/drivers/mfcl2700dncupswrapper { }; - mfcl2700dnlpr = callPackage_i686 ../misc/cups/drivers/mfcl2700dnlpr { }; + mfcl2700dnlpr = pkgsi686Linux.callPackage ../misc/cups/drivers/mfcl2700dnlpr { }; mfcl2720dwcupswrapper = callPackage ../misc/cups/drivers/mfcl2720dwcupswrapper { }; mfcl2720dwlpr = callPackage ../misc/cups/drivers/mfcl2720dwlpr { }; @@ -21711,7 +21711,7 @@ with pkgs; callPackage ../applications/networking/znc/modules.nix { } ); - zsnes = callPackage_i686 ../misc/emulators/zsnes { }; + zsnes = pkgsi686Linux.callPackage ../misc/emulators/zsnes { }; xcpc = callPackage ../misc/emulators/xcpc { }; diff --git a/pkgs/top-level/stage.nix b/pkgs/top-level/stage.nix index c209b05b09c5..cc70950c497c 100644 --- a/pkgs/top-level/stage.nix +++ b/pkgs/top-level/stage.nix @@ -117,29 +117,47 @@ let lib.optionalAttrs allowCustomOverrides ((config.packageOverrides or (super: {})) super); - # Override system. This is useful to build i686 packages on x86_64-linux. - forceSystem = system: kernel: nixpkgsFun { - localSystem = { - inherit system; - platform = stdenv.hostPlatform.platform // { kernelArch = kernel; }; - }; - }; - - # Convenience attributes for instantitating nixpkgs. Each of these - # will instantiate a new version of allPackages. They map example - # attributes to their own thing. - extraPkgs = self: super: { - pkgsCross = lib.mapAttrs (n: crossSystem: + # Convenience attributes for instantitating package sets. Each of + # these will instantiate a new version of allPackages. Currently the + # following package sets are provided: + # + # - pkgsCross.<system> where system is a member of lib.systems.examples + # - pkgsMusl + # - pkgsi686Linux + otherPackageSets = self: super: { + # This maps each entry in lib.systems.examples to its own package + # set. Each of these will contain all packages cross compiled for + # that target system. For instance, pkgsCross.rasberryPi.hello, + # will refer to the "hello" package built for the ARM6-based + # Raspberry Pi. + pkgsCross = lib.mapAttrs (n: crossSystem: nixpkgsFun { inherit crossSystem; }) lib.systems.examples; - pkgsLocal = lib.mapAttrs (n: localSystem: - nixpkgsFun { inherit localSystem; }) - lib.systems.examples; - # Used by wine, firefox with debugging version of Flash, ... - pkgsi686Linux = forceSystem "i686-linux" "i386"; - callPackage_i686 = self.pkgsi686Linux.callPackage; - inherit forceSystem; + # All packages built with the Musl libc. This will override the + # default GNU libc on Linux systems. Non-Linux systems are not + # supported. + pkgsMusl = if stdenv.hostPlatform.isLinux then nixpkgsFun { + localSystem = { + parsed = stdenv.hostPlatform.parsed // { + abi = { + "gnu" = lib.systems.parse.abis.musl; + "gnueabi" = lib.systems.parse.abis.musleabi; + "gnueabihf" = lib.systems.parse.abis.musleabihf; + }.${stdenv.hostPlatform.parsed.abi.name} or lib.systems.parse.abis.musl; + }; + }; + } else throw "Musl libc only supports Linux systems."; + + # All packages built for i686 Linux. + # Used by wine, firefox with debugging version of Flash, ... + pkgsi686Linux = assert stdenv.hostPlatform.isLinux; nixpkgsFun { + localSystem = { + parsed = stdenv.hostPlatform.parsed // { + cpu = lib.systems.parse.cpuTypes.i686; + }; + }; + }; }; # The complete chain of package set builders, applied from top to bottom. @@ -152,7 +170,7 @@ let trivialBuilders splice allPackages - extraPkgs + otherPackageSets aliases configOverrides ] ++ overlays ++ [ |