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 { buildEnv, nixpkgs, nixpkgs_i686, system
, stdenv, glibc, glibc_multi, glibcLocales , stdenv, glibc, glibc_multi, glibcLocales
, bashInteractive, coreutils, less, shadow, su , bashInteractive, coreutils, less, shadow, su
, gawk, gcc, diffutils, findutils, gnused, gnugrep , gawk, gcc, gcc_multi, diffutils, findutils, gnused, gnugrep
, gnutar, gzip, bzip2, xz , gnutar, gzip, bzip2, xz
} : } :
{ name, pkgs ? [], profile ? "" { name, pkgs ? [], profile ? ""
@ -33,12 +33,14 @@ let
else []; else [];
# base packages of the chroot # 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 # on multi builds
choosenGcc = if isMultiBuild then gcc_multi else gcc;
basePkgs = basePkgs =
[ (if isMultiBuild then glibc_multi else glibc) [ (if isMultiBuild then glibc_multi else glibc)
choosenGcc
bashInteractive coreutils less shadow su bashInteractive coreutils less shadow su
gawk gcc diffutils findutils gnused gnugrep gawk diffutils findutils gnused gnugrep
gnutar gzip bzip2 xz gnutar gzip bzip2 xz
]; ];
@ -101,23 +103,36 @@ let
${linkProfile staticUsrProfileMulti} ${linkProfile staticUsrProfileMulti}
cd .. cd ..
${setupLibDirs} ${setupMultiLibDirs}
cd usr cd usr
${setupLibDirs} ${setupMultiLibDirs}
cd .. cd ..
''; '';
setupLibDirs = '' setupMultiLibDirs = ''
rm -f lib lib32 lib64 rm -f lib lib32 lib64
mkdir -m0755 lib mkdir -m0755 lib
mkdir -m0755 lib64
ln -s lib lib32
# copy glibc stuff # copy glibc stuff
cp -rs ${staticUsrProfileTarget}/lib/32/* lib/ cp -rsf ${staticUsrProfileTarget}/lib/32/* lib/
# copy contents of multiPaths
# copy content of multiPaths (32bit libs)
cp -rsf ${staticUsrProfileMulti}/lib/* lib/ cp -rsf ${staticUsrProfileMulti}/lib/* lib/
ln -s lib lib32 # copy content of targetPaths (64bit libs)
ln -s ${staticUsrProfileTarget}/lib lib64 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 { in stdenv.mkDerivation {

View File

@ -265,7 +265,7 @@ let
inherit buildEnv system; inherit buildEnv system;
inherit stdenv glibc glibc_multi glibcLocales; inherit stdenv glibc glibc_multi glibcLocales;
inherit bashInteractive coreutils less shadow su; 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; inherit gnutar gzip bzip2 xz;
nixpkgs = pkgs; nixpkgs = pkgs;
@ -2738,6 +2738,7 @@ let
gambit = callPackage ../development/compilers/gambit { }; gambit = callPackage ../development/compilers/gambit { };
gcc = gcc48; gcc = gcc48;
gcc_multi = gcc48_multi;
gcc33 = wrapGCC (import ../development/compilers/gcc/3.3 { gcc33 = wrapGCC (import ../development/compilers/gcc/3.3 {
inherit fetchurl stdenv noSysDirs; inherit fetchurl stdenv noSysDirs;