Moving most of the ghdl logic outside the middle of the gcc expression.

Agreed on a final naming logic for the ghdl package: ghdl-wrapper-0.29


svn path=/nixpkgs/branches/stdenv-updates/; revision=19450
This commit is contained in:
Lluís Batlle i Rossell 2010-01-14 23:03:31 +00:00
parent 9183f21f7e
commit aaa4eafcbf
2 changed files with 35 additions and 24 deletions

View File

@ -30,6 +30,7 @@ with stdenv.lib;
let
version = "4.3.4";
crossConfigureFlags =
"--target=${cross.config}" +
(if crossStageStatic then
@ -49,11 +50,6 @@ let
stageNameAddon = if (crossStageStatic) then "-stage-static" else
"-stage-final";
crossNameAddon = if (cross != null) then "-${cross.config}" + stageNameAddon else "";
ghdlSrc = fetchurl {
url = "http://ghdl.free.fr/ghdl-0.29.tar.bz2";
sha256 = "15mlinr1lwljwll9ampzcfcrk9bk0qpdks1kxlvb70xf9zhh2jva";
};
in
stdenv.mkDerivation ({
@ -119,23 +115,6 @@ stdenv.mkDerivation ({
";
#Above I added a hack on making the build different than the host.
postUnpack = if langVhdl then ''
tar xvf ${ghdlSrc}
mv ghdl-*/vhdl gcc*/gcc
rm -Rf ghdl-*
'' else "";
# Ghdl has some timestamps checks, storing file timestamps in '.cf' files.
# As we will change the timestamps to 1970-01-01 00:00:01, we also set the
# content of that .cf to that value. This way ghdl does not complain on
# the installed object files from the basic libraries (ieee, ...)
postInstallGhdl = if langVhdl then ''
pushd $out
find . -name "*.cf" -exec \
sed 's/[0-9]*\.000" /19700101000001.000" /g' -i {} \;
popd
'' else "";
# Needed for the cross compilation to work
AR = "ar";
LD = "ld";
@ -152,10 +131,43 @@ stdenv.mkDerivation ({
license = "GPL/LGPL";
description = "GNU Compiler Collection, 4.3.x";
};
} // (if langJava then {
postConfigure = ''
make configure-gcc
sed -i gcc/Makefile -e 's@^CFLAGS = .*@& -I${zlib}/include@ ; s@^LDFLAGS = .*@& -L${zlib}/lib@'
sed -i gcc/Makefile -e 's@^CFLAGS = .*@& -I${boehmgc}/include@ ; s@^LDFLAGS = .*@& -L${boehmgc}/lib -lgc@'
'';
} else {})
// (if langVhdl then rec {
name = "ghdl-0.29";
ghdlSrc = fetchurl {
url = "http://ghdl.free.fr/ghdl-0.29.tar.bz2";
sha256 = "15mlinr1lwljwll9ampzcfcrk9bk0qpdks1kxlvb70xf9zhh2jva";
};
# Ghdl has some timestamps checks, storing file timestamps in '.cf' files.
# As we will change the timestamps to 1970-01-01 00:00:01, we also set the
# content of that .cf to that value. This way ghdl does not complain on
# the installed object files from the basic libraries (ieee, ...)
postInstallGhdl = ''
pushd $out
find . -name "*.cf" -exec \
sed 's/[0-9]*\.000" /19700101000001.000" /g' -i {} \;
popd
'';
postUnpack = ''
tar xvf ${ghdlSrc}
mv ghdl-*/vhdl gcc*/gcc
rm -Rf ghdl-*
'';
meta = {
homepage = "http://ghdl.free.fr/";
license = "GPLv2+";
description = "Complete VHDL simulator, using the GCC technology";
};
} else {}))

View File

@ -1923,7 +1923,6 @@ let
gfortran = gfortran43;
gfortran40 = wrapGCC (gcc40.gcc.override {
name = "gfortran";
langFortran = true;
langCC = false;
inherit gmp mpfr;
@ -1998,7 +1997,7 @@ let
ghdl = wrapGHDL (import ../development/compilers/gcc-4.3 {
inherit stdenv fetchurl texinfo gmp mpfr noSysDirs gnat;
name = "ghdl-0.29";
name = "ghdl";
langVhdl = true;
langCC = false;
langC = false;