build-fhs-chrootenv: fix gcc_multi paths

This commit is contained in:
Christoph Hrdinka 2014-04-26 14:42:10 +02:00 committed by Sander van der Burg
parent 72b1f874ef
commit 2d912e29d5
2 changed files with 30 additions and 14 deletions

View File

@ -1,7 +1,7 @@
{ buildEnv, nixpkgs, nixpkgs_i686, system
, stdenv, glibc, glibc_multi, glibcLocales
, bashInteractive, coreutils, less, shadow, su
, gawk, gcc, diffutils, findutils, gnused, gnugrep
, gawk, gcc, gcc_multi, diffutils, findutils, gnused, gnugrep
, gnutar, gzip, bzip2, xz
} :
{ name, pkgs ? [], profile ? ""
@ -33,12 +33,14 @@ let
else [];
# base packages of the chroot
# these match the hosts architecture, glibc_multi will be choosen
# these match the hosts architecture, gcc/glibc_multi will be choosen
# on multi builds
choosenGcc = if isMultiBuild then gcc_multi else gcc;
basePkgs =
[ (if isMultiBuild then glibc_multi else glibc)
choosenGcc
bashInteractive coreutils less shadow su
gawk gcc diffutils findutils gnused gnugrep
gawk diffutils findutils gnused gnugrep
gnutar gzip bzip2 xz
];
@ -101,23 +103,36 @@ let
${linkProfile staticUsrProfileMulti}
cd ..
${setupLibDirs}
${setupMultiLibDirs}
cd usr
${setupLibDirs}
${setupMultiLibDirs}
cd ..
'';
setupLibDirs = ''
setupMultiLibDirs = ''
rm -f lib lib32 lib64
mkdir -m0755 lib
# copy glibc stuff
cp -rs ${staticUsrProfileTarget}/lib/32/* lib/
# copy contents of multiPaths
cp -rsf ${staticUsrProfileMulti}/lib/* lib/
mkdir -m0755 lib64
ln -s lib lib32
ln -s ${staticUsrProfileTarget}/lib lib64
# copy glibc stuff
cp -rsf ${staticUsrProfileTarget}/lib/32/* lib/
# copy content of multiPaths (32bit libs)
cp -rsf ${staticUsrProfileMulti}/lib/* lib/
# copy content of targetPaths (64bit libs)
cp -rsf ${staticUsrProfileTarget}/lib/* lib64/
# most 64bit only libs put their stuff into /lib
# some pkgs (like gcc_multi) put 32bit libs into /lib 64bit libs into /lib64
# by overwriting these we will hopefully catch all these cases
# in the end /lib should only contain 32bit and /lib64 only 64bit libs
cp -rsf ${staticUsrProfileTarget}/lib64/* lib64/
# copy gcc libs (and may overwrite exitsting wrongly placed libs)
cp -rsf ${choosenGcc.gcc}/lib/* lib/
cp -rsf ${choosenGcc.gcc}/lib64/* lib64/
'';
in stdenv.mkDerivation {

View File

@ -265,7 +265,7 @@ let
inherit buildEnv system;
inherit stdenv glibc glibc_multi glibcLocales;
inherit bashInteractive coreutils less shadow su;
inherit gawk gcc diffutils findutils gnused gnugrep;
inherit gawk gcc gcc_multi diffutils findutils gnused gnugrep;
inherit gnutar gzip bzip2 xz;
nixpkgs = pkgs;
@ -2737,7 +2737,8 @@ let
gambit = callPackage ../development/compilers/gambit { };
gcc = gcc48;
gcc = gcc48;
gcc_multi = gcc48_multi;
gcc33 = wrapGCC (import ../development/compilers/gcc/3.3 {
inherit fetchurl stdenv noSysDirs;