From aaa4eafcbf283bf1db1220095852124642b0edf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Thu, 14 Jan 2010 23:03:31 +0000 Subject: [PATCH] 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 --- .../development/compilers/gcc-4.3/default.nix | 56 +++++++++++-------- pkgs/top-level/all-packages.nix | 3 +- 2 files changed, 35 insertions(+), 24 deletions(-) diff --git a/pkgs/development/compilers/gcc-4.3/default.nix b/pkgs/development/compilers/gcc-4.3/default.nix index 815bbde98714..6aa796254793 100644 --- a/pkgs/development/compilers/gcc-4.3/default.nix +++ b/pkgs/development/compilers/gcc-4.3/default.nix @@ -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 {})) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index bb0efb49915a..cc23bcde2359 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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;