Merge pull request #33087 from obsidiansystems/alt-stdenv

treewide: Clean up multi-arch tools and usage

authored by John Ericson and committed by GitHub ad1a1ee7 635c1014

+16 -24
+3 -5
pkgs/applications/audio/airwave/default.nix
··· 1 - { stdenv, cmake, fetchFromGitHub, file, gcc_multi, libX11, makeWrapper 2 , overrideCC, qt5, requireFile, unzip, wine 3 }: 4 ··· 12 rev = version; 13 sha256 = "1ban59skw422mak3cp57lj27hgq5d3a4f6y79ysjnamf8rpz9x4s"; 14 }; 15 - 16 - stdenv_multi = overrideCC stdenv gcc_multi; 17 18 vst-sdk = stdenv.mkDerivation rec { 19 name = "vstsdk368_08_11_2017_build_121"; ··· 38 39 in 40 41 - stdenv_multi.mkDerivation { 42 name = "airwave-${version}"; 43 44 src = airwave-src; ··· 54 # For airwave-host-32.exe.so, point wineg++ to 32-bit versions of 55 # these libraries, as $NIX_LDFLAGS contains only 64-bit ones. 56 substituteInPlace src/host/CMakeLists.txt --replace '-m32' \ 57 - '-m32 -L${wine-xembed}/lib -L${wine-xembed}/lib/wine -L${stdenv_multi.cc.libc.out}/lib/32' 58 ''; 59 60 # libstdc++.so link gets lost in 64-bit executables during
··· 1 + { stdenv, multiStdenv, cmake, fetchFromGitHub, file, libX11, makeWrapper 2 , overrideCC, qt5, requireFile, unzip, wine 3 }: 4 ··· 12 rev = version; 13 sha256 = "1ban59skw422mak3cp57lj27hgq5d3a4f6y79ysjnamf8rpz9x4s"; 14 }; 15 16 vst-sdk = stdenv.mkDerivation rec { 17 name = "vstsdk368_08_11_2017_build_121"; ··· 36 37 in 38 39 + multiStdenv.mkDerivation { 40 name = "airwave-${version}"; 41 42 src = airwave-src; ··· 52 # For airwave-host-32.exe.so, point wineg++ to 32-bit versions of 53 # these libraries, as $NIX_LDFLAGS contains only 64-bit ones. 54 substituteInPlace src/host/CMakeLists.txt --replace '-m32' \ 55 + '-m32 -L${wine-xembed}/lib -L${wine-xembed}/lib/wine -L${multiStdenv.cc.libc.out}/lib/32' 56 ''; 57 58 # libstdc++.so link gets lost in 64-bit executables during
+4 -6
pkgs/os-specific/linux/statifier/default.nix
··· 1 - { stdenv, fetchurl, gcc_multi, glibc_multi }: 2 3 let version = "1.7.4"; in 4 - stdenv.mkDerivation { 5 name = "statifier-${version}"; 6 7 src = fetchurl { ··· 9 sha256 = "03lzkla6knjhh186b43cac410x2fmhi28pkmzb3d211n3zp5i9y8"; 10 }; 11 12 - buildInputs = [ gcc_multi glibc_multi ]; 13 - 14 phaseNames = [ "patchPhase" "installPhase" ]; 15 16 postPatch = '' 17 sed -e s@/usr/@"$out/"@g -i */Makefile src/statifier 18 - sed -e s@/bin/bash@"${stdenv.shell}"@g -i src/*.sh 19 ''; 20 21 - meta = with stdenv.lib; { 22 description = "Tool for creating static Linux binaries"; 23 platforms = platforms.linux; 24 };
··· 1 + { multiStdenv, fetchurl }: 2 3 let version = "1.7.4"; in 4 + multiStdenv.mkDerivation { 5 name = "statifier-${version}"; 6 7 src = fetchurl { ··· 9 sha256 = "03lzkla6knjhh186b43cac410x2fmhi28pkmzb3d211n3zp5i9y8"; 10 }; 11 12 phaseNames = [ "patchPhase" "installPhase" ]; 13 14 postPatch = '' 15 sed -e s@/usr/@"$out/"@g -i */Makefile src/statifier 16 + sed -e s@/bin/bash@"${multiStdenv.shell}"@g -i src/*.sh 17 ''; 18 19 + meta = with multiStdenv.lib; { 20 description = "Tool for creating static Linux binaries"; 21 platforms = platforms.linux; 22 };
+2 -2
pkgs/tools/misc/loadlibrary/default.nix
··· 1 - { cabextract, glibc_multi, fetchFromGitHub, readline, stdenv_32bit }: 2 3 # stdenv_32bit is needed because the program depends upon 32-bit libraries and does not have 4 # support for 64-bit yet: it requires libc6-dev:i386, libreadline-dev:i386. ··· 14 sha256 = "01hb7wzfh1s5b8cvmrmr1gqknpq5zpzj9prq3wrpsgg129jpsjkb"; 15 }; 16 17 - buildInputs = [ glibc_multi cabextract readline stdenv_32bit.cc.libc ]; 18 19 installPhase = '' 20 mkdir -p $out/bin/
··· 1 + { cabextract, fetchFromGitHub, readline, stdenv_32bit }: 2 3 # stdenv_32bit is needed because the program depends upon 32-bit libraries and does not have 4 # support for 64-bit yet: it requires libc6-dev:i386, libreadline-dev:i386. ··· 14 sha256 = "01hb7wzfh1s5b8cvmrmr1gqknpq5zpzj9prq3wrpsgg129jpsjkb"; 15 }; 16 17 + buildInputs = [ cabextract readline ]; 18 19 installPhase = '' 20 mkdir -p $out/bin/
+7 -11
pkgs/top-level/all-packages.nix
··· 34 # A stdenv capable of building 32-bit binaries. On x86_64-linux, 35 # it uses GCC compiled with multilib support; on i686-linux, it's 36 # just the plain stdenv. 37 - stdenv_32bit = lowPrio ( 38 - if system == "x86_64-linux" then 39 - overrideCC stdenv gcc_multi 40 - else 41 - stdenv); 42 43 stdenvNoCC = stdenv.override { cc = null; }; 44 ··· 1566 m17n = callPackage ../tools/inputmethods/ibus-engines/ibus-m17n { }; 1567 1568 mozc = callPackage ../tools/inputmethods/ibus-engines/ibus-mozc rec { 1569 - clangStdenv = libcxxStdenv; # workaround for https://github.com/NixOS/nixpkgs/issues/28223 1570 python = python2; 1571 inherit (python2Packages) gyp; 1572 protobuf = pkgs.protobuf.overrideDerivation (oldAttrs: { stdenv = clangStdenv; }); ··· 2057 m17n = callPackage ../tools/inputmethods/fcitx-engines/fcitx-m17n { }; 2058 2059 mozc = callPackage ../tools/inputmethods/fcitx-engines/fcitx-mozc rec { 2060 - clangStdenv = libcxxStdenv; # workaround for https://github.com/NixOS/nixpkgs/issues/28223 2061 python = python2; 2062 inherit (python2Packages) gyp; 2063 protobuf = pkgs.protobuf.overrideDerivation (oldAttrs: { stdenv = clangStdenv; }); ··· 5568 }; 5569 5570 #Use this instead of stdenv to build with clang 5571 - clangStdenv = if stdenv.isDarwin then stdenv else lowPrio llvmPackages.stdenv; 5572 clang-sierraHack-stdenv = overrideCC stdenv clang-sierraHack; 5573 libcxxStdenv = if stdenv.isDarwin then stdenv else lowPrio llvmPackages.libcxxStdenv; 5574 ··· 5625 gcc = gcc6; 5626 gcc-unwrapped = gcc.cc; 5627 5628 - gccStdenv = if (!stdenv.isDarwin) then stdenv else stdenv.override { 5629 allowedRequisites = null; 5630 cc = gcc; 5631 - # Include unwrapped binaries like AS, etc. and remove libcxx/libcxxabi 5632 - extraBuildInputs = [ stdenv.cc.cc ]; 5633 }; 5634 5635 wrapCCMulti = cc: ··· 5669 5670 gccMultiStdenv = overrideCC stdenv gcc_multi; 5671 clangMultiStdenv = overrideCC stdenv clang_multi; 5672 5673 gcc_debug = lowPrio (wrapCC (gcc.cc.override { 5674 stripped = false;
··· 34 # A stdenv capable of building 32-bit binaries. On x86_64-linux, 35 # it uses GCC compiled with multilib support; on i686-linux, it's 36 # just the plain stdenv. 37 + stdenv_32bit = lowPrio (if hostPlatform.is32bit then stdenv else multiStdenv); 38 39 stdenvNoCC = stdenv.override { cc = null; }; 40 ··· 1562 m17n = callPackage ../tools/inputmethods/ibus-engines/ibus-m17n { }; 1563 1564 mozc = callPackage ../tools/inputmethods/ibus-engines/ibus-mozc rec { 1565 python = python2; 1566 inherit (python2Packages) gyp; 1567 protobuf = pkgs.protobuf.overrideDerivation (oldAttrs: { stdenv = clangStdenv; }); ··· 2052 m17n = callPackage ../tools/inputmethods/fcitx-engines/fcitx-m17n { }; 2053 2054 mozc = callPackage ../tools/inputmethods/fcitx-engines/fcitx-mozc rec { 2055 python = python2; 2056 inherit (python2Packages) gyp; 2057 protobuf = pkgs.protobuf.overrideDerivation (oldAttrs: { stdenv = clangStdenv; }); ··· 5562 }; 5563 5564 #Use this instead of stdenv to build with clang 5565 + clangStdenv = if stdenv.cc.isClang then stdenv else lowPrio llvmPackages.stdenv; 5566 clang-sierraHack-stdenv = overrideCC stdenv clang-sierraHack; 5567 libcxxStdenv = if stdenv.isDarwin then stdenv else lowPrio llvmPackages.libcxxStdenv; 5568 ··· 5619 gcc = gcc6; 5620 gcc-unwrapped = gcc.cc; 5621 5622 + gccStdenv = if stdenv.cc.isGNU then stdenv else stdenv.override { 5623 allowedRequisites = null; 5624 cc = gcc; 5625 + # Remove libcxx/libcxxabi, and add clang for AS if on darwin (it uses 5626 + # clang's internal assembler). 5627 + extraBuildInputs = lib.optional hostPlatform.isDarwin clang.cc; 5628 }; 5629 5630 wrapCCMulti = cc: ··· 5664 5665 gccMultiStdenv = overrideCC stdenv gcc_multi; 5666 clangMultiStdenv = overrideCC stdenv clang_multi; 5667 + multiStdenv = if stdenv.cc.isClang then clangMultiStdenv else gccMultiStdenv; 5668 5669 gcc_debug = lowPrio (wrapCC (gcc.cc.override { 5670 stripped = false;