2012-12-22 20:01:05 +01:00
|
|
|
{ stdenv, gccRaw }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "distcc-masq-${gccRaw.name}";
|
|
|
|
|
|
|
|
phases = [ "installPhase" ];
|
|
|
|
installPhase = ''
|
|
|
|
ensureDir $out/bin
|
|
|
|
|
|
|
|
bin=${gccRaw}/bin
|
|
|
|
|
|
|
|
shopt -s nullglob
|
|
|
|
if [ -f $bin/gcc ]; then
|
|
|
|
ln -s $bin/gcc $out/bin
|
|
|
|
else
|
2012-12-22 20:35:51 +01:00
|
|
|
for a in $bin/*-gcc; do
|
2012-12-22 20:01:05 +01:00
|
|
|
ln -s $bin/*-gcc $out/bin/gcc
|
2012-12-22 20:35:51 +01:00
|
|
|
ln -s $bin/*-gcc $out/bin/cc
|
2012-12-22 20:01:05 +01:00
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f $bin/g++ ]; then
|
|
|
|
ln -s $bin/g++ $out/bin
|
|
|
|
else
|
|
|
|
for a in $bin/*-g++; do
|
|
|
|
ln -sf $bin/*-g++ $out/bin/g++
|
2012-12-22 20:35:51 +01:00
|
|
|
ln -sf $bin/*-g++ $out/bin/c++
|
2012-12-22 20:01:05 +01:00
|
|
|
done
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
}
|