Merge 'staging' into multiple-outputs
Conflicts: pkgs/applications/audio/flac/default.nix pkgs/build-support/gcc-wrapper/builder.sh pkgs/development/libraries/apr-util/default.nix pkgs/development/libraries/apr/default.nix pkgs/development/libraries/atk/default.nix pkgs/development/libraries/freetype/default.nix pkgs/development/libraries/gdk-pixbuf/default.nix pkgs/development/libraries/glib/default.nix pkgs/development/libraries/glibc/2.17/builder.sh pkgs/development/libraries/glibc/2.17/locales.nix pkgs/development/libraries/libjpeg/default.nix pkgs/development/libraries/libogg/default.nix pkgs/development/libraries/libsamplerate/default.nix pkgs/development/libraries/libtiff/default.nix pkgs/development/libraries/libvorbis/default.nix pkgs/development/libraries/mesa/default.nix pkgs/development/libraries/pango/default.nix pkgs/development/web/nodejs/default.nix pkgs/os-specific/linux/pam/default.nix pkgs/os-specific/linux/systemd/default.nix pkgs/stdenv/generic/setup.sh pkgs/stdenv/linux/default.nix pkgs/top-level/all-packages.nix pkgs/top-level/release-small.nix
This commit is contained in:
@@ -2,12 +2,12 @@
|
||||
, avrdude, arduino_core, avrgcclibc }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
name = "ino-0.3.5";
|
||||
name = "ino-0.3.6";
|
||||
namePrefix = "";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://pypi.python.org/packages/source/i/ino/${name}.tar.gz";
|
||||
sha256 = "1j2qzcjp6r2an1v431whq9l47s81d5af6ni8j87gv294f53sl1ab";
|
||||
sha256 = "0k6lzfcn55favbj0w4afrvnmwyskf7bgzg9javv2ycvskp35srwv";
|
||||
};
|
||||
|
||||
# TODO: add avrgcclibc, it must be rebuild with C++ support
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
{ cabal, Agda }:
|
||||
|
||||
cabal.mkDerivation (self: {
|
||||
pname = "Agda-executable";
|
||||
version = "2.3.0.1";
|
||||
sha256 = "156nzvpmqi7yizjr4yym2ybc0iv4nqfp84qrpdxcha682k298ib1";
|
||||
isLibrary = false;
|
||||
isExecutable = true;
|
||||
buildDepends = [ Agda ];
|
||||
jailbreak = true;
|
||||
meta = {
|
||||
homepage = "http://wiki.portal.chalmers.se/agda/";
|
||||
description = "Command-line program for type-checking and compiling Agda programs";
|
||||
license = "unknown";
|
||||
platforms = self.ghc.meta.platforms;
|
||||
maintainers = [ self.stdenv.lib.maintainers.andres ];
|
||||
};
|
||||
})
|
||||
@@ -35,6 +35,6 @@ stdenv.mkDerivation rec {
|
||||
|
||||
meta = {
|
||||
description = "Flex SDK for Adobe Flash / ActionScript";
|
||||
homepage = "http://www.adobe.com/support/documentation/en/flex/3/releasenotes_flex3_sdk.html#installation";
|
||||
homepage = "http://www.adobe.com/support/documentation/en/flex/3/releasenotes_flex3_sdk.html#installation";
|
||||
license = stdenv.lib.licenses.mpl11;
|
||||
};
|
||||
|
||||
32
pkgs/development/compilers/agda/default.nix
Normal file
32
pkgs/development/compilers/agda/default.nix
Normal file
@@ -0,0 +1,32 @@
|
||||
# This file was auto-generated by cabal2nix. Please do NOT edit manually!
|
||||
|
||||
{ cabal, alex, binary, boxes, dataHash, deepseq, emacs, equivalence
|
||||
, filepath, geniplate, happy, hashable, hashtables, haskeline
|
||||
, haskellSrcExts, mtl, parallel, QuickCheck, STMonadTrans, strict
|
||||
, text, time, transformers, unorderedContainers, xhtml, zlib
|
||||
}:
|
||||
|
||||
cabal.mkDerivation (self: {
|
||||
pname = "Agda";
|
||||
version = "2.4.0.2";
|
||||
sha256 = "13c4ipscnlnbv94k93yajrp32mwzikqa8rhc95h8pmqzhjgwyh8b";
|
||||
isLibrary = true;
|
||||
isExecutable = true;
|
||||
buildDepends = [
|
||||
binary boxes dataHash deepseq equivalence filepath geniplate
|
||||
hashable hashtables haskeline haskellSrcExts mtl parallel
|
||||
QuickCheck STMonadTrans strict text time transformers
|
||||
unorderedContainers xhtml zlib
|
||||
];
|
||||
buildTools = [ alex emacs happy ];
|
||||
postInstall = ''
|
||||
$out/bin/agda -c --no-main $(find $out/share -name Primitive.agda)
|
||||
$out/bin/agda-mode compile
|
||||
'';
|
||||
meta = {
|
||||
homepage = "http://wiki.portal.chalmers.se/agda/";
|
||||
description = "A dependently typed functional programming language and proof assistant";
|
||||
license = "unknown";
|
||||
platforms = self.ghc.meta.platforms;
|
||||
};
|
||||
})
|
||||
31
pkgs/development/compilers/agda/stdlib.nix
Normal file
31
pkgs/development/compilers/agda/stdlib.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{ cabal, fetchurl, filemanip, Agda }:
|
||||
|
||||
cabal.mkDerivation (self: rec {
|
||||
pname = "Agda-stdlib";
|
||||
version = "0.8";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/agda/agda-stdlib/archive/v${version}.tar.gz";
|
||||
sha256 = "03gdcy2gar46qlmd6w91y05cm1x304ig6bda90ryww9qn05kif78";
|
||||
};
|
||||
|
||||
buildDepends = [ filemanip Agda ];
|
||||
|
||||
preConfigure = "cd ffi";
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $out/share
|
||||
cd ..
|
||||
${self.ghc.ghc}/bin/runhaskell GenerateEverything
|
||||
${Agda}/bin/agda -i . -i src Everything.agda
|
||||
cp -pR src $out/share/agda
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = "http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Libraries.StandardLibrary";
|
||||
description = "A standard library for use with the Agda compiler.";
|
||||
license = "unknown";
|
||||
platforms = self.ghc.meta.platforms;
|
||||
maintainers = [ self.stdenv.lib.maintainers.jwiegley ];
|
||||
};
|
||||
})
|
||||
@@ -2,12 +2,12 @@
|
||||
, autoconf, automake, libtool, openjdk, perl }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "aldor-1.1.0";
|
||||
name = "aldor-1.2.0";
|
||||
|
||||
src = fetchgit {
|
||||
url = "https://github.com/pippijn/aldor";
|
||||
sha256 = "14xv3jl15ib2knsdz0bd7jx64zg1qrr33q5zcr8gli860ps8gkg3";
|
||||
rev = "f7b95835cf709654744441ddb1c515bfc2bec998";
|
||||
sha256 = "1l9fc2cgwabifwbijcp293abc8hcv40nzx2w31jkxh8n0plbiczn";
|
||||
rev = "15471e75f3d65b93150f414ebcaf59a03054b68d";
|
||||
};
|
||||
|
||||
buildInputs = [ gmp which flex bison makeWrapper autoconf automake libtool
|
||||
|
||||
71
pkgs/development/compilers/aliceml/builder.sh
Normal file
71
pkgs/development/compilers/aliceml/builder.sh
Normal file
@@ -0,0 +1,71 @@
|
||||
source $stdenv/setup
|
||||
|
||||
export CXXFLAGS="-m32"
|
||||
|
||||
tar zxvf "$gecodeSrc"
|
||||
cd gecode-1.3.1
|
||||
./configure --prefix="$out" --disable-minimodel --disable-examples
|
||||
make
|
||||
make install
|
||||
cd ..
|
||||
|
||||
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:"$out"/lib/pkgconfig
|
||||
|
||||
tar zxvf "$seamSrc"
|
||||
cd seam-1.4
|
||||
./configure --prefix="$out" --with-zlib=$zlib
|
||||
make
|
||||
make install
|
||||
cd ..
|
||||
|
||||
PATH=$PATH:"$out"/bin
|
||||
|
||||
tar zxvf "$aliceSrc"
|
||||
cd alice-1.4
|
||||
sed -i -e 's/bin\/bash/usr\/bin\/env bash/g' bin/alicerun.in
|
||||
sed -i -e 's/bin\/bash/usr\/bin\/env bash/g' bin/aliceremote
|
||||
./configure --prefix="$out" --with-gmp=$gmp
|
||||
make
|
||||
make install
|
||||
cd ..
|
||||
|
||||
tar zxvf "$aliceGecodeSrc"
|
||||
cd alice-gecode-1.4
|
||||
make compiledll MUST_GENERATE=no
|
||||
make installdll MUST_GENERATE=no
|
||||
cd ..
|
||||
|
||||
tar zxvf "$aliceRegexSrc"
|
||||
cd alice-regex-1.4
|
||||
make compiledll MUST_GENERATE=no
|
||||
make installdll MUST_GENERATE=no
|
||||
cd ..
|
||||
|
||||
tar zxvf "$aliceSqliteSrc"
|
||||
cd alice-sqlite-1.4
|
||||
make compiledll MUST_GENERATE=no
|
||||
make installdll MUST_GENERATE=no
|
||||
cd ..
|
||||
|
||||
tar zxvf "$aliceXmlSrc"
|
||||
cd alice-xml-1.4
|
||||
make compiledll MUST_GENERATE=no
|
||||
make installdll MUST_GENERATE=no
|
||||
cd ..
|
||||
|
||||
tar zxvf "$aliceGtkSrc"
|
||||
cd alice-gtk-1.4
|
||||
sed -i -e 's/PRIVATE_GTK_LEAVE_PENDING/PRIVATE_GTK_HAS_POINTER/g' NativeGtk.cc
|
||||
sed -i -e 's/bin\/bash/usr\/bin\/env bash/g' myinstall
|
||||
make compiledll MUST_GENERATE=no
|
||||
make installdll MUST_GENERATE=no
|
||||
cd ..
|
||||
|
||||
tar zxvf "$aliceRuntimeSrc"
|
||||
cd alice-runtime-1.4
|
||||
./configure --prefix="$out"
|
||||
make
|
||||
make install
|
||||
cd ..
|
||||
|
||||
|
||||
75
pkgs/development/compilers/aliceml/default.nix
Normal file
75
pkgs/development/compilers/aliceml/default.nix
Normal file
@@ -0,0 +1,75 @@
|
||||
{stdenv, fetchurl, pkgsi686Linux, libtool, gnumake381, autoconf, automake111x, file, which, zsh, m4, pkgconfig, perl}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "aliceml-1.4";
|
||||
|
||||
aliceSrc = fetchurl {
|
||||
url = http://www.ps.uni-saarland.de/alice/download/sources/alice-1.4.tar.gz;
|
||||
sha256 = "1ay8r26g7xm9zlrlpigp6y1zmrl93hzkndb5phx7651wx8j2183r";
|
||||
};
|
||||
|
||||
aliceGecodeSrc = fetchurl {
|
||||
url = http://www.ps.uni-saarland.de/alice/download/sources/alice-gecode-1.4.tar.gz;
|
||||
sha256 = "0yklpsqnm3wwzfz4vvv69dmm7q7pzpl3z7iw7wg33klng85cidl6";
|
||||
};
|
||||
|
||||
aliceGtkSrc = fetchurl {
|
||||
url = http://www.ps.uni-saarland.de/alice/download/sources/alice-gtk-1.4.tar.gz;
|
||||
sha256 = "0zx4ks0pk5wgbcsflcmn0kbpa9j7pjbsc19d1s3jgp4rwb24m1an";
|
||||
};
|
||||
|
||||
aliceRegexSrc = fetchurl {
|
||||
url = http://www.ps.uni-saarland.de/alice/download/sources/alice-regex-1.4.tar.gz;
|
||||
sha256 = "0myjzh3295awamghs4c88ypaa41m8sxh5jys876yq6flslw41s02";
|
||||
};
|
||||
|
||||
aliceRuntimeSrc = fetchurl {
|
||||
url = http://www.ps.uni-saarland.de/alice/download/sources/alice-runtime-1.4.tar.gz;
|
||||
sha256 = "1cbca71vh16l2h0zjvhgzzs0rzq99nc8nx9a97yzw595355nq57f";
|
||||
};
|
||||
|
||||
aliceSqliteSrc = fetchurl {
|
||||
url = http://www.ps.uni-saarland.de/alice/download/sources/alice-sqlite-1.4.tar.gz;
|
||||
sha256 = "0554xbx8zgqmpb7x06d7xvhlbk7bxmc237khgjs6yjcy53yf366b";
|
||||
};
|
||||
|
||||
aliceXmlSrc = fetchurl {
|
||||
url = http://www.ps.uni-saarland.de/alice/download/sources/alice-xml-1.4.tar.gz;
|
||||
sha256 = "058a815a0vajjvjlsmd4ryx2bc71q6zwvyjg2c0v1gba2v3pddm0";
|
||||
};
|
||||
|
||||
seamSrc = fetchurl {
|
||||
url = http://www.ps.uni-saarland.de/alice/download/sources/seam-1.4.tar.gz;
|
||||
sha256 = "1iz98jdv914whaw426d5406shlqgxqwpy3fbyb472x7d3lfra2dz";
|
||||
};
|
||||
|
||||
gecodeSrc = fetchurl {
|
||||
url = http://www.gecode.org/download/gecode-1.3.1.tar.gz;
|
||||
sha256 = "0mgc6llbq166jmlq3alvagqsg3730670zvbwwkdgsqklw70v9355";
|
||||
};
|
||||
|
||||
zlib = pkgsi686Linux.zlib;
|
||||
gmp = pkgsi686Linux.gmp;
|
||||
|
||||
|
||||
buildInputs = [
|
||||
stdenv pkgsi686Linux.gcc34 pkgsi686Linux.glibc
|
||||
libtool gnumake381 autoconf automake111x pkgsi686Linux.zlib
|
||||
file which zsh pkgsi686Linux.gmp m4 pkgsi686Linux.gnome.gtk
|
||||
pkgsi686Linux.gnome.libgnomecanvas pkgsi686Linux.pango pkgsi686Linux.sqlite
|
||||
pkgsi686Linux.libxml2 pkgsi686Linux.lightning pkgconfig perl
|
||||
];
|
||||
|
||||
builder = ./builder.sh;
|
||||
|
||||
meta = {
|
||||
description = "Functional programming language based on Standard ML";
|
||||
longDescription = ''
|
||||
Alice ML is a functional programming language based on Standard ML,
|
||||
extended with rich support for concurrent, distributed, and constraint
|
||||
programming.
|
||||
'';
|
||||
homepage = http://www.ps.uni-saarland.de/alice/;
|
||||
license = "BSD";
|
||||
};
|
||||
}
|
||||
23
pkgs/development/compilers/ats/default.nix
Normal file
23
pkgs/development/compilers/ats/default.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{ stdenv, fetchurl, gmp }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "ats-${version}";
|
||||
version = "0.2.11";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/ats-lang/ats-lang-anairiats-${version}.tgz";
|
||||
sha256 = "0rqykyx5whichx85jr4l4c9fdan0qsdd4kwd7a81k3l07zbd9fc6";
|
||||
};
|
||||
|
||||
# this is necessary because atxt files usually include some .hats files
|
||||
patches = [ ./install-atsdoc-hats-files.patch ];
|
||||
buildInputs = [ gmp ];
|
||||
|
||||
meta = {
|
||||
description = "Functional programming language with dependent types";
|
||||
homepage = "http://www.ats-lang.org";
|
||||
license = stdenv.lib.licenses.gpl3Plus;
|
||||
platforms = stdenv.lib.platforms.unix;
|
||||
maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
--- ats-lang-anairiats-0.2.11/Makefile 2013-12-10 00:43:52.000000000 +0100
|
||||
+++ ats-lang-anairiats-0.2.11/Makefile 2014-03-02 07:49:06.985837425 +0100
|
||||
@@ -97,7 +97,7 @@
|
||||
cd $(abs_top_srcdir)
|
||||
[ -d $(bindir2) ] || $(MKDIR_P) $(bindir2)
|
||||
$(MKDIR_P) $(ATSLIBHOME2)/bin
|
||||
- find ccomp contrib doc libats libc prelude -type d \
|
||||
+ find ccomp contrib doc libats libatsdoc libc prelude -type d \
|
||||
-exec $(MKDIR_P) $(ATSLIBHOME2)/\{} \; \
|
||||
-print
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
#
|
||||
# recursively install all files in the list except .svn control files.
|
||||
#
|
||||
- for d in ccomp/runtime contrib doc libats libc prelude; do \
|
||||
+ for d in ccomp/runtime contrib doc libats libatsdoc libc prelude; do \
|
||||
cd $(abs_top_srcdir) && \
|
||||
$(INSTALL) -d $(ATSLIBHOME2)/"$$d" && \
|
||||
find "$$d" -name .svn -prune -o -type f \
|
||||
@@ -143,6 +143,17 @@
|
||||
$(INSTALL) -m 755 ats_env.sh $(bindir2)/"$$b" && \
|
||||
echo [ats_env.sh] is installed into $(bindir2)/"$$b"; \
|
||||
done
|
||||
+#
|
||||
+# install atsdoc headers
|
||||
+#
|
||||
+ for f in \
|
||||
+ utils/atsdoc/SATS/*.sats utils/atsdoc/DATS/*.dats utils/atsdoc/HATS/*.hats; \
|
||||
+ do \
|
||||
+ [ -f "$$f" ] || continue; \
|
||||
+ cd $(abs_top_srcdir) && \
|
||||
+ $(INSTALL) -m 644 -D "$$f" $(ATSLIBHOME2)/"$$f" && \
|
||||
+ echo "$$f"; \
|
||||
+ done
|
||||
|
||||
install:: install_files
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
{ stdenv, fetchurl, gmp }:
|
||||
|
||||
let version = "0.0.3"; in stdenv.mkDerivation {
|
||||
name = "ats2-postiats-${version}";
|
||||
stdenv.mkDerivation rec {
|
||||
name = "ats2-${version}";
|
||||
version = "0.1.0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-${version}.tgz";
|
||||
sha256 = "0hq63zrmm92j5ffnsmylhhllm8kgjpjkaj4xvzz1zlshz39lijxp";
|
||||
sha256 = "0i7b9v7xki9j2jjjpydz0gl33af94b4jjmk75b9w20bs003v8vd4";
|
||||
};
|
||||
|
||||
buildInputs = [ gmp ];
|
||||
|
||||
meta = {
|
||||
description = "A statically typed programming language that unifies implementation with formal specification";
|
||||
homepage = http://www.ats-lang.org/;
|
||||
license = stdenv.lib.licenses.gpl3Plus;
|
||||
maintainers = [ stdenv.lib.maintainers.shlevy ];
|
||||
description = "Functional programming language with dependent types";
|
||||
homepage = "http://www.ats-lang.org";
|
||||
license = stdenv.lib.licenses.gpl3Plus;
|
||||
platforms = stdenv.lib.platforms.unix;
|
||||
maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
|
||||
'';
|
||||
|
||||
homepage = http://www-sop.inria.fr/indes/fp/Bigloo/;
|
||||
license = "GPLv2+";
|
||||
license = stdenv.lib.licenses.gpl2Plus;
|
||||
|
||||
maintainers = [ stdenv.lib.maintainers.ludo ];
|
||||
platforms = stdenv.lib.platforms.gnu; # arbitrary choice
|
||||
|
||||
@@ -1,18 +1,37 @@
|
||||
{ stdenv, fetchurl }:
|
||||
|
||||
let
|
||||
version = "4.9.0.1";
|
||||
platform = with stdenv;
|
||||
if isDarwin then "macosx"
|
||||
else if isCygwin then "cygwin"
|
||||
else if isBSD then "bsd"
|
||||
else if isSunOS then "solaris"
|
||||
else "linux"; # Should be a sane default
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
name = "chicken-4.8.1";
|
||||
name = "chicken-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://code.call-cc.org/releases/4.9.0/chicken-${version}.tar.gz";
|
||||
sha256 = "0598mar1qswfd8hva9nqs88zjn02lzkqd8fzdd21dz1nki1prpq4";
|
||||
};
|
||||
|
||||
buildFlags = "PLATFORM=${platform} PREFIX=$(out) VARDIR=$(out)/var/lib";
|
||||
installFlags = "PLATFORM=${platform} PREFIX=$(out) VARDIR=$(out)/var/lib";
|
||||
|
||||
meta = {
|
||||
homepage = http://www.call-cc.org/;
|
||||
description = "Chicken Scheme";
|
||||
license = "BSD";
|
||||
maintainers = with stdenv.lib.maintainers; [ the-kenny ];
|
||||
platforms = with stdenv.lib.platforms; allBut darwin;
|
||||
description = "A portable compiler for the Scheme programming language";
|
||||
longDescription = ''
|
||||
CHICKEN is a compiler for the Scheme programming language.
|
||||
CHICKEN produces portable and efficient C, supports almost all
|
||||
of the R5RS Scheme language standard, and includes many
|
||||
enhancements and extensions. CHICKEN runs on Linux, MacOS X,
|
||||
Windows, and many Unix flavours.
|
||||
'';
|
||||
};
|
||||
|
||||
src = fetchurl {
|
||||
url = http://code.call-cc.org/dev-snapshots/2013/01/04/chicken-4.8.1.tar.gz;
|
||||
md5 = "bd758ec7abeaeb4f4c92c290fb5f3db7";
|
||||
};
|
||||
|
||||
buildFlags = "PLATFORM=linux PREFIX=$(out) VARDIR=$(out)/var/lib";
|
||||
installFlags = "PLATFORM=linux PREFIX=$(out) VARDIR=$(out)/var/lib";
|
||||
}
|
||||
|
||||
@@ -14,11 +14,11 @@ stdenv.mkDerivation rec {
|
||||
buildInputs = [ gnutar ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/lib/java $out/bin
|
||||
mkdir -p $out/share/java $out/bin
|
||||
tar -xzf $src
|
||||
cp -r compiler.jar $out/lib/java/
|
||||
cp -r compiler.jar $out/share/java/
|
||||
echo "#!${bash}/bin/bash" > $out/bin/closure-compiler
|
||||
echo "${jre}/bin/java -jar $out/lib/java/compiler.jar \"\$@\"" >> $out/bin/closure-compiler
|
||||
echo "${jre}/bin/java -jar $out/share/java/compiler.jar \"\$@\"" >> $out/bin/closure-compiler
|
||||
chmod +x $out/bin/closure-compiler
|
||||
'';
|
||||
|
||||
|
||||
27
pkgs/development/compilers/compcert/default.nix
Normal file
27
pkgs/development/compilers/compcert/default.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{ stdenv, fetchurl, coq, ocaml, ocamlPackages, gcc }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "compcert-${version}";
|
||||
version = "2.3pl2";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://compcert.inria.fr/release/${name}.tgz";
|
||||
sha256 = "1cq4my646ll1mszs5mbzwk4vp8l8qnsc96fpcv2pl35aw5i6jqm8";
|
||||
};
|
||||
|
||||
buildInputs = [ coq ocaml ocamlPackages.menhir ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
configurePhase = "./configure -prefix $out -toolprefix ${gcc}/bin/ " +
|
||||
(if stdenv.isDarwin then "ia32-macosx" else "ia32-linux");
|
||||
|
||||
meta = {
|
||||
description = "Formally verified C compiler";
|
||||
homepage = "http://compcert.inria.fr";
|
||||
license = stdenv.lib.licenses.inria;
|
||||
platforms = stdenv.lib.platforms.linux ++
|
||||
stdenv.lib.platforms.darwin;
|
||||
maintainers = [ stdenv.lib.maintainers.thoughtpolice
|
||||
stdenv.lib.maintainers.jwiegley ];
|
||||
};
|
||||
}
|
||||
117
pkgs/development/compilers/cryptol/1.8.x.nix
Normal file
117
pkgs/development/compilers/cryptol/1.8.x.nix
Normal file
@@ -0,0 +1,117 @@
|
||||
{ stdenv, requireFile, gmp4, ncurses, zlib, clang_33, makeWrapper }:
|
||||
|
||||
let
|
||||
name = "cryptol-${version}-${rev}";
|
||||
version = "1.8.27";
|
||||
rev = "1";
|
||||
lss-ver = "lss-0.2d";
|
||||
jss-ver = "jss-0.4";
|
||||
|
||||
libPath = stdenv.lib.makeLibraryPath
|
||||
[ stdenv.gcc.libc
|
||||
stdenv.gcc.gcc
|
||||
gmp4
|
||||
ncurses
|
||||
zlib
|
||||
] + ":${stdenv.gcc.gcc}/lib64";
|
||||
|
||||
cryptol-bin =
|
||||
if stdenv.system == "i686-linux"
|
||||
then requireFile {
|
||||
url = "http://cryptol.net";
|
||||
name = "${name}-i386-centos6-linux.tar.gz";
|
||||
sha256 = "131jkj3nh29rwwq5w5sfdf5jrb3c7ayjp4709v1zh84q4d6b35nf";
|
||||
}
|
||||
else requireFile {
|
||||
url = "http://cryptol.net";
|
||||
name = "${name}-x86_64-centos6-linux.tar.gz";
|
||||
sha256 = "1dmkns8s6r2d6pvh176w8k3891frik6hmcr2ibghk4l6qr6gwarx";
|
||||
};
|
||||
|
||||
lss-bin =
|
||||
if stdenv.system == "i686-linux"
|
||||
then requireFile {
|
||||
url = "http://cryptol.net";
|
||||
name = "${lss-ver}-centos6-32.tar.gz";
|
||||
sha256 = "015ssw3v523wwzkma0qbpj3jnyzckab5q00ypdz0gr3kjcxn5rxg";
|
||||
}
|
||||
else requireFile {
|
||||
url = "http://cryptol.net";
|
||||
name = "${lss-ver}-centos6-64.tar.gz";
|
||||
sha256 = "1zjy4xi8v3m6g8ydm9q6dgzg5xn0xc3a4zsll5plbhngprgwxcxm";
|
||||
};
|
||||
|
||||
jss-bin =
|
||||
if stdenv.system == "i686-linux"
|
||||
then requireFile {
|
||||
url = "http://cryptol.net";
|
||||
name = "${jss-ver}-centos5-32.tar.gz";
|
||||
sha256 = "1rlj14fbh9k3yvals8jsarczwl51fh6zjaic0pnhpc9s4p0pnjbr";
|
||||
}
|
||||
else requireFile {
|
||||
url = "http://cryptol.net";
|
||||
name = "${jss-ver}-centos5-64.tar.gz";
|
||||
sha256 = "0smarm2pi3jz4c8jas9gwcbghc6vc375vrwxbdj1mqx4awlhnz1n";
|
||||
};
|
||||
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
inherit name version cryptol-bin jss-bin lss-bin;
|
||||
|
||||
src = [ cryptol-bin lss-bin jss-bin ];
|
||||
buildInputs = [ makeWrapper ];
|
||||
|
||||
unpackPhase = ''
|
||||
tar xf ${cryptol-bin}
|
||||
tar xf ${lss-bin}
|
||||
tar xf ${jss-bin}
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/share $out/libexec
|
||||
|
||||
# Move Cryptol
|
||||
mv cryptol-${version}/bin $out
|
||||
mv cryptol-${version}/lib $out
|
||||
mv cryptol-${version}/man $out/share
|
||||
rm -f $out/bin/cryptol-2
|
||||
|
||||
# Move JSS
|
||||
# Create a wrapper for jss to keep the .jar out of the way
|
||||
mv ${jss-ver}/bin/jss $out/libexec
|
||||
mv ${jss-ver}/bin/galois.jar $out/libexec
|
||||
makeWrapper $out/libexec/jss $out/bin/jss --run "cd $out/libexec"
|
||||
mv ${jss-ver}/doc/jss.1 $out/share/man/man1
|
||||
|
||||
# Move LSS
|
||||
mv ${lss-ver}/bin/lss $out/bin
|
||||
mv ${lss-ver}/sym-api $out/include
|
||||
|
||||
# Create a convenient 'lss-clang' wrapper pointing to a valid Clang verison
|
||||
ln -s ${clang_33}/bin/clang $out/bin/lss-clang
|
||||
|
||||
# Hack around lack of libtinfo in NixOS
|
||||
ln -s ${ncurses}/lib/libncursesw.so.5.9 $out/lib/libtinfo.so.5
|
||||
ln -s ${stdenv.gcc.libc}/lib/libpthread-2.19.so $out/lib/libpthread.so.0
|
||||
'';
|
||||
|
||||
fixupPhase = ''
|
||||
for x in bin/cryptol bin/edif2verilog bin/copy-iverilog bin/symbolic_netlist bin/jaig bin/vvp-galois bin/lss libexec/jss; do
|
||||
patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
|
||||
--set-rpath "$out/lib:${libPath}" $out/$x
|
||||
patchelf --shrink-rpath $out/$x
|
||||
done
|
||||
'';
|
||||
|
||||
phases = "unpackPhase installPhase fixupPhase";
|
||||
|
||||
meta = {
|
||||
description = "Cryptol: The Language of Cryptography";
|
||||
homepage = "https://cryptol.net";
|
||||
license = stdenv.lib.licenses.unfree;
|
||||
platforms = stdenv.lib.platforms.linux;
|
||||
maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
|
||||
hydraPlatforms = stdenv.lib.platforms.none;
|
||||
broken = true;
|
||||
};
|
||||
}
|
||||
31
pkgs/development/compilers/cryptol/2.0.x.nix
Normal file
31
pkgs/development/compilers/cryptol/2.0.x.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{ cabal, cabalInstall, Cabal, alex, ansiTerminal, deepseq, executablePath
|
||||
, filepath, graphSCC, happy, haskeline, monadLib, mtl, presburger, QuickCheck
|
||||
, random, smtLib, syb, text, transformers, utf8String, process, fetchgit
|
||||
}:
|
||||
|
||||
cabal.mkDerivation (self: {
|
||||
pname = "cryptol";
|
||||
version = "2.0.0";
|
||||
src = fetchgit {
|
||||
url = "https://github.com/GaloisInc/cryptol.git";
|
||||
rev = "refs/tags/v2.0.0";
|
||||
sha256 = "6af3499d7c6f034446f6665660f7a66dd592e81281e34b0cee3e55bc03597e6b";
|
||||
};
|
||||
isLibrary = true;
|
||||
isExecutable = true;
|
||||
|
||||
patches = [ ./fix-gitrev.patch ];
|
||||
buildDepends = [
|
||||
ansiTerminal deepseq executablePath filepath graphSCC haskeline
|
||||
monadLib mtl presburger QuickCheck random smtLib syb text
|
||||
transformers utf8String process Cabal
|
||||
];
|
||||
buildTools = [ alex happy cabalInstall ];
|
||||
meta = {
|
||||
description = "Cryptol: The Language of Cryptography";
|
||||
homepage = "https://cryptol.net";
|
||||
license = self.stdenv.lib.licenses.bsd3;
|
||||
platforms = self.ghc.meta.platforms;
|
||||
maintainers = [ self.stdenv.lib.maintainers.thoughtpolice ];
|
||||
};
|
||||
})
|
||||
44
pkgs/development/compilers/cryptol/fix-gitrev.patch
Normal file
44
pkgs/development/compilers/cryptol/fix-gitrev.patch
Normal file
@@ -0,0 +1,44 @@
|
||||
From 3ceec293f8e68314d872909b7de1d4a2c3ecba49 Mon Sep 17 00:00:00 2001
|
||||
From: Austin Seipp <aseipp@pobox.com>
|
||||
Date: Fri, 25 Apr 2014 00:24:39 -0500
|
||||
Subject: [PATCH] Add GitRev.hs to signify v2.0.0 release
|
||||
|
||||
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
||||
---
|
||||
cryptol.cabal | 2 +-
|
||||
src/GitRev.hs | 10 ++++++++++
|
||||
2 files changed, 11 insertions(+), 1 deletion(-)
|
||||
create mode 100644 src/GitRev.hs
|
||||
|
||||
diff --git a/cryptol.cabal b/cryptol.cabal
|
||||
index 2ba6e56..9acd1ef 100644
|
||||
--- a/cryptol.cabal
|
||||
+++ b/cryptol.cabal
|
||||
@@ -6,7 +6,7 @@ Author: Galois, Inc.
|
||||
Maintainer: cryptol@galois.com
|
||||
Copyright: 2013-2014 Galois Inc.
|
||||
Category: Language
|
||||
-Build-type: Configure
|
||||
+Build-type: Simple
|
||||
Cabal-version: >= 1.18
|
||||
|
||||
data-files: lib/Cryptol.cry
|
||||
diff --git a/src/GitRev.hs b/src/GitRev.hs
|
||||
new file mode 100644
|
||||
index 0000000..1c767dc
|
||||
--- /dev/null
|
||||
+++ b/src/GitRev.hs
|
||||
@@ -0,0 +1,10 @@
|
||||
+module GitRev (hash, branch, dirty) where
|
||||
+
|
||||
+hash :: String
|
||||
+hash = "bd578915eaba8c56fadc29fe30f5dcd212c63374"
|
||||
+
|
||||
+branch :: String
|
||||
+branch = "Unknown"
|
||||
+
|
||||
+dirty :: Bool
|
||||
+dirty = False
|
||||
--
|
||||
1.8.3.2
|
||||
|
||||
@@ -16,6 +16,8 @@ stdenv.mkDerivation rec {
|
||||
}
|
||||
else throw "cudatoolkit does not support platform ${stdenv.system}";
|
||||
|
||||
outputs = [ "out" "sdk" ];
|
||||
|
||||
buildInputs = [ perl ];
|
||||
|
||||
runtimeDependencies = [
|
||||
@@ -30,6 +32,7 @@ stdenv.mkDerivation rec {
|
||||
sh $src --keep --noexec
|
||||
cd pkg/run_files
|
||||
sh cuda-linux64-rel-5.5.22-16488124.run --keep --noexec
|
||||
sh cuda-samples-linux-5.5.22-16488124.run --keep --noexec
|
||||
cd pkg
|
||||
'';
|
||||
|
||||
@@ -44,8 +47,10 @@ stdenv.mkDerivation rec {
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir $out
|
||||
mkdir $out $sdk
|
||||
perl ./install-linux.pl --prefix="$out"
|
||||
rm $out/tools/CUDA_Occupancy_Calculator.xls
|
||||
perl ./install-sdk-linux.pl --prefix="$sdk" --cudaprefix="$out"
|
||||
'';
|
||||
|
||||
meta = {
|
||||
60
pkgs/development/compilers/cudatoolkit/6.0.nix
Normal file
60
pkgs/development/compilers/cudatoolkit/6.0.nix
Normal file
@@ -0,0 +1,60 @@
|
||||
{ stdenv, fetchurl, patchelf, perl, ncurses, expat, python, zlib
|
||||
, xlibs, gtk2, glib, fontconfig, freetype, unixODBC, alsaLib
|
||||
} :
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "cudatoolkit-6.0.37";
|
||||
|
||||
dontPatchELF = true;
|
||||
dontStrip = true;
|
||||
|
||||
src =
|
||||
if stdenv.system == "x86_64-linux" then
|
||||
fetchurl {
|
||||
url = http://developer.download.nvidia.com/compute/cuda/6_0/rel/installers/cuda_6.0.37_linux_64.run;
|
||||
sha256 = "991e436c7a6c94ec67cf44204d136adfef87baa3ded270544fa211179779bc40";
|
||||
}
|
||||
else throw "cudatoolkit does not support platform ${stdenv.system}";
|
||||
|
||||
outputs = [ "out" "sdk" ];
|
||||
|
||||
buildInputs = [ perl ];
|
||||
|
||||
runtimeDependencies = [
|
||||
ncurses expat python zlib
|
||||
xlibs.libX11 xlibs.libXext xlibs.libXrender xlibs.libXt xlibs.libXtst xlibs.libXi xlibs.libXext
|
||||
gtk2 glib fontconfig freetype unixODBC alsaLib
|
||||
];
|
||||
|
||||
rpath = "${stdenv.lib.makeLibraryPath runtimeDependencies}:${stdenv.gcc.gcc}/lib64";
|
||||
|
||||
unpackPhase = ''
|
||||
sh $src --keep --noexec
|
||||
cd pkg/run_files
|
||||
sh cuda-linux64-rel-6.0.37-18176142.run --keep --noexec
|
||||
sh cuda-samples-linux-6.0.37-18176142.run --keep --noexec
|
||||
cd pkg
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
find . -type f -executable -exec patchelf \
|
||||
--set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
|
||||
'{}' \; || true
|
||||
find . -type f -exec patchelf \
|
||||
--set-rpath $rpath:$out/jre/lib/amd64/jli:$out/lib:$out/lib64:$out/nvvm/lib:$out/nvvm/lib64:$(cat $NIX_GCC/nix-support/orig-gcc)/lib \
|
||||
--force-rpath \
|
||||
'{}' \; || true
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir $out $sdk
|
||||
perl ./install-linux.pl --prefix="$out"
|
||||
rm $out/tools/CUDA_Occupancy_Calculator.xls
|
||||
perl ./install-sdk-linux.pl --prefix="$sdk" --cudaprefix="$out"
|
||||
'';
|
||||
|
||||
meta = {
|
||||
license = [ "nonfree" ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "dev86-0.16.19";
|
||||
|
||||
|
||||
src = fetchurl {
|
||||
url = http://www.debath.co.uk/dev86/Dev86src-0.16.19.tar.gz;
|
||||
sha256 = "33398b87ca85e2b69e4062cf59f2f7354af46da5edcba036c6f97bae17b8d00e";
|
||||
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
|
||||
''
|
||||
substituteInPlace makefile.in --replace "-O2" "" --replace "-O" ""
|
||||
'';
|
||||
|
||||
|
||||
meta = {
|
||||
description = "Linux 8086 development environment";
|
||||
homepage = http://www.debath.co.uk/;
|
||||
|
||||
52
pkgs/development/compilers/dmd/default.nix
Normal file
52
pkgs/development/compilers/dmd/default.nix
Normal file
@@ -0,0 +1,52 @@
|
||||
{ stdenv, fetchurl, gcc, unzip, curl }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "dmd-2.064.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = http://downloads.dlang.org/releases/2013/dmd.2.064.2.zip;
|
||||
sha256 = "1i0jdybigffwyb7c43j0c4aayxx3b93zzqrjxyw6zgp06yhi06pm";
|
||||
};
|
||||
|
||||
buildInputs = [ gcc unzip curl ];
|
||||
|
||||
configurePhase = "";
|
||||
patchPhase = ''
|
||||
cp src/VERSION src/dmd/
|
||||
cp license.txt src/phobos/LICENSE_1_0.txt
|
||||
'';
|
||||
buildPhase = ''
|
||||
cd src/dmd
|
||||
make -f posix.mak INSTALL_DIR=$out
|
||||
export DMD=$PWD/dmd
|
||||
cd ../druntime
|
||||
make -f posix.mak INSTALL_DIR=$out DMD=$DMD
|
||||
cd ../phobos
|
||||
make -f posix.mak INSTALL_DIR=$out DMD=$DMD
|
||||
cd ../..
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
cd src/dmd
|
||||
tee dmd.conf.default << EOF
|
||||
[Environment]
|
||||
DFLAGS=-I$out/import -L-L$out/lib
|
||||
EOF
|
||||
|
||||
make -f posix.mak INSTALL_DIR=$out install
|
||||
export DMD=$PWD/dmd
|
||||
cd ../druntime
|
||||
make -f posix.mak INSTALL_DIR=$out install
|
||||
cd ../phobos
|
||||
make -f posix.mak INSTALL_DIR=$out install
|
||||
cd ../..
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "D language compiler";
|
||||
homepage = http://dlang.org/;
|
||||
license = "open source, see included files";
|
||||
maintainers = with stdenv.lib.maintainers; [ vlstill ];
|
||||
platforms = stdenv.lib.platforms.unix;
|
||||
};
|
||||
}
|
||||
@@ -10,12 +10,12 @@ else
|
||||
throw "Unsupported architecture";
|
||||
|
||||
edk2 = stdenv.mkDerivation {
|
||||
name = "edk2-2013-10-09";
|
||||
name = "edk2-2014-02-01";
|
||||
|
||||
src = fetchgit {
|
||||
url = git://github.com/tianocore/edk2;
|
||||
rev = "5bcb62a4098c9bde9be6af0833a025adc768e08d";
|
||||
sha256 = "3e2958877061bf6bbfb28b150743d7244486929c1c320bdb1ff2586774aa042a";
|
||||
rev = "2818c158de6a164d012e6afb0fc145656aed4e4b";
|
||||
sha256 = "a756b5de3a3e71d82ce1de8c7832bc69d2affb98d704894b26540571f9f5e214";
|
||||
};
|
||||
|
||||
buildInputs = [ libuuid pythonFull ];
|
||||
@@ -47,10 +47,10 @@ edk2 = stdenv.mkDerivation {
|
||||
configurePhase = ''
|
||||
mkdir -v Conf
|
||||
sed -e 's|Nt32Pkg/Nt32Pkg.dsc|${projectDscPath}|' -e \
|
||||
's|MYTOOLS|GCC46|' -e 's|IA32|${targetArch}|' -e 's|DEBUG|RELEASE|'\
|
||||
's|MYTOOLS|GCC48|' -e 's|IA32|${targetArch}|' -e 's|DEBUG|RELEASE|'\
|
||||
< ${edk2}/BaseTools/Conf/target.template > Conf/target.txt
|
||||
sed -e 's|DEFINE GCC46_IA32_PREFIX = /usr/bin/|DEFINE GCC46_IA32_PREFIX = ""|' \
|
||||
-e 's|DEFINE GCC46_X64_PREFIX = /usr/bin/|DEFINE GCC46_X64_PREFIX = ""|' \
|
||||
sed -e 's|DEFINE GCC48_IA32_PREFIX = /usr/bin/|DEFINE GCC48_IA32_PREFIX = ""|' \
|
||||
-e 's|DEFINE GCC48_X64_PREFIX = /usr/bin/|DEFINE GCC48_X64_PREFIX = ""|' \
|
||||
-e 's|DEFINE UNIX_IASL_BIN = /usr/bin/iasl|DEFINE UNIX_IASL_BIN = ${iasl}/bin/iasl|' \
|
||||
< ${edk2}/BaseTools/Conf/tools_def.template > Conf/tools_def.txt
|
||||
export WORKSPACE="$PWD"
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
{ cabal, blazeHtml, deepseq, Elm, filepath, happstackServer, HTTP
|
||||
, mtl, parsec, transformers
|
||||
# This file was auto-generated by cabal2nix. Please do NOT edit manually!
|
||||
|
||||
{ cabal, cmdargs, Elm, filepath, mtl, snapCore, snapServer
|
||||
, unorderedContainers
|
||||
}:
|
||||
|
||||
cabal.mkDerivation (self: {
|
||||
pname = "elm-server";
|
||||
version = "0.9.0.2";
|
||||
sha256 = "0g362llb7jkwz8xhyhhsc8hz0vj7s7bgfz1az5qfh1cm4h8nynwr";
|
||||
version = "0.11.0.1";
|
||||
sha256 = "0nnkhmmm4cl6a314xxh5qwxkjsc3k3vcwdfar62578ykarxb53g1";
|
||||
isLibrary = false;
|
||||
isExecutable = true;
|
||||
buildDepends = [
|
||||
blazeHtml deepseq Elm filepath happstackServer HTTP mtl parsec
|
||||
transformers
|
||||
cmdargs Elm filepath mtl snapCore snapServer unorderedContainers
|
||||
];
|
||||
jailbreak = true;
|
||||
meta = {
|
||||
homepage = "http://elm-lang.org";
|
||||
description = "The Elm language server";
|
||||
description = "Server for developing Elm projects";
|
||||
license = self.stdenv.lib.licenses.bsd3;
|
||||
platforms = self.ghc.meta.platforms;
|
||||
};
|
||||
|
||||
@@ -1,21 +1,33 @@
|
||||
{ cabal, aeson, aesonPretty, binary, blazeHtml, blazeMarkup
|
||||
, cmdargs, filepath, HTF, indents, languageEcmascript, mtl, pandoc
|
||||
, parsec, text, transformers, unionFind, uniplate
|
||||
, cmdargs, filemanip, filepath, HUnit, indents, languageEcmascript
|
||||
, languageGlsl, mtl, pandoc, parsec, QuickCheck, scientific
|
||||
, testFramework, testFrameworkHunit, testFrameworkQuickcheck2, text
|
||||
, transformers, unionFind, unorderedContainers, yaml
|
||||
}:
|
||||
|
||||
cabal.mkDerivation (self: {
|
||||
pname = "Elm";
|
||||
version = "0.10.0.1";
|
||||
sha256 = "1r7z2fw9v6ngr9w4lmj1l6sc78rmxvqkqlxv4a9yc5jm80k3ar0i";
|
||||
version = "0.12.3";
|
||||
sha256 = "1v6h9qbbz27ikh19xwjbyfw0zi5ag9x1gp0khh9v4af1g0j86320";
|
||||
isLibrary = true;
|
||||
isExecutable = true;
|
||||
buildDepends = [
|
||||
aeson aesonPretty binary blazeHtml blazeMarkup cmdargs filepath
|
||||
indents languageEcmascript mtl pandoc parsec text transformers
|
||||
unionFind uniplate
|
||||
indents languageEcmascript languageGlsl mtl pandoc parsec
|
||||
scientific text transformers unionFind unorderedContainers yaml
|
||||
];
|
||||
testDepends = [
|
||||
aeson aesonPretty binary blazeHtml blazeMarkup cmdargs filemanip
|
||||
filepath HUnit indents languageEcmascript languageGlsl mtl pandoc
|
||||
parsec QuickCheck scientific testFramework testFrameworkHunit
|
||||
testFrameworkQuickcheck2 text transformers unionFind
|
||||
unorderedContainers yaml
|
||||
];
|
||||
testDepends = [ HTF ];
|
||||
doCheck = false;
|
||||
preConfigure = ''
|
||||
rm -f Setup.hs
|
||||
echo -e "import Distribution.Simple\nmain=defaultMain\n" > Setup.hs
|
||||
'';
|
||||
meta = {
|
||||
homepage = "http://elm-lang.org";
|
||||
description = "The Elm language module";
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# This file was auto-generated by cabal2nix. Please do NOT edit manually!
|
||||
|
||||
{ cabal, boehmgc, Cabal, gmp, happy, mtl }:
|
||||
|
||||
cabal.mkDerivation (self: {
|
||||
@@ -14,6 +16,7 @@ cabal.mkDerivation (self: {
|
||||
description = "Compiler for a simple functional language";
|
||||
license = self.stdenv.lib.licenses.bsd3;
|
||||
platforms = self.ghc.meta.platforms;
|
||||
maintainers = [ self.stdenv.lib.maintainers.andres ];
|
||||
hydraPlatforms = self.stdenv.lib.platforms.none;
|
||||
broken = true;
|
||||
};
|
||||
})
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
{cabal, fetchurl, unzip, xhtml, WebBits, WebBitsHtml, JsContracts}:
|
||||
|
||||
cabal.mkDerivation ( self: {
|
||||
pname = "flapjax";
|
||||
version = "2.1";
|
||||
|
||||
src = fetchurl {
|
||||
url = https://github.com/brownplt/flapjax/zipball/Flapjax-2.1;
|
||||
name = "flapjax-2.1.zip";
|
||||
sha256 = "1cp9g570528a813ljnvd1lb389iz0i6511xynf6kzryv8ckc1n7v";
|
||||
};
|
||||
|
||||
# The Makefile copies some files to update the flapjax website into
|
||||
# missing directories; the -p is to avoid these errors.
|
||||
preConfigure = ''
|
||||
cd fx
|
||||
sed -i 's/mkdir/mkdir -p/' Makefile
|
||||
make
|
||||
cd ../compiler
|
||||
'';
|
||||
|
||||
extraBuildInputs = [ unzip JsContracts ];
|
||||
propagatedBuildInputs = [ xhtml WebBits WebBitsHtml ];
|
||||
|
||||
meta = {
|
||||
description = "programming language designed around the demands of modern, client-based Web applications";
|
||||
homepage = http://www.flapjax-lang.org/;
|
||||
license = "BSD";
|
||||
};
|
||||
})
|
||||
@@ -1,18 +1,29 @@
|
||||
{ stdenv, fetchurl, mono, unzip, pkgconfig
|
||||
} :
|
||||
{ stdenv, fetchurl, mono, pkgconfig, autoconf, automake, which }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "fsharp";
|
||||
date = "2011-08-10";
|
||||
name = "${pname}-${date}";
|
||||
name = "fsharp-${version}";
|
||||
version = "3.1.1.25";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://download.mono-project.com/sources/fsharp/fsharp-cc126f2.zip";
|
||||
sha256 = "03j2ypnfddl2zpvg8ivhafjy8dlz49b38rdy89l8c3irxdsb7k6i";
|
||||
url = "https://github.com/fsharp/fsharp/archive/${version}.tar.gz";
|
||||
sha256 = "1vrgw7qk4g78mjjapc1a1frribcgya4cdrwahv3i26z9s10g5h3d";
|
||||
};
|
||||
|
||||
buildInputs = [mono unzip pkgconfig];
|
||||
buildInputs = [ mono pkgconfig autoconf automake which ];
|
||||
configurePhase = ''
|
||||
substituteInPlace ./autogen.sh --replace "/usr/bin/env sh" "/bin/sh"
|
||||
./autogen.sh --prefix $out
|
||||
'';
|
||||
|
||||
sourceRoot = "fsharp";
|
||||
# Make sure the executables use the right mono binary,
|
||||
# and set up some symlinks for backwards compatibility.
|
||||
postInstall = ''
|
||||
substituteInPlace $out/bin/fsharpc --replace " mono " " ${mono}/bin/mono "
|
||||
substituteInPlace $out/bin/fsharpi --replace " mono " " ${mono}/bin/mono "
|
||||
substituteInPlace $out/bin/fsharpiAnyCpu --replace " mono " " ${mono}/bin/mono "
|
||||
ln -s $out/bin/fsharpc $out/bin/fsc
|
||||
ln -s $out/bin/fsharpi $out/bin/fsi
|
||||
'';
|
||||
|
||||
# To fix this error when running:
|
||||
# The file "/nix/store/path/whatever.exe" is an not a valid CIL image
|
||||
@@ -20,9 +31,9 @@ stdenv.mkDerivation rec {
|
||||
|
||||
meta = {
|
||||
description = "A functional CLI language";
|
||||
homepage = "http://tryfsharp.org/";
|
||||
homepage = "http://fsharp.org/";
|
||||
license = stdenv.lib.licenses.asl20;
|
||||
maintainers = [ stdenv.lib.maintainers.raskin ];
|
||||
maintainers = with stdenv.lib.maintainers; [ thoughtpolice raskin ];
|
||||
platforms = with stdenv.lib.platforms; linux;
|
||||
};
|
||||
}
|
||||
|
||||
46
pkgs/development/compilers/gcc-arm-embedded/default.nix
Normal file
46
pkgs/development/compilers/gcc-arm-embedded/default.nix
Normal file
@@ -0,0 +1,46 @@
|
||||
{ stdenv, bzip2, patchelf, glibc, gcc, fetchurl, version, releaseType, sha256 }:
|
||||
with stdenv.lib;
|
||||
let
|
||||
versionParts = splitString "-" version; # 4.7 2013q3 20130916
|
||||
majorVersion = elemAt versionParts 0; # 4.7
|
||||
yearQuarter = elemAt versionParts 1; # 2013q3
|
||||
underscoreVersion = replaceChars ["."] ["_"] version; # 4_7-2013q3-20130916
|
||||
yearQuarterParts = splitString "q" yearQuarter; # 2013 3
|
||||
year = elemAt yearQuarterParts 0; # 2013
|
||||
quarter = elemAt yearQuarterParts 1; # 3
|
||||
subdirName = "${majorVersion}-${year}-q${quarter}-${releaseType}"; # 4.7-2013-q3-update
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
name = "gcc-arm-embedded-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://launchpad.net/gcc-arm-embedded/${majorVersion}/${subdirName}/+download/gcc-arm-none-eabi-${underscoreVersion}-linux.tar.bz2";
|
||||
sha256 = sha256;
|
||||
};
|
||||
|
||||
buildInputs = [ bzip2 patchelf ];
|
||||
|
||||
dontPatchELF = true;
|
||||
|
||||
phases = "unpackPhase patchPhase installPhase";
|
||||
|
||||
installPhase = ''
|
||||
mkdir -pv $out
|
||||
cp -r ./* $out
|
||||
|
||||
for f in $(find $out); do
|
||||
if [ -f "$f" ] && patchelf "$f" 2> /dev/null; then
|
||||
patchelf --set-interpreter ${glibc}/lib/ld-linux.so.2 \
|
||||
--set-rpath $out/lib:${gcc}/lib \
|
||||
"$f" || true
|
||||
fi
|
||||
done
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors (Cortex-M0/M0+/M3/M4, Cortex-R4/R5/R7)";
|
||||
homepage = "https://launchpad.net/gcc-arm-embedded";
|
||||
license = licenses.gpl3;
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
@@ -12,7 +12,7 @@ let
|
||||
revision = "5666.3"; # Apple's fork revision number.
|
||||
in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
stdenv.mkDerivation rec {
|
||||
name = "gcc-apple-${version}.${revision}";
|
||||
|
||||
builder = ./builder.sh;
|
||||
@@ -33,8 +33,10 @@ stdenv.mkDerivation {
|
||||
|
||||
sourceRoot = "gcc-${revision}/";
|
||||
|
||||
# The floor_log2_patch is from a Gentoo fix for the same issue:
|
||||
# https://bugs.gentoo.org/attachment.cgi?id=363174&action=diff
|
||||
patches =
|
||||
[ ./pass-cxxcpp.patch ]
|
||||
[ ./pass-cxxcpp.patch ./floor_log2_patch.diff ]
|
||||
++ stdenv.lib.optional noSysDirs ./no-sys-dirs.patch
|
||||
++ stdenv.lib.optional langCC ./fix-libstdc++-link.patch;
|
||||
|
||||
@@ -42,4 +44,6 @@ stdenv.mkDerivation {
|
||||
langC = true;
|
||||
|
||||
buildInputs = stdenv.lib.optionals langF77 [ gmp mpfr bison flex ];
|
||||
|
||||
#meta.broken = true;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@ Prevent our libstdc++.dylib from having a runtime dependency on
|
||||
passed by g++ when it links libstdc++.dylib. Adding "-nostdlib" to
|
||||
the g++ invocation prevents this.
|
||||
|
||||
jww (2014-06-21): I've added several more patches to this, for building on
|
||||
Mavericks.
|
||||
|
||||
diff -ru -x '*~' libstdcxx-39-orig/libstdcxx/libstdc++-v3/src/Makefile.in libstdcxx-39/libstdcxx/libstdc++-v3/src/Makefile.in
|
||||
--- x/libstdcxx/libstdc++-v3/src/Makefile.in 2006-10-16 21:08:22.000000000 +0200
|
||||
+++ y/libstdcxx/libstdc++-v3/src/Makefile.in 2012-02-17 18:44:05.210570590 +0100
|
||||
@@ -15,3 +18,54 @@ diff -ru -x '*~' libstdcxx-39-orig/libstdcxx/libstdc++-v3/src/Makefile.in libstd
|
||||
|
||||
|
||||
# Use special rules for the deprecated source files so that they find
|
||||
--- x/libstdcxx/libstdc++-v3/libsupc++/unwind-cxx.h
|
||||
+++ y/libstdcxx/libstdc++-v3/libsupc++/unwind-cxx.h
|
||||
@@ -38,7 +38,7 @@
|
||||
#include <typeinfo>
|
||||
#include <exception>
|
||||
#include <cstddef>
|
||||
-#include "unwind.h"
|
||||
+#include "unwind-generic.h"
|
||||
|
||||
#pragma GCC visibility push(default)
|
||||
|
||||
@@ -133,7 +133,7 @@ extern "C" void __cxa_bad_typeid ();
|
||||
// throws, and if bad_exception needs to be thrown. Called from the
|
||||
// compiler.
|
||||
extern "C" void __cxa_call_unexpected (void *) __attribute__((noreturn));
|
||||
-extern "C" void __cxa_call_terminate (void*) __attribute__((noreturn));
|
||||
+extern "C" void __cxa_call_terminate(_Unwind_Exception* ue_header);
|
||||
|
||||
#ifdef __ARM_EABI_UNWINDER__
|
||||
// Arm EABI specified routines.
|
||||
--- x/libstdcxx/libstdc++-v3/include/ext/bitmap_allocator.h
|
||||
+++ y/libstdcxx/libstdc++-v3/include/ext/bitmap_allocator.h
|
||||
@@ -549,6 +549,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
|
||||
*/
|
||||
class free_list
|
||||
{
|
||||
+ public:
|
||||
typedef size_t* value_type;
|
||||
typedef __detail::__mini_vector<value_type> vector_type;
|
||||
typedef vector_type::iterator iterator;
|
||||
--- x/libstdcxx/libstdc++-v3/include/ext/ropeimpl.h
|
||||
+++ y/libstdcxx/libstdc++-v3/include/ext/ropeimpl.h
|
||||
@@ -433,7 +433,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
|
||||
{
|
||||
size_t __old_len = __r->_M_size;
|
||||
_CharT* __new_data = (_CharT*)
|
||||
- _Data_allocate(_S_rounded_up_size(__old_len + __len));
|
||||
+ _Base::_Data_allocate(_S_rounded_up_size(__old_len + __len));
|
||||
_RopeLeaf* __result;
|
||||
|
||||
uninitialized_copy_n(__r->_M_data, __old_len, __new_data);
|
||||
@@ -817,7 +817,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
|
||||
if (__result_len > __lazy_threshold)
|
||||
goto lazy;
|
||||
__section = (_CharT*)
|
||||
- _Data_allocate(_S_rounded_up_size(__result_len));
|
||||
+ _Base::_Data_allocate(_S_rounded_up_size(__result_len));
|
||||
try
|
||||
{ (*(__f->_M_fn))(__start, __result_len, __section); }
|
||||
catch(...)
|
||||
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
--- gcc-5666.3/gcc/toplev.h
|
||||
+++ gcc-5666.3/gcc/toplev.h
|
||||
@@ -151,6 +151,8 @@
|
||||
/* Return true iff flags are set as if -ffast-math. */
|
||||
extern bool fast_math_flags_set_p (void);
|
||||
|
||||
+#if GCC_VERSION < 3004
|
||||
+
|
||||
/* Return log2, or -1 if not exact. */
|
||||
extern int exact_log2 (unsigned HOST_WIDE_INT);
|
||||
|
||||
@@ -158,7 +160,7 @@
|
||||
extern int floor_log2 (unsigned HOST_WIDE_INT);
|
||||
|
||||
/* Inline versions of the above for speed. */
|
||||
-#if GCC_VERSION >= 3004
|
||||
+#else /* GCC_VERSION < 3004 */
|
||||
# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
|
||||
# define CLZ_HWI __builtin_clzl
|
||||
# define CTZ_HWI __builtin_ctzl
|
||||
@@ -172,18 +172,18 @@
|
||||
# define CTZ_HWI __builtin_ctz
|
||||
# endif
|
||||
|
||||
-extern inline int
|
||||
+static inline int
|
||||
floor_log2 (unsigned HOST_WIDE_INT x)
|
||||
{
|
||||
return x ? HOST_BITS_PER_WIDE_INT - 1 - (int) CLZ_HWI (x) : -1;
|
||||
}
|
||||
|
||||
-extern inline int
|
||||
+static inline int
|
||||
exact_log2 (unsigned HOST_WIDE_INT x)
|
||||
{
|
||||
return x == (x & -x) && x ? (int) CTZ_HWI (x) : -1;
|
||||
}
|
||||
-#endif /* GCC_VERSION >= 3004 */
|
||||
+#endif /* GCC_VERSION < 3004 */
|
||||
|
||||
/* Functions used to get and set GCC's notion of in what directory
|
||||
compilation was started. */
|
||||
--- gcc-5666.3/gcc/toplev.c
|
||||
+++ gcc-5666.3/gcc/toplev.c
|
||||
@@ -555,7 +555,7 @@
|
||||
for floor_log2 and exact_log2; see toplev.h. That construct, however,
|
||||
conflicts with the ISO C++ One Definition Rule. */
|
||||
|
||||
-#if GCC_VERSION < 3004 || !defined (__cplusplus)
|
||||
+#if GCC_VERSION < 3004
|
||||
|
||||
/* Given X, an unsigned number, return the largest int Y such that 2**Y <= X.
|
||||
If X is 0, return -1. */
|
||||
@@ -607,7 +607,7 @@
|
||||
#endif
|
||||
}
|
||||
|
||||
-#endif /* GCC_VERSION < 3004 || !defined (__cplusplus) */
|
||||
+#endif /* GCC_VERSION < 3004 */
|
||||
|
||||
/* Handler for fatal signals, such as SIGSEGV. These are transformed
|
||||
into ICE messages, which is much more user friendly. In case the
|
||||
@@ -1,96 +0,0 @@
|
||||
source $stdenv/setup
|
||||
|
||||
|
||||
export NIX_FIXINC_DUMMY=$NIX_BUILD_TOP/dummy
|
||||
mkdir $NIX_FIXINC_DUMMY
|
||||
|
||||
|
||||
# libstdc++ needs this; otherwise it will use /lib/cpp, which is a Bad
|
||||
# Thing.
|
||||
export CPP="gcc -E"
|
||||
|
||||
|
||||
if test "$noSysDirs" = "1"; then
|
||||
|
||||
if test -e $NIX_GCC/nix-support/orig-libc; then
|
||||
|
||||
# Figure out what extra flags to pass to the gcc compilers
|
||||
# being generated to make sure that they use our glibc.
|
||||
extraCFlags="$(cat $NIX_GCC/nix-support/libc-cflags)"
|
||||
extraLDFlags="$(cat $NIX_GCC/nix-support/libc-ldflags) $(cat $NIX_GCC/nix-support/libc-ldflags-before)"
|
||||
|
||||
# Use *real* header files, otherwise a limits.h is generated
|
||||
# that does not include Glibc's limits.h (notably missing
|
||||
# SSIZE_MAX, which breaks the build).
|
||||
export NIX_FIXINC_DUMMY=$(cat $NIX_GCC/nix-support/orig-libc)/include
|
||||
|
||||
else
|
||||
# Hack: support impure environments.
|
||||
extraCFlags="-isystem /usr/include"
|
||||
extraLDFlags="-L/usr/lib64 -L/usr/lib"
|
||||
export NIX_FIXINC_DUMMY=/usr/include
|
||||
fi
|
||||
|
||||
extraCFlags="-g0 $extraCFlags"
|
||||
extraLDFlags="--strip-debug $extraLDFlags"
|
||||
|
||||
export NIX_EXTRA_CFLAGS=$extraCFlags
|
||||
for i in $extraLDFlags; do
|
||||
export NIX_EXTRA_LDFLAGS="$NIX_EXTRA_LDFLAGS -Wl,$i"
|
||||
done
|
||||
|
||||
makeFlagsArray=( \
|
||||
"${makeFlagsArray[@]}" \
|
||||
NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
|
||||
SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
|
||||
LIMITS_H_TEST=true \
|
||||
X_CFLAGS="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
|
||||
LDFLAGS="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
|
||||
LDFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
|
||||
)
|
||||
fi
|
||||
|
||||
|
||||
preConfigure() {
|
||||
# Perform the build in a different directory.
|
||||
mkdir ../build
|
||||
cd ../build
|
||||
configureScript=../$sourceRoot/configure
|
||||
}
|
||||
|
||||
|
||||
postInstall() {
|
||||
# Remove precompiled headers for now. They are very big and
|
||||
# probably not very useful yet.
|
||||
find $out/include -name "*.gch" -exec rm -rf {} \; -prune
|
||||
|
||||
# Remove `fixincl' to prevent a retained dependency on the
|
||||
# previous gcc.
|
||||
rm -rf $out/libexec/gcc/*/*/install-tools
|
||||
rm -rf $out/lib/gcc/*/*/install-tools
|
||||
|
||||
# Get rid of some "fixed" header files
|
||||
rm -rf $out/lib/gcc/*/*/include/root
|
||||
|
||||
# Replace hard links for i686-pc-linux-gnu-gcc etc. with symlinks.
|
||||
for i in $out/bin/*-gcc*; do
|
||||
if cmp -s $out/bin/gcc $i; then
|
||||
ln -sfn gcc $i
|
||||
fi
|
||||
done
|
||||
|
||||
for i in $out/bin/*-c++* $out/bin/*-g++*; do
|
||||
if cmp -s $out/bin/g++ $i; then
|
||||
ln -sfn g++ $i
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
if test -z "$profiledCompiler"; then
|
||||
buildFlags="bootstrap $buildFlags"
|
||||
else
|
||||
buildFlags="profiledbootstrap $buildFlags"
|
||||
fi
|
||||
|
||||
genericBuild
|
||||
@@ -1,66 +0,0 @@
|
||||
{ stdenv, fetchurl, noSysDirs
|
||||
, langC ? true, langCC ? true, langFortran ? false
|
||||
, profiledCompiler ? false
|
||||
, staticCompiler ? false
|
||||
, gmp ? null
|
||||
, mpfr ? null
|
||||
, texinfo ? null
|
||||
, name ? "gcc"
|
||||
}:
|
||||
|
||||
with stdenv.lib;
|
||||
|
||||
let version = "4.2.4"; in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "${name}-${version}";
|
||||
|
||||
builder = ./builder.sh;
|
||||
|
||||
src =
|
||||
optional /*langC*/ true (fetchurl {
|
||||
url = "mirror://gnu/gcc/gcc-${version}/gcc-core-${version}.tar.bz2";
|
||||
sha256 = "0cm5yzhqhgdfk03aayakmdj793sya42xkkqhslj7s2b697hygjfg";
|
||||
}) ++
|
||||
optional langCC (fetchurl {
|
||||
url = "mirror://gnu/gcc/gcc-${version}/gcc-g++-${version}.tar.bz2";
|
||||
sha256 = "0gq8ikci0qqgck71qqlhfld6zkwn9179x6z15vdd9blkdig55nxg";
|
||||
}) ++
|
||||
optional langFortran (fetchurl {
|
||||
url = "mirror://gnu/gcc/gcc-${version}/gcc-fortran-${version}.tar.bz2";
|
||||
sha256 = "013yqiqhdavgxzjryvylgf3lcnknmw89fx41jf2v4899srn0bhkg";
|
||||
});
|
||||
|
||||
patches =
|
||||
[./pass-cxxcpp.patch]
|
||||
++ optional noSysDirs [./no-sys-dirs.patch];
|
||||
|
||||
inherit noSysDirs profiledCompiler staticCompiler;
|
||||
|
||||
buildInputs = [gmp mpfr texinfo];
|
||||
|
||||
configureFlags = "
|
||||
--disable-multilib
|
||||
--disable-libstdcxx-pch
|
||||
--with-system-zlib
|
||||
--enable-languages=${
|
||||
concatStrings (intersperse ","
|
||||
( optional langC "c"
|
||||
++ optional langCC "c++"
|
||||
++ optional langFortran "fortran"
|
||||
)
|
||||
)
|
||||
}
|
||||
${if stdenv.isi686 then "--with-arch=i686" else ""}
|
||||
";
|
||||
|
||||
NIX_EXTRA_LDFLAGS = if staticCompiler then "-static" else "";
|
||||
|
||||
passthru = { inherit langC langCC langFortran; };
|
||||
|
||||
meta = {
|
||||
homepage = "http://gcc.gnu.org/";
|
||||
license = "GPL/LGPL";
|
||||
description = "GNU Compiler Collection, 4.2.x";
|
||||
};
|
||||
}
|
||||
@@ -1,139 +0,0 @@
|
||||
diff -rc gcc-4.2.0-orig/Makefile.in gcc-4.2.0/Makefile.in
|
||||
*** gcc-4.2.0-orig/Makefile.in 2006-12-29 18:47:06.000000000 +0100
|
||||
--- gcc-4.2.0/Makefile.in 2007-05-20 21:06:42.000000000 +0200
|
||||
***************
|
||||
*** 364,369 ****
|
||||
--- 364,377 ----
|
||||
@host_makefile_frag@
|
||||
###
|
||||
|
||||
+ CFLAGS += $(NIX_EXTRA_CFLAGS)
|
||||
+ CPPFLAGS_FOR_TARGET += $(NIX_EXTRA_CFLAGS)
|
||||
+ CXXFLAGS += $(NIX_EXTRA_CFLAGS)
|
||||
+ LDFLAGS += $(NIX_EXTRA_LDFLAGS)
|
||||
+ LDFLAGS_FOR_TARGET += $(NIX_EXTRA_LDFLAGS)
|
||||
+ BOOT_CFLAGS += $(NIX_EXTRA_CFLAGS)
|
||||
+ BOOT_LDFLAGS += $(NIX_EXTRA_LDFLAGS)
|
||||
+
|
||||
# This is the list of directories that may be needed in RPATH_ENVVAR
|
||||
# so that prorgams built for the target machine work.
|
||||
TARGET_LIB_PATH = $(TARGET_LIB_PATH_libstdc++-v3)$(TARGET_LIB_PATH_libmudflap)$(TARGET_LIB_PATH_libssp)$(TARGET_LIB_PATH_libgomp)$(HOST_LIB_PATH_gcc)
|
||||
diff -rc gcc-4.2.0-orig/gcc/Makefile.in gcc-4.2.0/gcc/Makefile.in
|
||||
*** gcc-4.2.0-orig/gcc/Makefile.in 2007-03-12 05:40:09.000000000 +0100
|
||||
--- gcc-4.2.0/gcc/Makefile.in 2007-05-20 19:35:13.000000000 +0200
|
||||
***************
|
||||
*** 396,402 ****
|
||||
MD5_H = $(srcdir)/../include/md5.h
|
||||
|
||||
# Default native SYSTEM_HEADER_DIR, to be overridden by targets.
|
||||
! NATIVE_SYSTEM_HEADER_DIR = /usr/include
|
||||
# Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
|
||||
CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
|
||||
|
||||
--- 396,406 ----
|
||||
MD5_H = $(srcdir)/../include/md5.h
|
||||
|
||||
# Default native SYSTEM_HEADER_DIR, to be overridden by targets.
|
||||
! # Nix: we override NATIVE_SYSTEM_HEADER_DIR in order to prevent
|
||||
! # `fixinc' from fixing header files in /usr/include. However,
|
||||
! # NATIVE_SYSTEM_HEADER_DIR must point to an existing directory, so set
|
||||
! # it to some dummy directory.
|
||||
! NATIVE_SYSTEM_HEADER_DIR = $(NIX_FIXINC_DUMMY)
|
||||
# Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
|
||||
CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
|
||||
|
||||
***************
|
||||
*** 3066,3072 ****
|
||||
-DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
|
||||
-DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
|
||||
-DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
|
||||
! -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
|
||||
-DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
|
||||
-DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
|
||||
@TARGET_SYSTEM_ROOT_DEFINE@
|
||||
--- 3070,3076 ----
|
||||
-DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
|
||||
-DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
|
||||
-DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
|
||||
! -DLOCAL_INCLUDE_DIR=\"/no-such-dir\" \
|
||||
-DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
|
||||
-DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
|
||||
@TARGET_SYSTEM_ROOT_DEFINE@
|
||||
diff -rc gcc-4.2.0-orig/gcc/cppdefault.c gcc-4.2.0/gcc/cppdefault.c
|
||||
*** gcc-4.2.0-orig/gcc/cppdefault.c 2006-01-20 22:00:03.000000000 +0100
|
||||
--- gcc-4.2.0/gcc/cppdefault.c 2007-05-20 17:16:44.000000000 +0200
|
||||
***************
|
||||
*** 41,46 ****
|
||||
--- 41,50 ----
|
||||
# undef CROSS_INCLUDE_DIR
|
||||
#endif
|
||||
|
||||
+ #undef LOCAL_INCLUDE_DIR
|
||||
+ #undef SYSTEM_INCLUDE_DIR
|
||||
+ #undef STANDARD_INCLUDE_DIR
|
||||
+
|
||||
const struct default_include cpp_include_defaults[]
|
||||
#ifdef INCLUDE_DEFAULTS
|
||||
= INCLUDE_DEFAULTS;
|
||||
diff -rc gcc-4.2.0-orig/gcc/gcc.c gcc-4.2.0/gcc/gcc.c
|
||||
*** gcc-4.2.0-orig/gcc/gcc.c 2007-03-05 21:37:05.000000000 +0100
|
||||
--- gcc-4.2.0/gcc/gcc.c 2007-05-20 17:49:48.000000000 +0200
|
||||
***************
|
||||
*** 1449,1458 ****
|
||||
/* Default prefixes to attach to command names. */
|
||||
|
||||
#ifndef STANDARD_STARTFILE_PREFIX_1
|
||||
! #define STANDARD_STARTFILE_PREFIX_1 "/lib/"
|
||||
#endif
|
||||
#ifndef STANDARD_STARTFILE_PREFIX_2
|
||||
! #define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
|
||||
#endif
|
||||
|
||||
#ifdef CROSS_COMPILE /* Don't use these prefixes for a cross compiler. */
|
||||
--- 1449,1458 ----
|
||||
/* Default prefixes to attach to command names. */
|
||||
|
||||
#ifndef STANDARD_STARTFILE_PREFIX_1
|
||||
! #define STANDARD_STARTFILE_PREFIX_1 ""
|
||||
#endif
|
||||
#ifndef STANDARD_STARTFILE_PREFIX_2
|
||||
! #define STANDARD_STARTFILE_PREFIX_2 ""
|
||||
#endif
|
||||
|
||||
#ifdef CROSS_COMPILE /* Don't use these prefixes for a cross compiler. */
|
||||
***************
|
||||
*** 1473,1480 ****
|
||||
#endif
|
||||
|
||||
static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX;
|
||||
! static const char *const standard_exec_prefix_1 = "/usr/libexec/gcc/";
|
||||
! static const char *const standard_exec_prefix_2 = "/usr/lib/gcc/";
|
||||
static const char *md_exec_prefix = MD_EXEC_PREFIX;
|
||||
|
||||
static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
|
||||
--- 1473,1480 ----
|
||||
#endif
|
||||
|
||||
static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX;
|
||||
! static const char *const standard_exec_prefix_1 = "/no-such-path/";
|
||||
! static const char *const standard_exec_prefix_2 = "/no-such-path/";
|
||||
static const char *md_exec_prefix = MD_EXEC_PREFIX;
|
||||
|
||||
static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
|
||||
diff -rc gcc-4.2.0-orig/ltconfig gcc-4.2.0/ltconfig
|
||||
*** gcc-4.2.0-orig/ltconfig 2007-02-14 18:08:35.000000000 +0100
|
||||
--- gcc-4.2.0/ltconfig 2007-05-20 22:16:24.000000000 +0200
|
||||
***************
|
||||
*** 2322,2327 ****
|
||||
--- 2322,2332 ----
|
||||
# A language-specific compiler.
|
||||
CC=$CC
|
||||
|
||||
+ # Ugly hack to get libmudflap (and possibly other libraries) to build.
|
||||
+ # Libtool filters out \`-B' flags when linking (why?), so the \`-B' flag
|
||||
+ # to Glibc gets lost. Here we forcibly add it to any invocation.
|
||||
+ CC="\$CC $NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS"
|
||||
+
|
||||
# Is the compiler the GNU C compiler?
|
||||
with_gcc=$with_gcc
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
diff -rc gcc-orig/Makefile.in gcc-4.1.1/Makefile.in
|
||||
*** gcc-orig/Makefile.in Wed Jun 21 13:40:23 2006
|
||||
--- gcc-4.1.1/Makefile.in Wed Jun 21 14:19:44 2006
|
||||
***************
|
||||
*** 213,219 ****
|
||||
RAW_CXX_TARGET_EXPORTS = \
|
||||
$(BASE_TARGET_EXPORTS) \
|
||||
CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
|
||||
! CXX="$(RAW_CXX_FOR_TARGET)"; export CXX;
|
||||
|
||||
NORMAL_TARGET_EXPORTS = \
|
||||
$(BASE_TARGET_EXPORTS) \
|
||||
--- 213,220 ----
|
||||
RAW_CXX_TARGET_EXPORTS = \
|
||||
$(BASE_TARGET_EXPORTS) \
|
||||
CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
|
||||
! CXX="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_BUILD)"; export CXX; \
|
||||
! CXXCPP="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_BUILD) -E"; export CXXCPP;
|
||||
|
||||
NORMAL_TARGET_EXPORTS = \
|
||||
$(BASE_TARGET_EXPORTS) \
|
||||
@@ -29,7 +29,7 @@ assert langVhdl -> gnat != null;
|
||||
with stdenv.lib;
|
||||
|
||||
let
|
||||
version = "4.3.4";
|
||||
version = "4.3.6";
|
||||
|
||||
crossConfigureFlags =
|
||||
"--target=${cross.config}" +
|
||||
@@ -54,27 +54,27 @@ in
|
||||
|
||||
stdenv.mkDerivation ({
|
||||
name = "${name}-${version}" + crossNameAddon;
|
||||
|
||||
|
||||
builder = ./builder.sh;
|
||||
|
||||
|
||||
src =
|
||||
optional /*langC*/ true (fetchurl {
|
||||
url = "mirror://gcc/releases/gcc-${version}/gcc-core-${version}.tar.bz2";
|
||||
sha256 = "1yk80nwyw8vkpw8d3x7lkg3zrv3ngjqlvj0i8zslzgj7a27q729i";
|
||||
sha256 = "0ygrfw3hgp48hkqipbl9lw38f27npigc2sm6f01g9iswpq1igbw6";
|
||||
}) ++
|
||||
optional langCC (fetchurl {
|
||||
url = "mirror://gcc/releases/gcc-${version}/gcc-g++-${version}.tar.bz2";
|
||||
sha256 = "0d8pyk5c9zmph25f4fl63vd8vhljj6ildbxpz2hr594g5i6pplpq";
|
||||
sha256 = "105xz3991b57zx3146xwlpchdb2sjmlknclvi1iac2gawm4mhxhf";
|
||||
}) ++
|
||||
optional langFortran (fetchurl {
|
||||
url = "mirror://gcc/releases/gcc-${version}/gcc-fortran-${version}.tar.bz2";
|
||||
sha256 = "1xf2njykv1qcgxiqwj693dxjf77ss1rcxirylvnsp5hs89mdlj12";
|
||||
sha256 = "12bqvf53hvhrwjnh101vn9frb5g8cr98cra4f11dzhzs4ppydpi1";
|
||||
}) ++
|
||||
optional langJava (fetchurl {
|
||||
url = "mirror://gcc/releases/gcc-${version}/gcc-java-${version}.tar.bz2";
|
||||
sha256 = "1v3krhxi3zyaqfj0x8dbxvg67fjp29cr1psyf71r9zf757p3vqsw";
|
||||
sha256 = "03w6jln9gmdv149s774rlw4rzi2zhbqna54r86cd6mql8flmy7fs";
|
||||
});
|
||||
|
||||
|
||||
patches =
|
||||
[ ./pass-cxxcpp.patch ./libmudflap-cpp.patch ./siginfo_t_fix.patch ]
|
||||
++ optional noSysDirs ./no-sys-dirs.patch
|
||||
@@ -173,7 +173,7 @@ stdenv.mkDerivation ({
|
||||
|
||||
meta = {
|
||||
homepage = "http://ghdl.free.fr/";
|
||||
license = "GPLv2+";
|
||||
license = stdenv.lib.licenses.gpl2Plus;
|
||||
description = "Complete VHDL simulator, using the GCC technology";
|
||||
maintainers = with stdenv.lib.maintainers; [viric];
|
||||
platforms = with stdenv.lib.platforms; linux;
|
||||
|
||||
@@ -31,7 +31,7 @@ assert langVhdl -> gnat != null;
|
||||
|
||||
with stdenv.lib;
|
||||
|
||||
let version = "4.4.6";
|
||||
let version = "4.4.7";
|
||||
javaEcj = fetchurl {
|
||||
# The `$(top_srcdir)/ecj.jar' file is automatically picked up at
|
||||
# `configure' time.
|
||||
@@ -246,11 +246,12 @@ stdenv.mkDerivation ({
|
||||
enableMultilib version; };
|
||||
|
||||
# ghdl does not build fine with parallel building
|
||||
enableParallelBuilding = !langVhdl;
|
||||
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46173
|
||||
#enableParallelBuilding = !langVhdl && !langAda;
|
||||
|
||||
meta = {
|
||||
homepage = http://gcc.gnu.org/;
|
||||
license = "GPLv3+"; # runtime support libraries are typically LGPLv3+
|
||||
license = stdenv.lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
|
||||
description = "GNU Compiler Collection, version ${version}";
|
||||
|
||||
longDescription = ''
|
||||
@@ -301,7 +302,7 @@ stdenv.mkDerivation ({
|
||||
|
||||
meta = {
|
||||
homepage = "http://ghdl.free.fr/";
|
||||
license = "GPLv2+";
|
||||
license = stdenv.lib.licenses.gpl2Plus;
|
||||
description = "Complete VHDL simulator, using the GCC technology (gcc ${version})";
|
||||
maintainers = with stdenv.lib.maintainers; [viric];
|
||||
platforms = with stdenv.lib.platforms; linux;
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
/* Automatically generated by `update-gcc.sh', do not edit.
|
||||
For GCC 4.4.6. */
|
||||
For GCC 4.4.7. */
|
||||
{ fetchurl, optional, version, langC, langCC, langFortran, langJava, langAda }:
|
||||
|
||||
assert version == "4.4.6";
|
||||
assert version == "4.4.7";
|
||||
optional /* langC */ true (fetchurl {
|
||||
url = "mirror://gcc/releases/gcc-${version}/gcc-core-${version}.tar.bz2";
|
||||
sha256 = "c2959820de3e42eee6b1d381586992f26430f0083b9a51db31d706080fc9b44a";
|
||||
sha256 = "c4663b7023909a4a075d3c2b2e17f6e082a9625aebfd0ce7f1d7817e44bf5542";
|
||||
}) ++
|
||||
optional langCC (fetchurl {
|
||||
url = "mirror://gcc/releases/gcc-${version}/gcc-g++-${version}.tar.bz2";
|
||||
sha256 = "6d5d2dacab9569472e4caa291abe94017a9b19574b9b0d866de7b04702634ddf";
|
||||
sha256 = "1882ff29be51eeb3fb349cbcda9df200a5c3cd20c97dd1d593101e0998b3c469";
|
||||
}) ++
|
||||
optional langFortran (fetchurl {
|
||||
url = "mirror://gcc/releases/gcc-${version}/gcc-fortran-${version}.tar.bz2";
|
||||
sha256 = "2b9998716a16b80f4cf843ce81da1cf58ce116e0b85422e3004ce4454e8ff923";
|
||||
sha256 = "545a1e8e97d9364de4408c6a91830f9051ce24b4fbfbfdc56e72c7b4be17ebdd";
|
||||
}) ++
|
||||
optional langJava (fetchurl {
|
||||
url = "mirror://gcc/releases/gcc-${version}/gcc-java-${version}.tar.bz2";
|
||||
sha256 = "7c8c12eac21d2a5c605ea4d9b7aa52e482354205b801bc93d62603b6f0956b35";
|
||||
sha256 = "3c31ddd80f945b797d8d4ed7761426c26343781c361ec1b33bcea9874cc4c6c0";
|
||||
}) ++
|
||||
optional langAda (fetchurl {
|
||||
url = "mirror://gcc/releases/gcc-${version}/gcc-ada-${version}.tar.bz2";
|
||||
sha256 = "771ef0e90abf61208ce84689bed15391ad249287e36a28e816d6a044035af0c6";
|
||||
sha256 = "fb9f30b85d48838390554b948d137487f0db09ad5f8ba73ca4d7ca35765c6ed8";
|
||||
}) ++
|
||||
[]
|
||||
|
||||
@@ -21,7 +21,7 @@ options["g++"]="langCC"
|
||||
options["fortran"]="langFortran"
|
||||
options["java"]="langJava"
|
||||
options["ada"]="langAda"
|
||||
options["go"]="langGo"
|
||||
#options["go"]="langGo"
|
||||
|
||||
cat > "$out"<<EOF
|
||||
/* Automatically generated by \`$(basename $0)', do not edit.
|
||||
@@ -32,7 +32,7 @@ cat > "$out"<<EOF
|
||||
assert version == "${version}";
|
||||
EOF
|
||||
|
||||
for component in core g++ fortran java ada go
|
||||
for component in core g++ fortran java ada #go
|
||||
do
|
||||
dir="ftp.gnu.org/gnu/gcc/gcc-${version}"
|
||||
file="gcc-${component}-${version}.tar.bz2"
|
||||
|
||||
@@ -212,7 +212,7 @@ stdenv.mkDerivation ({
|
||||
++ (optional (ppl != null) ppl)
|
||||
++ (optional (cloogppl != null) cloogppl)
|
||||
++ (optional (zlib != null) zlib)
|
||||
++ (optional (boehmgc != null) boehmgc)
|
||||
++ (optional langJava boehmgc)
|
||||
++ (optionals langJava [zip unzip])
|
||||
++ (optionals javaAwtGtk ([gtk pkgconfig libart_lgpl] ++ xlibs))
|
||||
++ (optionals (cross != null) [binutilsCross])
|
||||
@@ -360,11 +360,11 @@ stdenv.mkDerivation ({
|
||||
passthru = { inherit langC langCC langAda langFortran langVhdl
|
||||
enableMultilib version; };
|
||||
|
||||
enableParallelBuilding = true;
|
||||
enableParallelBuilding = !langAda;
|
||||
|
||||
meta = {
|
||||
homepage = http://gcc.gnu.org/;
|
||||
license = "GPLv3+"; # runtime support libraries are typically LGPLv3+
|
||||
license = stdenv.lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
|
||||
description = "GNU Compiler Collection, version ${version}"
|
||||
+ (if stripped then "" else " (with debugging info)");
|
||||
|
||||
@@ -432,7 +432,7 @@ stdenv.mkDerivation ({
|
||||
|
||||
meta = {
|
||||
homepage = "http://ghdl.free.fr/";
|
||||
license = "GPLv2+";
|
||||
license = stdenv.lib.licenses.gpl2Plus;
|
||||
description = "Complete VHDL simulator, using the GCC technology (gcc ${version})";
|
||||
maintainers = with stdenv.lib.maintainers; [viric];
|
||||
platforms = with stdenv.lib.platforms; linux;
|
||||
|
||||
@@ -249,6 +249,11 @@ postInstall() {
|
||||
fi
|
||||
done
|
||||
|
||||
# Disable RANDMMAP on grsec, which causes segfaults when using
|
||||
# precompiled headers.
|
||||
# See https://bugs.gentoo.org/show_bug.cgi?id=301299#c31
|
||||
paxmark r $out/libexec/gcc/*/*/{cc1,cc1plus}
|
||||
|
||||
eval "$postInstallGhdl"
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ let version = "4.6.3";
|
||||
withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
|
||||
withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
|
||||
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
|
||||
in
|
||||
in
|
||||
(withArch +
|
||||
withCpu +
|
||||
withAbi +
|
||||
@@ -159,10 +159,8 @@ let version = "4.6.3";
|
||||
# In any case, mingw32 g++ linking is broken by default with shared libs,
|
||||
# unless adding "-lsupc++" to any linking command. I don't know why.
|
||||
" --disable-shared" +
|
||||
(if cross.config == "x86_64-w64-mingw32" then
|
||||
# To keep ABI compatibility with upstream mingw-w64
|
||||
" --enable-fully-dynamic-string"
|
||||
else "")
|
||||
# To keep ABI compatibility with upstream mingw-w64
|
||||
" --enable-fully-dynamic-string"
|
||||
else (if cross.libc == "uclibc" then
|
||||
# In uclibc cases, libgomp needs an additional '-ldl'
|
||||
# and as I don't know how to pass it, I disable libgomp.
|
||||
@@ -440,13 +438,13 @@ stdenv.mkDerivation ({
|
||||
passthru = { inherit langC langCC langAda langFortran langVhdl
|
||||
langGo version; };
|
||||
|
||||
enableParallelBuilding = true;
|
||||
enableParallelBuilding = false;
|
||||
|
||||
inherit (stdenv) is64bit;
|
||||
|
||||
meta = {
|
||||
homepage = http://gcc.gnu.org/;
|
||||
license = "GPLv3+"; # runtime support libraries are typically LGPLv3+
|
||||
license = stdenv.lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
|
||||
description = "GNU Compiler Collection, version ${version}"
|
||||
+ (if stripped then "" else " (with debugging info)");
|
||||
|
||||
@@ -462,13 +460,15 @@ stdenv.mkDerivation ({
|
||||
maintainers = [
|
||||
stdenv.lib.maintainers.ludo
|
||||
stdenv.lib.maintainers.viric
|
||||
stdenv.lib.maintainers.shlevy
|
||||
];
|
||||
|
||||
# Volunteers needed for the {Cyg,Dar}win ports of *PPL.
|
||||
# gnatboot is not available out of linux platforms, so we disable the darwin build
|
||||
# for the gnat (ada compiler).
|
||||
platforms = stdenv.lib.platforms.linux ++ optionals (langAda == false && libelf == null) [ "i686-darwin" ];
|
||||
platforms =
|
||||
stdenv.lib.platforms.linux ++
|
||||
stdenv.lib.platforms.freebsd ++
|
||||
optionals (langAda == false) stdenv.lib.platforms.darwin;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -507,7 +507,7 @@ stdenv.mkDerivation ({
|
||||
|
||||
meta = {
|
||||
homepage = "http://ghdl.free.fr/";
|
||||
license = "GPLv2+";
|
||||
license = stdenv.lib.licenses.gpl2Plus;
|
||||
description = "Complete VHDL simulator, using the GCC technology (gcc ${version})";
|
||||
maintainers = with stdenv.lib.maintainers; [viric];
|
||||
platforms = with stdenv.lib.platforms; linux;
|
||||
|
||||
@@ -1,230 +0,0 @@
|
||||
Index: gcc-4_7-branch/libstdc++-v3/configure.host
|
||||
===================================================================
|
||||
--- gcc-4_7-branch/libstdc++-v3/configure.host (revision 194579)
|
||||
+++ gcc-4_7-branch/libstdc++-v3/configure.host (revision 194580)
|
||||
@@ -340,7 +340,7 @@
|
||||
fi
|
||||
esac
|
||||
case "${host}" in
|
||||
- arm*-*-linux-*eabi)
|
||||
+ arm*-*-linux-*eabi*)
|
||||
port_specific_symbol_files="\$(srcdir)/../config/os/gnu-linux/arm-eabi-extra.ver"
|
||||
;;
|
||||
esac
|
||||
Index: gcc-4_7-branch/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc
|
||||
===================================================================
|
||||
--- gcc-4_7-branch/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc (revision 194579)
|
||||
+++ gcc-4_7-branch/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc (revision 194580)
|
||||
@@ -1,5 +1,5 @@
|
||||
// { dg-options "-std=gnu++0x -funsigned-char -fshort-enums" }
|
||||
-// { dg-options "-std=gnu++0x -funsigned-char -fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi } }
|
||||
+// { dg-options "-std=gnu++0x -funsigned-char -fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi* } }
|
||||
|
||||
// 2007-05-03 Benjamin Kosnik <bkoz@redhat.com>
|
||||
//
|
||||
Index: gcc-4_7-branch/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc
|
||||
===================================================================
|
||||
--- gcc-4_7-branch/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc (revision 194579)
|
||||
+++ gcc-4_7-branch/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc (revision 194580)
|
||||
@@ -1,5 +1,5 @@
|
||||
// { dg-options "-std=gnu++0x -funsigned-char -fshort-enums" }
|
||||
-// { dg-options "-std=gnu++0x -funsigned-char -fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi } }
|
||||
+// { dg-options "-std=gnu++0x -funsigned-char -fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi* } }
|
||||
|
||||
// 2007-05-03 Benjamin Kosnik <bkoz@redhat.com>
|
||||
//
|
||||
Index: gcc-4_7-branch/libjava/configure.ac
|
||||
===================================================================
|
||||
--- gcc-4_7-branch/libjava/configure.ac (revision 194579)
|
||||
+++ gcc-4_7-branch/libjava/configure.ac (revision 194580)
|
||||
@@ -931,7 +931,7 @@
|
||||
# on Darwin -single_module speeds up loading of the dynamic libraries.
|
||||
extra_ldflags_libjava=-Wl,-single_module
|
||||
;;
|
||||
-arm*linux*eabi)
|
||||
+arm*-*-linux*eabi*)
|
||||
# Some of the ARM unwinder code is actually in libstdc++. We
|
||||
# could in principle replicate it in libgcj, but it's better to
|
||||
# have a dependency on libstdc++.
|
||||
Index: gcc-4_7-branch/libjava/configure
|
||||
===================================================================
|
||||
--- gcc-4_7-branch/libjava/configure (revision 194579)
|
||||
+++ gcc-4_7-branch/libjava/configure (revision 194580)
|
||||
@@ -20542,7 +20542,7 @@
|
||||
# on Darwin -single_module speeds up loading of the dynamic libraries.
|
||||
extra_ldflags_libjava=-Wl,-single_module
|
||||
;;
|
||||
-arm*linux*eabi)
|
||||
+arm*-*-linux*eabi*)
|
||||
# Some of the ARM unwinder code is actually in libstdc++. We
|
||||
# could in principle replicate it in libgcj, but it's better to
|
||||
# have a dependency on libstdc++.
|
||||
Index: gcc-4_7-branch/libgcc/config.host
|
||||
===================================================================
|
||||
--- gcc-4_7-branch/libgcc/config.host (revision 194579)
|
||||
+++ gcc-4_7-branch/libgcc/config.host (revision 194580)
|
||||
@@ -327,7 +327,7 @@
|
||||
arm*-*-linux*) # ARM GNU/Linux with ELF
|
||||
tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix"
|
||||
case ${host} in
|
||||
- arm*-*-linux-*eabi)
|
||||
+ arm*-*-linux-*eabi*)
|
||||
tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc"
|
||||
tm_file="$tm_file arm/bpabi-lib.h"
|
||||
unwind_header=config/arm/unwind-arm.h
|
||||
Index: gcc-4_7-branch/gcc/doc/install.texi
|
||||
===================================================================
|
||||
--- gcc-4_7-branch/gcc/doc/install.texi (revision 194579)
|
||||
+++ gcc-4_7-branch/gcc/doc/install.texi (revision 194580)
|
||||
@@ -3222,7 +3222,7 @@
|
||||
@heading @anchor{arm-x-eabi}arm-*-eabi
|
||||
ARM-family processors. Subtargets that use the ELF object format
|
||||
require GNU binutils 2.13 or newer. Such subtargets include:
|
||||
-@code{arm-*-netbsdelf}, @code{arm-*-*linux-gnueabi}
|
||||
+@code{arm-*-netbsdelf}, @code{arm-*-*linux-gnueabi*}
|
||||
and @code{arm-*-rtemseabi}.
|
||||
|
||||
@html
|
||||
Index: gcc-4_7-branch/gcc/testsuite/gcc.target/arm/synchronize.c
|
||||
===================================================================
|
||||
--- gcc-4_7-branch/gcc/testsuite/gcc.target/arm/synchronize.c (revision 194579)
|
||||
+++ gcc-4_7-branch/gcc/testsuite/gcc.target/arm/synchronize.c (revision 194580)
|
||||
@@ -1,4 +1,4 @@
|
||||
-/* { dg-final { scan-assembler "__sync_synchronize|dmb|mcr" { target arm*-*-linux-*eabi } } } */
|
||||
+/* { dg-final { scan-assembler "__sync_synchronize|dmb|mcr" { target arm*-*-linux-*eabi* } } } */
|
||||
|
||||
void *foo (void)
|
||||
{
|
||||
Index: gcc-4_7-branch/gcc/testsuite/g++.old-deja/g++.jason/enum6.C
|
||||
===================================================================
|
||||
--- gcc-4_7-branch/gcc/testsuite/g++.old-deja/g++.jason/enum6.C (revision 194579)
|
||||
+++ gcc-4_7-branch/gcc/testsuite/g++.old-deja/g++.jason/enum6.C (revision 194580)
|
||||
@@ -7,10 +7,10 @@
|
||||
// enum-size attributes should only be emitted if there are values of
|
||||
// enum type that can escape the compilation unit, gcc cannot currently
|
||||
// detect this; if this facility is added then this linker option should
|
||||
-// not be needed. arm-*-linux*eabi should be a good approximation to
|
||||
+// not be needed. arm-*-linux*eabi* should be a good approximation to
|
||||
// those platforms where the EABI supplement defines enum values to be
|
||||
// 32 bits wide.
|
||||
-// { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi } }
|
||||
+// { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi* } }
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
Index: gcc-4_7-branch/gcc/testsuite/g++.old-deja/g++.other/enum4.C
|
||||
===================================================================
|
||||
--- gcc-4_7-branch/gcc/testsuite/g++.old-deja/g++.other/enum4.C (revision 194579)
|
||||
+++ gcc-4_7-branch/gcc/testsuite/g++.old-deja/g++.other/enum4.C (revision 194580)
|
||||
@@ -9,10 +9,10 @@
|
||||
// enum-size attributes should only be emitted if there are values of
|
||||
// enum type that can escape the compilation unit, gcc cannot currently
|
||||
// detect this; if this facility is added then this linker option should
|
||||
-// not be needed. arm-*-linux*eabi should be a good approximation to
|
||||
+// not be needed. arm-*-linux*eabi* should be a good approximation to
|
||||
// those platforms where the EABI supplement defines enum values to be
|
||||
// 32 bits wide.
|
||||
-// { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi } }
|
||||
+// { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi* } }
|
||||
|
||||
enum E {
|
||||
a = -312
|
||||
Index: gcc-4_7-branch/gcc/testsuite/g++.old-deja/g++.law/enum9.C
|
||||
===================================================================
|
||||
--- gcc-4_7-branch/gcc/testsuite/g++.old-deja/g++.law/enum9.C (revision 194579)
|
||||
+++ gcc-4_7-branch/gcc/testsuite/g++.old-deja/g++.law/enum9.C (revision 194580)
|
||||
@@ -7,10 +7,10 @@
|
||||
// enum-size attributes should only be emitted if there are values of
|
||||
// enum type that can escape the compilation unit, gcc cannot currently
|
||||
// detect this; if this facility is added then this linker option should
|
||||
-// not be needed. arm-*-linux*eabi should be a good approximation to
|
||||
+// not be needed. arm-*-linux*eabi* should be a good approximation to
|
||||
// those platforms where the EABI supplement defines enum values to be
|
||||
// 32 bits wide.
|
||||
-// { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi } }
|
||||
+// { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi* } }
|
||||
|
||||
// GROUPS passed enums
|
||||
extern "C" int printf (const char *, ...);
|
||||
Index: gcc-4_7-branch/gcc/testsuite/lib/target-supports.exp
|
||||
===================================================================
|
||||
--- gcc-4_7-branch/gcc/testsuite/lib/target-supports.exp (revision 194579)
|
||||
+++ gcc-4_7-branch/gcc/testsuite/lib/target-supports.exp (revision 194580)
|
||||
@@ -3818,7 +3818,7 @@
|
||||
}
|
||||
} ""
|
||||
}]
|
||||
- } elseif { [istarget arm*-*-linux-gnueabi] } {
|
||||
+ } elseif { [istarget arm*-*-linux-gnueabi*] } {
|
||||
return [check_runtime sync_longlong_runtime {
|
||||
#include <stdlib.h>
|
||||
int main ()
|
||||
@@ -3860,7 +3860,7 @@
|
||||
|| [istarget i?86-*-*]
|
||||
|| [istarget x86_64-*-*]
|
||||
|| [istarget alpha*-*-*]
|
||||
- || [istarget arm*-*-linux-gnueabi]
|
||||
+ || [istarget arm*-*-linux-gnueabi*]
|
||||
|| [istarget bfin*-*linux*]
|
||||
|| [istarget hppa*-*linux*]
|
||||
|| [istarget s390*-*-*]
|
||||
@@ -3890,7 +3890,7 @@
|
||||
|| [istarget i?86-*-*]
|
||||
|| [istarget x86_64-*-*]
|
||||
|| [istarget alpha*-*-*]
|
||||
- || [istarget arm*-*-linux-gnueabi]
|
||||
+ || [istarget arm*-*-linux-gnueabi*]
|
||||
|| [istarget hppa*-*linux*]
|
||||
|| [istarget s390*-*-*]
|
||||
|| [istarget powerpc*-*-*]
|
||||
Index: gcc-4_7-branch/gcc/testsuite/gfortran.dg/enum_9.f90
|
||||
===================================================================
|
||||
--- gcc-4_7-branch/gcc/testsuite/gfortran.dg/enum_9.f90 (revision 194579)
|
||||
+++ gcc-4_7-branch/gcc/testsuite/gfortran.dg/enum_9.f90 (revision 194580)
|
||||
@@ -1,6 +1,6 @@
|
||||
! { dg-do run }
|
||||
! { dg-options "-fshort-enums" }
|
||||
-! { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi } }
|
||||
+! { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi* } }
|
||||
! Program to test enumerations when option -fshort-enums is given
|
||||
|
||||
program main
|
||||
Index: gcc-4_7-branch/gcc/testsuite/gfortran.dg/enum_10.f90
|
||||
===================================================================
|
||||
--- gcc-4_7-branch/gcc/testsuite/gfortran.dg/enum_10.f90 (revision 194579)
|
||||
+++ gcc-4_7-branch/gcc/testsuite/gfortran.dg/enum_10.f90 (revision 194580)
|
||||
@@ -1,7 +1,7 @@
|
||||
! { dg-do run }
|
||||
! { dg-additional-sources enum_10.c }
|
||||
! { dg-options "-fshort-enums -w" }
|
||||
-! { dg-options "-fshort-enums -w -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi } }
|
||||
+! { dg-options "-fshort-enums -w -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi* } }
|
||||
! Make sure short enums are indeed interoperable with the
|
||||
! corresponding C type.
|
||||
|
||||
Index: gcc-4_7-branch/gcc/ada/gcc-interface/Makefile.in
|
||||
===================================================================
|
||||
--- gcc-4_7-branch/gcc/ada/gcc-interface/Makefile.in (revision 194579)
|
||||
+++ gcc-4_7-branch/gcc/ada/gcc-interface/Makefile.in (revision 194580)
|
||||
@@ -1866,7 +1866,7 @@
|
||||
LIBRARY_VERSION := $(LIB_VERSION)
|
||||
endif
|
||||
|
||||
-ifeq ($(strip $(filter-out arm% linux-gnueabi,$(arch) $(osys)-$(word 4,$(targ)))),)
|
||||
+ifeq ($(strip $(filter-out arm%-linux,$(arch)-$(osys)) $(if $(findstring eabi,$(word 4,$(targ))),,$(word 4,$(targ)))),)
|
||||
LIBGNAT_TARGET_PAIRS = \
|
||||
a-intnam.ads<a-intnam-linux.ads \
|
||||
s-inmaop.adb<s-inmaop-posix.adb \
|
||||
Index: gcc-4_7-branch/gcc/config.gcc
|
||||
===================================================================
|
||||
--- gcc-4_7-branch/gcc/config.gcc (revision 194579)
|
||||
+++ gcc-4_7-branch/gcc/config.gcc (revision 194580)
|
||||
@@ -855,7 +855,7 @@
|
||||
esac
|
||||
tmake_file="${tmake_file} arm/t-arm"
|
||||
case ${target} in
|
||||
- arm*-*-linux-*eabi)
|
||||
+ arm*-*-linux-*eabi*)
|
||||
tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
|
||||
tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
|
||||
# Define multilib configuration for arm-linux-androideabi.
|
||||
255
pkgs/development/compilers/gcc/4.8/builder.sh
Normal file
255
pkgs/development/compilers/gcc/4.8/builder.sh
Normal file
@@ -0,0 +1,255 @@
|
||||
source $stdenv/setup
|
||||
|
||||
|
||||
export NIX_FIXINC_DUMMY=$NIX_BUILD_TOP/dummy
|
||||
mkdir $NIX_FIXINC_DUMMY
|
||||
|
||||
|
||||
if test "$staticCompiler" = "1"; then
|
||||
EXTRA_LDFLAGS="-static"
|
||||
else
|
||||
EXTRA_LDFLAGS=""
|
||||
fi
|
||||
|
||||
# GCC interprets empty paths as ".", which we don't want.
|
||||
if test -z "$CPATH"; then unset CPATH; fi
|
||||
if test -z "$LIBRARY_PATH"; then unset LIBRARY_PATH; fi
|
||||
echo "\$CPATH is \`$CPATH'"
|
||||
echo "\$LIBRARY_PATH is \`$LIBRARY_PATH'"
|
||||
|
||||
if test "$noSysDirs" = "1"; then
|
||||
|
||||
if test -e $NIX_GCC/nix-support/orig-libc; then
|
||||
|
||||
# Figure out what extra flags to pass to the gcc compilers
|
||||
# being generated to make sure that they use our glibc.
|
||||
extraFlags="$(cat $NIX_GCC/nix-support/libc-cflags)"
|
||||
extraLDFlags="$(cat $NIX_GCC/nix-support/libc-ldflags) $(cat $NIX_GCC/nix-support/libc-ldflags-before)"
|
||||
|
||||
# Use *real* header files, otherwise a limits.h is generated
|
||||
# that does not include Glibc's limits.h (notably missing
|
||||
# SSIZE_MAX, which breaks the build).
|
||||
export NIX_FIXINC_DUMMY=$(cat $NIX_GCC/nix-support/orig-libc)/include
|
||||
|
||||
# The path to the Glibc binaries such as `crti.o'.
|
||||
glibc_libdir="$(cat $NIX_GCC/nix-support/orig-libc)/lib"
|
||||
|
||||
else
|
||||
# Hack: support impure environments.
|
||||
extraFlags="-isystem /usr/include"
|
||||
extraLDFlags="-L/usr/lib64 -L/usr/lib"
|
||||
glibc_libdir="/usr/lib"
|
||||
export NIX_FIXINC_DUMMY=/usr/include
|
||||
fi
|
||||
|
||||
extraFlags="-I$NIX_FIXINC_DUMMY $extraFlags"
|
||||
extraLDFlags="-L$glibc_libdir -rpath $glibc_libdir $extraLDFlags"
|
||||
|
||||
# BOOT_CFLAGS defaults to `-g -O2'; since we override it below,
|
||||
# make sure to explictly add them so that files compiled with the
|
||||
# bootstrap compiler are optimized and (optionally) contain
|
||||
# debugging information (info "(gccinstall) Building").
|
||||
if test -n "$dontStrip"; then
|
||||
extraFlags="-O2 -g $extraFlags"
|
||||
else
|
||||
# Don't pass `-g' at all; this saves space while building.
|
||||
extraFlags="-O2 $extraFlags"
|
||||
fi
|
||||
|
||||
EXTRA_FLAGS="$extraFlags"
|
||||
for i in $extraLDFlags; do
|
||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,$i"
|
||||
done
|
||||
|
||||
if test -n "$targetConfig"; then
|
||||
# Cross-compiling, we need gcc not to read ./specs in order to build
|
||||
# the g++ compiler (after the specs for the cross-gcc are created).
|
||||
# Having LIBRARY_PATH= makes gcc read the specs from ., and the build
|
||||
# breaks. Having this variable comes from the default.nix code to bring
|
||||
# gcj in.
|
||||
unset LIBRARY_PATH
|
||||
unset CPATH
|
||||
if test -z "$crossStageStatic"; then
|
||||
EXTRA_TARGET_CFLAGS="-B${libcCross}/lib -idirafter ${libcCross}/include"
|
||||
EXTRA_TARGET_LDFLAGS="-Wl,-L${libcCross}/lib -Wl,-rpath,${libcCross}/lib -Wl,-rpath-link,${libcCross}/lib"
|
||||
fi
|
||||
else
|
||||
if test -z "$NIX_GCC_CROSS"; then
|
||||
EXTRA_TARGET_CFLAGS="$EXTRA_FLAGS"
|
||||
EXTRA_TARGET_CXXFLAGS="$EXTRA_FLAGS"
|
||||
EXTRA_TARGET_LDFLAGS="$EXTRA_LDFLAGS"
|
||||
else
|
||||
# This the case of cross-building the gcc.
|
||||
# We need special flags for the target, different than those of the build
|
||||
# Assertion:
|
||||
test -e $NIX_GCC_CROSS/nix-support/orig-libc
|
||||
|
||||
# Figure out what extra flags to pass to the gcc compilers
|
||||
# being generated to make sure that they use our glibc.
|
||||
extraFlags="$(cat $NIX_GCC_CROSS/nix-support/libc-cflags)"
|
||||
extraLDFlags="$(cat $NIX_GCC_CROSS/nix-support/libc-ldflags) $(cat $NIX_GCC_CROSS/nix-support/libc-ldflags-before)"
|
||||
|
||||
# Use *real* header files, otherwise a limits.h is generated
|
||||
# that does not include Glibc's limits.h (notably missing
|
||||
# SSIZE_MAX, which breaks the build).
|
||||
NIX_FIXINC_DUMMY_CROSS=$(cat $NIX_GCC_CROSS/nix-support/orig-libc)/include
|
||||
|
||||
# The path to the Glibc binaries such as `crti.o'.
|
||||
glibc_dir="$(cat $NIX_GCC_CROSS/nix-support/orig-libc)"
|
||||
glibc_libdir="$glibc_dir/lib"
|
||||
configureFlags="$configureFlags --with-native-system-header-dir=$glibc_dir/include"
|
||||
|
||||
extraFlags="-I$NIX_FIXINC_DUMMY_CROSS $extraFlags"
|
||||
extraLDFlags="-L$glibc_libdir -rpath $glibc_libdir $extraLDFlags"
|
||||
|
||||
EXTRA_TARGET_CFLAGS="$extraFlags"
|
||||
for i in $extraLDFlags; do
|
||||
EXTRA_TARGET_LDFLAGS="$EXTRA_TARGET_LDFLAGS -Wl,$i"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
# CFLAGS_FOR_TARGET are needed for the libstdc++ configure script to find
|
||||
# the startfiles.
|
||||
# FLAGS_FOR_TARGET are needed for the target libraries to receive the -Bxxx
|
||||
# for the startfiles.
|
||||
makeFlagsArray+=( \
|
||||
NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
|
||||
SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
|
||||
CFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
|
||||
CXXFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
|
||||
CFLAGS_FOR_TARGET="$EXTRA_TARGET_CFLAGS $EXTRA_TARGET_LDFLAGS" \
|
||||
CXXFLAGS_FOR_TARGET="$EXTRA_TARGET_CFLAGS $EXTRA_TARGET_LDFLAGS" \
|
||||
FLAGS_FOR_TARGET="$EXTRA_TARGET_CFLAGS $EXTRA_TARGET_LDFLAGS" \
|
||||
LDFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
|
||||
LDFLAGS_FOR_TARGET="$EXTRA_TARGET_LDFLAGS $EXTRA_TARGET_LDFLAGS" \
|
||||
)
|
||||
|
||||
if test -z "$targetConfig"; then
|
||||
makeFlagsArray+=( \
|
||||
BOOT_CFLAGS="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
|
||||
BOOT_LDFLAGS="$EXTRA_TARGET_CFLAGS $EXTRA_TARGET_LDFLAGS" \
|
||||
)
|
||||
fi
|
||||
|
||||
if test -n "$targetConfig" -a "$crossStageStatic" == 1; then
|
||||
# We don't want the gcc build to assume there will be a libc providing
|
||||
# limits.h in this stagae
|
||||
makeFlagsArray+=( \
|
||||
LIMITS_H_TEST=false \
|
||||
)
|
||||
else
|
||||
makeFlagsArray+=( \
|
||||
LIMITS_H_TEST=true \
|
||||
)
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$targetConfig"; then
|
||||
# The host strip will destroy some important details of the objects
|
||||
dontStrip=1
|
||||
fi
|
||||
|
||||
providedPreConfigure="$preConfigure";
|
||||
preConfigure() {
|
||||
if test -n "$newlibSrc"; then
|
||||
tar xvf "$newlibSrc" -C ..
|
||||
ln -s ../newlib-*/newlib newlib
|
||||
# Patch to get armvt5el working:
|
||||
sed -i -e 's/ arm)/ arm*)/' newlib/configure.host
|
||||
fi
|
||||
|
||||
# Bug - they packaged zlib
|
||||
if test -d "zlib"; then
|
||||
# This breaks the build without-headers, which should build only
|
||||
# the target libgcc as target libraries.
|
||||
# See 'configure:5370'
|
||||
rm -Rf zlib
|
||||
fi
|
||||
|
||||
if test -f "$NIX_GCC/nix-support/orig-libc"; then
|
||||
# Patch the configure script so it finds glibc headers. It's
|
||||
# important for example in order not to get libssp built,
|
||||
# because its functionality is in glibc already.
|
||||
glibc_headers="$(cat $NIX_GCC/nix-support/orig-libc)/include"
|
||||
sed -i \
|
||||
-e "s,glibc_header_dir=/usr/include,glibc_header_dir=$glibc_headers", \
|
||||
gcc/configure
|
||||
fi
|
||||
|
||||
if test -n "$crossMingw" -a -n "$crossStageStatic"; then
|
||||
mkdir -p ../mingw
|
||||
# --with-build-sysroot expects that:
|
||||
cp -R $libcCross/include ../mingw
|
||||
configureFlags="$configureFlags --with-build-sysroot=`pwd`/.."
|
||||
fi
|
||||
|
||||
# Eval the preConfigure script from nix expression.
|
||||
eval "$providedPreConfigure"
|
||||
|
||||
# Perform the build in a different directory.
|
||||
mkdir ../build
|
||||
cd ../build
|
||||
configureScript=../$sourceRoot/configure
|
||||
}
|
||||
|
||||
|
||||
postConfigure() {
|
||||
# Don't store the configure flags in the resulting executables.
|
||||
sed -e '/TOPLEVEL_CONFIGURE_ARGUMENTS=/d' -i Makefile
|
||||
}
|
||||
|
||||
|
||||
preInstall() {
|
||||
# Make ‘lib64’ a symlink to ‘lib’.
|
||||
if [ -n "$is64bit" -a -z "$enableMultilib" ]; then
|
||||
mkdir -p $out/lib
|
||||
ln -s lib $out/lib64
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
postInstall() {
|
||||
# Remove precompiled headers for now. They are very big and
|
||||
# probably not very useful yet.
|
||||
find $out/include -name "*.gch" -exec rm -rf {} \; -prune
|
||||
|
||||
# Remove `fixincl' to prevent a retained dependency on the
|
||||
# previous gcc.
|
||||
rm -rf $out/libexec/gcc/*/*/install-tools
|
||||
rm -rf $out/lib/gcc/*/*/install-tools
|
||||
|
||||
# More dependencies with the previous gcc or some libs (gccbug stores the build command line)
|
||||
rm -rf $out/bin/gccbug
|
||||
# Take out the bootstrap-tools from the rpath, as it's not needed at all having $out
|
||||
for i in $out/libexec/gcc/*/*/*; do
|
||||
if PREV_RPATH=`patchelf --print-rpath $i`; then
|
||||
patchelf --set-rpath `echo $PREV_RPATH | sed 's,:[^:]*bootstrap-tools/lib,,'` $i
|
||||
fi
|
||||
done
|
||||
|
||||
# Get rid of some "fixed" header files
|
||||
rm -rf $out/lib/gcc/*/*/include/root
|
||||
|
||||
# Replace hard links for i686-pc-linux-gnu-gcc etc. with symlinks.
|
||||
for i in $out/bin/*-gcc*; do
|
||||
if cmp -s $out/bin/gcc $i; then
|
||||
ln -sfn gcc $i
|
||||
fi
|
||||
done
|
||||
|
||||
for i in $out/bin/c++ $out/bin/*-c++* $out/bin/*-g++*; do
|
||||
if cmp -s $out/bin/g++ $i; then
|
||||
ln -sfn g++ $i
|
||||
fi
|
||||
done
|
||||
|
||||
# Disable RANDMMAP on grsec, which causes segfaults when using
|
||||
# precompiled headers.
|
||||
# See https://bugs.gentoo.org/show_bug.cgi?id=301299#c31
|
||||
paxmark r $out/libexec/gcc/*/*/{cc1,cc1plus}
|
||||
|
||||
eval "$postInstallGhdl"
|
||||
}
|
||||
|
||||
genericBuild
|
||||
541
pkgs/development/compilers/gcc/4.8/default.nix
Normal file
541
pkgs/development/compilers/gcc/4.8/default.nix
Normal file
@@ -0,0 +1,541 @@
|
||||
{ stdenv, fetchurl, noSysDirs
|
||||
, langC ? true, langCC ? true, langFortran ? false
|
||||
, langObjC ? stdenv.isDarwin
|
||||
, langObjCpp ? stdenv.isDarwin
|
||||
, langJava ? false
|
||||
, langAda ? false
|
||||
, langVhdl ? false
|
||||
, langGo ? false
|
||||
, profiledCompiler ? false
|
||||
, staticCompiler ? false
|
||||
, enableShared ? true
|
||||
, texinfo ? null
|
||||
, perl ? null # optional, for texi2pod (then pod2man); required for Java
|
||||
, gmp, mpfr, mpc, gettext, which
|
||||
, libelf # optional, for link-time optimizations (LTO)
|
||||
, ppl ? null, cloog ? null, isl ? null # optional, for the Graphite optimization framework.
|
||||
, zlib ? null, boehmgc ? null
|
||||
, zip ? null, unzip ? null, pkgconfig ? null, gtk ? null, libart_lgpl ? null
|
||||
, libX11 ? null, libXt ? null, libSM ? null, libICE ? null, libXtst ? null
|
||||
, libXrender ? null, xproto ? null, renderproto ? null, xextproto ? null
|
||||
, libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null
|
||||
, gnatboot ? null
|
||||
, enableMultilib ? false
|
||||
, enablePlugin ? true # whether to support user-supplied plug-ins
|
||||
, name ? "gcc"
|
||||
, cross ? null
|
||||
, binutilsCross ? null
|
||||
, libcCross ? null
|
||||
, crossStageStatic ? true
|
||||
, gnat ? null
|
||||
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
|
||||
, stripped ? true
|
||||
, gnused ? null
|
||||
}:
|
||||
|
||||
assert langJava -> zip != null && unzip != null
|
||||
&& zlib != null && boehmgc != null
|
||||
&& perl != null; # for `--enable-java-home'
|
||||
assert langAda -> gnatboot != null;
|
||||
assert langVhdl -> gnat != null;
|
||||
|
||||
# We enable the isl cloog backend.
|
||||
assert cloog != null -> isl != null;
|
||||
|
||||
# LTO needs libelf and zlib.
|
||||
assert libelf != null -> zlib != null;
|
||||
|
||||
# Make sure we get GNU sed.
|
||||
assert stdenv.isDarwin -> gnused != null;
|
||||
|
||||
# The go frontend is written in c++
|
||||
assert langGo -> langCC;
|
||||
|
||||
with stdenv.lib;
|
||||
with builtins;
|
||||
|
||||
let version = "4.8.3";
|
||||
|
||||
# Whether building a cross-compiler for GNU/Hurd.
|
||||
crossGNU = cross != null && cross.config == "i586-pc-gnu";
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
patches = []
|
||||
++ optional enableParallelBuilding ./parallel-bconfig.patch
|
||||
++ optional (cross != null) ./libstdc++-target.patch
|
||||
++ optional noSysDirs ./no-sys-dirs.patch
|
||||
# The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
|
||||
# target libraries and tools.
|
||||
++ optional langAda ./gnat-cflags.patch
|
||||
++ optional langFortran ./gfortran-driving.patch;
|
||||
|
||||
javaEcj = fetchurl {
|
||||
# The `$(top_srcdir)/ecj.jar' file is automatically picked up at
|
||||
# `configure' time.
|
||||
|
||||
# XXX: Eventually we might want to take it from upstream.
|
||||
url = "ftp://sourceware.org/pub/java/ecj-4.3.jar";
|
||||
sha256 = "0jz7hvc0s6iydmhgh5h2m15yza7p2rlss2vkif30vm9y77m97qcx";
|
||||
};
|
||||
|
||||
# Antlr (optional) allows the Java `gjdoc' tool to be built. We want a
|
||||
# binary distribution here to allow the whole chain to be bootstrapped.
|
||||
javaAntlr = fetchurl {
|
||||
url = http://www.antlr.org/download/antlr-3.1.3.jar;
|
||||
sha256 = "1f41j0y4kjydl71lqlvr73yagrs2jsg1fjymzjz66mjy7al5lh09";
|
||||
};
|
||||
|
||||
xlibs = [
|
||||
libX11 libXt libSM libICE libXtst libXrender libXrandr libXi
|
||||
xproto renderproto xextproto inputproto randrproto
|
||||
];
|
||||
|
||||
javaAwtGtk = langJava && gtk != null;
|
||||
|
||||
/* Platform flags */
|
||||
platformFlags = let
|
||||
gccArch = stdenv.platform.gcc.arch or null;
|
||||
gccCpu = stdenv.platform.gcc.cpu or null;
|
||||
gccAbi = stdenv.platform.gcc.abi or null;
|
||||
gccFpu = stdenv.platform.gcc.fpu or null;
|
||||
gccFloat = stdenv.platform.gcc.float or null;
|
||||
gccMode = stdenv.platform.gcc.mode or null;
|
||||
withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
|
||||
withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
|
||||
withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
|
||||
withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
|
||||
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
|
||||
withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
|
||||
in
|
||||
withArch +
|
||||
withCpu +
|
||||
withAbi +
|
||||
withFpu +
|
||||
withFloat +
|
||||
withMode;
|
||||
|
||||
/* Cross-gcc settings */
|
||||
crossMingw = cross != null && cross.libc == "msvcrt";
|
||||
crossDarwin = cross != null && cross.libc == "libSystem";
|
||||
crossConfigureFlags = let
|
||||
gccArch = stdenv.cross.gcc.arch or null;
|
||||
gccCpu = stdenv.cross.gcc.cpu or null;
|
||||
gccAbi = stdenv.cross.gcc.abi or null;
|
||||
gccFpu = stdenv.cross.gcc.fpu or null;
|
||||
gccFloat = stdenv.cross.gcc.float or null;
|
||||
gccMode = stdenv.cross.gcc.mode or null;
|
||||
withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
|
||||
withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
|
||||
withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
|
||||
withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
|
||||
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
|
||||
withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
|
||||
in
|
||||
"--target=${cross.config}" +
|
||||
withArch +
|
||||
withCpu +
|
||||
withAbi +
|
||||
withFpu +
|
||||
withFloat +
|
||||
withMode +
|
||||
(if crossMingw && crossStageStatic then
|
||||
" --with-headers=${libcCross}/include" +
|
||||
" --with-gcc" +
|
||||
" --with-gnu-as" +
|
||||
" --with-gnu-ld" +
|
||||
" --with-gnu-ld" +
|
||||
" --disable-shared" +
|
||||
" --disable-nls" +
|
||||
" --disable-debug" +
|
||||
" --enable-sjlj-exceptions" +
|
||||
" --enable-threads=win32" +
|
||||
" --disable-win32-registry"
|
||||
else if crossStageStatic then
|
||||
" --disable-libssp --disable-nls" +
|
||||
" --without-headers" +
|
||||
" --disable-threads " +
|
||||
" --disable-libmudflap " +
|
||||
" --disable-libgomp " +
|
||||
" --disable-libquadmath" +
|
||||
" --disable-shared" +
|
||||
" --disable-libatomic " + # libatomic requires libc
|
||||
" --disable-decimal-float" # libdecnumber requires libc
|
||||
else
|
||||
(if crossDarwin then " --with-sysroot=${libcCross}/share/sysroot"
|
||||
else " --with-headers=${libcCross}/include") +
|
||||
# Ensure that -print-prog-name is able to find the correct programs.
|
||||
(stdenv.lib.optionalString (crossMingw || crossDarwin) (
|
||||
" --with-as=${binutilsCross}/bin/${cross.config}-as" +
|
||||
" --with-ld=${binutilsCross}/bin/${cross.config}-ld"
|
||||
)) +
|
||||
" --enable-__cxa_atexit" +
|
||||
" --enable-long-long" +
|
||||
(if crossMingw then
|
||||
" --enable-threads=win32" +
|
||||
" --enable-sjlj-exceptions" +
|
||||
" --enable-hash-synchronization" +
|
||||
" --disable-libssp" +
|
||||
" --disable-nls" +
|
||||
" --with-dwarf2" +
|
||||
# I think noone uses shared gcc libs in mingw, so we better do the same.
|
||||
# In any case, mingw32 g++ linking is broken by default with shared libs,
|
||||
# unless adding "-lsupc++" to any linking command. I don't know why.
|
||||
" --disable-shared" +
|
||||
# To keep ABI compatibility with upstream mingw-w64
|
||||
" --enable-fully-dynamic-string"
|
||||
else (if cross.libc == "uclibc" then
|
||||
# In uclibc cases, libgomp needs an additional '-ldl'
|
||||
# and as I don't know how to pass it, I disable libgomp.
|
||||
" --disable-libgomp" else "") +
|
||||
" --enable-threads=posix" +
|
||||
" --enable-nls" +
|
||||
" --disable-decimal-float") # No final libdecnumber (it may work only in 386)
|
||||
);
|
||||
stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
|
||||
crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
|
||||
|
||||
bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips;
|
||||
|
||||
in
|
||||
|
||||
# We need all these X libraries when building AWT with GTK+.
|
||||
assert gtk != null -> (filter (x: x == null) xlibs) == [];
|
||||
|
||||
stdenv.mkDerivation ({
|
||||
name = "${name}${if stripped then "" else "-debug"}-${version}" + crossNameAddon;
|
||||
|
||||
builder = ./builder.sh;
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.bz2";
|
||||
sha256 = "07hg10zs7gnqz58my10ch0zygizqh0z0bz6pv4pgxx45n48lz3ka";
|
||||
};
|
||||
|
||||
inherit patches;
|
||||
|
||||
postPatch =
|
||||
if (stdenv.isGNU
|
||||
|| (libcCross != null # e.g., building `gcc.crossDrv'
|
||||
&& libcCross ? crossConfig
|
||||
&& libcCross.crossConfig == "i586-pc-gnu")
|
||||
|| (crossGNU && libcCross != null))
|
||||
then
|
||||
# On GNU/Hurd glibc refers to Hurd & Mach headers and libpthread is not
|
||||
# in glibc, so add the right `-I' flags to the default spec string.
|
||||
assert libcCross != null -> libpthreadCross != null;
|
||||
let
|
||||
libc = if libcCross != null then libcCross else stdenv.glibc;
|
||||
gnu_h = "gcc/config/gnu.h";
|
||||
extraCPPDeps =
|
||||
libc.propagatedBuildInputs
|
||||
++ stdenv.lib.optional (libpthreadCross != null) libpthreadCross
|
||||
++ stdenv.lib.optional (libpthread != null) libpthread;
|
||||
extraCPPSpec =
|
||||
concatStrings (intersperse " "
|
||||
(map (x: "-I${x}/include") extraCPPDeps));
|
||||
extraLibSpec =
|
||||
if libpthreadCross != null
|
||||
then "-L${libpthreadCross}/lib ${libpthreadCross.TARGET_LDFLAGS}"
|
||||
else "-L${libpthread}/lib";
|
||||
in
|
||||
'' echo "augmenting \`CPP_SPEC' in \`${gnu_h}' with \`${extraCPPSpec}'..."
|
||||
sed -i "${gnu_h}" \
|
||||
-es'|CPP_SPEC *"\(.*\)$|CPP_SPEC "${extraCPPSpec} \1|g'
|
||||
|
||||
echo "augmenting \`LIB_SPEC' in \`${gnu_h}' with \`${extraLibSpec}'..."
|
||||
sed -i "${gnu_h}" \
|
||||
-es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
|
||||
|
||||
echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc}/include'..."
|
||||
sed -i "${gnu_h}" \
|
||||
-es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc}/include"|g'
|
||||
''
|
||||
else if cross != null || stdenv.gcc.libc != null then
|
||||
# On NixOS, use the right path to the dynamic linker instead of
|
||||
# `/lib/ld*.so'.
|
||||
let
|
||||
libc = if libcCross != null then libcCross else stdenv.gcc.libc;
|
||||
in
|
||||
'' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..."
|
||||
for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h
|
||||
do
|
||||
grep -q LIBC_DYNAMIC_LINKER "$header" || continue
|
||||
echo " fixing \`$header'..."
|
||||
sed -i "$header" \
|
||||
-e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc}\3"|g'
|
||||
done
|
||||
''
|
||||
else null;
|
||||
|
||||
inherit noSysDirs staticCompiler langJava crossStageStatic
|
||||
libcCross crossMingw;
|
||||
|
||||
nativeBuildInputs = [ texinfo which gettext ]
|
||||
++ (optional (perl != null) perl)
|
||||
++ (optional javaAwtGtk pkgconfig);
|
||||
|
||||
buildInputs = [ gmp mpfr mpc libelf ]
|
||||
++ (optional (ppl != null) ppl)
|
||||
++ (optional (cloog != null) cloog)
|
||||
++ (optional (isl != null) isl)
|
||||
++ (optional (zlib != null) zlib)
|
||||
++ (optionals langJava [ boehmgc zip unzip ])
|
||||
++ (optionals javaAwtGtk ([ gtk libart_lgpl ] ++ xlibs))
|
||||
++ (optionals (cross != null) [binutilsCross])
|
||||
++ (optionals langAda [gnatboot])
|
||||
++ (optionals langVhdl [gnat])
|
||||
|
||||
# The builder relies on GNU sed (for instance, Darwin's `sed' fails with
|
||||
# "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
|
||||
++ (optional stdenv.isDarwin gnused)
|
||||
;
|
||||
|
||||
NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isSunOS "-lm -ldl";
|
||||
|
||||
preConfigure = ''
|
||||
configureFlagsArray=(
|
||||
${stdenv.lib.optionalString (ppl != null && ppl ? dontDisableStatic && ppl.dontDisableStatic)
|
||||
"'--with-host-libstdcxx=-lstdc++ -lgcc_s'"}
|
||||
${stdenv.lib.optionalString (ppl != null && stdenv.isSunOS)
|
||||
"\"--with-host-libstdcxx=-Wl,-rpath,\$prefix/lib/amd64 -lstdc++\"
|
||||
\"--with-boot-ldflags=-L../prev-x86_64-pc-solaris2.11/libstdc++-v3/src/.libs\""}
|
||||
);
|
||||
'' + stdenv.lib.optionalString (stdenv.isSunOS && stdenv.is64bit) ''
|
||||
export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g`
|
||||
export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
|
||||
export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
|
||||
export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
|
||||
'' + stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
if SDKROOT=$(/usr/bin/xcrun --show-sdk-path); then
|
||||
configureFlagsArray+=(--with-native-system-header-dir=$SDKROOT/usr/include)
|
||||
makeFlagsArray+=( \
|
||||
CFLAGS_FOR_BUILD=-F$SDKROOT/System/Library/Frameworks \
|
||||
CFLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
|
||||
FLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
|
||||
)
|
||||
fi
|
||||
'';
|
||||
|
||||
dontDisableStatic = true;
|
||||
|
||||
configureFlags = "
|
||||
${if stdenv.isSunOS then
|
||||
" --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " +
|
||||
# On Illumos/Solaris GNU as is preferred
|
||||
" --with-gnu-as --without-gnu-ld "
|
||||
else ""}
|
||||
--enable-lto
|
||||
${if enableMultilib then "--disable-libquadmath" else "--disable-multilib"}
|
||||
${if enableShared then "" else "--disable-shared"}
|
||||
${if enablePlugin then "--enable-plugin" else "--disable-plugin"}
|
||||
${if ppl != null then "--with-ppl=${ppl} --disable-ppl-version-check" else ""}
|
||||
${optionalString (isl != null) "--with-isl=${isl}"}
|
||||
${optionalString (cloog != null) "--with-cloog=${cloog} --disable-cloog-version-check --enable-cloog-backend=isl"}
|
||||
${if langJava then
|
||||
"--with-ecj-jar=${javaEcj} " +
|
||||
|
||||
# Follow Sun's layout for the convenience of IcedTea/OpenJDK. See
|
||||
# <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>.
|
||||
"--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre "
|
||||
else ""}
|
||||
${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
|
||||
${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""}
|
||||
--with-gmp=${gmp}
|
||||
--with-mpfr=${mpfr}
|
||||
--with-mpc=${mpc}
|
||||
${if libelf != null then "--with-libelf=${libelf}" else ""}
|
||||
--disable-libstdcxx-pch
|
||||
--without-included-gettext
|
||||
--with-system-zlib
|
||||
--enable-static
|
||||
--enable-languages=${
|
||||
concatStrings (intersperse ","
|
||||
( optional langC "c"
|
||||
++ optional langCC "c++"
|
||||
++ optional langFortran "fortran"
|
||||
++ optional langJava "java"
|
||||
++ optional langAda "ada"
|
||||
++ optional langVhdl "vhdl"
|
||||
++ optional langGo "go"
|
||||
++ optional langObjC "objc"
|
||||
++ optional langObjCpp "obj-c++"
|
||||
++ optionals crossDarwin [ "objc" "obj-c++" ]
|
||||
)
|
||||
)
|
||||
}
|
||||
${if (stdenv ? glibc && cross == null)
|
||||
then " --with-native-system-header-dir=${stdenv.glibc}/include"
|
||||
else ""}
|
||||
${if langAda then " --enable-libada" else ""}
|
||||
${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
|
||||
${if cross != null then crossConfigureFlags else ""}
|
||||
${if !bootstrap then "--disable-bootstrap" else ""}
|
||||
${if cross == null then platformFlags else ""}
|
||||
";
|
||||
|
||||
targetConfig = if cross != null then cross.config else null;
|
||||
|
||||
buildFlags = if bootstrap then
|
||||
(if profiledCompiler then "profiledbootstrap" else "bootstrap")
|
||||
else "";
|
||||
|
||||
installTargets =
|
||||
if stripped
|
||||
then "install-strip"
|
||||
else "install";
|
||||
|
||||
crossAttrs = let
|
||||
xgccArch = stdenv.cross.gcc.arch or null;
|
||||
xgccCpu = stdenv.cross.gcc.cpu or null;
|
||||
xgccAbi = stdenv.cross.gcc.abi or null;
|
||||
xgccFpu = stdenv.cross.gcc.fpu or null;
|
||||
xgccFloat = stdenv.cross.gcc.float or null;
|
||||
xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else "";
|
||||
xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else "";
|
||||
xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else "";
|
||||
xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else "";
|
||||
xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else "";
|
||||
in {
|
||||
AR = "${stdenv.cross.config}-ar";
|
||||
LD = "${stdenv.cross.config}-ld";
|
||||
CC = "${stdenv.cross.config}-gcc";
|
||||
CXX = "${stdenv.cross.config}-gcc";
|
||||
AR_FOR_TARGET = "${stdenv.cross.config}-ar";
|
||||
LD_FOR_TARGET = "${stdenv.cross.config}-ld";
|
||||
CC_FOR_TARGET = "${stdenv.cross.config}-gcc";
|
||||
NM_FOR_TARGET = "${stdenv.cross.config}-nm";
|
||||
CXX_FOR_TARGET = "${stdenv.cross.config}-g++";
|
||||
# If we are making a cross compiler, cross != null
|
||||
NIX_GCC_CROSS = if cross == null then "${stdenv.gccCross}" else "";
|
||||
dontStrip = true;
|
||||
configureFlags = ''
|
||||
${if enableMultilib then "" else "--disable-multilib"}
|
||||
${if enableShared then "" else "--disable-shared"}
|
||||
${if ppl != null then "--with-ppl=${ppl.crossDrv}" else ""}
|
||||
${if cloog != null then "--with-cloog=${cloog.crossDrv} --enable-cloog-backend=isl" else ""}
|
||||
${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""}
|
||||
${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
|
||||
${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
|
||||
--with-gmp=${gmp.crossDrv}
|
||||
--with-mpfr=${mpfr.crossDrv}
|
||||
--disable-libstdcxx-pch
|
||||
--without-included-gettext
|
||||
--with-system-zlib
|
||||
--enable-languages=${
|
||||
concatStrings (intersperse ","
|
||||
( optional langC "c"
|
||||
++ optional langCC "c++"
|
||||
++ optional langFortran "fortran"
|
||||
++ optional langJava "java"
|
||||
++ optional langAda "ada"
|
||||
++ optional langVhdl "vhdl"
|
||||
++ optional langGo "go"
|
||||
)
|
||||
)
|
||||
}
|
||||
${if langAda then " --enable-libada" else ""}
|
||||
--target=${stdenv.cross.config}
|
||||
${xwithArch}
|
||||
${xwithCpu}
|
||||
${xwithAbi}
|
||||
${xwithFpu}
|
||||
${xwithFloat}
|
||||
'';
|
||||
buildFlags = "";
|
||||
};
|
||||
|
||||
|
||||
# Needed for the cross compilation to work
|
||||
AR = "ar";
|
||||
LD = "ld";
|
||||
# http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210
|
||||
CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc";
|
||||
|
||||
# Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find
|
||||
# the library headers and binaries, regarless of the language being
|
||||
# compiled.
|
||||
|
||||
# Note: When building the Java AWT GTK+ peer, the build system doesn't
|
||||
# honor `--with-gmp' et al., e.g., when building
|
||||
# `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just
|
||||
# add them to $CPATH and $LIBRARY_PATH in this case.
|
||||
#
|
||||
# Likewise, the LTO code doesn't find zlib.
|
||||
|
||||
CPATH = concatStrings
|
||||
(intersperse ":" (map (x: x + "/include")
|
||||
(optionals (zlib != null) [ zlib ]
|
||||
++ optionals langJava [ boehmgc ]
|
||||
++ optionals javaAwtGtk xlibs
|
||||
++ optionals javaAwtGtk [ gmp mpfr ]
|
||||
++ optional (libpthread != null) libpthread
|
||||
++ optional (libpthreadCross != null) libpthreadCross
|
||||
|
||||
# On GNU/Hurd glibc refers to Mach & Hurd
|
||||
# headers.
|
||||
++ optionals (libcCross != null && libcCross ? "propagatedBuildInputs" )
|
||||
libcCross.propagatedBuildInputs)));
|
||||
|
||||
LIBRARY_PATH = concatStrings
|
||||
(intersperse ":" (map (x: x + "/lib")
|
||||
(optionals (zlib != null) [ zlib ]
|
||||
++ optionals langJava [ boehmgc ]
|
||||
++ optionals javaAwtGtk xlibs
|
||||
++ optionals javaAwtGtk [ gmp mpfr ]
|
||||
++ optional (libpthread != null) libpthread)));
|
||||
|
||||
EXTRA_TARGET_CFLAGS =
|
||||
if cross != null && libcCross != null
|
||||
then "-idirafter ${libcCross}/include"
|
||||
else null;
|
||||
|
||||
EXTRA_TARGET_LDFLAGS =
|
||||
if cross != null && libcCross != null
|
||||
then "-B${libcCross}/lib -Wl,-L${libcCross}/lib" +
|
||||
(optionalString (libpthreadCross != null)
|
||||
" -L${libpthreadCross}/lib -Wl,${libpthreadCross.TARGET_LDFLAGS}")
|
||||
else null;
|
||||
|
||||
passthru =
|
||||
{ inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; };
|
||||
|
||||
inherit enableParallelBuilding enableMultilib;
|
||||
|
||||
inherit (stdenv) is64bit;
|
||||
|
||||
meta = {
|
||||
homepage = http://gcc.gnu.org/;
|
||||
license = stdenv.lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
|
||||
description = "GNU Compiler Collection, version ${version}"
|
||||
+ (if stripped then "" else " (with debugging info)");
|
||||
|
||||
longDescription = ''
|
||||
The GNU Compiler Collection includes compiler front ends for C, C++,
|
||||
Objective-C, Fortran, OpenMP for C/C++/Fortran, Java, and Ada, as well
|
||||
as libraries for these languages (libstdc++, libgcj, libgomp,...).
|
||||
|
||||
GCC development is a part of the GNU Project, aiming to improve the
|
||||
compiler used in the GNU system including the GNU/Linux variant.
|
||||
'';
|
||||
|
||||
maintainers = with stdenv.lib.maintainers; [ ludo viric shlevy simons ];
|
||||
|
||||
# Volunteers needed for the {Cyg,Dar}win ports of *PPL.
|
||||
# gnatboot is not available out of linux platforms, so we disable the darwin build
|
||||
# for the gnat (ada compiler).
|
||||
platforms =
|
||||
stdenv.lib.platforms.linux ++
|
||||
stdenv.lib.platforms.freebsd ++
|
||||
optionals (langAda == false) stdenv.lib.platforms.darwin;
|
||||
};
|
||||
}
|
||||
|
||||
// optionalAttrs (cross != null && cross.libc == "msvcrt" && crossStageStatic) {
|
||||
makeFlags = [ "all-gcc" "all-target-libgcc" ];
|
||||
installTargets = "install-gcc install-target-libgcc";
|
||||
}
|
||||
|
||||
# Strip kills static libs of other archs (hence cross != null)
|
||||
// optionalAttrs (!stripped || cross != null) { dontStrip = true; NIX_STRIP_DEBUG = 0; }
|
||||
)
|
||||
28
pkgs/development/compilers/gcc/4.8/no-sys-dirs.patch
Normal file
28
pkgs/development/compilers/gcc/4.8/no-sys-dirs.patch
Normal file
@@ -0,0 +1,28 @@
|
||||
diff -ru -x '*~' gcc-4.8.3-orig/gcc/cppdefault.c gcc-4.8.3/gcc/cppdefault.c
|
||||
--- gcc-4.8.3-orig/gcc/cppdefault.c 2013-01-10 21:38:27.000000000 +0100
|
||||
+++ gcc-4.8.3/gcc/cppdefault.c 2014-08-18 16:20:32.893944536 +0200
|
||||
@@ -35,6 +35,8 @@
|
||||
# undef CROSS_INCLUDE_DIR
|
||||
#endif
|
||||
|
||||
+#undef LOCAL_INCLUDE_DIR
|
||||
+
|
||||
const struct default_include cpp_include_defaults[]
|
||||
#ifdef INCLUDE_DEFAULTS
|
||||
= INCLUDE_DEFAULTS;
|
||||
diff -ru -x '*~' gcc-4.8.3-orig/gcc/gcc.c gcc-4.8.3/gcc/gcc.c
|
||||
--- gcc-4.8.3-orig/gcc/gcc.c 2014-03-23 12:30:57.000000000 +0100
|
||||
+++ gcc-4.8.3/gcc/gcc.c 2014-08-18 13:19:32.689201690 +0200
|
||||
@@ -1162,10 +1162,10 @@
|
||||
/* Default prefixes to attach to command names. */
|
||||
|
||||
#ifndef STANDARD_STARTFILE_PREFIX_1
|
||||
-#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
|
||||
+#define STANDARD_STARTFILE_PREFIX_1 ""
|
||||
#endif
|
||||
#ifndef STANDARD_STARTFILE_PREFIX_2
|
||||
-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
|
||||
+#define STANDARD_STARTFILE_PREFIX_2 ""
|
||||
#endif
|
||||
|
||||
#ifdef CROSS_DIRECTORY_STRUCTURE /* Don't use these prefixes for a cross compiler. */
|
||||
32
pkgs/development/compilers/gcc/4.8/parallel-bconfig.patch
Normal file
32
pkgs/development/compilers/gcc/4.8/parallel-bconfig.patch
Normal file
@@ -0,0 +1,32 @@
|
||||
Hacky work-around for highly parallel builds.
|
||||
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57125
|
||||
|
||||
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
|
||||
index aad927c..182f666 100644
|
||||
--- a/gcc/Makefile.in
|
||||
+++ b/gcc/Makefile.in
|
||||
@@ -3908,21 +3908,21 @@ build/gengtype-lex.o: $(BCONFIG_H)
|
||||
|
||||
gengtype-parse.o build/gengtype-parse.o : gengtype-parse.c gengtype.h \
|
||||
$(SYSTEM_H)
|
||||
-gengtype-parse.o: $(CONFIG_H)
|
||||
+gengtype-parse.o: $(CONFIG_H) $(BCONFIG_H)
|
||||
CFLAGS-gengtype-parse.o += -DGENERATOR_FILE
|
||||
build/gengtype-parse.o: $(BCONFIG_H)
|
||||
|
||||
gengtype-state.o build/gengtype-state.o: gengtype-state.c $(SYSTEM_H) \
|
||||
gengtype.h errors.h double-int.h version.h $(HASHTAB_H) $(OBSTACK_H) \
|
||||
$(XREGEX_H)
|
||||
-gengtype-state.o: $(CONFIG_H)
|
||||
+gengtype-state.o: $(CONFIG_H) $(BCONFIG_H)
|
||||
CFLAGS-gengtype-state.o += -DGENERATOR_FILE
|
||||
build/gengtype-state.o: $(BCONFIG_H)
|
||||
|
||||
gengtype.o build/gengtype.o : gengtype.c $(SYSTEM_H) gengtype.h \
|
||||
rtl.def insn-notes.def errors.h double-int.h version.h $(HASHTAB_H) \
|
||||
$(OBSTACK_H) $(XREGEX_H)
|
||||
-gengtype.o: $(CONFIG_H)
|
||||
+gengtype.o: $(CONFIG_H) $(BCONFIG_H)
|
||||
CFLAGS-gengtype.o += -DGENERATOR_FILE
|
||||
build/gengtype.o: $(BCONFIG_H)
|
||||
|
||||
@@ -33,7 +33,7 @@ if test "$noSysDirs" = "1"; then
|
||||
|
||||
# The path to the Glibc binaries such as `crti.o'.
|
||||
glibc_libdir="$(cat $NIX_GCC/nix-support/orig-libc)/lib"
|
||||
|
||||
|
||||
else
|
||||
# Hack: support impure environments.
|
||||
extraFlags="-isystem /usr/include"
|
||||
@@ -50,10 +50,10 @@ if test "$noSysDirs" = "1"; then
|
||||
# bootstrap compiler are optimized and (optionally) contain
|
||||
# debugging information (info "(gccinstall) Building").
|
||||
if test -n "$dontStrip"; then
|
||||
extraFlags="-O2 -g $extraFlags"
|
||||
extraFlags="-O2 -g $extraFlags"
|
||||
else
|
||||
# Don't pass `-g' at all; this saves space while building.
|
||||
extraFlags="-O2 $extraFlags"
|
||||
# Don't pass `-g' at all; this saves space while building.
|
||||
extraFlags="-O2 $extraFlags"
|
||||
fi
|
||||
|
||||
EXTRA_FLAGS="$extraFlags"
|
||||
@@ -155,7 +155,7 @@ if test -n "$targetConfig"; then
|
||||
dontStrip=1
|
||||
fi
|
||||
|
||||
|
||||
providedPreConfigure="$preConfigure";
|
||||
preConfigure() {
|
||||
if test -n "$newlibSrc"; then
|
||||
tar xvf "$newlibSrc" -C ..
|
||||
@@ -188,6 +188,9 @@ preConfigure() {
|
||||
configureFlags="$configureFlags --with-build-sysroot=`pwd`/.."
|
||||
fi
|
||||
|
||||
# Eval the preConfigure script from nix expression.
|
||||
eval $providedPreConfigure;
|
||||
env;
|
||||
# Perform the build in a different directory.
|
||||
mkdir ../build
|
||||
cd ../build
|
||||
@@ -210,7 +213,7 @@ postInstall() {
|
||||
# previous gcc.
|
||||
rm -rf $out/libexec/gcc/*/*/install-tools
|
||||
rm -rf $out/lib/gcc/*/*/install-tools
|
||||
|
||||
|
||||
# More dependencies with the previous gcc or some libs (gccbug stores the build command line)
|
||||
rm -rf $out/bin/gccbug
|
||||
# Take out the bootstrap-tools from the rpath, as it's not needed at all having $out
|
||||
@@ -11,7 +11,7 @@
|
||||
, perl ? null # optional, for texi2pod (then pod2man); required for Java
|
||||
, gmp, mpfr, mpc, gettext, which
|
||||
, libelf # optional, for link-time optimizations (LTO)
|
||||
, ppl ? null, cloog ? null # optional, for the Graphite optimization framework.
|
||||
, ppl ? null, cloog ? null, isl ? null # optional, for the Graphite optimization framework.
|
||||
, zlib ? null, boehmgc ? null
|
||||
, zip ? null, unzip ? null, pkgconfig ? null, gtk ? null, libart_lgpl ? null
|
||||
, libX11 ? null, libXt ? null, libSM ? null, libICE ? null, libXtst ? null
|
||||
@@ -37,6 +37,9 @@ assert langJava -> zip != null && unzip != null
|
||||
assert langAda -> gnatboot != null;
|
||||
assert langVhdl -> gnat != null;
|
||||
|
||||
# We enable the isl cloog backend.
|
||||
assert cloog != null -> isl != null;
|
||||
|
||||
# LTO needs libelf and zlib.
|
||||
assert libelf != null -> zlib != null;
|
||||
|
||||
@@ -49,13 +52,15 @@ assert langGo -> langCC;
|
||||
with stdenv.lib;
|
||||
with builtins;
|
||||
|
||||
let version = "4.7.3";
|
||||
let version = "4.9.1";
|
||||
|
||||
# Whether building a cross-compiler for GNU/Hurd.
|
||||
crossGNU = cross != null && cross.config == "i586-pc-gnu";
|
||||
|
||||
patches = []
|
||||
++ optional stdenv.isArm [ ./arm-eabi.patch ]
|
||||
enableParallelBuilding = true;
|
||||
|
||||
patches = [ ]
|
||||
++ optional enableParallelBuilding ./parallel-bconfig.patch
|
||||
++ optional (cross != null) ./libstdc++-target.patch
|
||||
# ++ optional noSysDirs ./no-sys-dirs.patch
|
||||
# The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
|
||||
@@ -88,35 +93,36 @@ let version = "4.7.3";
|
||||
|
||||
/* Platform flags */
|
||||
platformFlags = let
|
||||
gccArch = stdenv.lib.attrByPath [ "platform" "gcc" "arch" ] null stdenv;
|
||||
gccCpu = stdenv.lib.attrByPath [ "platform" "gcc" "cpu" ] null stdenv;
|
||||
gccAbi = stdenv.lib.attrByPath [ "platform" "gcc" "abi" ] null stdenv;
|
||||
gccFpu = stdenv.lib.attrByPath [ "platform" "gcc" "fpu" ] null stdenv;
|
||||
gccFloat = stdenv.lib.attrByPath [ "platform" "gcc" "float" ] null stdenv;
|
||||
gccMode = stdenv.lib.attrByPath [ "platform" "gcc" "mode" ] null stdenv;
|
||||
gccArch = stdenv.platform.gcc.arch or null;
|
||||
gccCpu = stdenv.platform.gcc.cpu or null;
|
||||
gccAbi = stdenv.platform.gcc.abi or null;
|
||||
gccFpu = stdenv.platform.gcc.fpu or null;
|
||||
gccFloat = stdenv.platform.gcc.float or null;
|
||||
gccMode = stdenv.platform.gcc.mode or null;
|
||||
withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
|
||||
withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
|
||||
withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
|
||||
withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
|
||||
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
|
||||
withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
|
||||
in
|
||||
(withArch +
|
||||
in
|
||||
withArch +
|
||||
withCpu +
|
||||
withAbi +
|
||||
withFpu +
|
||||
withFloat +
|
||||
withMode);
|
||||
withMode;
|
||||
|
||||
/* Cross-gcc settings */
|
||||
crossMingw = (cross != null && cross.libc == "msvcrt");
|
||||
crossMingw = cross != null && cross.libc == "msvcrt";
|
||||
crossDarwin = cross != null && cross.libc == "libSystem";
|
||||
crossConfigureFlags = let
|
||||
gccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null cross;
|
||||
gccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null cross;
|
||||
gccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null cross;
|
||||
gccFpu = stdenv.lib.attrByPath [ "gcc" "fpu" ] null cross;
|
||||
gccFloat = stdenv.lib.attrByPath [ "gcc" "float" ] null cross;
|
||||
gccMode = stdenv.lib.attrByPath [ "gcc" "mode" ] null cross;
|
||||
gccArch = stdenv.cross.gcc.arch or null;
|
||||
gccCpu = stdenv.cross.gcc.cpu or null;
|
||||
gccAbi = stdenv.cross.gcc.abi or null;
|
||||
gccFpu = stdenv.cross.gcc.fpu or null;
|
||||
gccFloat = stdenv.cross.gcc.float or null;
|
||||
gccMode = stdenv.cross.gcc.mode or null;
|
||||
withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
|
||||
withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
|
||||
withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
|
||||
@@ -153,7 +159,13 @@ let version = "4.7.3";
|
||||
" --disable-shared" +
|
||||
" --disable-decimal-float" # libdecnumber requires libc
|
||||
else
|
||||
" --with-headers=${libcCross}/include" +
|
||||
(if crossDarwin then " --with-sysroot=${libcCross}/share/sysroot"
|
||||
else " --with-headers=${libcCross}/include") +
|
||||
# Ensure that -print-prog-name is able to find the correct programs.
|
||||
(stdenv.lib.optionalString (crossMingw || crossDarwin) (
|
||||
" --with-as=${binutilsCross}/bin/${cross.config}-as" +
|
||||
" --with-ld=${binutilsCross}/bin/${cross.config}-ld"
|
||||
)) +
|
||||
" --enable-__cxa_atexit" +
|
||||
" --enable-long-long" +
|
||||
(if crossMingw then
|
||||
@@ -167,10 +179,8 @@ let version = "4.7.3";
|
||||
# In any case, mingw32 g++ linking is broken by default with shared libs,
|
||||
# unless adding "-lsupc++" to any linking command. I don't know why.
|
||||
" --disable-shared" +
|
||||
(if cross.config == "x86_64-w64-mingw32" then
|
||||
# To keep ABI compatibility with upstream mingw-w64
|
||||
" --enable-fully-dynamic-string"
|
||||
else "")
|
||||
# To keep ABI compatibility with upstream mingw-w64
|
||||
" --enable-fully-dynamic-string"
|
||||
else (if cross.libc == "uclibc" then
|
||||
# In uclibc cases, libgomp needs an additional '-ldl'
|
||||
# and as I don't know how to pass it, I disable libgomp.
|
||||
@@ -179,8 +189,7 @@ let version = "4.7.3";
|
||||
" --enable-nls" +
|
||||
" --disable-decimal-float") # No final libdecnumber (it may work only in 386)
|
||||
);
|
||||
stageNameAddon = if crossStageStatic then "-stage-static" else
|
||||
"-stage-final";
|
||||
stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
|
||||
crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
|
||||
|
||||
bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips;
|
||||
@@ -197,7 +206,7 @@ stdenv.mkDerivation ({
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.bz2";
|
||||
sha256 = "1hx9h64ivarlzi4hxvq42as5m9vlr5cyzaaq4gzj4i619zmkfz1g";
|
||||
sha256 = "0zki3ngi0gsidnmsp88mjl2868cc7cm5wm1vwqw6znja28d7hd6k";
|
||||
};
|
||||
|
||||
inherit patches;
|
||||
@@ -266,6 +275,7 @@ stdenv.mkDerivation ({
|
||||
buildInputs = [ gmp mpfr mpc libelf ]
|
||||
++ (optional (ppl != null) ppl)
|
||||
++ (optional (cloog != null) cloog)
|
||||
++ (optional (isl != null) isl)
|
||||
++ (optional (zlib != null) zlib)
|
||||
++ (optionals langJava [ boehmgc zip unzip ])
|
||||
++ (optionals javaAwtGtk ([ gtk libart_lgpl ] ++ xlibs))
|
||||
@@ -278,22 +288,40 @@ stdenv.mkDerivation ({
|
||||
++ (optional stdenv.isDarwin gnused)
|
||||
;
|
||||
|
||||
configureFlagsArray = stdenv.lib.optionals
|
||||
(ppl != null && ppl ? dontDisableStatic && ppl.dontDisableStatic)
|
||||
[ "--with-host-libstdcxx=-lstdc++ -lgcc_s" ];
|
||||
NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isSunOS "-lm -ldl";
|
||||
|
||||
# 'iant' at #go-nuts@freenode, gccgo maintainer, said that
|
||||
# they have a bug in 4.7.1 if adding "--disable-static"
|
||||
dontDisableStatic = langGo;
|
||||
preConfigure = ''
|
||||
configureFlagsArray=(
|
||||
${stdenv.lib.optionalString (ppl != null && ppl ? dontDisableStatic && ppl.dontDisableStatic)
|
||||
"'--with-host-libstdcxx=-lstdc++ -lgcc_s'"}
|
||||
${stdenv.lib.optionalString (ppl != null && stdenv.isSunOS)
|
||||
"\"--with-host-libstdcxx=-Wl,-rpath,\$prefix/lib/amd64 -lstdc++\"
|
||||
\"--with-boot-ldflags=-L../prev-x86_64-pc-solaris2.11/libstdc++-v3/src/.libs\""}
|
||||
);
|
||||
${stdenv.lib.optionalString (stdenv.isSunOS && stdenv.is64bit)
|
||||
''
|
||||
export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g`
|
||||
export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
|
||||
export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
|
||||
export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
|
||||
''}
|
||||
'';
|
||||
|
||||
dontDisableStatic = true;
|
||||
|
||||
configureFlags = "
|
||||
${if enableMultilib then "" else "--disable-multilib"}
|
||||
${if enableShared then "" else "--disable-shared"}
|
||||
${if enablePlugin then "--enable-plugin" else ""}
|
||||
${if ppl != null then "--with-ppl=${ppl}" else ""}
|
||||
${if cloog != null then
|
||||
"--with-cloog=${cloog} --enable-cloog-backend=isl"
|
||||
${if stdenv.isSunOS then
|
||||
" --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " +
|
||||
# On Illumos/Solaris GNU as is preferred
|
||||
" --with-gnu-as --without-gnu-ld "
|
||||
else ""}
|
||||
--enable-lto
|
||||
${if enableMultilib then "--disable-libquadmath" else "--disable-multilib"}
|
||||
${if enableShared then "" else "--disable-shared"}
|
||||
${if enablePlugin then "--enable-plugin" else "--disable-plugin"}
|
||||
${if ppl != null then "--with-ppl=${ppl} --disable-ppl-version-check" else ""}
|
||||
${optionalString (isl != null) "--with-isl=${isl}"}
|
||||
${optionalString (cloog != null) "--with-cloog=${cloog} --disable-cloog-version-check --enable-cloog-backend=isl"}
|
||||
${if langJava then
|
||||
"--with-ecj-jar=${javaEcj} " +
|
||||
|
||||
@@ -310,6 +338,7 @@ stdenv.mkDerivation ({
|
||||
--disable-libstdcxx-pch
|
||||
--without-included-gettext
|
||||
--with-system-zlib
|
||||
--enable-static
|
||||
--enable-languages=${
|
||||
concatStrings (intersperse ","
|
||||
( optional langC "c"
|
||||
@@ -319,6 +348,7 @@ stdenv.mkDerivation ({
|
||||
++ optional langAda "ada"
|
||||
++ optional langVhdl "vhdl"
|
||||
++ optional langGo "go"
|
||||
++ optionals crossDarwin [ "objc" "obj-c++" ]
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -344,11 +374,11 @@ stdenv.mkDerivation ({
|
||||
else "install";
|
||||
|
||||
crossAttrs = let
|
||||
xgccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null stdenv.cross;
|
||||
xgccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null stdenv.cross;
|
||||
xgccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null stdenv.cross;
|
||||
xgccFpu = stdenv.lib.attrByPath [ "gcc" "fpu" ] null stdenv.cross;
|
||||
xgccFloat = stdenv.lib.attrByPath [ "gcc" "float" ] null stdenv.cross;
|
||||
xgccArch = stdenv.cross.gcc.arch or null;
|
||||
xgccCpu = stdenv.cross.gcc.cpu or null;
|
||||
xgccAbi = stdenv.cross.gcc.abi or null;
|
||||
xgccFpu = stdenv.cross.gcc.fpu or null;
|
||||
xgccFloat = stdenv.cross.gcc.float or null;
|
||||
xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else "";
|
||||
xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else "";
|
||||
xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else "";
|
||||
@@ -407,7 +437,8 @@ stdenv.mkDerivation ({
|
||||
# Needed for the cross compilation to work
|
||||
AR = "ar";
|
||||
LD = "ld";
|
||||
CC = "gcc";
|
||||
# http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210
|
||||
CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc";
|
||||
|
||||
# Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find
|
||||
# the library headers and binaries, regarless of the language being
|
||||
@@ -431,8 +462,7 @@ stdenv.mkDerivation ({
|
||||
|
||||
# On GNU/Hurd glibc refers to Mach & Hurd
|
||||
# headers.
|
||||
++ optionals (libcCross != null &&
|
||||
hasAttr "propagatedBuildInputs" libcCross)
|
||||
++ optionals (libcCross != null && libcCross ? "propagatedBuildInputs" )
|
||||
libcCross.propagatedBuildInputs)));
|
||||
|
||||
LIBRARY_PATH = concatStrings
|
||||
@@ -455,18 +485,14 @@ stdenv.mkDerivation ({
|
||||
" -L${libpthreadCross}/lib -Wl,${libpthreadCross.TARGET_LDFLAGS}")
|
||||
else null;
|
||||
|
||||
passthru = { inherit langC langCC langAda langFortran langVhdl
|
||||
langGo enableMultilib version; };
|
||||
passthru =
|
||||
{ inherit langC langCC langAda langFortran langVhdl langGo enableMultilib version; };
|
||||
|
||||
/* From gccinstall.info:
|
||||
"parallel make is currently not supported since collisions in profile
|
||||
collecting may occur"
|
||||
*/
|
||||
enableParallelBuilding = !profiledCompiler;
|
||||
inherit enableParallelBuilding;
|
||||
|
||||
meta = {
|
||||
homepage = http://gcc.gnu.org/;
|
||||
license = "GPLv3+"; # runtime support libraries are typically LGPLv3+
|
||||
license = stdenv.lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
|
||||
description = "GNU Compiler Collection, version ${version}"
|
||||
+ (if stripped then "" else " (with debugging info)");
|
||||
|
||||
@@ -479,16 +505,15 @@ stdenv.mkDerivation ({
|
||||
compiler used in the GNU system including the GNU/Linux variant.
|
||||
'';
|
||||
|
||||
maintainers = [
|
||||
stdenv.lib.maintainers.ludo
|
||||
stdenv.lib.maintainers.viric
|
||||
stdenv.lib.maintainers.shlevy
|
||||
];
|
||||
maintainers = with stdenv.lib.maintainers; [ ludo viric shlevy simons ];
|
||||
|
||||
# Volunteers needed for the {Cyg,Dar}win ports of *PPL.
|
||||
# gnatboot is not available out of linux platforms, so we disable the darwin build
|
||||
# for the gnat (ada compiler).
|
||||
platforms = stdenv.lib.platforms.linux ++ optionals (langAda == false && libelf == null) [ "i686-darwin" ];
|
||||
platforms =
|
||||
stdenv.lib.platforms.linux ++
|
||||
stdenv.lib.platforms.freebsd ++
|
||||
optionals (langAda == false) stdenv.lib.platforms.darwin;
|
||||
};
|
||||
}
|
||||
|
||||
20
pkgs/development/compilers/gcc/4.9/gfortran-driving.patch
Normal file
20
pkgs/development/compilers/gcc/4.9/gfortran-driving.patch
Normal file
@@ -0,0 +1,20 @@
|
||||
This patch fixes interaction with Libtool.
|
||||
See <http://thread.gmane.org/gmane.comp.gcc.patches/258777>, for details.
|
||||
|
||||
--- a/gcc/fortran/gfortranspec.c
|
||||
+++ b/gcc/fortran/gfortranspec.c
|
||||
@@ -461,8 +461,15 @@ For more information about these matters, see the file named COPYING\n\n"));
|
||||
{
|
||||
fprintf (stderr, _("Driving:"));
|
||||
for (i = 0; i < g77_newargc; i++)
|
||||
+ {
|
||||
+ if (g77_new_decoded_options[i].opt_index == OPT_l)
|
||||
+ /* Make sure no white space is inserted after `-l'. */
|
||||
+ fprintf (stderr, " -l%s",
|
||||
+ g77_new_decoded_options[i].canonical_option[1]);
|
||||
+ else
|
||||
fprintf (stderr, " %s",
|
||||
g77_new_decoded_options[i].orig_option_with_args_text);
|
||||
+ }
|
||||
fprintf (stderr, "\n");
|
||||
}
|
||||
33
pkgs/development/compilers/gcc/4.9/gnat-cflags.patch
Normal file
33
pkgs/development/compilers/gcc/4.9/gnat-cflags.patch
Normal file
@@ -0,0 +1,33 @@
|
||||
diff --git a/libada/Makefile.in b/libada/Makefile.in
|
||||
index f5057a0..337e0c6 100644
|
||||
--- a/libada/Makefile.in
|
||||
+++ b/libada/Makefile.in
|
||||
@@ -55,7 +55,7 @@ GCC_WARN_CFLAGS = $(LOOSE_WARN)
|
||||
WARN_CFLAGS = @warn_cflags@
|
||||
|
||||
TARGET_LIBGCC2_CFLAGS=
|
||||
-GNATLIBCFLAGS= -g -O2
|
||||
+GNATLIBCFLAGS= -g -O2 $(CFLAGS)
|
||||
GNATLIBCFLAGS_FOR_C = $(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) -fexceptions \
|
||||
-DIN_RTS @have_getipinfo@
|
||||
|
||||
--- a/gcc/ada/gcc-interface/Makefile.in
|
||||
+++ b/gcc/ada/gcc-interface/Makefile.in
|
||||
@@ -105,7 +105,7 @@ ADAFLAGS = -W -Wall -gnatpg -gnata
|
||||
SOME_ADAFLAGS =-gnata
|
||||
FORCE_DEBUG_ADAFLAGS = -g
|
||||
GNATLIBFLAGS = -gnatpg -nostdinc
|
||||
-GNATLIBCFLAGS = -g -O2
|
||||
+GNATLIBCFLAGS = -g -O2 $(CFLAGS_FOR_TARGET)
|
||||
# Pretend that _Unwind_GetIPInfo is available for the target by default. This
|
||||
# should be autodetected during the configuration of libada and passed down to
|
||||
# here, but we need something for --disable-libada and hope for the best.
|
||||
@@ -193,7 +193,7 @@ RTSDIR = rts$(subst /,_,$(MULTISUBDIR))
|
||||
# Link flags used to build gnat tools. By default we prefer to statically
|
||||
# link with libgcc to avoid a dependency on shared libgcc (which is tricky
|
||||
# to deal with as it may conflict with the libgcc provided by the system).
|
||||
-GCC_LINK_FLAGS=-static-libgcc
|
||||
+GCC_LINK_FLAGS=-static-libgcc $(CFLAGS_FOR_TARGET)
|
||||
|
||||
# End of variables for you to override.
|
||||
|
||||
17
pkgs/development/compilers/gcc/4.9/java-jvgenmain-link.patch
Normal file
17
pkgs/development/compilers/gcc/4.9/java-jvgenmain-link.patch
Normal file
@@ -0,0 +1,17 @@
|
||||
The `jvgenmain' executable must be linked against `vec.o', among others,
|
||||
since it uses its vector API.
|
||||
|
||||
--- gcc-4.3.3/gcc/java/Make-lang.in 2008-12-05 00:00:19.000000000 +0100
|
||||
+++ gcc-4.3.3/gcc/java/Make-lang.in 2009-07-03 16:11:41.000000000 +0200
|
||||
@@ -109,9 +109,9 @@ jcf-dump$(exeext): $(JCFDUMP_OBJS) $(LIB
|
||||
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JCFDUMP_OBJS) \
|
||||
$(CPPLIBS) $(ZLIB) $(LDEXP_LIB) $(LIBS)
|
||||
|
||||
-jvgenmain$(exeext): $(JVGENMAIN_OBJS) $(LIBDEPS)
|
||||
+jvgenmain$(exeext): $(JVGENMAIN_OBJS) $(LIBDEPS) $(BUILD_RTL)
|
||||
rm -f $@
|
||||
- $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JVGENMAIN_OBJS) $(LIBS)
|
||||
+ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JVGENMAIN_OBJS) $(BUILD_RTL) $(LIBS)
|
||||
|
||||
#
|
||||
# Build hooks:
|
||||
32
pkgs/development/compilers/gcc/4.9/libstdc++-target.patch
Normal file
32
pkgs/development/compilers/gcc/4.9/libstdc++-target.patch
Normal file
@@ -0,0 +1,32 @@
|
||||
Patch to make the target libraries 'configure' scripts find the proper CPP.
|
||||
I noticed that building the mingw32 cross compiler.
|
||||
Looking at the build script for mingw in archlinux, I think that only nixos
|
||||
needs this patch. I don't know why.
|
||||
diff --git a/Makefile.in b/Makefile.in
|
||||
index 93f66b6..d691917 100644
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -266,6 +266,7 @@ BASE_TARGET_EXPORTS = \
|
||||
AR="$(AR_FOR_TARGET)"; export AR; \
|
||||
AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \
|
||||
CC="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \
|
||||
+ CPP="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS -E"; export CC; \
|
||||
CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
|
||||
CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
|
||||
CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \
|
||||
@@ -291,11 +292,13 @@ BASE_TARGET_EXPORTS = \
|
||||
RAW_CXX_TARGET_EXPORTS = \
|
||||
$(BASE_TARGET_EXPORTS) \
|
||||
CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
|
||||
- CXX="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX;
|
||||
+ CXX="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; \
|
||||
+ CXXCPP="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS -E"; export CXX;
|
||||
|
||||
NORMAL_TARGET_EXPORTS = \
|
||||
$(BASE_TARGET_EXPORTS) \
|
||||
- CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX;
|
||||
+ CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; \
|
||||
+ CXXCPP="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS -E"; export CXX;
|
||||
|
||||
# Where to find GMP
|
||||
HOST_GMPLIBS = @gmplibs@
|
||||
32
pkgs/development/compilers/gcc/4.9/parallel-bconfig.patch
Normal file
32
pkgs/development/compilers/gcc/4.9/parallel-bconfig.patch
Normal file
@@ -0,0 +1,32 @@
|
||||
Hacky work-around for highly parallel builds.
|
||||
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57125
|
||||
|
||||
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
|
||||
index aad927c..182f666 100644
|
||||
--- a/gcc/Makefile.in
|
||||
+++ b/gcc/Makefile.in
|
||||
@@ -3908,21 +3908,21 @@ build/gengtype-lex.o: $(BCONFIG_H)
|
||||
|
||||
gengtype-parse.o build/gengtype-parse.o : gengtype-parse.c gengtype.h \
|
||||
$(SYSTEM_H)
|
||||
-gengtype-parse.o: $(CONFIG_H)
|
||||
+gengtype-parse.o: $(CONFIG_H) $(BCONFIG_H)
|
||||
CFLAGS-gengtype-parse.o += -DGENERATOR_FILE
|
||||
build/gengtype-parse.o: $(BCONFIG_H)
|
||||
|
||||
gengtype-state.o build/gengtype-state.o: gengtype-state.c $(SYSTEM_H) \
|
||||
gengtype.h errors.h double-int.h version.h $(HASHTAB_H) $(OBSTACK_H) \
|
||||
$(XREGEX_H)
|
||||
-gengtype-state.o: $(CONFIG_H)
|
||||
+gengtype-state.o: $(CONFIG_H) $(BCONFIG_H)
|
||||
CFLAGS-gengtype-state.o += -DGENERATOR_FILE
|
||||
build/gengtype-state.o: $(BCONFIG_H)
|
||||
|
||||
gengtype.o build/gengtype.o : gengtype.c $(SYSTEM_H) gengtype.h \
|
||||
rtl.def insn-notes.def errors.h double-int.h version.h $(HASHTAB_H) \
|
||||
$(OBSTACK_H) $(XREGEX_H)
|
||||
-gengtype.o: $(CONFIG_H)
|
||||
+gengtype.o: $(CONFIG_H) $(BCONFIG_H)
|
||||
CFLAGS-gengtype.o += -DGENERATOR_FILE
|
||||
build/gengtype.o: $(BCONFIG_H)
|
||||
|
||||
@@ -16,15 +16,12 @@ assert a.stdenv.gcc.gcc != null ;
|
||||
assert a.stdenv.gcc.libc != null ;
|
||||
|
||||
rec {
|
||||
src = a.fetchcvs {
|
||||
cvsRoot = ":pserver:anonymous@cvs.sv.gnu.org:/sources/gcl";
|
||||
module = "gcl";
|
||||
# tag = "Version_2_6_8pre";
|
||||
date = "2010-07-01";
|
||||
sha256 = "a61d1bf669fd11d13050e8e1ab850a5eecb38126b47c744c3e21646773c4fb4d";
|
||||
src = a.fetchurl {
|
||||
sha256 = "1vsicv81ml7d92c87bckgkpvcshi6hzdnj44k0j6zs5mj8pzp8br";
|
||||
url="http://gnu.spinellicreations.com/gcl/gcl-2.6.10.tar.gz";
|
||||
};
|
||||
|
||||
name = "gcl-2.6.8pre";
|
||||
name = "gcl-2.6.10";
|
||||
inherit buildInputs;
|
||||
configureFlags = [
|
||||
"--enable-ansi"
|
||||
|
||||
@@ -20,6 +20,8 @@ stdenv.mkDerivation rec {
|
||||
"--with-gcc=${stdenv.gcc}/bin/gcc"
|
||||
];
|
||||
|
||||
NIX_CFLAGS_COMPILE = "-fomit-frame-pointer";
|
||||
|
||||
meta = {
|
||||
inherit homepage;
|
||||
description = "The Glasgow Haskell Compiler";
|
||||
|
||||
@@ -25,6 +25,8 @@ stdenv.mkDerivation rec {
|
||||
"--with-gcc=${stdenv.gcc}/bin/gcc"
|
||||
];
|
||||
|
||||
NIX_CFLAGS_COMPILE = "-fomit-frame-pointer";
|
||||
|
||||
# required, because otherwise all symbols from HSffi.o are stripped, and
|
||||
# that in turn causes GHCi to abort
|
||||
stripDebugFlags=["-S" "--keep-file-symbols"];
|
||||
|
||||
@@ -6,7 +6,7 @@ stdenv.mkDerivation rec {
|
||||
name = "ghc-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://new-www.haskell.org/ghc/dist/${version}/${name}-src.tar.bz2";
|
||||
url = "http://www.haskell.org/ghc/dist/${version}/${name}-src.tar.bz2";
|
||||
sha256 = "1iciljngxmqy465cw3pkl6jp0ydiils4bfz6ixfaxk7aqv7r7xsi";
|
||||
};
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ stdenv.mkDerivation rec {
|
||||
stdenv.lib.maintainers.andres
|
||||
];
|
||||
inherit (ghc.meta) license platforms;
|
||||
broken = true;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ stdenv.mkDerivation rec {
|
||||
stdenv.lib.maintainers.andres
|
||||
];
|
||||
inherit (ghc.meta) license platforms;
|
||||
broken = true;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@ stdenv.mkDerivation rec {
|
||||
"--with-gcc=${stdenv.gcc}/bin/gcc"
|
||||
];
|
||||
|
||||
NIX_CFLAGS_COMPILE = "-fomit-frame-pointer";
|
||||
|
||||
# required, because otherwise all symbols from HSffi.o are stripped, and
|
||||
# that in turn causes GHCi to abort
|
||||
stripDebugFlags=["-S" "--keep-file-symbols"];
|
||||
|
||||
@@ -25,6 +25,8 @@ stdenv.mkDerivation rec {
|
||||
"--with-gcc=${stdenv.gcc}/bin/gcc"
|
||||
];
|
||||
|
||||
NIX_CFLAGS_COMPILE = "-fomit-frame-pointer";
|
||||
|
||||
# required, because otherwise all symbols from HSffi.o are stripped, and
|
||||
# that in turn causes GHCi to abort
|
||||
stripDebugFlags=["-S" "--keep-file-symbols"];
|
||||
|
||||
@@ -12,7 +12,6 @@ stdenv.mkDerivation rec {
|
||||
|
||||
buildInputs = [ ghc perl gmp ncurses ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
buildMK = ''
|
||||
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp}/lib"
|
||||
@@ -22,6 +21,7 @@ stdenv.mkDerivation rec {
|
||||
preConfigure = ''
|
||||
echo "${buildMK}" > mk/build.mk
|
||||
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
||||
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
|
||||
export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}"
|
||||
'';
|
||||
|
||||
|
||||
@@ -12,17 +12,6 @@ stdenv.mkDerivation rec {
|
||||
|
||||
buildInputs = [ ghc perl gmp ncurses ];
|
||||
|
||||
# My attempts to compile GHC with parallel build support enabled, failed
|
||||
# 4 consecutive times with the following error:
|
||||
#
|
||||
# building rts/dist/build/AutoApply.debug_o
|
||||
# building rts/dist/build/AutoApply.thr_o
|
||||
# rts_dist_HC rts/dist/build/AutoApply.debug_o
|
||||
# /nix/store/1iigiim5855m8j7pmwf5xrnpf705s4dh-binutils-2.21.1a/bin/ld: cannot find libraries/integer-gmp/dist-install/build/cbits/gmp-wrappers_o_split/gmp-wrappers__1.o
|
||||
# collect2: ld returned 1 exit status
|
||||
# make[1]: *** [libraries/integer-gmp/dist-install/build/cbits/gmp-wrappers.p_o] Error 1
|
||||
enableParallelBuilding = false;
|
||||
|
||||
buildMK = ''
|
||||
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp}/lib"
|
||||
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp}/include"
|
||||
|
||||
@@ -12,7 +12,6 @@ stdenv.mkDerivation rec {
|
||||
|
||||
buildInputs = [ ghc perl gmp ncurses ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
buildMK = ''
|
||||
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp}/lib"
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
{ stdenv, fetchurl, ghc, perl, gmp, ncurses }:
|
||||
{ stdenv, fetchurl, ghc, perl, gmp, ncurses, binutils }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
let
|
||||
# The "-Wa,--noexecstack" options might be needed only with GNU ld (as opposed
|
||||
# to the gold linker). It prevents binaries' stacks from being marked as
|
||||
# executable, which fails to run on a grsecurity/PaX kernel.
|
||||
ghcFlags = "-optc-Wa,--noexecstack -opta-Wa,--noexecstack";
|
||||
cFlags = "-Wa,--noexecstack";
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
version = "7.6.3";
|
||||
|
||||
name = "ghc-${version}";
|
||||
@@ -12,21 +19,40 @@ stdenv.mkDerivation rec {
|
||||
|
||||
buildInputs = [ ghc perl gmp ncurses ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
buildMK = ''
|
||||
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp}/lib"
|
||||
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp}/include"
|
||||
|
||||
'' + stdenv.lib.optionalString stdenv.isLinux ''
|
||||
# Set ghcFlags for building ghc itself
|
||||
SRC_HC_OPTS += ${ghcFlags}
|
||||
SRC_CC_OPTS += ${cFlags}
|
||||
'';
|
||||
|
||||
preConfigure = ''
|
||||
echo "${buildMK}" > mk/build.mk
|
||||
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
||||
|
||||
'' + stdenv.lib.optionalString stdenv.isLinux ''
|
||||
# Set ghcFlags for binaries that ghc builds
|
||||
sed -i -e 's|"\$topdir"|"\$topdir" ${ghcFlags}|' ghc/ghc.wrapper
|
||||
|
||||
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
|
||||
export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}"
|
||||
'';
|
||||
|
||||
configureFlags = "--with-gcc=${stdenv.gcc}/bin/gcc";
|
||||
|
||||
postInstall = ''
|
||||
# ghci uses mmap with rwx protection at it implements dynamic
|
||||
# linking on its own. See:
|
||||
# - https://bugs.gentoo.org/show_bug.cgi?id=299709
|
||||
# - https://ghc.haskell.org/trac/ghc/ticket/4244
|
||||
# Therefore, we have to pax-mark the resulting binary.
|
||||
# Haddock also seems to run with ghci, so mark it as well.
|
||||
paxmark m $out/lib/${name}/{ghc,haddock}
|
||||
'';
|
||||
|
||||
# required, because otherwise all symbols from HSffi.o are stripped, and
|
||||
# that in turn causes GHCi to abort
|
||||
stripDebugFlags=["-S" "--keep-file-symbols"];
|
||||
|
||||
46
pkgs/development/compilers/ghc/7.8.3.nix
Normal file
46
pkgs/development/compilers/ghc/7.8.3.nix
Normal file
@@ -0,0 +1,46 @@
|
||||
{ stdenv, fetchurl, ghc, perl, gmp, ncurses }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "7.8.3";
|
||||
name = "ghc-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://www.haskell.org/ghc/dist/7.8.3/${name}-src.tar.xz";
|
||||
sha256 = "0n5rhwl83yv8qm0zrbaxnyrf8x1i3b6si927518mwfxs96jrdkdh";
|
||||
};
|
||||
|
||||
buildInputs = [ ghc perl gmp ncurses ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
buildMK = ''
|
||||
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp}/lib"
|
||||
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp}/include"
|
||||
DYNAMIC_BY_DEFAULT = NO
|
||||
'';
|
||||
|
||||
preConfigure = ''
|
||||
echo "${buildMK}" > mk/build.mk
|
||||
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
||||
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
|
||||
export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}"
|
||||
'';
|
||||
|
||||
configureFlags = "--with-gcc=${stdenv.gcc}/bin/gcc";
|
||||
|
||||
# required, because otherwise all symbols from HSffi.o are stripped, and
|
||||
# that in turn causes GHCi to abort
|
||||
stripDebugFlags = [ "-S" "--keep-file-symbols" ];
|
||||
|
||||
meta = {
|
||||
homepage = "http://haskell.org/ghc";
|
||||
description = "The Glasgow Haskell Compiler";
|
||||
maintainers = [
|
||||
stdenv.lib.maintainers.marcweber
|
||||
stdenv.lib.maintainers.andres
|
||||
stdenv.lib.maintainers.simons
|
||||
];
|
||||
inherit (ghc.meta) license platforms;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Usage:
|
||||
# $1: version of GHC
|
||||
# $2: invocation path of GHC
|
||||
# $3: prefix
|
||||
version="$1"
|
||||
if test -z "$3"; then
|
||||
prefix="-package-conf "
|
||||
else
|
||||
prefix="$3"
|
||||
fi
|
||||
PATH="$2:$PATH"
|
||||
IFS=":"
|
||||
for p in $PATH; do
|
||||
PkgDir="$p/../lib/ghc-pkgs/ghc-$version"
|
||||
for i in $PkgDir/*.installedconf; do
|
||||
# output takes place here
|
||||
test -f $i && echo -n " $prefix$i"
|
||||
done
|
||||
done
|
||||
test -f "$2/../lib/ghc-$version/package.conf" && echo -n " $prefix$2/../lib/ghc-$version/package.conf"
|
||||
@@ -1,15 +1,15 @@
|
||||
{ stdenv, fetchurl, ghc, perl, gmp, ncurses }:
|
||||
{ stdenv, fetchurl, ghc, perl, gmp, ncurses, happy, alex }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "7.7.20130828";
|
||||
version = "7.9.20140814";
|
||||
name = "ghc-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://darcs.haskell.org/ghcBuilder/uploads/tn23/${name}-src.tar.bz2";
|
||||
sha256 = "180nkd77kz3mv4g7yq8ipx34p5q8k714l0z2527y49lghy118jzv";
|
||||
url = "http://deb.haskell.org/dailies/2014-08-14/ghc_${version}.orig.tar.bz2";
|
||||
sha256 = "05vmlbzbfv72z570xmlh8n003z9xc4l5hixjqvczyyyisdvmyaa3";
|
||||
};
|
||||
|
||||
buildInputs = [ ghc perl gmp ncurses ];
|
||||
buildInputs = [ ghc perl gmp ncurses happy alex ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
@@ -22,6 +22,7 @@ stdenv.mkDerivation rec {
|
||||
preConfigure = ''
|
||||
echo "${buildMK}" > mk/build.mk
|
||||
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
||||
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
|
||||
export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}"
|
||||
'';
|
||||
|
||||
|
||||
@@ -1,16 +1,42 @@
|
||||
{ stdenv, ghc, packages, buildEnv, makeWrapper }:
|
||||
{ stdenv, ghc, packages, buildEnv, makeWrapper, ignoreCollisions ? false }:
|
||||
|
||||
assert packages != [];
|
||||
# This wrapper works only with GHC 6.12 or later.
|
||||
assert stdenv.lib.versionOlder "6.12" ghc.version;
|
||||
|
||||
# It's probably a good idea to include the library "ghc-paths" in the
|
||||
# compiler environment, because we have a specially patched version of
|
||||
# that package in Nix that honors these environment variables
|
||||
#
|
||||
# NIX_GHC
|
||||
# NIX_GHCPKG
|
||||
# NIX_GHC_DOCDIR
|
||||
# NIX_GHC_LIBDIR
|
||||
#
|
||||
# instead of hard-coding the paths. The wrapper sets these variables
|
||||
# appropriately to configure ghc-paths to point back to the wrapper
|
||||
# instead of to the pristine GHC package, which doesn't know any of the
|
||||
# additional libraries.
|
||||
#
|
||||
# A good way to import the environment set by the wrapper below into
|
||||
# your shell is to add the following snippet to your ~/.bashrc:
|
||||
#
|
||||
# if [ -e ~/.nix-profile/bin/ghc ]; then
|
||||
# eval $(grep export ~/.nix-profile/bin/ghc)
|
||||
# fi
|
||||
|
||||
let
|
||||
ghc761OrLater = stdenv.lib.versionOlder "7.6.1" ghc.version;
|
||||
packageDBFlag = if ghc761OrLater then "--package-db" else "--package-conf";
|
||||
packageDBFlag = if ghc761OrLater then "--global-package-db" else "--global-conf";
|
||||
libDir = "$out/lib/ghc-${ghc.version}";
|
||||
docDir = "$out/share/doc/ghc/html";
|
||||
packageCfgDir = "${libDir}/package.conf.d";
|
||||
isHaskellPkg = x: (x ? pname) && (x ? version);
|
||||
in
|
||||
if packages == [] then ghc else
|
||||
buildEnv {
|
||||
name = "haskell-env-${ghc.name}";
|
||||
paths = stdenv.lib.filter (x: x ? ghc) (stdenv.lib.closePropagation packages) ++ [ghc];
|
||||
paths = stdenv.lib.filter isHaskellPkg (stdenv.lib.closePropagation packages) ++ [ghc];
|
||||
inherit ignoreCollisions;
|
||||
postBuild = ''
|
||||
. ${makeWrapper}/nix-support/setup-hook
|
||||
|
||||
@@ -20,6 +46,7 @@ buildEnv {
|
||||
--add-flags '"-B$NIX_GHC_LIBDIR"' \
|
||||
--set "NIX_GHC" "$out/bin/ghc" \
|
||||
--set "NIX_GHCPKG" "$out/bin/ghc-pkg" \
|
||||
--set "NIX_GHC_DOCDIR" "${docDir}" \
|
||||
--set "NIX_GHC_LIBDIR" "${libDir}"
|
||||
done
|
||||
|
||||
@@ -29,12 +56,13 @@ buildEnv {
|
||||
--add-flags "-f $out/bin/ghc" \
|
||||
--set "NIX_GHC" "$out/bin/ghc" \
|
||||
--set "NIX_GHCPKG" "$out/bin/ghc-pkg" \
|
||||
--set "NIX_GHC_DOCDIR" "${docDir}" \
|
||||
--set "NIX_GHC_LIBDIR" "${libDir}"
|
||||
done
|
||||
|
||||
for prg in ghc-pkg ghc-pkg-${ghc.version}; do
|
||||
rm -f $out/bin/$prg
|
||||
makeWrapper ${ghc}/bin/$prg $out/bin/$prg --add-flags "${packageDBFlag} ${packageCfgDir}"
|
||||
makeWrapper ${ghc}/bin/$prg $out/bin/$prg --add-flags "${packageDBFlag}=${packageCfgDir}"
|
||||
done
|
||||
|
||||
$out/bin/ghc-pkg recache
|
||||
|
||||
64
pkgs/development/compilers/ghdl/default.nix
Normal file
64
pkgs/development/compilers/ghdl/default.nix
Normal file
@@ -0,0 +1,64 @@
|
||||
{ stdenv, fetchurl, gnat, zlib }:
|
||||
|
||||
assert stdenv.system == "i686-linux";
|
||||
|
||||
let
|
||||
version = "0.31";
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
name = "ghdl-mcode-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/ghdl/ghdl-${version}.tar.gz";
|
||||
sha256 = "1v0l9h6906b0bvnwfi2qg5nz9vjg80isc5qgjxr1yqxpkfm2xcf0";
|
||||
};
|
||||
|
||||
buildInputs = [ gnat zlib ];
|
||||
|
||||
# Tarbomb
|
||||
preUnpack = ''
|
||||
mkdir ghdl
|
||||
cd ghdl
|
||||
'';
|
||||
|
||||
sourceRoot = "translate/ghdldrv";
|
||||
|
||||
patchPhase = ''
|
||||
sed -i 's,$$curdir/lib,'$out'/share/ghdl_mcode/translate/lib,' Makefile
|
||||
'';
|
||||
|
||||
postBuild = ''
|
||||
# Build the LIB
|
||||
ln -s ghdl_mcode ghdl
|
||||
make install.mcode
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp ghdl_mcode $out/bin
|
||||
|
||||
mkdir -p $out/share/ghdl_mcode/translate
|
||||
cp -R ../lib $out/share/ghdl_mcode/translate
|
||||
cp -R ../../libraries $out/share/ghdl_mcode
|
||||
|
||||
mkdir -p $out/share/man/man1
|
||||
cp ../../doc/ghdl.1 $out/share/man/man1/ghdl_mcode.1
|
||||
|
||||
# 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, ...)
|
||||
pushd $out
|
||||
find . -name "*.cf" -exec \
|
||||
sed 's/[0-9]*\.000" /19700101000001.000" /g' -i {} \;
|
||||
popd
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = "http://sourceforge.net/p/ghdl-updates/wiki/Home/";
|
||||
description = "Free VHDL simulator, mcode flavour";
|
||||
maintainers = with stdenv.lib.maintainers; [viric];
|
||||
platforms = with stdenv.lib.platforms; linux;
|
||||
license = stdenv.lib.licenses.gpl2Plus;
|
||||
};
|
||||
}
|
||||
@@ -38,7 +38,7 @@ stdenv.mkDerivation {
|
||||
|
||||
meta = {
|
||||
homepage = http://gentoo.org;
|
||||
license = "GPLv3+"; # runtime support libraries are typically LGPLv3+
|
||||
license = stdenv.lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
|
||||
maintainers = [
|
||||
stdenv.lib.maintainers.viric
|
||||
];
|
||||
|
||||
@@ -45,6 +45,11 @@ stdenv.mkDerivation {
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p "$out/bin"
|
||||
|
||||
# CGO is broken on Maverick. See: http://code.google.com/p/go/issues/detail?id=5926
|
||||
# Reevaluate once go 1.1.3 is out
|
||||
export CGO_ENABLED=0
|
||||
|
||||
export GOROOT="$(pwd)/"
|
||||
export GOBIN="$out/bin"
|
||||
export PATH="$GOBIN:$PATH"
|
||||
|
||||
86
pkgs/development/compilers/go/1.2.nix
Normal file
86
pkgs/development/compilers/go/1.2.nix
Normal file
@@ -0,0 +1,86 @@
|
||||
{ stdenv, fetchurl, bison, glibc, bash, coreutils, makeWrapper, tzdata, iana_etc }:
|
||||
|
||||
let
|
||||
loader386 = "${glibc}/lib/ld-linux.so.2";
|
||||
loaderAmd64 = "${glibc}/lib/ld-linux-x86-64.so.2";
|
||||
loaderArm = "${glibc}/lib/ld-linux.so.3";
|
||||
in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "go-1.2.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = https://storage.googleapis.com/golang/go1.2.2.src.tar.gz;
|
||||
sha1 = "3ce0ac4db434fc1546fec074841ff40dc48c1167";
|
||||
};
|
||||
|
||||
buildInputs = [ bison glibc bash makeWrapper ];
|
||||
|
||||
# I'm not sure what go wants from its 'src', but the go installation manual
|
||||
# describes an installation keeping the src.
|
||||
preUnpack = ''
|
||||
mkdir -p $out/share
|
||||
cd $out/share
|
||||
'';
|
||||
|
||||
prePatch = ''
|
||||
cd ..
|
||||
if [ ! -d go ]; then
|
||||
mv * go
|
||||
fi
|
||||
cd go
|
||||
|
||||
patchShebangs ./ # replace /bin/bash
|
||||
# !!! substituteInPlace does not seems to be effective.
|
||||
sed -i 's,/lib/ld-linux.so.2,${loader386},' src/cmd/8l/asm.c
|
||||
sed -i 's,/lib64/ld-linux-x86-64.so.2,${loaderAmd64},' src/cmd/6l/asm.c
|
||||
sed -i 's,/lib64/ld-linux-x86-64.so.3,${loaderArm},' src/cmd/5l/asm.c
|
||||
sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/pkg/time/zoneinfo_unix.go
|
||||
sed -i 's,/etc/protocols,${iana_etc}/etc/protocols,' src/pkg/net/lookup_unix.go
|
||||
|
||||
#sed -i -e 's,/bin/cat,${coreutils}/bin/cat,' \
|
||||
# -e 's,/bin/echo,${coreutils}/bin/echo,' \
|
||||
# src/pkg/exec/exec_test.go
|
||||
|
||||
# Disabling the 'os/http/net' tests (they want files not available in
|
||||
# chroot builds)
|
||||
rm src/pkg/net/{multicast_test.go,parse_test.go,port_test.go}
|
||||
# The os test wants to read files in an existing path. Just it don't be /usr/bin.
|
||||
sed -i 's,/usr/bin,'"`pwd`", src/pkg/os/os_test.go
|
||||
sed -i 's,/bin/pwd,'"`type -P pwd`", src/pkg/os/os_test.go
|
||||
# Disable the hostname test
|
||||
sed -i '/TestHostname/areturn' src/pkg/os/os_test.go
|
||||
'';
|
||||
|
||||
patches = [ ./cacert-1.2.patch ];
|
||||
|
||||
GOOS = "linux";
|
||||
GOARCH = if stdenv.system == "i686-linux" then "386"
|
||||
else if stdenv.system == "x86_64-linux" then "amd64"
|
||||
else if stdenv.system == "armv5tel-linux" then "arm"
|
||||
else throw "Unsupported system";
|
||||
GOARM = stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") "5";
|
||||
GO386 = 387; # from Arch: don't assume sse2 on i686
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p "$out/bin"
|
||||
export GOROOT="$(pwd)/"
|
||||
export GOBIN="$out/bin"
|
||||
export PATH="$GOBIN:$PATH"
|
||||
cd ./src
|
||||
./all.bash
|
||||
cd -
|
||||
|
||||
# Copy the emacs configuration for Go files.
|
||||
mkdir -p "$out/share/emacs/site-lisp"
|
||||
cp ./misc/emacs/* $out/share/emacs/site-lisp/
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = http://golang.org/;
|
||||
description = "The Go Programming language";
|
||||
license = "BSD";
|
||||
maintainers = with stdenv.lib.maintainers; [ pierron viric wizeman ];
|
||||
platforms = stdenv.lib.platforms.linux;
|
||||
};
|
||||
}
|
||||
94
pkgs/development/compilers/go/1.3.nix
Normal file
94
pkgs/development/compilers/go/1.3.nix
Normal file
@@ -0,0 +1,94 @@
|
||||
{ stdenv, lib, fetchurl, bison, glibc, bash, coreutils, makeWrapper, tzdata, iana_etc }:
|
||||
|
||||
let
|
||||
loader386 = "${glibc}/lib/ld-linux.so.2";
|
||||
loaderAmd64 = "${glibc}/lib/ld-linux-x86-64.so.2";
|
||||
loaderArm = "${glibc}/lib/ld-linux.so.3";
|
||||
in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "go-1.3";
|
||||
|
||||
src = fetchurl {
|
||||
url = https://storage.googleapis.com/golang/go1.3.src.tar.gz;
|
||||
sha256 = "10jkqgzlinzynciw3wr15c7n2vw5q4d2ni65hbs3i61bbdn3x67b";
|
||||
};
|
||||
|
||||
buildInputs = [ bison bash makeWrapper ] ++ lib.optionals stdenv.isLinux [ glibc ] ;
|
||||
|
||||
# I'm not sure what go wants from its 'src', but the go installation manual
|
||||
# describes an installation keeping the src.
|
||||
preUnpack = ''
|
||||
mkdir -p $out/share
|
||||
cd $out/share
|
||||
'';
|
||||
|
||||
prePatch = ''
|
||||
# Ensure that the source directory is named go
|
||||
cd ..
|
||||
if [ ! -d go ]; then
|
||||
mv * go
|
||||
fi
|
||||
cd go
|
||||
patchShebangs ./ # replace /bin/bash
|
||||
|
||||
# Disabling the 'os/http/net' tests (they want files not available in
|
||||
# chroot builds)
|
||||
rm src/pkg/net/{multicast_test.go,parse_test.go,port_test.go}
|
||||
# !!! substituteInPlace does not seems to be effective.
|
||||
# The os test wants to read files in an existing path. Just don't let it be /usr/bin.
|
||||
sed -i 's,/usr/bin,'"`pwd`", src/pkg/os/os_test.go
|
||||
sed -i 's,/bin/pwd,'"`type -P pwd`", src/pkg/os/os_test.go
|
||||
# Disable the unix socket test
|
||||
sed -i '/TestShutdownUnix/areturn' src/pkg/net/net_test.go
|
||||
# Disable the hostname test
|
||||
sed -i '/TestHostname/areturn' src/pkg/os/os_test.go
|
||||
sed -i 's,/etc/protocols,${iana_etc}/etc/protocols,' src/pkg/net/lookup_unix.go
|
||||
'' + lib.optionalString stdenv.isLinux ''
|
||||
sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/pkg/time/zoneinfo_unix.go
|
||||
sed -i 's,/lib/ld-linux.so.3,${loaderArm},' src/cmd/5l/asm.c
|
||||
sed -i 's,/lib64/ld-linux-x86-64.so.2,${loaderAmd64},' src/cmd/6l/asm.c
|
||||
sed -i 's,/lib/ld-linux.so.2,${loader386},' src/cmd/8l/asm.c
|
||||
'';
|
||||
|
||||
patches = [ ./cacert-1.2.patch ];
|
||||
|
||||
GOOS = if stdenv.isDarwin then "darwin" else "linux";
|
||||
GOARCH = if stdenv.isDarwin then "amd64"
|
||||
else if stdenv.system == "i686-linux" then "386"
|
||||
else if stdenv.system == "x86_64-linux" then "amd64"
|
||||
else if stdenv.system == "armv5tel-linux" then "arm"
|
||||
else throw "Unsupported system";
|
||||
GOARM = stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") "5";
|
||||
GO386 = 387; # from Arch: don't assume sse2 on i686
|
||||
CGO_ENABLED = 1;
|
||||
|
||||
installPhase = ''
|
||||
export CC=cc
|
||||
|
||||
# http://lists.science.uu.nl/pipermail/nix-dev/2013-October/011891.html
|
||||
# Fix for "libgcc_s.so.1 must be installed for pthread_cancel to work"
|
||||
# during tests:
|
||||
export LD_LIBRARY_PATH="$(dirname $(echo ${stdenv.gcc.gcc}/lib/libgcc_s.so))"
|
||||
|
||||
mkdir -p "$out/bin"
|
||||
export GOROOT="$(pwd)/"
|
||||
export GOBIN="$out/bin"
|
||||
export PATH="$GOBIN:$PATH"
|
||||
cd ./src
|
||||
./all.bash
|
||||
cd -
|
||||
|
||||
# Copy the emacs configuration for Go files.
|
||||
mkdir -p "$out/share/emacs/site-lisp"
|
||||
cp ./misc/emacs/* $out/share/emacs/site-lisp/
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = http://golang.org/;
|
||||
description = "The Go Programming language";
|
||||
license = "BSD";
|
||||
maintainers = with stdenv.lib.maintainers; [ cstrahan ];
|
||||
platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
|
||||
};
|
||||
}
|
||||
19
pkgs/development/compilers/go/1_0-gcc-bug.patch
Normal file
19
pkgs/development/compilers/go/1_0-gcc-bug.patch
Normal file
@@ -0,0 +1,19 @@
|
||||
http://code.google.com/p/go/source/detail?r=8b13b2ec6b18
|
||||
--- a/src/cmd/cgo/gcc.go 2014-07-02 12:00:12.171796197 +0200
|
||||
+++ b/src/cmd/cgo/gcc.go 2014-07-02 12:01:57.844472754 +0200
|
||||
@@ -840,6 +840,15 @@
|
||||
func (p *Package) gccErrors(stdin []byte) string {
|
||||
// TODO(rsc): require failure
|
||||
args := p.gccCmd()
|
||||
+
|
||||
+ // GCC 4.8.0 has a bug: it sometimes does not apply
|
||||
+ // -Wunused-value to values that are macros defined in system
|
||||
+ // headers. See issue 5118. Adding -Wsystem-headers avoids
|
||||
+ // that problem. This will produce additional errors, but it
|
||||
+ // doesn't matter because we will ignore all errors that are
|
||||
+ // not marked for the cgo-test file.
|
||||
+ args = append(args, "-Wsystem-headers")
|
||||
+
|
||||
if *debugGcc {
|
||||
fmt.Fprintf(os.Stderr, "$ %s <<EOF\n", strings.Join(args, " "))
|
||||
os.Stderr.Write(stdin)
|
||||
12
pkgs/development/compilers/go/1_0-opt-error.patch
Normal file
12
pkgs/development/compilers/go/1_0-opt-error.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
https://code.google.com/p/go-wiki/wiki/OlderVersions
|
||||
--- a/src/cmd/cc/funct.c 2014-07-02 11:54:42.230663598 +0200
|
||||
+++ b/src/cmd/cc/funct.c 2014-07-02 11:55:01.653790128 +0200
|
||||
@@ -269,7 +269,7 @@
|
||||
goto bad;
|
||||
|
||||
f = alloc(sizeof(*f));
|
||||
- for(o=0; o<sizeof(f->sym); o++)
|
||||
+ for(o=0; o<nelem(f->sym); o++)
|
||||
f->sym[o] = S;
|
||||
|
||||
t->funct = f;
|
||||
15
pkgs/development/compilers/go/cacert-1.2.patch
Normal file
15
pkgs/development/compilers/go/cacert-1.2.patch
Normal file
@@ -0,0 +1,15 @@
|
||||
Go comes with hardcoded cacert. We add the usual in NixOS,
|
||||
for easier NixOS life.
|
||||
|
||||
diff --git a/src/pkg/crypto/x509/root_unix.go b/src/pkg/crypto/x509/root_unix.go
|
||||
index 76e79f4..6ef1dd3 100644
|
||||
--- a/src/pkg/crypto/x509/root_unix.go
|
||||
+++ b/src/pkg/crypto/x509/root_unix.go
|
||||
@@ -15,6 +15,7 @@ var certFiles = []string{
|
||||
"/etc/ssl/ca-bundle.pem", // OpenSUSE
|
||||
"/etc/ssl/cert.pem", // OpenBSD
|
||||
"/usr/local/share/certs/ca-root-nss.crt", // FreeBSD/DragonFly
|
||||
+ "/etc/ssl/certs/ca-bundle.crt", // NixOS
|
||||
}
|
||||
|
||||
func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate, err error) {
|
||||
@@ -51,7 +51,7 @@ stdenv.mkDerivation {
|
||||
sed -i '/TestHostname/areturn' src/pkg/os/os_test.go
|
||||
'';
|
||||
|
||||
patches = [ ./cacert.patch ];
|
||||
patches = [ ./cacert.patch ./1_0-opt-error.patch ./1_0-gcc-bug.patch ];
|
||||
|
||||
GOOS = "linux";
|
||||
GOARCH = if stdenv.system == "i686-linux" then "386"
|
||||
|
||||
54
pkgs/development/compilers/go/gox.nix
Normal file
54
pkgs/development/compilers/go/gox.nix
Normal file
@@ -0,0 +1,54 @@
|
||||
{ stdenv, lib, go, fetchFromGitHub }:
|
||||
|
||||
let
|
||||
goDeps = [
|
||||
{
|
||||
root = "github.com/mitchellh/gox";
|
||||
src = fetchFromGitHub {
|
||||
owner = "mitchellh";
|
||||
repo = "gox";
|
||||
rev = "c7329055e2aeb253a947e5cc876586ff4ca19199";
|
||||
sha256 = "0zhb88jjxqn3sdc4bpzvajqvgi9igp5gk03q12gaksaxhy2wl4jy";
|
||||
};
|
||||
}
|
||||
{
|
||||
root = "github.com/mitchellh/iochan";
|
||||
src = fetchFromGitHub {
|
||||
owner = "mitchellh";
|
||||
repo = "iochan";
|
||||
rev = "b584a329b193e206025682ae6c10cdbe03b0cd77";
|
||||
sha256 = "1fcwdhfci41ibpng2j4c1bqfng578cwzb3c00yw1lnbwwhaq9r6b";
|
||||
};
|
||||
}
|
||||
];
|
||||
sources = stdenv.mkDerivation rec {
|
||||
name = "go-deps";
|
||||
buildCommand =
|
||||
lib.concatStrings
|
||||
(map (dep: ''
|
||||
mkdir -p $out/src/`dirname ${dep.root}`
|
||||
ln -s ${dep.src} $out/src/${dep.root}
|
||||
'') goDeps);
|
||||
};
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "gox";
|
||||
|
||||
src = sources;
|
||||
|
||||
propagatedBuildInputs = [ go ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
export GOPATH=$src
|
||||
go build -v -o $out/bin/gox github.com/mitchellh/gox
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A simple, no-frills tool for Go cross compilation that behaves a lot like standard go build";
|
||||
homepage = https://github.com/mitchellh/gox;
|
||||
maintainers = with maintainers; [ cstrahan ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
@@ -11,6 +11,10 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "13miyas47bmijmadm68cbvb21n4s156gjafz7kfx9brk9djfkh0q";
|
||||
};
|
||||
|
||||
patchPhase = ''
|
||||
sed -i -e "s|/tmp/make.log|$TMPDIR/make.log|g" src/Pl2Wam/check_boot
|
||||
'';
|
||||
|
||||
preConfigure = ''
|
||||
cd src
|
||||
configureFlagsArray=(
|
||||
|
||||
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
|
||||
buildInputs = [ unzip ];
|
||||
|
||||
installPhase = ''
|
||||
ensureDir $out
|
||||
mkdir -p $out
|
||||
unzip $src
|
||||
mv gwt-2.4.0 $out/bin
|
||||
'';
|
||||
|
||||
@@ -1,30 +1,28 @@
|
||||
{ stdenv, fetchsvn, ocaml, zlib, neko }:
|
||||
{ stdenv, fetchgit, ocaml, zlib, neko }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "haxe-3.00";
|
||||
name = "haxe-3.1.3";
|
||||
|
||||
buildInputs = [ocaml zlib neko];
|
||||
|
||||
src = fetchsvn {
|
||||
url = "http://haxe.googlecode.com/svn/trunk";
|
||||
sha256 = "0hg8qailhgrcdk7r4k9kmwfl9d9ds0vy0l7wbv5wdrrc34qzifm4";
|
||||
rev = 6706;
|
||||
src = fetchgit {
|
||||
url = "https://github.com/HaxeFoundation/haxe.git";
|
||||
sha256 = "1p4yja6flv2r04q9lcrjxia3f3fsmhi3d88s0lz0nf0r4m61bjz0";
|
||||
fetchSubmodules = true;
|
||||
|
||||
# Tag 3.1.3
|
||||
rev = "7be30670b2f1f9b6082499c8fb9e23c0a6df6c28";
|
||||
};
|
||||
|
||||
prePatch = ''
|
||||
sed -i -e 's|com.class_path <- \[|&"'"$out/lib/haxe/std/"'";|' main.ml
|
||||
'';
|
||||
|
||||
postBuild = ''
|
||||
find std/tools -name '*.n' -delete
|
||||
rm -f std/tools/haxedoc/haxedoc std/tools/haxelib/haxelib
|
||||
'';
|
||||
|
||||
buildFlags = [ "all" "tools" ];
|
||||
|
||||
installPhase = ''
|
||||
install -vd "$out/bin" "$out/lib/haxe/std"
|
||||
install -vt "$out/bin" haxe haxelib haxedoc
|
||||
install -vt "$out/bin" haxe haxelib
|
||||
cp -vr std "$out/lib/haxe"
|
||||
'';
|
||||
|
||||
|
||||
64
pkgs/development/compilers/hhvm/default.nix
Normal file
64
pkgs/development/compilers/hhvm/default.nix
Normal file
@@ -0,0 +1,64 @@
|
||||
{ stdenv, fetchgit, cmake, pkgconfig, boost, libunwind, mariadb, libmemcached, pcre
|
||||
, libevent, gd, curl, libxml2, icu, flex, bison, openssl, zlib, php, re2c
|
||||
, expat, libcap, oniguruma, libdwarf, libmcrypt, tbb, gperftools, glog
|
||||
, bzip2, openldap, readline, libelf, uwimap, binutils, cyrus_sasl, pam, libpng
|
||||
, libxslt, ocaml, freetype
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "hhvm-${version}";
|
||||
version = "3.2.0";
|
||||
|
||||
src = fetchgit {
|
||||
url = "https://github.com/facebook/hhvm.git";
|
||||
rev = "01228273b8cf709aacbd3df1c51b1e690ecebac8";
|
||||
sha256 = "418d5a55ac4ba5335a42329ebfb7dd96fdb8d5edbc2700251c86e9fa2ae4a967";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
buildInputs =
|
||||
[ cmake pkgconfig boost libunwind mariadb libmemcached pcre libevent gd curl
|
||||
libxml2 icu flex bison openssl zlib php expat libcap oniguruma
|
||||
libdwarf libmcrypt tbb gperftools bzip2 openldap readline
|
||||
libelf uwimap binutils cyrus_sasl pam glog libpng libxslt ocaml
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
dontUseCmakeBuildDir = true;
|
||||
dontUseCmakeConfigure = true;
|
||||
NIX_LDFLAGS = "-lpam -L${pam}/lib";
|
||||
USE_HHVM=1;
|
||||
MYSQL_INCLUDE_DIR="${mariadb}/include/mysql";
|
||||
MYSQL_DIR=mariadb;
|
||||
|
||||
# work around broken build system
|
||||
NIX_CFLAGS_COMPILE = "-I${freetype}/include/freetype2";
|
||||
|
||||
patchPhase = ''
|
||||
substituteInPlace hphp/util/generate-buildinfo.sh \
|
||||
--replace /bin/bash ${stdenv.shell}
|
||||
substituteInPlace ./configure \
|
||||
--replace "/usr/bin/env bash" ${stdenv.shell}
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin $out/lib
|
||||
mv hphp/hhvm/hhvm $out/bin
|
||||
mv hphp/hack/bin/hh_server $out/bin
|
||||
mv hphp/hack/bin/hh_client $out/bin
|
||||
mv hphp/hack/hhi $out/lib/hack-hhi
|
||||
|
||||
cat > $out/bin/hhvm-hhi-copy <<EOF
|
||||
#!${stdenv.shell}
|
||||
cp -R $out/lib/hack-hhi \$1
|
||||
EOF
|
||||
chmod +x $out/bin/hhvm-hhi-copy
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "High-performance JIT compiler for PHP/Hack";
|
||||
homepage = "http://hhvm.com";
|
||||
license = "PHP/Zend";
|
||||
platforms = [ "x86_64-linux" ];
|
||||
maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
|
||||
};
|
||||
}
|
||||
39
pkgs/development/compilers/icedtea-web/default.nix
Normal file
39
pkgs/development/compilers/icedtea-web/default.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
{ stdenv, fetchurl, jdk, gtk2, xulrunner, zip, pkgconfig, perl, npapi_sdk, bash }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "icedtea-web-${version}";
|
||||
|
||||
version = "1.5";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://icedtea.wildebeest.org/download/source/${name}.tar.gz";
|
||||
|
||||
sha256 = "0bbwa944kaam0r8ldlqrrj9z9zj54v6zdc3q663ck59shw5z828w";
|
||||
};
|
||||
|
||||
buildInputs = [ gtk2 xulrunner zip pkgconfig npapi_sdk ];
|
||||
|
||||
preConfigure = ''
|
||||
substituteInPlace javac.in --replace '#!/usr/bin/perl' '#!${perl}/bin/perl'
|
||||
|
||||
configureFlags="BIN_BASH=${bash}/bin/bash $configureFlags"
|
||||
'';
|
||||
|
||||
configureFlags = [
|
||||
"--with-jdk-home=${jdk}"
|
||||
];
|
||||
|
||||
mozillaPlugin = "/lib";
|
||||
|
||||
meta = {
|
||||
description = "Java web browser plugin and an implementation of Java Web Start";
|
||||
longDescription = ''
|
||||
A Free Software web browser plugin running applets written in the Java
|
||||
programming language and an implementation of Java Web Start, originally
|
||||
based on the NetX project.
|
||||
'';
|
||||
homepage = http://icedtea.classpath.org/wiki/IcedTea-Web;
|
||||
maintainers = with stdenv.lib.maintainers; [ wizeman ];
|
||||
platforms = stdenv.lib.platforms.linux;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
diff -Naur openjdk-orig/jdk/make/sun/awt/mawt.gmk openjdk/jdk/make/sun/awt/mawt.gmk
|
||||
--- openjdk-orig/jdk/make/sun/awt/mawt.gmk 2012-08-28 19:13:16.000000000 -0400
|
||||
+++ openjdk/jdk/make/sun/awt/mawt.gmk 2013-01-22 11:56:22.315418708 -0500
|
||||
@@ -234,12 +234,6 @@
|
||||
endif # !HEADLESS
|
||||
endif # PLATFORM
|
||||
|
||||
-ifeq ($(PLATFORM), linux)
|
||||
- # Checking for the X11/extensions headers at the additional location
|
||||
- CPPFLAGS += -I$(firstword $(wildcard $(OPENWIN_HOME)/include/X11/extensions) \
|
||||
- $(wildcard /usr/include/X11/extensions))
|
||||
-endif
|
||||
-
|
||||
ifeq ($(PLATFORM), macosx))
|
||||
CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions \
|
||||
-I$(OPENWIN_HOME)/include
|
||||
179
pkgs/development/compilers/icedtea/default.nix
Normal file
179
pkgs/development/compilers/icedtea/default.nix
Normal file
@@ -0,0 +1,179 @@
|
||||
{ stdenv, fetchurl, jdk, jdkPath, ant, wget, zip, unzip, cpio, file, libxslt
|
||||
, xorg, zlib, pkgconfig, libjpeg, libpng, giflib, lcms2, gtk2, krb5, attr
|
||||
, alsaLib, procps, automake, autoconf, cups, which, perl, coreutils, binutils
|
||||
, cacert, setJavaClassPath
|
||||
}:
|
||||
|
||||
let
|
||||
|
||||
/**
|
||||
* The JRE libraries are in directories that depend on the CPU.
|
||||
*/
|
||||
architecture =
|
||||
if stdenv.system == "i686-linux" then
|
||||
"i386"
|
||||
else if stdenv.system == "x86_64-linux" then
|
||||
"amd64"
|
||||
else
|
||||
throw "icedtea requires i686-linux or x86_64 linux";
|
||||
|
||||
srcInfo = (import ./sources.nix).icedtea7;
|
||||
|
||||
pkgName = "icedtea7-${srcInfo.version}";
|
||||
|
||||
defSrc = name:
|
||||
with (builtins.getAttr name srcInfo.bundles); fetchurl {
|
||||
inherit url sha256;
|
||||
name = "${pkgName}-${name}-${baseNameOf url}";
|
||||
};
|
||||
|
||||
bundleNames = builtins.attrNames srcInfo.bundles;
|
||||
|
||||
sources = stdenv.lib.genAttrs bundleNames (name: defSrc name);
|
||||
|
||||
bundleFun = name: "--with-${name}-src-zip=" + builtins.getAttr name sources;
|
||||
bundleFlags = map bundleFun bundleNames;
|
||||
|
||||
in
|
||||
|
||||
with srcInfo; stdenv.mkDerivation {
|
||||
name = pkgName;
|
||||
|
||||
src = fetchurl {
|
||||
inherit url sha256;
|
||||
};
|
||||
|
||||
outputs = [ "out" "jre" ];
|
||||
|
||||
# TODO: Probably some more dependencies should be on this list but are being
|
||||
# propagated instead
|
||||
buildInputs = [
|
||||
jdk ant wget zip unzip cpio file libxslt pkgconfig procps automake
|
||||
autoconf which perl coreutils xorg.lndir
|
||||
zlib libjpeg libpng giflib lcms2 krb5 attr alsaLib cups
|
||||
xorg.libX11 xorg.libXtst gtk2
|
||||
];
|
||||
|
||||
configureFlags = bundleFlags ++ [
|
||||
"--disable-bootstrap"
|
||||
"--disable-downloading"
|
||||
|
||||
"--without-rhino"
|
||||
"--with-pax=paxctl"
|
||||
"--with-jdk-home=${jdkPath}"
|
||||
];
|
||||
|
||||
preConfigure = ''
|
||||
unset JAVA_HOME JDK_HOME CLASSPATH JAVAC JAVACFLAGS
|
||||
|
||||
substituteInPlace javac.in --replace '#!/usr/bin/perl' '#!${perl}/bin/perl'
|
||||
substituteInPlace javah.in --replace '#!/usr/bin/perl' '#!${perl}/bin/perl'
|
||||
|
||||
./autogen.sh
|
||||
'';
|
||||
|
||||
preBuild = ''
|
||||
make stamps/extract.stamp
|
||||
|
||||
substituteInPlace openjdk/jdk/make/common/shared/Defs-utils.gmk --replace '/bin/echo' '${coreutils}/bin/echo'
|
||||
substituteInPlace openjdk/corba/make/common/shared/Defs-utils.gmk --replace '/bin/echo' '${coreutils}/bin/echo'
|
||||
|
||||
patch -p0 < ${./cppflags-include-fix.patch}
|
||||
patch -p0 < ${./fix-java-home.patch}
|
||||
'';
|
||||
|
||||
NIX_NO_SELF_RPATH = true;
|
||||
|
||||
makeFlags = [
|
||||
"ALSA_INCLUDE=${alsaLib}/include/alsa/version.h"
|
||||
"ALT_UNIXCOMMAND_PATH="
|
||||
"ALT_USRBIN_PATH="
|
||||
"ALT_DEVTOOLS_PATH="
|
||||
"ALT_COMPILER_PATH="
|
||||
"ALT_CUPS_HEADERS_PATH=${cups}/include"
|
||||
"ALT_OBJCOPY=${binutils}/bin/objcopy"
|
||||
"SORT=${coreutils}/bin/sort"
|
||||
"UNLIMITED_CRYPTO=1"
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/lib/icedtea $out/share $jre/lib/icedtea
|
||||
|
||||
cp -av openjdk.build/j2sdk-image/* $out/lib/icedtea
|
||||
|
||||
# Move some stuff to top-level.
|
||||
mv $out/lib/icedtea/include $out/include
|
||||
mv $out/lib/icedtea/man $out/share/man
|
||||
|
||||
# jni.h expects jni_md.h to be in the header search path.
|
||||
ln -s $out/include/linux/*_md.h $out/include/
|
||||
|
||||
# Remove some broken manpages.
|
||||
rm -rf $out/share/man/ja*
|
||||
|
||||
# Remove crap from the installation.
|
||||
rm -rf $out/lib/icedtea/demo $out/lib/icedtea/sample
|
||||
|
||||
# Move the JRE to a separate output.
|
||||
mv $out/lib/icedtea/jre $jre/lib/icedtea/
|
||||
mkdir $out/lib/icedtea/jre
|
||||
lndir $jre/lib/icedtea/jre $out/lib/icedtea/jre
|
||||
|
||||
# The following files cannot be symlinked, as it seems to violate Java security policies
|
||||
rm $out/lib/icedtea/jre/lib/ext/*
|
||||
cp $jre/lib/icedtea/jre/lib/ext/* $out/lib/icedtea/jre/lib/ext/
|
||||
|
||||
rm -rf $out/lib/icedtea/jre/bin
|
||||
ln -s $out/lib/icedtea/bin $out/lib/icedtea/jre/bin
|
||||
|
||||
# Remove duplicate binaries.
|
||||
for i in $(cd $out/lib/icedtea/bin && echo *); do
|
||||
if [ "$i" = java ]; then continue; fi
|
||||
if cmp -s $out/lib/icedtea/bin/$i $jre/lib/icedtea/jre/bin/$i; then
|
||||
ln -sfn $jre/lib/icedtea/jre/bin/$i $out/lib/icedtea/bin/$i
|
||||
fi
|
||||
done
|
||||
|
||||
# Generate certificates.
|
||||
pushd $jre/lib/icedtea/jre/lib/security
|
||||
rm cacerts
|
||||
perl ${./generate-cacerts.pl} $jre/lib/icedtea/jre/bin/keytool ${cacert}/etc/ca-bundle.crt
|
||||
popd
|
||||
|
||||
ln -s $out/lib/icedtea/bin $out/bin
|
||||
ln -s $jre/lib/icedtea/jre/bin $jre/bin
|
||||
'';
|
||||
|
||||
# FIXME: this is unnecessary once the multiple-outputs branch is merged.
|
||||
preFixup = ''
|
||||
prefix=$jre stripDirs "$stripDebugList" "''${stripDebugFlags:--S}"
|
||||
patchELF $jre
|
||||
propagatedNativeBuildInputs+=" $jre"
|
||||
|
||||
# Propagate the setJavaClassPath setup hook from the JRE so that
|
||||
# any package that depends on the JRE has $CLASSPATH set up
|
||||
# properly.
|
||||
mkdir -p $jre/nix-support
|
||||
echo -n "${setJavaClassPath}" > $jre/nix-support/propagated-native-build-inputs
|
||||
|
||||
# Set JAVA_HOME automatically.
|
||||
mkdir -p $out/nix-support
|
||||
cat <<EOF > $out/nix-support/setup-hook
|
||||
if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out/lib/icedtea; fi
|
||||
EOF
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Free Java development kit based on OpenJDK 7.0 and the IcedTea project";
|
||||
longDescription = ''
|
||||
Free Java environment based on OpenJDK 7.0 and the IcedTea project.
|
||||
- Full Java runtime environment
|
||||
- Needed for executing Java Webstart programs and the free Java web browser plugin.
|
||||
'';
|
||||
homepage = http://icedtea.classpath.org;
|
||||
maintainers = with stdenv.lib.maintainers; [ wizeman ];
|
||||
platforms = stdenv.lib.platforms.linux;
|
||||
};
|
||||
|
||||
passthru = { inherit architecture; };
|
||||
}
|
||||
17
pkgs/development/compilers/icedtea/fix-java-home.patch
Normal file
17
pkgs/development/compilers/icedtea/fix-java-home.patch
Normal file
@@ -0,0 +1,17 @@
|
||||
diff -ru -x '*~' openjdk-orig/hotspot/src/os/linux/vm/os_linux.cpp openjdk/hotspot/src/os/linux/vm/os_linux.cpp
|
||||
--- openjdk-orig/hotspot/src/os/linux/vm/os_linux.cpp 2013-09-06 20:22:03.000000000 +0200
|
||||
+++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp 2014-01-24 22:44:08.223857012 +0100
|
||||
@@ -2358,12 +2358,10 @@
|
||||
CAST_FROM_FN_PTR(address, os::jvm_path),
|
||||
dli_fname, sizeof(dli_fname), NULL);
|
||||
assert(ret, "cannot locate libjvm");
|
||||
char *rp = NULL;
|
||||
if (ret && dli_fname[0] != '\0') {
|
||||
- rp = realpath(dli_fname, buf);
|
||||
+ snprintf(buf, buflen, "%s", dli_fname);
|
||||
}
|
||||
- if (rp == NULL)
|
||||
- return;
|
||||
|
||||
if (Arguments::created_by_gamma_launcher()) {
|
||||
// Support for the gamma launcher. Typical value for buf is
|
||||
366
pkgs/development/compilers/icedtea/generate-cacerts.pl
Normal file
366
pkgs/development/compilers/icedtea/generate-cacerts.pl
Normal file
@@ -0,0 +1,366 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
# Copyright (C) 2007, 2008 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# generate-cacerts.pl generates a JKS keystore named 'cacerts' from
|
||||
# OpenSSL's certificate bundle using OpenJDK's keytool.
|
||||
|
||||
# First extract each of OpenSSL's bundled certificates into its own
|
||||
# aliased filename.
|
||||
|
||||
# Downloaded from http://cvs.fedoraproject.org/viewvc/rpms/ca-certificates/F-12/generate-cacerts.pl?revision=1.2
|
||||
# Check and prevention of duplicate aliases added by Vlastimil Babka <caster@gentoo.org>
|
||||
|
||||
$file = $ARGV[1];
|
||||
open(CERTS, $file);
|
||||
@certs = <CERTS>;
|
||||
close(CERTS);
|
||||
|
||||
$pem_file_count = 0;
|
||||
$in_cert_block = 0;
|
||||
$write_current_cert = 1;
|
||||
foreach $cert (@certs)
|
||||
{
|
||||
if ($cert =~ /Issuer: /)
|
||||
{
|
||||
$_ = $cert;
|
||||
if ($cert =~ /personal-freemail/)
|
||||
{
|
||||
$cert_alias = "thawtepersonalfreemailca";
|
||||
}
|
||||
elsif ($cert =~ /personal-basic/)
|
||||
{
|
||||
$cert_alias = "thawtepersonalbasicca";
|
||||
}
|
||||
elsif ($cert =~ /personal-premium/)
|
||||
{
|
||||
$cert_alias = "thawtepersonalpremiumca";
|
||||
}
|
||||
elsif ($cert =~ /server-certs/)
|
||||
{
|
||||
$cert_alias = "thawteserverca";
|
||||
}
|
||||
elsif ($cert =~ /premium-server/)
|
||||
{
|
||||
$cert_alias = "thawtepremiumserverca";
|
||||
}
|
||||
elsif ($cert =~ /Class 1 Public Primary Certification Authority$/)
|
||||
{
|
||||
$cert_alias = "verisignclass1ca";
|
||||
}
|
||||
elsif ($cert =~ /Class 1 Public Primary Certification Authority - G2/)
|
||||
{
|
||||
$cert_alias = "verisignclass1g2ca";
|
||||
}
|
||||
elsif ($cert =~
|
||||
/VeriSign Class 1 Public Primary Certification Authority - G3/)
|
||||
{
|
||||
$cert_alias = "verisignclass1g3ca";
|
||||
}
|
||||
elsif ($cert =~ /Class 2 Public Primary Certification Authority$/)
|
||||
{
|
||||
$cert_alias = "verisignclass2ca";
|
||||
}
|
||||
elsif ($cert =~ /Class 2 Public Primary Certification Authority - G2/)
|
||||
{
|
||||
$cert_alias = "verisignclass2g2ca";
|
||||
}
|
||||
elsif ($cert =~
|
||||
/VeriSign Class 2 Public Primary Certification Authority - G3/)
|
||||
{
|
||||
$cert_alias = "verisignclass2g3ca";
|
||||
}
|
||||
elsif ($cert =~ /Class 3 Public Primary Certification Authority$/)
|
||||
{
|
||||
$cert_alias = "verisignclass3ca";
|
||||
}
|
||||
# Version 1 of Class 3 Public Primary Certification Authority
|
||||
# - G2 is added. Version 3 is excluded. See below.
|
||||
elsif ($cert =~
|
||||
/VeriSign Class 3 Public Primary Certification Authority - G3/)
|
||||
{
|
||||
$cert_alias = "verisignclass3g3ca";
|
||||
}
|
||||
elsif ($cert =~
|
||||
/RSA Data Security.*Secure Server Certification Authority/)
|
||||
{
|
||||
$cert_alias = "verisignserverca";
|
||||
}
|
||||
elsif ($cert =~ /GTE CyberTrust Global Root/)
|
||||
{
|
||||
$cert_alias = "gtecybertrustglobalca";
|
||||
}
|
||||
elsif ($cert =~ /Baltimore CyberTrust Root/)
|
||||
{
|
||||
$cert_alias = "baltimorecybertrustca";
|
||||
}
|
||||
elsif ($cert =~ /www.entrust.net\/Client_CA_Info\/CPS/)
|
||||
{
|
||||
$cert_alias = "entrustclientca";
|
||||
}
|
||||
elsif ($cert =~ /www.entrust.net\/GCCA_CPS/)
|
||||
{
|
||||
$cert_alias = "entrustglobalclientca";
|
||||
}
|
||||
elsif ($cert =~ /www.entrust.net\/CPS_2048/)
|
||||
{
|
||||
$cert_alias = "entrust2048ca";
|
||||
}
|
||||
elsif ($cert =~ /www.entrust.net\/CPS /)
|
||||
{
|
||||
$cert_alias = "entrustsslca";
|
||||
}
|
||||
elsif ($cert =~ /www.entrust.net\/SSL_CPS/)
|
||||
{
|
||||
$cert_alias = "entrustgsslca";
|
||||
}
|
||||
elsif ($cert =~ /The Go Daddy Group/)
|
||||
{
|
||||
$cert_alias = "godaddyclass2ca";
|
||||
}
|
||||
elsif ($cert =~ /Starfield Class 2 Certification Authority/)
|
||||
{
|
||||
$cert_alias = "starfieldclass2ca";
|
||||
}
|
||||
elsif ($cert =~ /ValiCert Class 2 Policy Validation Authority/)
|
||||
{
|
||||
$cert_alias = "valicertclass2ca";
|
||||
}
|
||||
elsif ($cert =~ /GeoTrust Global CA$/)
|
||||
{
|
||||
$cert_alias = "geotrustglobalca";
|
||||
}
|
||||
elsif ($cert =~ /Equifax Secure Certificate Authority/)
|
||||
{
|
||||
$cert_alias = "equifaxsecureca";
|
||||
}
|
||||
elsif ($cert =~ /Equifax Secure eBusiness CA-1/)
|
||||
{
|
||||
$cert_alias = "equifaxsecureebusinessca1";
|
||||
}
|
||||
elsif ($cert =~ /Equifax Secure eBusiness CA-2/)
|
||||
{
|
||||
$cert_alias = "equifaxsecureebusinessca2";
|
||||
}
|
||||
elsif ($cert =~ /Equifax Secure Global eBusiness CA-1/)
|
||||
{
|
||||
$cert_alias = "equifaxsecureglobalebusinessca1";
|
||||
}
|
||||
elsif ($cert =~ /Sonera Class1 CA/)
|
||||
{
|
||||
$cert_alias = "soneraclass1ca";
|
||||
}
|
||||
elsif ($cert =~ /Sonera Class2 CA/)
|
||||
{
|
||||
$cert_alias = "soneraclass2ca";
|
||||
}
|
||||
elsif ($cert =~ /AAA Certificate Services/)
|
||||
{
|
||||
$cert_alias = "comodoaaaca";
|
||||
}
|
||||
elsif ($cert =~ /AddTrust Class 1 CA Root/)
|
||||
{
|
||||
$cert_alias = "addtrustclass1ca";
|
||||
}
|
||||
elsif ($cert =~ /AddTrust External CA Root/)
|
||||
{
|
||||
$cert_alias = "addtrustexternalca";
|
||||
}
|
||||
elsif ($cert =~ /AddTrust Qualified CA Root/)
|
||||
{
|
||||
$cert_alias = "addtrustqualifiedca";
|
||||
}
|
||||
elsif ($cert =~ /UTN-USERFirst-Hardware/)
|
||||
{
|
||||
$cert_alias = "utnuserfirsthardwareca";
|
||||
}
|
||||
elsif ($cert =~ /UTN-USERFirst-Client Authentication and Email/)
|
||||
{
|
||||
$cert_alias = "utnuserfirstclientauthemailca";
|
||||
}
|
||||
elsif ($cert =~ /UTN - DATACorp SGC/)
|
||||
{
|
||||
$cert_alias = "utndatacorpsgcca";
|
||||
}
|
||||
elsif ($cert =~ /UTN-USERFirst-Object/)
|
||||
{
|
||||
$cert_alias = "utnuserfirstobjectca";
|
||||
}
|
||||
elsif ($cert =~ /America Online Root Certification Authority 1/)
|
||||
{
|
||||
$cert_alias = "aolrootca1";
|
||||
}
|
||||
elsif ($cert =~ /DigiCert Assured ID Root CA/)
|
||||
{
|
||||
$cert_alias = "digicertassuredidrootca";
|
||||
}
|
||||
elsif ($cert =~ /DigiCert Global Root CA/)
|
||||
{
|
||||
$cert_alias = "digicertglobalrootca";
|
||||
}
|
||||
elsif ($cert =~ /DigiCert High Assurance EV Root CA/)
|
||||
{
|
||||
$cert_alias = "digicerthighassuranceevrootca";
|
||||
}
|
||||
elsif ($cert =~ /GlobalSign Root CA$/)
|
||||
{
|
||||
$cert_alias = "globalsignca";
|
||||
}
|
||||
elsif ($cert =~ /GlobalSign Root CA - R2/)
|
||||
{
|
||||
$cert_alias = "globalsignr2ca";
|
||||
}
|
||||
elsif ($cert =~ /Elektronik.*Kas.*2005/)
|
||||
{
|
||||
$cert_alias = "extra-elektronikkas2005";
|
||||
}
|
||||
elsif ($cert =~ /Elektronik/)
|
||||
{
|
||||
$cert_alias = "extra-elektronik2005";
|
||||
}
|
||||
# Mozilla does not provide these certificates:
|
||||
# baltimorecodesigningca
|
||||
# gtecybertrust5ca
|
||||
# trustcenterclass2caii
|
||||
# trustcenterclass4caii
|
||||
# trustcenteruniversalcai
|
||||
else
|
||||
{
|
||||
# Generate an alias using the OU and CN attributes of the
|
||||
# Issuer field if both are present, otherwise use only the
|
||||
# CN attribute. The Issuer field must have either the OU
|
||||
# or the CN attribute.
|
||||
$_ = $cert;
|
||||
if ($cert =~ /OU=/)
|
||||
{
|
||||
s/Issuer:.*?OU=//;
|
||||
# Remove other occurrences of OU=.
|
||||
s/OU=.*CN=//;
|
||||
# Remove CN= if there were not other occurrences of OU=.
|
||||
s/CN=//;
|
||||
s/\/emailAddress.*//;
|
||||
s/Certificate Authority/ca/g;
|
||||
s/Certification Authority/ca/g;
|
||||
}
|
||||
elsif ($cert =~ /CN=/)
|
||||
{
|
||||
s/Issuer:.*CN=//;
|
||||
s/\/emailAddress.*//;
|
||||
s/Certificate Authority/ca/g;
|
||||
s/Certification Authority/ca/g;
|
||||
}
|
||||
s/\W//g;
|
||||
tr/A-Z/a-z/;
|
||||
$cert_alias = "extra-$_";
|
||||
|
||||
}
|
||||
while (-e "$cert_alias.pem")
|
||||
{
|
||||
$cert_alias = "$cert_alias" . "_";
|
||||
}
|
||||
}
|
||||
# When it attempts to parse:
|
||||
#
|
||||
# Class 3 Public Primary Certification Authority - G2, Version 3
|
||||
#
|
||||
# keytool says:
|
||||
#
|
||||
# #2: ObjectId: 1.3.6.1.5.5.7.1.1 Criticality=false
|
||||
# Unparseable AuthorityInfoAccess extension due to
|
||||
# java.io.IOException: Invalid encoding of URI
|
||||
#
|
||||
# If we do not exclude this file
|
||||
# openjdk/jdk/test/lib/security/cacerts/VerifyCACerts.java fails
|
||||
# on this cert, printing:
|
||||
#
|
||||
# Couldn't verify: java.security.SignatureException: Signature
|
||||
# does not match.
|
||||
#
|
||||
elsif ($cert =~
|
||||
/A6:0F:34:C8:62:6C:81:F6:8B:F7:7D:A9:F6:67:58:8A:90:3F:7D:36/)
|
||||
{
|
||||
$write_current_cert = 0;
|
||||
$pem_file_count--;
|
||||
}
|
||||
elsif ($cert eq "-----BEGIN CERTIFICATE-----\n")
|
||||
{
|
||||
$_ = $cert;
|
||||
s/\W//g;
|
||||
tr/A-Z/a-z/;
|
||||
$cert_alias = "extra-$_";
|
||||
while (-e "$cert_alias.pem")
|
||||
{
|
||||
$cert_alias = "$cert_alias" . "_";
|
||||
}
|
||||
if ($in_cert_block != 0)
|
||||
{
|
||||
die "$file is malformed.";
|
||||
}
|
||||
$in_cert_block = 1;
|
||||
if ($write_current_cert == 1)
|
||||
{
|
||||
$pem_file_count++;
|
||||
if (-e "$cert_alias.pem")
|
||||
{
|
||||
print "$cert_alias";
|
||||
die "already exists"
|
||||
}
|
||||
open(PEM, ">$cert_alias.pem");
|
||||
print PEM $cert;
|
||||
}
|
||||
}
|
||||
elsif ($cert eq "-----END CERTIFICATE-----\n")
|
||||
{
|
||||
$in_cert_block = 0;
|
||||
if ($write_current_cert == 1)
|
||||
{
|
||||
print PEM $cert;
|
||||
close(PEM);
|
||||
}
|
||||
$write_current_cert = 1
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($in_cert_block == 1 && $write_current_cert == 1)
|
||||
{
|
||||
print PEM $cert;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Check that the correct number of .pem files were produced.
|
||||
@pem_files = <*.pem>;
|
||||
if (@pem_files != $pem_file_count)
|
||||
{
|
||||
print "$pem_file_count";
|
||||
die "Number of .pem files produced does not match".
|
||||
" number of certs read from $file.";
|
||||
}
|
||||
|
||||
# Now store each cert in the 'cacerts' file using keytool.
|
||||
$certs_written_count = 0;
|
||||
foreach $pem_file (@pem_files)
|
||||
{
|
||||
system "$ARGV[0] -noprompt -import".
|
||||
" -alias `basename $pem_file .pem`".
|
||||
" -keystore cacerts -storepass 'changeit' -file $pem_file";
|
||||
unlink($pem_file);
|
||||
$certs_written_count++;
|
||||
}
|
||||
|
||||
# Check that the correct number of certs were added to the keystore.
|
||||
if ($certs_written_count != $pem_file_count)
|
||||
{
|
||||
die "Number of certs added to keystore does not match".
|
||||
" number of certs read from $file.";
|
||||
}
|
||||
56
pkgs/development/compilers/icedtea/sources.nix
Normal file
56
pkgs/development/compilers/icedtea/sources.nix
Normal file
@@ -0,0 +1,56 @@
|
||||
# This file is autogenerated from update.py in the same directory.
|
||||
{
|
||||
icedtea7 = rec {
|
||||
branch = "2.4";
|
||||
version = "${branch}.7";
|
||||
|
||||
url = "http://icedtea.wildebeest.org/download/source/icedtea-${version}.tar.xz";
|
||||
sha256 = "17a58wcxvg0dd7ka99k819ci6bga2b9l8kp67fq8z3w0yyz76sdn";
|
||||
|
||||
hg_url = "http://icedtea.classpath.org/hg/release/icedtea7-forest-${branch}";
|
||||
|
||||
bundles = {
|
||||
openjdk = rec {
|
||||
changeset = "13970e76b784";
|
||||
url = "${hg_url}/archive/${changeset}.tar.gz";
|
||||
sha256 = "bcd45546509defc439f42f230c0ca64e8aa6ec00542c3634aab3a4c10be3fe6b";
|
||||
};
|
||||
|
||||
corba = rec {
|
||||
changeset = "e6ad5b912691";
|
||||
url = "${hg_url}/corba/archive/${changeset}.tar.gz";
|
||||
sha256 = "cc37272df260d08207c84763d4c39d7807728ba2d5908276b9bc63e925e70674";
|
||||
};
|
||||
|
||||
jaxp = rec {
|
||||
changeset = "94b7e8e0d96f";
|
||||
url = "${hg_url}/jaxp/archive/${changeset}.tar.gz";
|
||||
sha256 = "3515cd105c29563bf78432576e658005386f45d7c3b2b7eac7af86cf196aaaea";
|
||||
};
|
||||
|
||||
jaxws = rec {
|
||||
changeset = "bd9a50a78d04";
|
||||
url = "${hg_url}/jaxws/archive/${changeset}.tar.gz";
|
||||
sha256 = "3e107628080d84a80a78ef0ef9dc3664989291dd17c8bacf031d59fba7bd7f4d";
|
||||
};
|
||||
|
||||
jdk = rec {
|
||||
changeset = "9448fff93286";
|
||||
url = "${hg_url}/jdk/archive/${changeset}.tar.gz";
|
||||
sha256 = "9222e5317264f20d4a0b8170b4c4d02459cda98333c18e3a75064e7856ff58be";
|
||||
};
|
||||
|
||||
langtools = rec {
|
||||
changeset = "8c26a3c39128";
|
||||
url = "${hg_url}/langtools/archive/${changeset}.tar.gz";
|
||||
sha256 = "5af29e32344e2f2fc0beb31f91b8312f2a0d6d02c53b4cb700ee2e27bcf1043b";
|
||||
};
|
||||
|
||||
hotspot = rec {
|
||||
changeset = "69b542696e5b";
|
||||
url = "${hg_url}/hotspot/archive/${changeset}.tar.gz";
|
||||
sha256 = "e3bbed298ed7c77169fdfddc47cdb85c62ef2e5e7ea04ca28aa8779861efca65";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
275
pkgs/development/compilers/icedtea/update.py
Executable file
275
pkgs/development/compilers/icedtea/update.py
Executable file
@@ -0,0 +1,275 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import subprocess, urllib.request, re, os, tarfile
|
||||
from html.parser import HTMLParser
|
||||
|
||||
HG_URL = 'http://icedtea.classpath.org/hg/release/icedtea{}-forest-{}'
|
||||
DOWNLOAD_URL = 'http://icedtea.wildebeest.org/download/source/'
|
||||
DOWNLOAD_HTML = DOWNLOAD_URL + '?C=M;O=D'
|
||||
|
||||
ICEDTEA_JDKS = [7]
|
||||
|
||||
BUNDLES = ['openjdk', 'corba', 'jaxp', 'jaxws', 'jdk', 'langtools', 'hotspot']
|
||||
|
||||
SRC_PATH = './sources.nix'
|
||||
|
||||
def get_output(cmd, env = None):
|
||||
try:
|
||||
proc = subprocess.Popen(cmd, env = env, stdout = subprocess.PIPE)
|
||||
out = proc.communicate()[0]
|
||||
except subprocess.CalledProcessError as e:
|
||||
return None
|
||||
|
||||
return out.decode('utf-8').strip()
|
||||
|
||||
def nix_prefetch_url(url):
|
||||
env = os.environ.copy()
|
||||
env['PRINT_PATH'] = '1'
|
||||
out = get_output(['nix-prefetch-url', url], env = env)
|
||||
|
||||
return out.split('\n')
|
||||
|
||||
def get_nix_attr(path, attr):
|
||||
out = get_output(['nix-instantiate', '--eval-only', '-A', attr, path])
|
||||
|
||||
if len(out) < 2 or out[0] != '"' or out[-1] != '"':
|
||||
raise Exception('Cannot find Nix attribute "{}" (parsing failure?)'.format(attr))
|
||||
|
||||
# Strip quotes
|
||||
return out[1:-1]
|
||||
|
||||
def get_jdk_attr(jdk, attr):
|
||||
return get_nix_attr(SRC_PATH, 'icedtea{}.{}'.format(jdk, attr))
|
||||
|
||||
class Parser(HTMLParser):
|
||||
def __init__(self, link_regex):
|
||||
HTMLParser.__init__(self)
|
||||
|
||||
self.regex = link_regex
|
||||
self.href = None
|
||||
self.version = None
|
||||
|
||||
def handle_starttag(self, tag, attrs):
|
||||
if self.href != None or tag != 'a':
|
||||
return
|
||||
|
||||
href = None
|
||||
for attr in attrs:
|
||||
if attr[0] == 'href':
|
||||
href = attr[1]
|
||||
if href == None:
|
||||
return
|
||||
|
||||
m = re.match(self.regex, href)
|
||||
if m != None:
|
||||
self.href = href
|
||||
self.version = m.group(1)
|
||||
|
||||
def get_latest_version_url(major):
|
||||
f = urllib.request.urlopen(DOWNLOAD_HTML)
|
||||
html = f.read().decode('utf-8')
|
||||
f.close()
|
||||
|
||||
parser = Parser(r'^icedtea\d?-({}\.\d[\d.]*)\.tar\.xz$'.format(major))
|
||||
parser.feed(html)
|
||||
parser.close()
|
||||
|
||||
if parser.href == None:
|
||||
raise Exception('Error: could not find download url for major version "{}"'.format(major))
|
||||
|
||||
return parser.version, DOWNLOAD_URL + parser.href
|
||||
|
||||
def get_old_bundle_attrs(jdk, bundle):
|
||||
attrs = {}
|
||||
for attr in ('changeset', 'url', 'sha256'):
|
||||
attrs[attr] = get_jdk_attr(jdk, 'bundles.{}.{}'.format(bundle, attr))
|
||||
|
||||
return attrs
|
||||
|
||||
def get_old_attrs(jdk):
|
||||
attrs = {}
|
||||
|
||||
for attr in ('branch', 'version', 'url', 'sha256'):
|
||||
attrs[attr] = get_jdk_attr(jdk, attr)
|
||||
|
||||
attrs['bundles'] = {}
|
||||
|
||||
for bundle in BUNDLES:
|
||||
attrs['bundles'][bundle] = get_old_bundle_attrs(jdk, bundle)
|
||||
|
||||
return attrs
|
||||
|
||||
def get_member_filename(tarball, name):
|
||||
for fname in tarball.getnames():
|
||||
m = re.match(r'^icedtea\d?-\d[\d.]*/{}$'.format(name), fname)
|
||||
if m != None:
|
||||
return m.group(0)
|
||||
|
||||
return None
|
||||
|
||||
def get_member_file(tarball, name):
|
||||
path = get_member_filename(tarball, name)
|
||||
if path == None:
|
||||
raise Exception('Could not find "{}" inside tarball'.format(name))
|
||||
|
||||
f = tarball.extractfile(path)
|
||||
data = f.read().decode('utf-8')
|
||||
f.close()
|
||||
|
||||
return data
|
||||
|
||||
def get_new_bundle_attr(makefile, bundle, attr):
|
||||
var = '{}_{}'.format(bundle.upper(), attr.upper())
|
||||
regex = r'^{} = (.*?)$'.format(var)
|
||||
|
||||
m = re.search(regex, makefile, re.MULTILINE)
|
||||
if m == None:
|
||||
raise Exception('Could not find variable "{}" in Makefile.am'.format(var))
|
||||
|
||||
return m.group(1)
|
||||
|
||||
def get_new_bundle_attrs(jdk, branch, path):
|
||||
hg_url = HG_URL.format(jdk, branch)
|
||||
|
||||
attrs = {}
|
||||
|
||||
print('Opening file: "{}"'.format(path))
|
||||
tar = tarfile.open(name = path, mode = 'r:xz')
|
||||
|
||||
makefile = get_member_file(tar, 'Makefile.am')
|
||||
hotspot_map = get_member_file(tar, 'hotspot.map')
|
||||
|
||||
for bundle in BUNDLES:
|
||||
battrs = {}
|
||||
|
||||
if bundle == 'hotspot':
|
||||
m = re.search(r'^default (.*?) (.*?) (.*?)$', hotspot_map, re.MULTILINE)
|
||||
if m == None:
|
||||
raise Exception('Could not find info for hotspot bundle in hotspot.map')
|
||||
|
||||
battrs['url'] = '{}/archive/{}.tar.gz'.format(m.group(1), m.group(2))
|
||||
battrs['changeset'] = m.group(2)
|
||||
battrs['sha256'] = m.group(3)
|
||||
|
||||
attrs[bundle] = battrs
|
||||
continue
|
||||
|
||||
changeset = get_new_bundle_attr(makefile, bundle, 'changeset')
|
||||
battrs['changeset'] = changeset
|
||||
battrs['sha256'] = get_new_bundle_attr(makefile, bundle, 'sha256sum')
|
||||
|
||||
if bundle == 'openjdk':
|
||||
battrs['url'] = '{}/archive/{}.tar.gz'.format(hg_url, changeset)
|
||||
else:
|
||||
battrs['url'] = '{}/{}/archive/{}.tar.gz'.format(hg_url, bundle, changeset)
|
||||
|
||||
attrs[bundle] = battrs
|
||||
|
||||
tar.close()
|
||||
|
||||
return attrs
|
||||
|
||||
def get_new_attrs(jdk):
|
||||
print('Getting old attributes for JDK {}...'.format(jdk))
|
||||
old_attrs = get_old_attrs(jdk)
|
||||
attrs = {}
|
||||
|
||||
# The major version corresponds to a specific JDK (1 = OpenJDK6, 2 = OpenJDK7, 3 = OpenJDK8)
|
||||
major = jdk - 5
|
||||
|
||||
print('Getting latest version for JDK {}...'.format(jdk))
|
||||
version, url = get_latest_version_url(major)
|
||||
|
||||
print()
|
||||
print('Old version: {}'.format(old_attrs['version']))
|
||||
print('New version: {}'.format(version))
|
||||
print()
|
||||
|
||||
if version == old_attrs['version']:
|
||||
print('No update available, skipping...')
|
||||
print()
|
||||
return old_attrs
|
||||
|
||||
print('Update available, generating new attributes for JDK {}...'.format(jdk))
|
||||
|
||||
attrs['version'] = version
|
||||
attrs['branch'] = '.'.join(version.split('.')[:2])
|
||||
attrs['url'] = url
|
||||
|
||||
print('Downloading tarball from url "{}"...'.format(url))
|
||||
print()
|
||||
attrs['sha256'], path = nix_prefetch_url(url)
|
||||
print()
|
||||
|
||||
print('Inspecting tarball for bundle information...')
|
||||
|
||||
attrs['bundles'] = get_new_bundle_attrs(jdk, attrs['branch'], path)
|
||||
|
||||
print('Done!')
|
||||
|
||||
return attrs
|
||||
|
||||
def generate_jdk(jdk):
|
||||
attrs = get_new_attrs(jdk)
|
||||
|
||||
branch = attrs['branch']
|
||||
src_version = attrs['version'].replace(branch, '${branch}')
|
||||
src_url = attrs['url'].replace(attrs['version'], '${version}')
|
||||
|
||||
hg_url = HG_URL.format(jdk, branch)
|
||||
src_hg_url = HG_URL.format(jdk, '${branch}')
|
||||
|
||||
src = ' icedtea{} = rec {{\n'.format(jdk)
|
||||
src += ' branch = "{}";\n'.format(branch)
|
||||
src += ' version = "{}";\n'.format(src_version)
|
||||
src += '\n'
|
||||
src += ' url = "{}";\n'.format(src_url)
|
||||
src += ' sha256 = "{}";\n'.format(attrs['sha256'])
|
||||
src += '\n'
|
||||
src += ' hg_url = "{}";\n'.format(src_hg_url)
|
||||
src += '\n'
|
||||
src += ' bundles = {\n'
|
||||
|
||||
for bundle in BUNDLES:
|
||||
battrs = attrs['bundles'][bundle]
|
||||
|
||||
b_url = battrs['url']
|
||||
b_url = b_url.replace(hg_url, '${hg_url}')
|
||||
b_url = b_url.replace(battrs['changeset'], '${changeset}')
|
||||
|
||||
src += ' {} = rec {{\n'.format(bundle)
|
||||
src += ' changeset = "{}";\n'.format(battrs['changeset'])
|
||||
src += ' url = "{}";\n'.format(b_url)
|
||||
src += ' sha256 = "{}";\n'.format(battrs['sha256'])
|
||||
src += ' };\n'
|
||||
|
||||
if bundle != BUNDLES[-1]:
|
||||
src += '\n'
|
||||
|
||||
src += ' };\n'
|
||||
src += ' };\n'
|
||||
|
||||
return src
|
||||
|
||||
def generate_sources(jdks):
|
||||
src = '# This file is autogenerated from update.py in the same directory.\n'
|
||||
src += '{\n'
|
||||
|
||||
for jdk in jdks:
|
||||
print()
|
||||
print('Generating sources for JDK {}...'.format(jdk))
|
||||
src += generate_jdk(jdk)
|
||||
|
||||
src += '}\n'
|
||||
return src
|
||||
|
||||
if __name__ == '__main__':
|
||||
print('Generating {}...'.format(SRC_PATH))
|
||||
src = generate_sources(ICEDTEA_JDKS)
|
||||
|
||||
f = open(SRC_PATH, 'w', encoding = 'utf-8')
|
||||
f.write(src)
|
||||
f.close()
|
||||
|
||||
print()
|
||||
print('Update complete!')
|
||||
@@ -1,24 +1,32 @@
|
||||
{ cabal, ansiTerminal, ansiWlPprint, binary, boehmgc, Cabal
|
||||
, filepath, gmp, happy, haskeline, languageJava, libffi
|
||||
, llvmGeneral, llvmGeneralPure, mtl, parsec, parsers, split, text
|
||||
, time, transformers, trifecta, unorderedContainers, utf8String
|
||||
, vector, vectorBinaryInstances
|
||||
# This file was auto-generated by cabal2nix. Please do NOT edit manually!
|
||||
|
||||
{ cabal, annotatedWlPprint, ansiTerminal, ansiWlPprint
|
||||
, base64Bytestring, binary, blazeHtml, blazeMarkup, boehmgc, Cabal
|
||||
, cheapskate, deepseq, filepath, fingertree, gmp, happy, haskeline
|
||||
, languageJava, lens, libffi, llvmGeneral, llvmGeneralPure, mtl
|
||||
, network, optparseApplicative, parsers, split, text, time
|
||||
, transformers, trifecta, unorderedContainers, utf8String, vector
|
||||
, vectorBinaryInstances, xml, zlib
|
||||
}:
|
||||
|
||||
cabal.mkDerivation (self: {
|
||||
pname = "idris";
|
||||
version = "0.9.9.3";
|
||||
sha256 = "1l19xx0xbcwlnnh2w0rmri7wwixffzfrafpbji64nwyx1awz4iab";
|
||||
isLibrary = false;
|
||||
version = "0.9.14.1";
|
||||
sha256 = "11x4f0hvd51m9rlf9r0i5xsjmc73kjsayny4xyv0wgb88v9v737b";
|
||||
isLibrary = true;
|
||||
isExecutable = true;
|
||||
buildDepends = [
|
||||
ansiTerminal ansiWlPprint binary Cabal filepath haskeline
|
||||
languageJava libffi llvmGeneral llvmGeneralPure mtl parsec parsers
|
||||
split text time transformers trifecta unorderedContainers
|
||||
utf8String vector vectorBinaryInstances
|
||||
annotatedWlPprint ansiTerminal ansiWlPprint base64Bytestring binary
|
||||
blazeHtml blazeMarkup Cabal cheapskate deepseq filepath fingertree
|
||||
haskeline languageJava lens libffi llvmGeneral llvmGeneralPure mtl
|
||||
network optparseApplicative parsers split text time transformers
|
||||
trifecta unorderedContainers utf8String vector
|
||||
vectorBinaryInstances xml zlib
|
||||
];
|
||||
buildTools = [ happy ];
|
||||
extraLibraries = [ boehmgc gmp ];
|
||||
configureFlags = "-fllvm -fgmp -fffi";
|
||||
jailbreak = true;
|
||||
meta = {
|
||||
homepage = "http://www.idris-lang.org/";
|
||||
description = "Functional Programming Language with Dependent Types";
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{ gmp, makeWrapper, gcc, runCommand, idris_plain}:
|
||||
{ gmp, makeWrapper, gcc, runCommand, idris_plain, boehmgc}:
|
||||
|
||||
runCommand "idris-wrapper" {} ''
|
||||
source ${makeWrapper}/nix-support/setup-hook
|
||||
mkdir -p $out/bin
|
||||
ln -s ${idris_plain}/bin/idris $out/bin
|
||||
wrapProgram $out/bin/idris \
|
||||
--suffix NIX_CFLAGS_COMPILE : '"-I${gmp}/include -L${gmp}/lib"' \
|
||||
--suffix NIX_CFLAGS_COMPILE : '"-I${gmp}/include -L${gmp}/lib -L${boehmgc}/lib"' \
|
||||
--suffix PATH : ${gcc}/bin
|
||||
''
|
||||
|
||||
@@ -14,6 +14,6 @@ stdenv.mkDerivation rec {
|
||||
meta = {
|
||||
description = "Ikarus - a Scheme compiler, aiming at R6RS";
|
||||
homepage = http://ikarus-scheme.org/;
|
||||
license = "GPLv3";
|
||||
license = stdenv.lib.licenses.gpl3;
|
||||
};
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user