treewide: Cleanup usage of multi-arch tools

- Don't needlessly force GCC

 - Prefer using multi-arch stdenvs to using multi-arch tools directly.
This commit is contained in:
John Ericson 2017-12-26 15:23:01 -05:00
parent 831c71eea3
commit 558c96fe13
3 changed files with 9 additions and 13 deletions

View File

@ -1,4 +1,4 @@
{ stdenv, cmake, fetchFromGitHub, file, gcc_multi, libX11, makeWrapper { stdenv, multiStdenv, cmake, fetchFromGitHub, file, libX11, makeWrapper
, overrideCC, qt5, requireFile, unzip, wine , overrideCC, qt5, requireFile, unzip, wine
}: }:
@ -13,8 +13,6 @@ let
sha256 = "1ban59skw422mak3cp57lj27hgq5d3a4f6y79ysjnamf8rpz9x4s"; sha256 = "1ban59skw422mak3cp57lj27hgq5d3a4f6y79ysjnamf8rpz9x4s";
}; };
stdenv_multi = overrideCC stdenv gcc_multi;
vst-sdk = stdenv.mkDerivation rec { vst-sdk = stdenv.mkDerivation rec {
name = "vstsdk368_08_11_2017_build_121"; name = "vstsdk368_08_11_2017_build_121";
src = requireFile { src = requireFile {
@ -38,7 +36,7 @@ let
in in
stdenv_multi.mkDerivation { multiStdenv.mkDerivation {
name = "airwave-${version}"; name = "airwave-${version}";
src = airwave-src; src = airwave-src;
@ -54,7 +52,7 @@ stdenv_multi.mkDerivation {
# For airwave-host-32.exe.so, point wineg++ to 32-bit versions of # For airwave-host-32.exe.so, point wineg++ to 32-bit versions of
# these libraries, as $NIX_LDFLAGS contains only 64-bit ones. # these libraries, as $NIX_LDFLAGS contains only 64-bit ones.
substituteInPlace src/host/CMakeLists.txt --replace '-m32' \ substituteInPlace src/host/CMakeLists.txt --replace '-m32' \
'-m32 -L${wine-xembed}/lib -L${wine-xembed}/lib/wine -L${stdenv_multi.cc.libc.out}/lib/32' '-m32 -L${wine-xembed}/lib -L${wine-xembed}/lib/wine -L${multiStdenv.cc.libc.out}/lib/32'
''; '';
# libstdc++.so link gets lost in 64-bit executables during # libstdc++.so link gets lost in 64-bit executables during

View File

@ -1,7 +1,7 @@
{ stdenv, fetchurl, gcc_multi, glibc_multi }: { multiStdenv, fetchurl }:
let version = "1.7.4"; in let version = "1.7.4"; in
stdenv.mkDerivation { multiStdenv.mkDerivation {
name = "statifier-${version}"; name = "statifier-${version}";
src = fetchurl { src = fetchurl {
@ -9,16 +9,14 @@ stdenv.mkDerivation {
sha256 = "03lzkla6knjhh186b43cac410x2fmhi28pkmzb3d211n3zp5i9y8"; sha256 = "03lzkla6knjhh186b43cac410x2fmhi28pkmzb3d211n3zp5i9y8";
}; };
buildInputs = [ gcc_multi glibc_multi ];
phaseNames = [ "patchPhase" "installPhase" ]; phaseNames = [ "patchPhase" "installPhase" ];
postPatch = '' postPatch = ''
sed -e s@/usr/@"$out/"@g -i */Makefile src/statifier sed -e s@/usr/@"$out/"@g -i */Makefile src/statifier
sed -e s@/bin/bash@"${stdenv.shell}"@g -i src/*.sh sed -e s@/bin/bash@"${multiStdenv.shell}"@g -i src/*.sh
''; '';
meta = with stdenv.lib; { meta = with multiStdenv.lib; {
description = "Tool for creating static Linux binaries"; description = "Tool for creating static Linux binaries";
platforms = platforms.linux; platforms = platforms.linux;
}; };

View File

@ -1,4 +1,4 @@
{ cabextract, glibc_multi, fetchFromGitHub, readline, stdenv_32bit }: { cabextract, fetchFromGitHub, readline, stdenv_32bit }:
# stdenv_32bit is needed because the program depends upon 32-bit libraries and does not have # stdenv_32bit is needed because the program depends upon 32-bit libraries and does not have
# support for 64-bit yet: it requires libc6-dev:i386, libreadline-dev:i386. # support for 64-bit yet: it requires libc6-dev:i386, libreadline-dev:i386.
@ -14,7 +14,7 @@ stdenv_32bit.mkDerivation rec {
sha256 = "01hb7wzfh1s5b8cvmrmr1gqknpq5zpzj9prq3wrpsgg129jpsjkb"; sha256 = "01hb7wzfh1s5b8cvmrmr1gqknpq5zpzj9prq3wrpsgg129jpsjkb";
}; };
buildInputs = [ glibc_multi cabextract readline stdenv_32bit.cc.libc ]; buildInputs = [ cabextract readline ];
installPhase = '' installPhase = ''
mkdir -p $out/bin/ mkdir -p $out/bin/