diff options
author | Peter Simons <simons@cryp.to> | 2015-03-05 12:24:57 +0100 |
---|---|---|
committer | Peter Simons <simons@cryp.to> | 2015-03-05 12:24:57 +0100 |
commit | 1d953779b06bcaee9159dc8fb697b8db2bcd7a18 (patch) | |
tree | 2edec3ba749d81478fba08be2e702e858687470f /pkgs/development/compilers | |
parent | 36c1a8a6c7b9fd137f4428dc802978cbc765bdd9 (diff) | |
parent | 17479728ecf1e7b435f914a59a7e6ce9f3228fe2 (diff) | |
download | nixlib-1d953779b06bcaee9159dc8fb697b8db2bcd7a18.tar nixlib-1d953779b06bcaee9159dc8fb697b8db2bcd7a18.tar.gz nixlib-1d953779b06bcaee9159dc8fb697b8db2bcd7a18.tar.bz2 nixlib-1d953779b06bcaee9159dc8fb697b8db2bcd7a18.tar.lz nixlib-1d953779b06bcaee9159dc8fb697b8db2bcd7a18.tar.xz nixlib-1d953779b06bcaee9159dc8fb697b8db2bcd7a18.tar.zst nixlib-1d953779b06bcaee9159dc8fb697b8db2bcd7a18.zip |
Merge remote-tracking branch 'origin/master' into staging.
Diffstat (limited to 'pkgs/development/compilers')
21 files changed, 305 insertions, 314 deletions
diff --git a/pkgs/development/compilers/chicken/default.nix b/pkgs/development/compilers/chicken/default.nix index a1eec63af561..3b9d4d391188 100644 --- a/pkgs/development/compilers/chicken/default.nix +++ b/pkgs/development/compilers/chicken/default.nix @@ -5,9 +5,9 @@ let platform = with stdenv; if isDarwin then "macosx" else if isCygwin then "cygwin" - else if isBSD then "bsd" + else if (isFreeBSD || isOpenBSD) then "bsd" else if isSunOS then "solaris" - else "linux"; # Should be a sane default + else "linux"; # Should be a sane default lib = stdenv.lib; in stdenv.mkDerivation { diff --git a/pkgs/development/compilers/cudatoolkit/5.5.nix b/pkgs/development/compilers/cudatoolkit/5.5.nix index aea58867a447..b42261638650 100644 --- a/pkgs/development/compilers/cudatoolkit/5.5.nix +++ b/pkgs/development/compilers/cudatoolkit/5.5.nix @@ -41,7 +41,7 @@ stdenv.mkDerivation rec { --set-interpreter "$(cat $NIX_CC/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_CC/nix-support/orig-gcc)/lib \ + --set-rpath $rpath:$out/jre/lib/amd64/jli:$out/lib:$out/lib64:$out/nvvm/lib:$out/nvvm/lib64:$(cat $NIX_CC/nix-support/orig-cc)/lib \ --force-rpath \ '{}' \; || true ''; diff --git a/pkgs/development/compilers/cudatoolkit/6.0.nix b/pkgs/development/compilers/cudatoolkit/6.0.nix index 558034721efe..49a52fe5d32e 100644 --- a/pkgs/development/compilers/cudatoolkit/6.0.nix +++ b/pkgs/development/compilers/cudatoolkit/6.0.nix @@ -41,7 +41,7 @@ stdenv.mkDerivation rec { --set-interpreter "$(cat $NIX_CC/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_CC/nix-support/orig-gcc)/lib \ + --set-rpath $rpath:$out/jre/lib/amd64/jli:$out/lib:$out/lib64:$out/nvvm/lib:$out/nvvm/lib64:$(cat $NIX_CC/nix-support/orig-cc)/lib \ --force-rpath \ '{}' \; || true ''; diff --git a/pkgs/development/compilers/cudatoolkit/6.5.nix b/pkgs/development/compilers/cudatoolkit/6.5.nix index 9f9d3bc94bfb..17156cd06647 100644 --- a/pkgs/development/compilers/cudatoolkit/6.5.nix +++ b/pkgs/development/compilers/cudatoolkit/6.5.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation rec { gtk2 glib fontconfig freetype unixODBC alsaLib ]; - rpath = "${stdenv.lib.makeLibraryPath runtimeDependencies}:${stdenv.gcc.gcc}/lib64"; + rpath = "${stdenv.lib.makeLibraryPath runtimeDependencies}:${stdenv.cc.cc}/lib64"; unpackPhase = '' sh $src --keep --noexec @@ -40,10 +40,10 @@ stdenv.mkDerivation rec { buildPhase = '' find . -type f -executable -exec patchelf \ - --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \ + --set-interpreter "$(cat $NIX_CC/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 \ + --set-rpath $rpath:$out/jre/lib/amd64/jli:$out/lib:$out/lib64:$out/nvvm/lib:$out/nvvm/lib64:$(cat $NIX_CC/nix-support/orig-cc)/lib \ --force-rpath \ '{}' \; || true ''; diff --git a/pkgs/development/compilers/gnatboot/default.nix b/pkgs/development/compilers/gnatboot/default.nix index b8e3c172739a..a209e392bc6f 100644 --- a/pkgs/development/compilers/gnatboot/default.nix +++ b/pkgs/development/compilers/gnatboot/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation { set +e for a in $out/bin/* ; do patchelf --interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ - --set-rpath $(cat $NIX_CC/nix-support/orig-libc)/lib:$(cat $NIX_CC/nix-support/orig-gcc)/lib64:$(cat $NIX_CC/nix-support/orig-gcc)/lib $a + --set-rpath $(cat $NIX_CC/nix-support/orig-libc)/lib:$(cat $NIX_CC/nix-support/orig-cc)/lib64:$(cat $NIX_CC/nix-support/orig-cc)/lib $a done set -e mv $out/bin/gnatgcc_2wrap $out/bin/gnatgcc diff --git a/pkgs/development/compilers/go/1.4.nix b/pkgs/development/compilers/go/1.4.nix index 9acb399aa1b4..371496250056 100644 --- a/pkgs/development/compilers/go/1.4.nix +++ b/pkgs/development/compilers/go/1.4.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchurl, fetchgit, bison, glibc, bash, coreutils, makeWrapper, tzdata, iana_etc, perl }: +{ stdenv, lib, fetchurl, fetchgit, bison, glibc, bash, coreutils, makeWrapper, tzdata, iana_etc, perl, Security }: let loader386 = "${glibc}/lib/ld-linux.so.2"; @@ -6,8 +6,8 @@ let loaderArm = "${glibc}/lib/ld-linux.so.3"; srcs = { golang = fetchurl { - url = https://github.com/golang/go/archive/go1.4.1.tar.gz; - sha256 = "1q21i08nymy30vszbcah8l8yjxm32x2wmjs44kn2x2r4556y1mgi"; + url = https://github.com/golang/go/archive/go1.4.2.tar.gz; + sha256 = "3e5d07bc5214a1ffe187cf6406c5b5a80ee44f12f6bca97a5463db0afee2f6ac"; }; tools = fetchgit { url = https://github.com/golang/tools.git; @@ -18,12 +18,14 @@ let in stdenv.mkDerivation { - name = "go-1.4.1"; + name = "go-1.4.2"; src = srcs.golang; # perl is used for testing go vet - buildInputs = [ bison bash makeWrapper perl ] ++ lib.optionals stdenv.isLinux [ glibc ] ; + buildInputs = [ bison bash makeWrapper perl ] + ++ lib.optionals stdenv.isLinux [ glibc ] + ++ lib.optionals stdenv.isDarwin [ Security ]; # I'm not sure what go wants from its 'src', but the go installation manual # describes an installation keeping the src. @@ -76,10 +78,13 @@ stdenv.mkDerivation { 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 = if stdenv.isDarwin then 0 else 1; + CGO_ENABLED = 1; + + # The go build actually checks for CC=*/clang and does something different, so we don't + # just want the generic `cc` here. + CC = if stdenv.isDarwin then "clang" else "cc"; installPhase = '' - export CC=cc mkdir -p "$out/bin" export GOROOT="$(pwd)/" export GOBIN="$out/bin" diff --git a/pkgs/development/compilers/microscheme/default.nix b/pkgs/development/compilers/microscheme/default.nix index a9f2fba9409f..9ed5b8950e95 100644 --- a/pkgs/development/compilers/microscheme/default.nix +++ b/pkgs/development/compilers/microscheme/default.nix @@ -1,27 +1,19 @@ -{ stdenv, fetchgit, vim, avrdude, avrgcclibc, makeWrapper }: +{ stdenv, fetchzip, vim, avrdude, avrgcclibc, makeWrapper }: stdenv.mkDerivation rec { name = "microscheme-${version}"; - version = "2015-02-04"; + version = "0.9.2"; - # externalize url/rev/sha256 to permit easier override - rev = "2f14781034a67adc081a22728fbf47a632f4484e"; - sha256 = "15bdlmchzbhxj262r2fj78wm4c4hfrap4kyzv8n5b624svszr0zd"; - url = https://github.com/ryansuchocki/microscheme.git; - - src = fetchgit { - inherit rev; - inherit sha256; - inherit url; + src = fetchzip { + name = "${name}-src"; + url = "https://github.com/ryansuchocki/microscheme/archive/v${version}.tar.gz"; + sha256 = "0ly1cphvnsip70kng9q0blb07pkyp9allav42sr6ybswqfqg60j9"; }; buildInputs = [ makeWrapper vim ]; installPhase = '' - mkdir -p $out/bin && make install PREFIX=$out - - mkdir -p $out/share/microscheme/ - cp -r examples/ $out/share/microscheme + make install PREFIX=$out wrapProgram $out/bin/microscheme \ --prefix PATH : "${avrdude}/bin:${avrgcclibc}/bin" diff --git a/pkgs/development/compilers/rustc/1.0.0-alpha.nix b/pkgs/development/compilers/rustc/1.0.0-alpha.nix index fa80bcb5e02c..7a2e485c9c62 100644 --- a/pkgs/development/compilers/rustc/1.0.0-alpha.nix +++ b/pkgs/development/compilers/rustc/1.0.0-alpha.nix @@ -1,90 +1,17 @@ -{stdenv, fetchurl, which, file, perl, curl, python27, makeWrapper -, tzdata, git, valgrind, procps, coreutils -}: - -assert !stdenv.isFreeBSD; - -/* Rust's build process has a few quirks : - -- It requires some patched in llvm that haven't landed upstream, so it - compiles its own llvm. This might change in the future, so at some - point we may be able to switch to nix's llvm. - -- The Rust compiler is written is Rust, so it requires a bootstrap - compiler, which is downloaded during the build. To make the build - pure, we download it ourself before and put it where it is - expected. Once the language is stable (1.0) , we might want to - switch it to use nix's packaged rust compiler. - -*/ - -with ((import ./common.nix) {inherit stdenv; version = "1.0.0-alpha"; }); - -let snapshotHash = if stdenv.system == "i686-linux" - then "d8b73fc9aa3ad72ce1408a41e35d78dba10eb4d4" - else if stdenv.system == "x86_64-linux" - then "697880d3640e981bbbf23284363e8e9a158b588d" - else if stdenv.system == "i686-darwin" - then "a73b1fc03e8cac747aab0aa186292bb4332a7a98" - else if stdenv.system == "x86_64-darwin" - then "e4ae2670ea4ba5c2e5b4245409c9cab45c9eeb5b" - else abort "no-snapshot for platform ${stdenv.system}"; - snapshotDate = "2015-01-07"; - snapshotRev = "9e4e524"; - snapshotName = "rust-stage0-${snapshotDate}-${snapshotRev}-${platform}-${snapshotHash}.tar.bz2"; - -in stdenv.mkDerivation { - inherit name; - inherit version; - inherit meta; - - src = fetchurl { - url = "http://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"; - sha256 = "0p62gx3s087n09d2v3l9iyfx5cmsa1x91n4ysixcb7w3drr8a8is"; - }; - - # We need rust to build rust. If we don't provide it, configure will try to download it. - snapshot = stdenv.mkDerivation { - name = "rust-stage0"; - src = fetchurl { - url = "http://static.rust-lang.org/stage0-snapshots/${snapshotName}"; - sha1 = snapshotHash; - }; - dontStrip = true; - installPhase = '' - mkdir -p "$out" - cp -r bin "$out/bin" - '' + (if stdenv.isLinux then '' - patchelf --interpreter "${stdenv.glibc}/lib/${stdenv.cc.dynamicLinker}" \ - --set-rpath "${stdenv.cc.cc}/lib/:${stdenv.cc.cc}/lib64/" \ - "$out/bin/rustc" - '' else ""); - }; - - configureFlags = [ "--enable-local-rust" "--local-rust-root=$snapshot" ] - ++ stdenv.lib.optional (stdenv.cc ? clang) "--enable-clang"; - - # The compiler requires cc, so we patch the source to tell it where to find it - patches = [ ./hardcode_paths.patch ./local_stage0.patch ] - ++ stdenv.lib.optional stdenv.needsPax ./grsec.patch; - - postPatch = '' - substituteInPlace src/librustc_trans/back/link.rs \ - --subst-var-by "ccPath" "${stdenv.cc}/bin/cc" - substituteInPlace src/librustc_back/archive.rs \ - --subst-var-by "arPath" "${stdenv.cc.binutils}/bin/ar" - - substituteInPlace src/rust-installer/gen-install-script.sh \ - --replace /bin/echo "${coreutils}/bin/echo" - substituteInPlace src/rust-installer/gen-installer.sh \ - --replace /bin/echo "${coreutils}/bin/echo" - ''; - - buildInputs = [ which file perl curl python27 makeWrapper git valgrind procps ]; - - enableParallelBuilding = false; # disabled due to rust-lang/rust#16305 - - preCheck = "export TZDIR=${tzdata}/share/zoneinfo"; - - doCheck = true; +{ stdenv, callPackage }: +callPackage ./makeRustcDerivation.nix { + shortVersion = "1.0.0-alpha"; + isRelease = true; + srcSha = "0p62gx3s087n09d2v3l9iyfx5cmsa1x91n4ysixcb7w3drr8a8is"; + snapshotHashLinux686 = "d8b73fc9aa3ad72ce1408a41e35d78dba10eb4d4"; + snapshotHashLinux64 = "697880d3640e981bbbf23284363e8e9a158b588d"; + snapshotHashDarwin686 = "a73b1fc03e8cac747aab0aa186292bb4332a7a98"; + snapshotHashDarwin64 = "e4ae2670ea4ba5c2e5b4245409c9cab45c9eeb5b"; + snapshotDate = "2015-01-07"; + snapshotRev = "9e4e524"; + patches = [ + ./patches/hardcode_paths.alpha.patch + ./patches/local_stage0.alpha.patch + ] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch; } + diff --git a/pkgs/development/compilers/rustc/1.0.0-alpha2.nix b/pkgs/development/compilers/rustc/1.0.0-alpha2.nix new file mode 100644 index 000000000000..94bdd995592f --- /dev/null +++ b/pkgs/development/compilers/rustc/1.0.0-alpha2.nix @@ -0,0 +1,16 @@ +{ stdenv, callPackage }: +callPackage ./makeRustcDerivation.nix { + shortVersion = "1.0.0-alpha.2"; + isRelease = true; + srcSha = "1j2n34w0hdz7jrl100c9q9hl80l8nsc3xwnzizv9sh4gx52vjcd9"; + snapshotHashLinux686 = "191ed5ec4f17e32d36abeade55a1c6085e51245c"; + snapshotHashLinux64 = "acec86045632f4f3f085c072ba696f889906dffe"; + snapshotHashDarwin686 = "9d9e622584bfa318f32bcb5b9ce6a365febff595"; + snapshotHashDarwin64 = "e96c1e9860b186507cc75c186d1b96d44df12292"; + snapshotDate = "2015-02-17"; + snapshotRev = "f1bb6c2"; + patches = [ + ./patches/alpha2.patch + ] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch; +} + diff --git a/pkgs/development/compilers/rustc/common.nix b/pkgs/development/compilers/rustc/common.nix deleted file mode 100644 index 8debb4342dac..000000000000 --- a/pkgs/development/compilers/rustc/common.nix +++ /dev/null @@ -1,35 +0,0 @@ -{stdenv, version}: - -{ - inherit version; - - platform = if stdenv.system == "i686-linux" - then "linux-i386" - else if stdenv.system == "x86_64-linux" - then "linux-x86_64" - else if stdenv.system == "i686-darwin" - then "macos-i386" - else if stdenv.system == "x86_64-darwin" - then "macos-x86_64" - else abort "no snapshot to bootstrap for this platform (missing platform url suffix)"; - - target = if stdenv.system == "i686-linux" - then "i686-unknown-linux-gnu" - else if stdenv.system == "x86_64-linux" - then "x86_64-unknown-linux-gnu" - else if stdenv.system == "i686-darwin" - then "i686-apple-darwin" - else if stdenv.system == "x86_64-darwin" - then "x86_64-apple-darwin" - else abort "no snapshot to bootstrap for this platform (missing target triple)"; - - meta = with stdenv.lib; { - homepage = http://www.rust-lang.org/; - description = "A safe, concurrent, practical language"; - maintainers = with maintainers; [ madjar cstrahan wizeman ]; - license = map (builtins.getAttr "shortName") [ licenses.mit licenses.asl20 ]; - platforms = platforms.linux; - }; - - name = "rustc-${version}"; -} diff --git a/pkgs/development/compilers/rustc/grsec.HEAD.patch b/pkgs/development/compilers/rustc/grsec.HEAD.patch deleted file mode 100644 index 84582ab7d70f..000000000000 --- a/pkgs/development/compilers/rustc/grsec.HEAD.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/src/test/run-make/relocation-model/Makefile b/src/test/run-make/relocation-model/Makefile -index 2fcdd32..2d9ddb0 100644 ---- a/src/test/run-make/relocation-model/Makefile -+++ b/src/test/run-make/relocation-model/Makefile -@@ -5,9 +5,11 @@ all: - $(call RUN,foo) - - $(RUSTC) -C relocation-model=default foo.rs -+ paxctl -czexm $(TMPDIR)/foo - $(call RUN,foo) - - $(RUSTC) -C relocation-model=static foo.rs -+ paxctl -czexm $(TMPDIR)/foo - $(call RUN,foo) - - $(RUSTC) -C relocation-model=default --crate-type=dylib foo.rs diff --git a/pkgs/development/compilers/rustc/hardcode_paths.patch b/pkgs/development/compilers/rustc/hardcode_paths.patch deleted file mode 100644 index 2a9cb09dcbd3..000000000000 --- a/pkgs/development/compilers/rustc/hardcode_paths.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/src/librustc_back/archive.rs b/src/librustc_back/archive.rs -index 7ea192b..cd5d01b 100644 ---- a/src/librustc_back/archive.rs -+++ b/src/librustc_back/archive.rs -@@ -54,7 +54,7 @@ fn run_ar(handler: &ErrorHandler, maybe_ar_prog: &Option<String>, - paths: &[&Path]) -> ProcessOutput { - let ar = match *maybe_ar_prog { - Some(ref ar) => &ar[], -- None => "ar" -+ None => "@arPath@" - }; - let mut cmd = Command::new(ar); - -diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs -index dacf620..815ce60 100644 ---- a/src/librustc_trans/back/link.rs -+++ b/src/librustc_trans/back/link.rs -@@ -348,8 +348,8 @@ pub fn mangle_internal_name_by_path_and_seq(path: PathElems, flav: &str) -> Stri - - pub fn get_cc_prog(sess: &Session) -> String { - match sess.opts.cg.linker { -- Some(ref linker) => return linker.to_string(), -- None => sess.target.target.options.linker.clone(), -+ Some(ref linker) => linker.to_string(), -+ None => "@ccPath@".to_string(), - } - } - diff --git a/pkgs/development/compilers/rustc/head.nix b/pkgs/development/compilers/rustc/head.nix index dd73449d5fd0..5669b15a7000 100644 --- a/pkgs/development/compilers/rustc/head.nix +++ b/pkgs/development/compilers/rustc/head.nix @@ -1,101 +1,18 @@ -{ stdenv, fetchurl, fetchgit, which, file, perl, curl, python27, makeWrapper -, tzdata, git, valgrind, procps, coreutils -}: - -assert !stdenv.isFreeBSD; - -/* Rust's build process has a few quirks : - -- It requires some patched in llvm that haven't landed upstream, so it - compiles its own llvm. This might change in the future, so at some - point we may be able to switch to nix's llvm. - -- The Rust compiler is written is Rust, so it requires a bootstrap - compiler, which is downloaded during the build. To make the build - pure, we download it ourself before and put it where it is - expected. Once the language is stable (1.0) , we might want to - switch it to use nix's packaged rust compiler. - - -NOTE : some derivation depend on rust. When updating this, please make -sure those derivations still compile. (racer, for example). - -*/ - -let shortVersion = "1.0.0-dev"; - rev = "a833337943300db1c310a4cf9c84b7b4ef4e9468"; - revShort = builtins.substring 0 7 rev; -in - -with ((import ./common.nix) {inherit stdenv; version = "${shortVersion}-g${revShort}"; }); - -let snapshotHash = if stdenv.system == "i686-linux" - then "0197ad7179d74eba06a8b46432548caf226aa03d" - else if stdenv.system == "x86_64-linux" - then "03459f8b216e96ed8b9abe25a42a75859195103d" - else if stdenv.system == "i686-darwin" - then "b5c004883ddff84159f11a3329cde682e0b7f75b" - else if stdenv.system == "x86_64-darwin" - then "b69ea42e1c995682adf0390ed4ef8a762c001a4e" - else abort "no snapshot for platform ${stdenv.system}"; - snapshotDate = "2015-01-15"; - snapshotRev = "9ade482"; - snapshotName = "rust-stage0-${snapshotDate}-${snapshotRev}-${platform}-${snapshotHash}.tar.bz2"; -in - -stdenv.mkDerivation { - inherit name; - inherit version; - inherit meta; - - src = fetchgit { - url = https://github.com/rust-lang/rust; - inherit rev; - sha256 = "1b9rnx3j37ckxa3vf20g8amsbffzvk2m9lzv5x1m04ci54w85f56"; - }; - - # We need rust to build rust. If we don't provide it, configure will try to download it. - snapshot = stdenv.mkDerivation { - name = "rust-stage0"; - src = fetchurl { - url = "http://static.rust-lang.org/stage0-snapshots/${snapshotName}"; - sha1 = snapshotHash; - }; - dontStrip = true; - installPhase = '' - mkdir -p "$out" - cp -r bin "$out/bin" - '' + (if stdenv.isLinux then '' - patchelf --interpreter "${stdenv.glibc}/lib/${stdenv.cc.dynamicLinker}" \ - --set-rpath "${stdenv.cc.cc}/lib/:${stdenv.cc.cc}/lib64/" \ - "$out/bin/rustc" - '' else ""); - }; - - configureFlags = [ "--enable-local-rust" "--local-rust-root=$snapshot" ] - ++ stdenv.lib.optional (stdenv.cc ? clang) "--enable-clang"; - - # The compiler requires cc, so we patch the source to tell it where to find it - patches = [ ./hardcode_paths.HEAD.patch ./local_stage0.HEAD.patch ] - ++ stdenv.lib.optional stdenv.needsPax ./grsec.HEAD.patch; - - postPatch = '' - substituteInPlace src/librustc_trans/back/link.rs \ - --subst-var-by "ccPath" "${stdenv.cc}/bin/cc" - substituteInPlace src/librustc_back/archive.rs \ - --subst-var-by "arPath" "${stdenv.cc.binutils}/bin/ar" - - substituteInPlace src/rust-installer/gen-install-script.sh \ - --replace /bin/echo "${coreutils}/bin/echo" - substituteInPlace src/rust-installer/gen-installer.sh \ - --replace /bin/echo "${coreutils}/bin/echo" - ''; - - buildInputs = [ which file perl curl python27 makeWrapper git valgrind procps ]; - - enableParallelBuilding = false; # disabled due to rust-lang/rust#16305 - - preCheck = "export TZDIR=${tzdata}/share/zoneinfo"; - - doCheck = true; +{ stdenv, callPackage }: +callPackage ./makeRustcDerivation.nix { + shortVersion = "1.0.0-dev"; + isRelease = false; + # src rev for master on 2015/03/01 + srcRev = "157614249594f187f421cd97f928e64c5ab5c1fa"; + srcSha = "06d6fwl1dg6wfnwa002ak89hnjplpf2sjhg78yjg4ki0ca7b0b74"; + snapshotHashLinux686 = "3278ebbce8cb269acc0614dac5ddac07eab6a99c"; + snapshotHashLinux64 = "72287d0d88de3e5a53bae78ac0d958e1a7637d73"; + snapshotHashDarwin686 = "33b366b5287427a340a0aa6ed886d5ff4edf6a76"; + snapshotHashDarwin64 = "914bf9baa32081a9d5633f1d06f4d382cd71504e"; + snapshotDate = "2015-02-25"; + snapshotRev = "880fb89"; + patches = [ + ./patches/head.patch + ] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch; } + diff --git a/pkgs/development/compilers/rustc/local_stage0.patch b/pkgs/development/compilers/rustc/local_stage0.patch deleted file mode 100644 index 2f38d7c1757c..000000000000 --- a/pkgs/development/compilers/rustc/local_stage0.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/src/etc/local_stage0.sh b/src/etc/local_stage0.sh -index e78f231..6b6773b 100755 ---- a/src/etc/local_stage0.sh -+++ b/src/etc/local_stage0.sh -@@ -53,11 +53,6 @@ - fi - - cp ${PREFIX}/bin/rustc${BIN_SUF} ${TARG_DIR}/stage0/bin/ --cp ${PREFIX}/${LIB_DIR}/${RUSTLIBDIR}/${TARG_DIR}/${LIB_DIR}/* ${TARG_DIR}/stage0/${LIB_DIR}/ --cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}extra*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/ --cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}rust*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/ --cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}std*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/ --cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}syntax*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/ - - # do not fail if one of the above fails, as all we need is a working rustc! - exit 0 diff --git a/pkgs/development/compilers/rustc/makeRustcDerivation.nix b/pkgs/development/compilers/rustc/makeRustcDerivation.nix new file mode 100644 index 000000000000..7be005fb763e --- /dev/null +++ b/pkgs/development/compilers/rustc/makeRustcDerivation.nix @@ -0,0 +1,140 @@ +{ stdenv, fetchurl, fetchgit, which, file, perl, curl, python27, makeWrapper +, tzdata, git, valgrind, procps, coreutils + +, shortVersion, isRelease +, srcSha, srcRev ? "" +, snapshotHashLinux686, snapshotHashLinux64 +, snapshotHashDarwin686, snapshotHashDarwin64 +, snapshotDate, snapshotRev + +, patches +}: + +assert !stdenv.isFreeBSD; + +/* Rust's build process has a few quirks : + +- It requires some patched in llvm that haven't landed upstream, so it + compiles its own llvm. This might change in the future, so at some + point we may be able to switch to nix's llvm. + +- The Rust compiler is written is Rust, so it requires a bootstrap + compiler, which is downloaded during the build. To make the build + pure, we download it ourself before and put it where it is + expected. Once the language is stable (1.0) , we might want to + switch it to use nix's packaged rust compiler. + +NOTE : some derivation depend on rust. When updating this, please make +sure those derivations still compile. (racer, for example). + +*/ + +assert (if isRelease then srcRev == "" else srcRev != ""); + +let version = if isRelease then + "${shortVersion}" + else + "${shortVersion}-g${builtins.substring 0 7 srcRev}"; + + name = "rustc-${version}"; + + platform = if stdenv.system == "i686-linux" + then "linux-i386" + else if stdenv.system == "x86_64-linux" + then "linux-x86_64" + else if stdenv.system == "i686-darwin" + then "macos-i386" + else if stdenv.system == "x86_64-darwin" + then "macos-x86_64" + else abort "no snapshot to bootstrap for this platform (missing platform url suffix)"; + + target = if stdenv.system == "i686-linux" + then "i686-unknown-linux-gnu" + else if stdenv.system == "x86_64-linux" + then "x86_64-unknown-linux-gnu" + else if stdenv.system == "i686-darwin" + then "i686-apple-darwin" + else if stdenv.system == "x86_64-darwin" + then "x86_64-apple-darwin" + else abort "no snapshot to bootstrap for this platform (missing target triple)"; + + meta = with stdenv.lib; { + homepage = http://www.rust-lang.org/; + description = "A safe, concurrent, practical language"; + maintainers = with maintainers; [ madjar cstrahan wizeman ]; + license = map (builtins.getAttr "shortName") [ licenses.mit licenses.asl20 ]; + platforms = platforms.linux; + }; + + snapshotHash = if stdenv.system == "i686-linux" + then snapshotHashLinux686 + else if stdenv.system == "x86_64-linux" + then snapshotHashLinux64 + else if stdenv.system == "i686-darwin" + then snapshotHashDarwin686 + else if stdenv.system == "x86_64-darwin" + then snapshotHashDarwin64 + else abort "no snapshot for platform ${stdenv.system}"; + snapshotName = "rust-stage0-${snapshotDate}-${snapshotRev}-${platform}-${snapshotHash}.tar.bz2"; +in + +stdenv.mkDerivation { + inherit name; + inherit version; + inherit meta; + + src = if isRelease then + fetchurl { + url = "http://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"; + sha256 = srcSha; + } + else + fetchgit { + url = https://github.com/rust-lang/rust; + rev = srcRev; + sha256 = srcSha; + }; + + # We need rust to build rust. If we don't provide it, configure will try to download it. + snapshot = stdenv.mkDerivation { + name = "rust-stage0"; + src = fetchurl { + url = "http://static.rust-lang.org/stage0-snapshots/${snapshotName}"; + sha1 = snapshotHash; + }; + dontStrip = true; + installPhase = '' + mkdir -p "$out" + cp -r bin "$out/bin" + '' + (if stdenv.isLinux then '' + patchelf --interpreter "${stdenv.glibc}/lib/${stdenv.cc.dynamicLinker}" \ + --set-rpath "${stdenv.cc.cc}/lib/:${stdenv.cc.cc}/lib64/" \ + "$out/bin/rustc" + '' else ""); + }; + + configureFlags = [ "--enable-local-rust" "--local-rust-root=$snapshot" ] + ++ stdenv.lib.optional (stdenv.cc ? clang) "--enable-clang"; + + inherit patches; + + postPatch = '' + substituteInPlace src/librustc_trans/back/link.rs \ + --subst-var-by "ccPath" "${stdenv.cc}/bin/cc" + substituteInPlace src/librustc_back/archive.rs \ + --subst-var-by "arPath" "${stdenv.cc.binutils}/bin/ar" + + substituteInPlace src/rust-installer/gen-install-script.sh \ + --replace /bin/echo "${coreutils}/bin/echo" + substituteInPlace src/rust-installer/gen-installer.sh \ + --replace /bin/echo "${coreutils}/bin/echo" + ''; + + buildInputs = [ which file perl curl python27 makeWrapper git valgrind procps ]; + + enableParallelBuilding = false; # disabled due to rust-lang/rust#16305 + + preCheck = "export TZDIR=${tzdata}/share/zoneinfo"; + + doCheck = true; +} diff --git a/pkgs/development/compilers/rustc/patches/alpha2.patch b/pkgs/development/compilers/rustc/patches/alpha2.patch new file mode 100644 index 000000000000..8c15af5aca9b --- /dev/null +++ b/pkgs/development/compilers/rustc/patches/alpha2.patch @@ -0,0 +1,44 @@ +diff --git a/src/etc/local_stage0.sh b/src/etc/local_stage0.sh +index b506aff..b4b346b 100755 +--- a/src/etc/local_stage0.sh ++++ b/src/etc/local_stage0.sh +@@ -50,11 +50,6 @@ if [ -z $TARG_DIR ]; then + fi + + cp ${PREFIX}/bin/rustc${BIN_SUF} ${TARG_DIR}/stage0/bin/ +-cp ${PREFIX}/${LIB_DIR}/${RUSTLIBDIR}/${TARG_DIR}/${LIB_DIR}/* ${TARG_DIR}/stage0/${LIB_DIR}/ +-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}extra*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/ +-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}rust*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/ +-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}std*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/ +-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}syntax*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/ + + # do not fail if one of the above fails, as all we need is a working rustc! + exit 0 +diff --git a/src/librustc_back/archive.rs b/src/librustc_back/archive.rs +index c45ee25..0f91672 100644 +--- a/src/librustc_back/archive.rs ++++ b/src/librustc_back/archive.rs +@@ -54,7 +54,7 @@ fn run_ar(handler: &ErrorHandler, maybe_ar_prog: &Option<String>, + paths: &[&Path]) -> ProcessOutput { + let ar = match *maybe_ar_prog { + Some(ref ar) => &ar[..], +- None => "ar" ++ None => "@arPath@" + }; + let mut cmd = Command::new(ar); + +diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs +index ef849bb..e090b99 100644 +--- a/src/librustc_trans/back/link.rs ++++ b/src/librustc_trans/back/link.rs +@@ -350,8 +350,8 @@ pub fn mangle_internal_name_by_path_and_seq(path: PathElems, flav: &str) -> Stri + + pub fn get_cc_prog(sess: &Session) -> String { + match sess.opts.cg.linker { +- Some(ref linker) => return linker.to_string(), +- None => sess.target.target.options.linker.clone(), ++ Some(ref linker) => linker.to_string(), ++ None => "@ccPath@".to_string(), + } + } + diff --git a/pkgs/development/compilers/rustc/grsec.patch b/pkgs/development/compilers/rustc/patches/grsec.patch index 84582ab7d70f..84582ab7d70f 100644 --- a/pkgs/development/compilers/rustc/grsec.patch +++ b/pkgs/development/compilers/rustc/patches/grsec.patch diff --git a/pkgs/development/compilers/rustc/hardcode_paths.HEAD.patch b/pkgs/development/compilers/rustc/patches/hardcode_paths.alpha.patch index 2a9cb09dcbd3..2a9cb09dcbd3 100644 --- a/pkgs/development/compilers/rustc/hardcode_paths.HEAD.patch +++ b/pkgs/development/compilers/rustc/patches/hardcode_paths.alpha.patch diff --git a/pkgs/development/compilers/rustc/patches/head.patch b/pkgs/development/compilers/rustc/patches/head.patch new file mode 100644 index 000000000000..a0ecdaeb0495 --- /dev/null +++ b/pkgs/development/compilers/rustc/patches/head.patch @@ -0,0 +1,44 @@ +diff --git a/src/etc/local_stage0.sh b/src/etc/local_stage0.sh +index ca59b1c..65ee7bf 100755 +--- a/src/etc/local_stage0.sh ++++ b/src/etc/local_stage0.sh +@@ -50,11 +50,6 @@ if [ -z $TARG_DIR ]; then + fi + + cp ${PREFIX}/bin/rustc${BIN_SUF} ${TARG_DIR}/stage0/bin/ +-cp ${PREFIX}/${LIB_DIR}/${RUSTLIBDIR}/${TARG_DIR}/${LIB_DIR}/* ${TARG_DIR}/stage0/${LIB_DIR}/ +-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}extra*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/ +-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}rust*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/ +-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}std*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/ +-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}syntax*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/ + + # do not fail if one of the above fails, as all we need is a working rustc! + exit 0 +diff --git a/src/librustc_back/archive.rs b/src/librustc_back/archive.rs +index 6bf7453..319f9af 100644 +--- a/src/librustc_back/archive.rs ++++ b/src/librustc_back/archive.rs +@@ -54,7 +54,7 @@ fn run_ar(handler: &ErrorHandler, maybe_ar_prog: &Option<String>, + paths: &[&Path]) -> ProcessOutput { + let ar = match *maybe_ar_prog { + Some(ref ar) => &ar[..], +- None => "ar" ++ None => "@arPath@" + }; + let mut cmd = Command::new(ar); + +diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs +index ea5001a..911445c 100644 +--- a/src/librustc_trans/back/link.rs ++++ b/src/librustc_trans/back/link.rs +@@ -350,8 +350,8 @@ pub fn mangle_internal_name_by_path_and_seq(path: PathElems, flav: &str) -> Stri + + pub fn get_cc_prog(sess: &Session) -> String { + match sess.opts.cg.linker { +- Some(ref linker) => return linker.to_string(), +- None => sess.target.target.options.linker.clone(), ++ Some(ref linker) => linker.to_string(), ++ None => "@ccPath@".to_string(), + } + } + diff --git a/pkgs/development/compilers/rustc/local_stage0.HEAD.patch b/pkgs/development/compilers/rustc/patches/local_stage0.alpha.patch index 2f38d7c1757c..2f38d7c1757c 100644 --- a/pkgs/development/compilers/rustc/local_stage0.HEAD.patch +++ b/pkgs/development/compilers/rustc/patches/local_stage0.alpha.patch diff --git a/pkgs/development/compilers/yap/default.nix b/pkgs/development/compilers/yap/default.nix index 5bab88e9c41a..f9b587c05049 100644 --- a/pkgs/development/compilers/yap/default.nix +++ b/pkgs/development/compilers/yap/default.nix @@ -20,5 +20,6 @@ stdenv.mkDerivation rec { maintainers = [ stdenv.lib.maintainers.simons ]; platforms = stdenv.lib.platforms.linux; + broken = !stdenv.is64bit; # the linux 32 bit build fails. }; } |