diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2017-09-28 12:32:57 -0400 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2017-09-28 12:32:57 -0400 |
commit | f037625f87b0b1d8852a1f31ebaece5fdbc87a2b (patch) | |
tree | af8c8369954890db69195a1e9394ce16c7640d7f /pkgs/development/compilers | |
parent | f08d6f0e2daf9f3d9daa070eee223855b33c430d (diff) | |
parent | 4e22e88b914ffb63393449c5e20fe8843a7ce93b (diff) | |
download | nixlib-f037625f87b0b1d8852a1f31ebaece5fdbc87a2b.tar nixlib-f037625f87b0b1d8852a1f31ebaece5fdbc87a2b.tar.gz nixlib-f037625f87b0b1d8852a1f31ebaece5fdbc87a2b.tar.bz2 nixlib-f037625f87b0b1d8852a1f31ebaece5fdbc87a2b.tar.lz nixlib-f037625f87b0b1d8852a1f31ebaece5fdbc87a2b.tar.xz nixlib-f037625f87b0b1d8852a1f31ebaece5fdbc87a2b.tar.zst nixlib-f037625f87b0b1d8852a1f31ebaece5fdbc87a2b.zip |
Merge remote-tracking branch 'upstream/staging' into deps-reorg
Diffstat (limited to 'pkgs/development/compilers')
26 files changed, 809 insertions, 231 deletions
diff --git a/pkgs/development/compilers/compcert/default.nix b/pkgs/development/compilers/compcert/default.nix index f519776b6891..a12f1c42ba61 100644 --- a/pkgs/development/compilers/compcert/default.nix +++ b/pkgs/development/compilers/compcert/default.nix @@ -7,11 +7,11 @@ assert lib.versionAtLeast ocamlPackages.ocaml.version "4.02"; stdenv.mkDerivation rec { name = "compcert-${version}"; - version = "3.0.1"; + version = "3.1"; src = fetchurl { url = "http://compcert.inria.fr/release/${name}.tgz"; - sha256 = "0dgrj26dzdy4n3s9b5hwc6lm54vans1v4qx9hdp1q8w1qqcdriq9"; + sha256 = "0irfwlw2chalp0g2gw0makc699hn3z37sha1a239p9d90mzx03cx"; }; buildInputs = [ coq ] @@ -20,6 +20,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; configurePhase = '' + substituteInPlace VERSION --replace '3.0.1' '3.1' substituteInPlace ./configure --replace '{toolprefix}gcc' '{toolprefix}cc' ./configure -clightgen -prefix $out -toolprefix ${tools}/bin/ '' + (if stdenv.isDarwin then "x86_64-macosx" else "x86_64-linux"); @@ -39,7 +40,7 @@ stdenv.mkDerivation rec { meta = with stdenv.lib; { description = "Formally verified C compiler"; homepage = "http://compcert.inria.fr"; - license = licenses.inria; + license = licenses.inria-compcert; platforms = platforms.linux ++ platforms.darwin; maintainers = with maintainers; [ thoughtpolice jwiegley vbgl ]; diff --git a/pkgs/development/compilers/dmd/2.067.1.nix b/pkgs/development/compilers/dmd/2.067.1.nix index 3cf530e9e5e8..6fab56e4e7da 100644 --- a/pkgs/development/compilers/dmd/2.067.1.nix +++ b/pkgs/development/compilers/dmd/2.067.1.nix @@ -43,6 +43,7 @@ stdenv.mkDerivation rec { # Compile with PIC to prevent colliding modules with binutils 2.28. # https://issues.dlang.org/show_bug.cgi?id=17375 usePIC = "-fPIC"; + ROOT_HOME_DIR = "$(echo ~root)"; postPatch = '' # Ugly hack so the dlopen call has a chance to succeed. @@ -67,19 +68,23 @@ stdenv.mkDerivation rec { --replace g++ $CXX '' - + stdenv.lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace dmd/src/root/port.c \ - --replace "#include <bits/mathdef.h>" "#include <complex.h>" - '' + + stdenv.lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace dmd/src/root/port.c \ + --replace "#include <bits/mathdef.h>" "#include <complex.h>" - + stdenv.lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace dmd/src/posix.mak \ - --replace MACOSX_DEPLOYMENT_TARGET MACOSX_DEPLOYMENT_TARGET_ + # See https://github.com/NixOS/nixpkgs/issues/29443 + substituteInPlace phobos/std/path.d \ + --replace "\"/root" "\"${ROOT_HOME_DIR}" + '' + + + stdenv.lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace dmd/src/posix.mak \ + --replace MACOSX_DEPLOYMENT_TARGET MACOSX_DEPLOYMENT_TARGET_ - # Was not able to compile on darwin due to "__inline_isnanl" - # being undefined. - substituteInPlace dmd/src/root/port.c --replace __inline_isnanl __inline_isnan - ''; + # Was not able to compile on darwin due to "__inline_isnanl" + # being undefined. + substituteInPlace dmd/src/root/port.c --replace __inline_isnanl __inline_isnan + ''; nativeBuildInputs = [ makeWrapper unzip which ]; buildInputs = [ curl tzdata ]; @@ -96,7 +101,8 @@ stdenv.mkDerivation rec { cd .. ''; - doCheck = true; + # disable check phase because some tests are not working with sandboxing + doCheck = false; checkPhase = '' cd dmd diff --git a/pkgs/development/compilers/dmd/default.nix b/pkgs/development/compilers/dmd/default.nix index 2b29ba9aa3e8..27f70b8d6c71 100644 --- a/pkgs/development/compilers/dmd/default.nix +++ b/pkgs/development/compilers/dmd/default.nix @@ -1,6 +1,6 @@ { stdenv, fetchFromGitHub , makeWrapper, unzip, which -, curl, tzdata, gdb +, curl, tzdata, gdb, darwin # Versions 2.070.2 and up require a working dmd compiler to build: , bootstrapDmd }: @@ -73,7 +73,12 @@ stdenv.mkDerivation rec { --replace MACOSX_DEPLOYMENT_TARGET MACOSX_DEPLOYMENT_TARGET_ ''; - nativeBuildInputs = [ bootstrapDmd makeWrapper unzip which gdb ]; + nativeBuildInputs = [ bootstrapDmd makeWrapper unzip which gdb ] + + ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [ + Foundation + ]); + buildInputs = [ curl tzdata ]; # Buid and install are based on http://wiki.dlang.org/Building_DMD @@ -92,7 +97,8 @@ stdenv.mkDerivation rec { cd .. ''; - doCheck = true; + # disable check phase because some tests are not working with sandboxing + doCheck = false; checkPhase = '' cd dmd diff --git a/pkgs/development/compilers/gambit/bootstrap.nix b/pkgs/development/compilers/gambit/bootstrap.nix index 65fb20aa2603..e645ecb41bd2 100644 --- a/pkgs/development/compilers/gambit/bootstrap.nix +++ b/pkgs/development/compilers/gambit/bootstrap.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { buildInputs = [ autoconf ]; configurePhase = '' - ./configure --prefix=$out --enable-single-host + ./configure --prefix=$out ''; buildPhase = '' diff --git a/pkgs/development/compilers/gambit/default.nix b/pkgs/development/compilers/gambit/default.nix index 58b08ebd4fb7..79f57c42c50d 100644 --- a/pkgs/development/compilers/gambit/default.nix +++ b/pkgs/development/compilers/gambit/default.nix @@ -1,19 +1,16 @@ { stdenv, fetchurl, fetchgit, git, openssl, autoconf, pkgs }: +# TODO: distinct packages for gambit-release and gambit-devel + stdenv.mkDerivation rec { name = "gambit-${version}"; - version = "4.8.8-f3ffeb6"; + version = "4.8.8-300db59"; bootstrap = import ./bootstrap.nix ( pkgs ); -# devver = "4_8_8"; -# src = fetchurl { -# url = "http://www.iro.umontreal.ca/~gambit/download/gambit/v4.8/source/gambit-v${version}-devel.tgz"; -# sha256 = "0j3ka76cfb007rlcc3nv5p1s6vh31cwp87hwwabawf16vs1jb7bl"; -# }; src = fetchgit { url = "https://github.com/feeley/gambit.git"; - rev = "f3ffeb695aeea80c18c1b9ef276b57898c780dca"; - sha256 = "1lqixsrgk9z2gj6z1nkys0pfd3m5zjxrp3gvqn2wpr9h7hjb8x06"; + rev = "300db59e1d3b66bcd597f617849df0274d2a4472"; + sha256 = "1mhy49lasakgvdaswkxasdssik11lx3hfx4h1gs2b6881488ssdp"; }; buildInputs = [ openssl git autoconf bootstrap ]; @@ -28,6 +25,8 @@ stdenv.mkDerivation rec { --enable-absolute-shared-libs # Yes, NixOS will want an absolute path, and fix it. --enable-poll --enable-openssl + --enable-default-runtime-options="f8,-8,t8" # Default to UTF-8 for source and all I/O + #--enable-debug # Nope: enables plenty of good stuff, but also the costly console.log #--enable-multiple-versions # Nope, NixOS already does version multiplexing #--enable-guide @@ -49,15 +48,15 @@ stdenv.mkDerivation rec { buildPhase = '' # Make bootstrap compiler, from release bootstrap - mkdir -p boot/wip-compiler && - cp -rp ${bootstrap}/. boot/wip-compiler/. && + mkdir -p boot && + cp -rp ${bootstrap}/. boot/. && chmod -R u+w boot && - cd boot/wip-compiler && \ - cp ../../gsc/makefile.in ../../gsc/*.scm gsc && \ - (cd gsc && make bootclean ) && - make bootstrap && - cd ../.. && - cp boot/wip-compiler/gsc/gsc gsc-boot && + cd boot && + cp ../gsc/makefile.in ../gsc/*.scm gsc && # */ + ./configure && + for i in lib gsi gsc ; do (cd $i ; make ) ; done && + cd .. && + cp boot/gsc/gsc gsc-boot && # Now use the bootstrap compiler to build the real thing! make -j2 from-scratch diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index c3e14d9328e4..d1c76b6097ea 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -221,8 +221,7 @@ stdenv.mkDerivation ({ inherit sha256; }; - # FIXME stackprotector needs gcc 4.9 in bootstrap tools - hardeningDisable = [ "stackprotector" "format" ]; + hardeningDisable = [ "format" ]; inherit patches; diff --git a/pkgs/development/compilers/gerbil/default.nix b/pkgs/development/compilers/gerbil/default.nix index 22047b663d04..59cafee3b3a9 100644 --- a/pkgs/development/compilers/gerbil/default.nix +++ b/pkgs/development/compilers/gerbil/default.nix @@ -2,23 +2,27 @@ coreutils, rsync, bash, openssl, zlib, sqlite, libxml2, libyaml, libmysql, lmdb, leveldb }: +# TODO: distinct packages for gerbil-release and gerbil-devel + stdenv.mkDerivation rec { name = "gerbil-${version}"; - version = "0.12-DEV"; + version = "0.12-DEV-777-gd855915"; src = fetchgit { url = "https://github.com/vyzo/gerbil.git"; - rev = "3657b6e940ea248e0b312f276590e38ff68997e7"; - sha256 = "11ys7082ghkm4yikz4qxmv3jpxcr42jfi0jhjw1mpzbqdg6004w2"; + rev = "9db6187dc996eec4087f83b86339e7b17bb69bad"; + sha256 = "1hqmsy77d62dvil3az4vdr0rmwvxhinjl1dbcxzamz2c2kcjv1jg"; }; buildInputs = [ - gambit openssl + gambit coreutils rsync bash - zlib openssl zlib sqlite libxml2 libyaml libmysql lmdb leveldb + openssl zlib sqlite libxml2 libyaml libmysql lmdb leveldb ]; postPatch = '' + echo '(define (gerbil-version-string) "v${version}")' > src/gerbil/runtime/gx-version.scm + patchShebangs . find . -type f -executable -print0 | while IFS= read -r -d ''$'\0' f; do diff --git a/pkgs/development/compilers/ghc/6.10.2-binary.nix b/pkgs/development/compilers/ghc/6.10.2-binary.nix index 60749a29b58b..84250c1a6d33 100644 --- a/pkgs/development/compilers/ghc/6.10.2-binary.nix +++ b/pkgs/development/compilers/ghc/6.10.2-binary.nix @@ -1,24 +1,26 @@ -{stdenv, lib, fetchurl, perl, libedit, ncurses5, gmp}: +{ stdenv +, fetchurl, perl +, libedit, ncurses5, gmp +}: stdenv.mkDerivation rec { version = "6.10.2"; name = "ghc-${version}-binary"; - src = - if stdenv.system == "i686-linux" then - fetchurl { - # This binary requires libedit.so.0 (rather than libedit.so.2). - url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2"; - sha256 = "1fw0zr2qshlpk8s0d16k27zcv5263nqdg2xds5ymw8ff6qz9rz9b"; - } - else if stdenv.system == "x86_64-linux" then - fetchurl { - # Idem. - url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2"; - sha256 = "1rd2j7lmcfsm2rdfb5g6q0l8dz3sxadk5m3d2f69d4a6g4p4h7jj"; - } - else throw "cannot bootstrap GHC on this platform"; + src = fetchurl ({ + "i686-linux" = { + # This binary requires libedit.so.0 (rather than libedit.so.2). + url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2"; + sha256 = "1fw0zr2qshlpk8s0d16k27zcv5263nqdg2xds5ymw8ff6qz9rz9b"; + }; + "x86_64-linux" = { + # Idem. + url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2"; + sha256 = "1rd2j7lmcfsm2rdfb5g6q0l8dz3sxadk5m3d2f69d4a6g4p4h7jj"; + }; + }.${stdenv.hostPlatform.system} + or (throw "cannot bootstrap GHC on this platform")); buildInputs = [perl]; @@ -27,27 +29,27 @@ stdenv.mkDerivation rec { # first. The GHC Cabal build system makes use of strip by default and # has hardcoded paths to /usr/bin/strip in many places. We replace # those below, making them point to our dummy script. - '' + '' mkdir "$TMP/bin" for i in strip; do echo '#! ${stdenv.shell}' > "$TMP/bin/$i" chmod +x "$TMP/bin/$i" done PATH="$TMP/bin:$PATH" - '' + + '' + # On Linux, use patchelf to modify the executables so that they can # find editline/gmp. - (if stdenv.isLinux then '' + stdenv.lib.optionalString stdenv.hostPlatform.isLinux '' find . -type f -perm -0100 \ -exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ - --set-rpath "${lib.makeLibraryPath [ libedit ncurses5 gmp ]}" {} \; + --set-rpath "${stdenv.lib.makeLibraryPath [ libedit ncurses5 gmp ]}" {} \; for prog in ld ar gcc strip ranlib; do find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \; done - '' else ""); + ''; configurePhase = '' - ./configure --prefix=$out --with-gmp-libraries=${lib.getLib gmp}/lib --with-gmp-includes=${lib.getDev gmp}/include + ./configure --prefix=$out --with-gmp-libraries=${stdenv.lib.getLib gmp}/lib --with-gmp-includes=${stdenv.lib.getDev gmp}/include ''; # Stripping combined with patchelf breaks the executables (they die @@ -58,44 +60,21 @@ stdenv.mkDerivation rec { # calls install-strip ... dontBuild = true; - # The binaries for Darwin use frameworks, so fake those frameworks, - # and create some wrapper scripts that set DYLD_FRAMEWORK_PATH so - # that the executables work with no special setup. - postInstall = - (if stdenv.isDarwin then - '' - mkdir -p $out/frameworks/GMP.framework/Versions/A - ln -s ${gmp.out}/lib/libgmp.dylib $out/frameworks/GMP.framework/GMP - ln -s ${gmp.out}/lib/libgmp.dylib $out/frameworks/GMP.framework/Versions/A/GMP - # !!! fix this - mkdir -p $out/frameworks/GNUeditline.framework/Versions/A - ln -s ${libedit}/lib/libeditline.dylib $out/frameworks/GNUeditline.framework/GNUeditline - ln -s ${libedit}/lib/libeditline.dylib $out/frameworks/GNUeditline.framework/Versions/A/GNUeditline + postInstall = '' + # bah, the passing gmp doesn't work, so let's add it to the final package.conf in a quick but dirty way + sed -i "s@^\(.*pkgName = PackageName \"rts\".*\libraryDirs = \\[\)\(.*\)@\\1\"${gmp.out}/lib\",\2@" $out/lib/ghc-${version}/package.conf - mv $out/bin $out/bin-orig - mkdir $out/bin - for i in $(cd $out/bin-orig && ls); do - echo \"#! $SHELL -e\" >> $out/bin/$i - echo \"DYLD_FRAMEWORK_PATH=$out/frameworks exec $out/bin-orig/$i -framework-path $out/frameworks \\\"\\$@\\\"\" >> $out/bin/$i - chmod +x $out/bin/$i - done - '' else "") - + - '' - # bah, the passing gmp doesn't work, so let's add it to the final package.conf in a quick but dirty way - sed -i "s@^\(.*pkgName = PackageName \"rts\".*\libraryDirs = \\[\)\(.*\)@\\1\"${gmp.out}/lib\",\2@" $out/lib/ghc-${version}/package.conf - - # Sanity check, can ghc create executables? - cd $TMP - mkdir test-ghc; cd test-ghc - cat > main.hs << EOF - module Main where - main = putStrLn "yes" - EOF - $out/bin/ghc --make main.hs - echo compilation ok - [ $(./main) == "yes" ] - ''; + # Sanity check, can ghc create executables? + cd $TMP + mkdir test-ghc; cd test-ghc + cat > main.hs << EOF + module Main where + main = putStrLn "yes" + EOF + $out/bin/ghc --make main.hs + echo compilation ok + [ $(./main) == "yes" ] + ''; meta = { homepage = http://haskell.org/ghc; diff --git a/pkgs/development/compilers/ghc/7.0.4-binary.nix b/pkgs/development/compilers/ghc/7.0.4-binary.nix index 6140cde4a9ef..394e4239e9a0 100644 --- a/pkgs/development/compilers/ghc/7.0.4-binary.nix +++ b/pkgs/development/compilers/ghc/7.0.4-binary.nix @@ -1,32 +1,32 @@ -{stdenv, fetchurl, perl, ncurses5, gmp, libiconv}: +{ stdenv +, fetchurl, perl +, ncurses5, gmp, libiconv +}: stdenv.mkDerivation rec { version = "7.0.4"; name = "ghc-${version}-binary"; - src = - if stdenv.system == "i686-linux" then - fetchurl { - url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2"; - sha256 = "0mfnihiyjl06f5w1yrjp36sw9g67g2ymg5sdl0g23h1pab99jx63"; - } - else if stdenv.system == "x86_64-linux" then - fetchurl { - url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2"; - sha256 = "0mc4rhqcxz427wq4zgffmnn0d2yjqvy6af4x9mha283p1gdj5q99"; - } - else if stdenv.system == "i686-darwin" then - fetchurl { - url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2"; - sha256 = "0qj45hslrrr8zfks8m1jcb3awwx9rh35ndnpfmb0gwb6j7azq5n3"; - } - else if stdenv.system == "x86_64-darwin" then - fetchurl { - url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2"; - sha256 = "1m2ml88p1swf4dnv2vq8hz4drcp46n3ahpfi05wh01ajkf8hnn3l"; - } - else throw "cannot bootstrap GHC on this platform"; + src = fetchurl ({ + "i686-linux" = { + url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2"; + sha256 = "0mfnihiyjl06f5w1yrjp36sw9g67g2ymg5sdl0g23h1pab99jx63"; + }; + "x86_64-linux" = { + url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2"; + sha256 = "0mc4rhqcxz427wq4zgffmnn0d2yjqvy6af4x9mha283p1gdj5q99"; + }; + "i686-darwin" = { + url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2"; + sha256 = "0qj45hslrrr8zfks8m1jcb3awwx9rh35ndnpfmb0gwb6j7azq5n3"; + }; + "x86_64-darwin" = { + url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2"; + sha256 = "1m2ml88p1swf4dnv2vq8hz4drcp46n3ahpfi05wh01ajkf8hnn3l"; + }; + }.${stdenv.hostPlatform.system} + or (throw "cannot bootstrap GHC on this platform")); buildInputs = [perl]; @@ -41,22 +41,22 @@ stdenv.mkDerivation rec { # first. The GHC Cabal build system makes use of strip by default and # has hardcoded paths to /usr/bin/strip in many places. We replace # those below, making them point to our dummy script. - '' + '' mkdir "$TMP/bin" for i in strip; do echo '#! ${stdenv.shell}' > "$TMP/bin/$i" chmod +x "$TMP/bin/$i" done PATH="$TMP/bin:$PATH" - '' + + '' + # We have to patch the GMP paths for the integer-gmp package. - '' + '' find . -name integer-gmp.buildinfo \ -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${gmp.out}/lib@" {} \; - '' + stdenv.lib.optionalString stdenv.isDarwin '' + '' + stdenv.lib.optionalString stdenv.isDarwin '' find . -name base.buildinfo \ -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${libiconv}/lib@" {} \; - '' + + '' + # On Linux, use patchelf to modify the executables so that they can # find editline/gmp. stdenv.lib.optionalString stdenv.isLinux '' @@ -68,24 +68,24 @@ stdenv.mkDerivation rec { for prog in ld ar gcc strip ranlib; do find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \; done - '' + stdenv.lib.optionalString stdenv.isDarwin '' - # not enough room in the object files for the full path to libiconv :( - fix () { - install_name_tool -change /usr/lib/libiconv.2.dylib @executable_path/libiconv.dylib $1 - } + '' + stdenv.lib.optionalString stdenv.isDarwin '' + # not enough room in the object files for the full path to libiconv :( + fix () { + install_name_tool -change /usr/lib/libiconv.2.dylib @executable_path/libiconv.dylib $1 + } - ln -s ${libiconv}/lib/libiconv.dylib ghc-7.0.4/utils/ghc-pwd/dist/build/tmp - ln -s ${libiconv}/lib/libiconv.dylib ghc-7.0.4/utils/hpc/dist/build/tmp - ln -s ${libiconv}/lib/libiconv.dylib ghc-7.0.4/ghc/stage2/build/tmp + ln -s ${libiconv}/lib/libiconv.dylib ghc-${version}/utils/ghc-pwd/dist/build/tmp + ln -s ${libiconv}/lib/libiconv.dylib ghc-${version}/utils/hpc/dist/build/tmp + ln -s ${libiconv}/lib/libiconv.dylib ghc-${version}/ghc/stage2/build/tmp - for file in ghc-cabal ghc-pwd ghc-stage2 ghc-pkg haddock hsc2hs hpc; do - fix $(find . -type f -name $file) - done + for file in ghc-cabal ghc-pwd ghc-stage2 ghc-pkg haddock hsc2hs hpc; do + fix $(find . -type f -name $file) + done - for file in $(find . -name setup-config); do - substituteInPlace $file --replace /usr/bin/ranlib "$(type -P ranlib)" - done - ''; + for file in $(find . -name setup-config); do + substituteInPlace $file --replace /usr/bin/ranlib "$(type -P ranlib)" + done + ''; configurePhase = '' ./configure --prefix=$out \ @@ -101,19 +101,18 @@ stdenv.mkDerivation rec { # calls install-strip ... dontBuild = true; - postInstall = - '' - # Sanity check, can ghc create executables? - cd $TMP - mkdir test-ghc; cd test-ghc - cat > main.hs << EOF - module Main where - main = putStrLn "yes" - EOF - $out/bin/ghc --make main.hs - echo compilation ok - [ $(./main) == "yes" ] - ''; + postInstall = '' + # Sanity check, can ghc create executables? + cd $TMP + mkdir test-ghc; cd test-ghc + cat > main.hs << EOF + module Main where + main = putStrLn "yes" + EOF + $out/bin/ghc --make main.hs + echo compilation ok + [ $(./main) == "yes" ] + ''; meta.license = stdenv.lib.licenses.bsd3; meta.platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin"]; diff --git a/pkgs/development/compilers/ghc/7.4.2-binary.nix b/pkgs/development/compilers/ghc/7.4.2-binary.nix index 100bb87768b5..9d85253f6309 100644 --- a/pkgs/development/compilers/ghc/7.4.2-binary.nix +++ b/pkgs/development/compilers/ghc/7.4.2-binary.nix @@ -1,32 +1,32 @@ -{stdenv, fetchurl, perl, ncurses5, gmp, libiconv, makeWrapper}: +{ stdenv +, fetchurl, perl, makeWrapper +, ncurses5, gmp, libiconv +}: stdenv.mkDerivation rec { version = "7.4.2"; name = "ghc-${version}-binary"; - src = - if stdenv.system == "i686-linux" then - fetchurl { - url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2"; - sha256 = "0gny7knhss0w0d9r6jm1gghrcb8kqjvj94bb7hxf9syrk4fxlcxi"; - } - else if stdenv.system == "x86_64-linux" then - fetchurl { - url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2"; - sha256 = "043jabd0lh6n1zlqhysngbpvlsdznsa2mmsj08jyqgahw9sjb5ns"; - } - else if stdenv.system == "i686-darwin" then - fetchurl { - url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2"; - sha256 = "1vrbs3pzki37hzym1f1nh07lrqh066z3ypvm81fwlikfsvk4djc0"; - } - else if stdenv.system == "x86_64-darwin" then - fetchurl { - url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2"; - sha256 = "1imzqc0slpg0r6p40n5a9m18cbcm0m86z8dgyhfxcckksw54mzwf"; - } - else throw "cannot bootstrap GHC on this platform"; + src = fetchurl ({ + "i686-linux" = { + url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2"; + sha256 = "0gny7knhss0w0d9r6jm1gghrcb8kqjvj94bb7hxf9syrk4fxlcxi"; + }; + "x86_64-linux" = { + url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2"; + sha256 = "043jabd0lh6n1zlqhysngbpvlsdznsa2mmsj08jyqgahw9sjb5ns"; + }; + "i686-darwin" = { + url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2"; + sha256 = "1vrbs3pzki37hzym1f1nh07lrqh066z3ypvm81fwlikfsvk4djc0"; + }; + "x86_64-darwin" = { + url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2"; + sha256 = "1imzqc0slpg0r6p40n5a9m18cbcm0m86z8dgyhfxcckksw54mzwf"; + }; + }.${stdenv.hostPlatform.system} + or (throw "cannot bootstrap GHC on this platform")); buildInputs = [perl]; @@ -41,22 +41,22 @@ stdenv.mkDerivation rec { # first. The GHC Cabal build system makes use of strip by default and # has hardcoded paths to /usr/bin/strip in many places. We replace # those below, making them point to our dummy script. - '' + '' mkdir "$TMP/bin" for i in strip; do echo '#! ${stdenv.shell}' > "$TMP/bin/$i" chmod +x "$TMP/bin/$i" done PATH="$TMP/bin:$PATH" - '' + + '' + # We have to patch the GMP paths for the integer-gmp package. - '' + '' find . -name integer-gmp.buildinfo \ -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${gmp.out}/lib@" {} \; - '' + stdenv.lib.optionalString stdenv.isDarwin '' + '' + stdenv.lib.optionalString stdenv.isDarwin '' find . -name base.buildinfo \ -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${libiconv}/lib@" {} \; - '' + + '' + # On Linux, use patchelf to modify the executables so that they can # find editline/gmp. stdenv.lib.optionalString stdenv.isLinux '' @@ -73,24 +73,24 @@ stdenv.mkDerivation rec { for prog in ld ar gcc strip ranlib; do find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \; done - '' + stdenv.lib.optionalString stdenv.isDarwin '' - # not enough room in the object files for the full path to libiconv :( - fix () { - install_name_tool -change /usr/lib/libiconv.2.dylib @executable_path/libiconv.dylib $1 - } + '' + stdenv.lib.optionalString stdenv.isDarwin '' + # not enough room in the object files for the full path to libiconv :( + fix () { + install_name_tool -change /usr/lib/libiconv.2.dylib @executable_path/libiconv.dylib $1 + } - ln -s ${libiconv}/lib/libiconv.dylib ghc-7.4.2/utils/ghc-pwd/dist-install/build/tmp - ln -s ${libiconv}/lib/libiconv.dylib ghc-7.4.2/utils/hpc/dist-install/build/tmp - ln -s ${libiconv}/lib/libiconv.dylib ghc-7.4.2/ghc/stage2/build/tmp + ln -s ${libiconv}/lib/libiconv.dylib ghc-${version}/utils/ghc-pwd/dist-install/build/tmp + ln -s ${libiconv}/lib/libiconv.dylib ghc-${version}/utils/hpc/dist-install/build/tmp + ln -s ${libiconv}/lib/libiconv.dylib ghc-${version}/ghc/stage2/build/tmp - for file in ghc-cabal ghc-pwd ghc-stage2 ghc-pkg haddock hsc2hs hpc; do - fix $(find . -type f -name $file) - done + for file in ghc-cabal ghc-pwd ghc-stage2 ghc-pkg haddock hsc2hs hpc; do + fix $(find . -type f -name $file) + done - for file in $(find . -name setup-config); do - substituteInPlace $file --replace /usr/bin/ranlib "$(type -P ranlib)" - done - ''; + for file in $(find . -name setup-config); do + substituteInPlace $file --replace /usr/bin/ranlib "$(type -P ranlib)" + done + ''; configurePhase = '' ./configure --prefix=$out \ @@ -107,10 +107,10 @@ stdenv.mkDerivation rec { dontBuild = true; preInstall = stdenv.lib.optionalString stdenv.isDarwin '' - mkdir -p $out/lib/ghc-7.4.2 + mkdir -p $out/lib/ghc-${version} mkdir -p $out/bin ln -s ${libiconv}/lib/libiconv.dylib $out/bin - ln -s ${libiconv}/lib/libiconv.dylib $out/lib/ghc-7.4.2/libiconv.dylib + ln -s ${libiconv}/lib/libiconv.dylib $out/lib/ghc-${version}/libiconv.dylib ln -s ${libiconv}/lib/libiconv.dylib utils/ghc-cabal/dist-install/build/tmp ''; diff --git a/pkgs/development/compilers/ghcjs/head_shims.nix b/pkgs/development/compilers/ghcjs/head_shims.nix index 68b03d057397..a9a7f8d45e27 100644 --- a/pkgs/development/compilers/ghcjs/head_shims.nix +++ b/pkgs/development/compilers/ghcjs/head_shims.nix @@ -2,6 +2,6 @@ fetchFromGitHub { owner = "ghcjs"; repo = "shims"; - rev = "f67394c559ac921a768b12f141499119563b8bf3"; - sha256 = "1lz86qmkxkfch1yk9a62admw7jsd34sqcrskgpq28hbhjpgzf1lv"; + rev = "85395dce971e23a39e5f93af4ed139ca36d4e448"; + sha256 = "1kqgik75jx681s1kjx1s7dryigr3m940c3zb9vy0r3psxrw6sf2g"; } diff --git a/pkgs/development/compilers/jetbrains-jdk/default.nix b/pkgs/development/compilers/jetbrains-jdk/default.nix new file mode 100644 index 000000000000..e0aa815e4dcb --- /dev/null +++ b/pkgs/development/compilers/jetbrains-jdk/default.nix @@ -0,0 +1,80 @@ +{ stdenv, lib, fetchurl, file, glib, libxml2, libav_0_8, ffmpeg, libxslt +, mesa_noglu , xorg, alsaLib, fontconfig, freetype, pango, gtk2, cairo +, gdk_pixbuf, atk }: + +# TODO: Investigate building from source instead of patching binaries. +# TODO: Binary patching for not just x86_64-linux but also x86_64-darwin i686-linux + +let drv = stdenv.mkDerivation rec { + pname = "jetbrainsjdk"; + version = "152b970.2"; + name = pname + "-" + version; + + src = if stdenv.system == "x86_64-linux" then + fetchurl { + url = "https://bintray.com/jetbrains/intellij-jdk/download_file?file_path=jbsdk8u${version}_linux_x64.tar.gz"; + sha256 = "0i2cqjfab91kr618z88nb5g9yg60j5z08wjl0nlvcmpvg2z6va0m"; + } + else + abort "unsupported system: ${stdenv.system}"; + + nativeBuildInputs = [ file ]; + + unpackCmd = "mkdir jdk; pushd jdk; tar -xzf $src; popd"; + + installPhase = '' + cd .. + + exes=$(file $sourceRoot/bin/* $sourceRoot/jre/bin/* 2> /dev/null | grep -E 'ELF.*(executable|shared object)' | sed -e 's/: .*$//') + for file in $exes; do + paxmark m "$file" + done + + mv $sourceRoot $out + jrePath=$out/jre + ''; + + postFixup = let + arch = "amd64"; + rSubPaths = [ + "lib/${arch}/jli" + "lib/${arch}/server" + "lib/${arch}/xawt" + "lib/${arch}" + ]; + in '' + rpath+="''${rpath:+:}${stdenv.lib.concatStringsSep ":" (map (a: "$jrePath/${a}") rSubPaths)}" + find $out -type f -perm -0100 \ + -exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ + --set-rpath "$rpath" {} \; + find $out -name "*.so" -exec patchelf --set-rpath "$rpath" {} \; + ''; + + rpath = lib.makeLibraryPath ([ + stdenv.cc.cc stdenv.cc.libc glib libxml2 libav_0_8 ffmpeg libxslt mesa_noglu + alsaLib fontconfig freetype pango gtk2 cairo gdk_pixbuf atk + ] ++ (with xorg; [ + libX11 libXext libXtst libXi libXp libXt libXrender libXxf86vm + ])); + + passthru.home = drv; + + meta = with stdenv.lib; { + description = "An OpenJDK fork to better support Jetbrains's products."; + longDescription = '' + JetBrains Runtime is a runtime environment for running IntelliJ Platform + based products on Windows, Mac OS X, and Linux. JetBrains Runtime is + based on OpenJDK project with some modifications. These modifications + include: Subpixel Anti-Aliasing, enhanced font rendering on Linux, HiDPI + support, ligatures, some fixes for native crashes not presented in + official build, and other small enhancements. + + JetBrains Runtime is not a certified build of OpenJDK. Please, use at + your own risk. + ''; + homepage = "https://bintray.com/jetbrains/intellij-jdk/"; + licenses = licenses.gpl2; + maintainers = with maintainers; [ edwtjo ]; + platforms = with platforms; [ "x86_64-linux" ]; + }; +}; in drv diff --git a/pkgs/development/compilers/jhc/default.nix b/pkgs/development/compilers/jhc/default.nix index cfeff329fb56..6b8c6599062e 100644 --- a/pkgs/development/compilers/jhc/default.nix +++ b/pkgs/development/compilers/jhc/default.nix @@ -27,5 +27,6 @@ stdenv.mkDerivation rec { license = stdenv.lib.licenses.bsd3; platforms = ["x86_64-linux"]; # 32 bit builds are broken maintainers = with stdenv.lib.maintainers; [ aforemny thoughtpolice ]; + broken = true; # https://hydra.nixos.org/build/61700723 }; } diff --git a/pkgs/development/compilers/kotlin/default.nix b/pkgs/development/compilers/kotlin/default.nix index 65c2125dfbca..bc24cdfb87e9 100644 --- a/pkgs/development/compilers/kotlin/default.nix +++ b/pkgs/development/compilers/kotlin/default.nix @@ -1,12 +1,12 @@ { stdenv, fetchurl, makeWrapper, jre, unzip }: stdenv.mkDerivation rec { - version = "1.1.4-2"; + version = "1.1.50"; name = "kotlin-${version}"; src = fetchurl { url = "https://github.com/JetBrains/kotlin/releases/download/v${version}/kotlin-compiler-${version}.zip"; - sha256 = "09sikwk5xxn4b30icbq28mjs4lm9xbj0bv5yjx75r165iz65g2cv"; + sha256 = "01y7m0r5wa2apd05c38h77060javgbj8072vd08lz4qaw6c6445m"; }; propagatedBuildInputs = [ jre ] ; diff --git a/pkgs/development/compilers/ldc/default.nix b/pkgs/development/compilers/ldc/default.nix index 22d2923897cd..4be275318887 100644 --- a/pkgs/development/compilers/ldc/default.nix +++ b/pkgs/development/compilers/ldc/default.nix @@ -81,7 +81,8 @@ stdenv.mkDerivation rec { makeFlags = [ "DMD=$DMD" ]; - doCheck = true; + # disable check phase because some tests are not working with sandboxing + doCheck = false; checkPhase = '' ctest -j $NIX_BUILD_CORES -V DMD=$DMD diff --git a/pkgs/development/compilers/openjdk/8.nix b/pkgs/development/compilers/openjdk/8.nix index 45054a3577db..fef41d33d080 100644 --- a/pkgs/development/compilers/openjdk/8.nix +++ b/pkgs/development/compilers/openjdk/8.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchurl, cpio, pkgconfig, file, which, unzip, zip, cups, freetype +{ stdenv, lib, fetchurl, bash, cpio, pkgconfig, file, which, unzip, zip, cups, freetype , alsaLib, bootjdk, cacert, perl, liberation_ttf, fontconfig, zlib, lndir , libX11, libICE, libXrender, libXext, libXt, libXtst, libXi, libXinerama, libXcursor , libjpeg, giflib @@ -75,11 +75,14 @@ let gtk2 gnome_vfs GConf glib ]; + #move the seven other source dirs under the main jdk8u directory, + #with version suffixes removed, as the remainder of the build will expect prePatch = '' - ls | grep jdk | grep -v '^jdk8u' | awk -F- '{print $1}' | while read p; do - mv $p-* $(ls | grep '^jdk8u')/$p + mainDir=$(find . -maxdepth 1 -name jdk8u\*); + find . -maxdepth 1 -name \*jdk\* -not -name jdk8u\* | awk -F- '{print $1}' | while read p; do + mv $p-* $mainDir/$p done - cd $(ls | grep '^jdk8u') + cd $mainDir ''; patches = [ @@ -95,7 +98,7 @@ let preConfigure = '' chmod +x configure - substituteInPlace configure --replace /bin/bash "$shell" + substituteInPlace configure --replace /bin/bash "${bash}/bin/bash" substituteInPlace hotspot/make/linux/adlc_updater --replace /bin/sh "$shell" substituteInPlace hotspot/make/linux/makefiles/dtrace.make --replace /usr/include/sys/sdt.h "/no-such-path" '' @@ -188,10 +191,11 @@ let done # Generate certificates. - pushd $jre/lib/openjdk/jre/lib/security - rm cacerts - perl ${./generate-cacerts.pl} $jre/lib/openjdk/jre/bin/keytool ${cacert}/etc/ssl/certs/ca-bundle.crt - popd + ( + cd $jre/lib/openjdk/jre/lib/security + rm cacerts + perl ${./generate-cacerts.pl} $jre/lib/openjdk/jre/bin/keytool ${cacert}/etc/ssl/certs/ca-bundle.crt + ) ln -s $out/lib/openjdk/bin $out/bin ln -s $jre/lib/openjdk/jre/bin $jre/bin @@ -221,13 +225,13 @@ let # Build the set of output library directories to rpath against LIBDIRS="" for output in $outputs; do - LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \; | sort | uniq | tr '\n' ':'):$LIBDIRS" + LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \+ | sort | uniq | tr '\n' ':'):$LIBDIRS" done # Add the local library paths to remove dependencies on the bootstrap for output in $outputs; do - OUTPUTDIR="$(eval echo \$$output)" - BINLIBS="$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*)" + OUTPUTDIR=$(eval echo \$$output) + BINLIBS=$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*) echo "$BINLIBS" | while read i; do patchelf --set-rpath "$LIBDIRS:$(patchelf --print-rpath "$i")" "$i" || true patchelf --shrink-rpath "$i" || true diff --git a/pkgs/development/compilers/openjdk/9.nix b/pkgs/development/compilers/openjdk/9.nix new file mode 100644 index 000000000000..ce556a32c11d --- /dev/null +++ b/pkgs/development/compilers/openjdk/9.nix @@ -0,0 +1,262 @@ +{ stdenv, lib, fetchurl, bash, cpio, pkgconfig, file, which, unzip, zip, cups, freetype +, alsaLib, bootjdk, cacert, perl, liberation_ttf, fontconfig, zlib, lndir +, libX11, libICE, libXrender, libXext, libXt, libXtst, libXi, libXinerama, libXcursor +, libjpeg, giflib +, setJavaClassPath +, minimal ? false +#, enableInfinality ? true # font rendering patch +, enableGnome2 ? true, gtk2, gnome_vfs, glib, GConf +}: + +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 "openjdk requires i686-linux or x86_64 linux"; + + update = ""; + build = "181"; + baseurl = "http://hg.openjdk.java.net/jdk9/jdk9"; + repover = "jdk-9${update}+${build}"; + paxflags = if stdenv.isi686 then "msp" else "m"; + jdk9 = fetchurl { + url = "${baseurl}/archive/${repover}.tar.gz"; + sha256 = "0c7jwz4qvl93brs6c2v4dfc2v3lsv6ic0y72lkh04bnxg9343z82"; + }; + langtools = fetchurl { + url = "${baseurl}/langtools/archive/${repover}.tar.gz"; + sha256 = "1wa5rjan6lcs8nnxndbwpw6gkx3qbw013s6zisjjczkcaiq044pp"; + }; + hotspot = fetchurl { + url = "${baseurl}/hotspot/archive/${repover}.tar.gz"; + sha256 = "00jnj19rim1gxpsxrpr8ifx1glwrbma3qjiy1ya7n5f08fb263hs"; + }; + corba = fetchurl { + url = "${baseurl}/corba/archive/${repover}.tar.gz"; + sha256 = "1gvx6dblzj7rb8648iqwdiv36x97ibykgs323dd9044n3vbqihvj"; + }; + jdk = fetchurl { + url = "${baseurl}/jdk/archive/${repover}.tar.gz"; + sha256 = "15pwdw6s03rfyw2gx06xg4f70bjl8j19ycssxiigj39h524xc9aw"; + }; + jaxws = fetchurl { + url = "${baseurl}/jaxws/archive/${repover}.tar.gz"; + sha256 = "0jz32pjbgr77ybb2v1vwr1n9ljdrc3y0d5lrj072g3is1hmn2wbh"; + }; + jaxp = fetchurl { + url = "${baseurl}/jaxp/archive/${repover}.tar.gz"; + sha256 = "1jdxr9hcqx6va56ll5s2x9bx9dnlrs7zyvhjk1zgr5hxg5yfcqzr"; + }; + nashorn = fetchurl { + url = "${baseurl}/nashorn/archive/${repover}.tar.gz"; + sha256 = "12lihmw9ga6yhz0h26fvfablcjkkma0k3idjggmap97xha8zgd6n"; + }; + openjdk9 = stdenv.mkDerivation { + name = "openjdk-9${update}-b${build}"; + + srcs = [ jdk9 langtools hotspot corba jdk jaxws jaxp nashorn ]; + sourceRoot = "."; + + outputs = [ "out" "jre" ]; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ + cpio file which unzip zip perl bootjdk zlib cups freetype alsaLib + libjpeg giflib libX11 libICE libXext libXrender libXtst libXt libXtst + libXi libXinerama libXcursor lndir fontconfig + ] ++ lib.optionals (!minimal && enableGnome2) [ + gtk2 gnome_vfs GConf glib + ]; + + #move the seven other source dirs under the main jdk8u directory, + #with version suffixes removed, as the remainder of the build will expect + prePatch = '' + mainDir=$(find . -maxdepth 1 -name jdk9\*); + find . -maxdepth 1 -name \*jdk\* -not -name jdk9\* | awk -F- '{print $1}' | while read p; do + mv $p-* $mainDir/$p + done + cd $mainDir + ''; + + patches = [ + ./fix-java-home-jdk9.patch + ./read-truststore-from-env-jdk9.patch + ./currency-date-range-jdk8.patch + #] ++ lib.optionals (!minimal && enableInfinality) [ + # ./004_add-fontconfig.patch + # ./005_enable-infinality.patch + ] ++ lib.optionals (!minimal && enableGnome2) [ + ./swing-use-gtk-jdk9.patch + ]; + + preConfigure = '' + chmod +x configure + substituteInPlace configure --replace /bin/bash "${bash}/bin/bash" + + configureFlagsArray=( + "--with-boot-jdk=${bootjdk.home}" + "--with-update-version=${update}" + "--with-build-number=${build}" + "--with-milestone=fcs" + "--enable-unlimited-crypto" + "--disable-debug-symbols" + "--disable-freetype-bundling" + "--with-zlib=system" + "--with-giflib=system" + "--with-stdc++lib=dynamic" + + # glibc 2.24 deprecated readdir_r so we need this + # See https://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg49006.html + "--with-extra-cflags=-Wno-error=deprecated-declarations -Wno-error=format-contains-nul -Wno-error=unused-result" + '' + + lib.optionalString minimal "\"--enable-headless-only\"" + + ");" + # https://bugzilla.redhat.com/show_bug.cgi?id=1306558 + # https://github.com/JetBrains/jdk8u/commit/eaa5e0711a43d64874111254d74893fa299d5716 + + stdenv.lib.optionalString stdenv.cc.isGNU '' + NIX_CFLAGS_COMPILE+=" -fno-lifetime-dse -fno-delete-null-pointer-checks -std=gnu++98 -Wno-error" + ''; + + NIX_LDFLAGS= lib.optionals (!minimal) [ + "-lfontconfig" "-lcups" "-lXinerama" "-lXrandr" "-lmagic" + ] ++ lib.optionals (!minimal && enableGnome2) [ + "-lgtk-x11-2.0" "-lgio-2.0" "-lgnomevfs-2" "-lgconf-2" + ]; + + buildFlags = [ "all" ]; + + installPhase = '' + mkdir -p $out/lib/openjdk $out/share $jre/lib/openjdk + + cp -av build/*/images/jdk/* $out/lib/openjdk + + # Remove some broken manpages. + rm -rf $out/lib/openjdk/man/ja* + + # Mirror some stuff in top-level. + mkdir $out/include $out/share/man + ln -s $out/lib/openjdk/include/* $out/include/ + ln -s $out/lib/openjdk/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/ + + # Copy the JRE to a separate output and setup fallback fonts + cp -av build/*/images/jre $jre/lib/openjdk/ + mkdir $out/lib/openjdk/jre + ${lib.optionalString (!minimal) '' + mkdir -p $jre/lib/openjdk/jre/lib/fonts/fallback + lndir ${liberation_ttf}/share/fonts/truetype $jre/lib/openjdk/jre/lib/fonts/fallback + ''} + + # Remove crap from the installation. + rm -rf $out/lib/openjdk/demo + ${lib.optionalString minimal '' + for d in $out/lib/openjdk/lib $jre/lib/openjdk/jre/lib; do + rm ''${d}/{libjsound,libjsoundalsa,libawt*,libfontmanager}.so + done + ''} + + lndir $jre/lib/openjdk/jre $out/lib/openjdk/jre + + # Make sure cmm/*.pf are not symlinks: + # https://youtrack.jetbrains.com/issue/IDEA-147272 + # in 9, it seems no *.pf files end up in $out ... ? + # rm -rf $out/lib/openjdk/jre/lib/cmm + # ln -s {$jre,$out}/lib/openjdk/jre/lib/cmm + + # Set PaX markings + exes=$(file $out/lib/openjdk/bin/* $jre/lib/openjdk/jre/bin/* 2> /dev/null | grep -E 'ELF.*(executable|shared object)' | sed -e 's/: .*$//') + echo "to mark: *$exes*" + for file in $exes; do + echo "marking *$file*" + paxmark ${paxflags} "$file" + done + + # Remove duplicate binaries. + for i in $(cd $out/lib/openjdk/bin && echo *); do + if [ "$i" = java ]; then continue; fi + if cmp -s $out/lib/openjdk/bin/$i $jre/lib/openjdk/jre/bin/$i; then + ln -sfn $jre/lib/openjdk/jre/bin/$i $out/lib/openjdk/bin/$i + fi + done + + # Generate certificates. + ( + cd $jre/lib/openjdk/jre/lib/security + rm cacerts + perl ${./generate-cacerts.pl} $jre/lib/openjdk/jre/bin/keytool ${cacert}/etc/ssl/certs/ca-bundle.crt + ) + + ln -s $out/lib/openjdk/bin $out/bin + ln -s $jre/lib/openjdk/jre/bin $jre/bin + ln -s $jre/lib/openjdk/jre $out/jre + ''; + + # 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 + #TODO or printWords? cf https://github.com/NixOS/nixpkgs/pull/27427#issuecomment-317293040 + 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/openjdk; fi + EOF + ''; + + postFixup = '' + # Build the set of output library directories to rpath against + LIBDIRS="" + for output in $outputs; do + LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \+ | sort | uniq | tr '\n' ':'):$LIBDIRS" + done + + # Add the local library paths to remove dependencies on the bootstrap + for output in $outputs; do + OUTPUTDIR=$(eval echo \$$output) + BINLIBS=$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*) + echo "$BINLIBS" | while read i; do + patchelf --set-rpath "$LIBDIRS:$(patchelf --print-rpath "$i")" "$i" || true + patchelf --shrink-rpath "$i" || true + done + done + + # Test to make sure that we don't depend on the bootstrap + for output in $outputs; do + if grep -q -r '${bootjdk}' $(eval echo \$$output); then + echo "Extraneous references to ${bootjdk} detected" + exit 1 + fi + done + ''; + + meta = with stdenv.lib; { + homepage = http://openjdk.java.net/; + license = licenses.gpl2; + description = "The open-source Java Development Kit"; + maintainers = with maintainers; [ edwtjo ]; + platforms = platforms.linux; + }; + + passthru = { + inherit architecture; + home = "${openjdk9}/lib/openjdk"; + }; + }; +in openjdk9 diff --git a/pkgs/development/compilers/openjdk/fix-java-home-jdk9.patch b/pkgs/development/compilers/openjdk/fix-java-home-jdk9.patch new file mode 100644 index 000000000000..f9755d58e48f --- /dev/null +++ b/pkgs/development/compilers/openjdk/fix-java-home-jdk9.patch @@ -0,0 +1,14 @@ +--- a/hotspot/src/os/linux/vm/os_linux.cpp 2017-07-04 23:09:02.533972226 -0400 ++++ b/hotspot/src/os/linux/vm/os_linux.cpp 2017-07-04 23:07:52.118338845 -0400 +@@ -2318,10 +2318,7 @@ + assert(ret, "cannot locate libjvm"); + char *rp = NULL; + if (ret && dli_fname[0] != '\0') { +- rp = realpath(dli_fname, buf); +- } +- if (rp == NULL) { +- return; ++ snprintf(buf, buflen, "%s", dli_fname); + } + + if (Arguments::sun_java_launcher_is_altjvm()) { diff --git a/pkgs/development/compilers/openjdk/read-truststore-from-env-jdk9.patch b/pkgs/development/compilers/openjdk/read-truststore-from-env-jdk9.patch new file mode 100644 index 000000000000..cb8d59ff8063 --- /dev/null +++ b/pkgs/development/compilers/openjdk/read-truststore-from-env-jdk9.patch @@ -0,0 +1,20 @@ +--- a/jdk/src/java.base/share/classes/sun/security/ssl/TrustStoreManager.java 2017-06-26 21:48:25.000000000 -0400 ++++ b/jdk/src/java.base/share/classes/sun/security/ssl/TrustStoreManager.java.new 2017-07-05 20:45:57.491295030 -0400 +@@ -71,6 +71,7 @@ + * + * The preference of the default trusted KeyStore is: + * javax.net.ssl.trustStore ++ * system environment variable JAVAX_NET_SSL_TRUSTSTORE + * jssecacerts + * cacerts + */ +@@ -144,6 +145,9 @@ + String temporaryName = ""; + File temporaryFile = null; + long temporaryTime = 0L; ++ if (storePropName == null){ ++ storePropName = System.getenv("JAVAX_NET_SSL_TRUSTSTORE"); ++ } + if (!"NONE".equals(storePropName)) { + String[] fileNames = + new String[] {storePropName, defaultStore}; diff --git a/pkgs/development/compilers/openjdk/swing-use-gtk-jdk9.patch b/pkgs/development/compilers/openjdk/swing-use-gtk-jdk9.patch new file mode 100644 index 000000000000..07d95ba71b8a --- /dev/null +++ b/pkgs/development/compilers/openjdk/swing-use-gtk-jdk9.patch @@ -0,0 +1,26 @@ +diff -ru3 a/jdk/src/share/classes/javax/swing/UIManager.java b/jdk/src/share/classes/javax/swing/UIManager.java +--- a/jdk/src/java.desktop/share/classes/javax/swing/UIManager.java 2016-07-26 00:41:37.000000000 +0300 ++++ b/jdk/src/java.desktop/share/classes/javax/swing/UIManager.java 2016-10-02 22:46:01.890071761 +0300 +@@ -607,11 +607,9 @@ + if (osType == OSInfo.OSType.WINDOWS) { + return "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"; + } else { +- String desktop = AccessController.doPrivileged(new GetPropertyAction("sun.desktop")); + Toolkit toolkit = Toolkit.getDefaultToolkit(); +- if ("gnome".equals(desktop) && +- toolkit instanceof SunToolkit && +- ((SunToolkit) toolkit).isNativeGTKAvailable()) { ++ if (toolkit instanceof SunToolkit && ++ ((SunToolkit) toolkit).isNativeGTKAvailable()) { + // May be set on Linux and Solaris boxs. + return "com.sun.java.swing.plaf.gtk.GTKLookAndFeel"; + } +@@ -1341,7 +1339,7 @@ + lafName = (String) lafData.remove("defaultlaf"); + } + if (lafName == null) { +- lafName = getCrossPlatformLookAndFeelClassName(); ++ lafName = getSystemLookAndFeelClassName(); + } + lafName = swingProps.getProperty(defaultLAFKey, lafName); + diff --git a/pkgs/development/compilers/oraclejdk/jdk9-linux.nix b/pkgs/development/compilers/oraclejdk/jdk9-linux.nix new file mode 100644 index 000000000000..7f0a5750c0e8 --- /dev/null +++ b/pkgs/development/compilers/oraclejdk/jdk9-linux.nix @@ -0,0 +1,175 @@ +{ swingSupport ? true +, stdenv +, requireFile +, makeWrapper +, unzip +, file +, xorg ? null +, packageType ? "JDK" # JDK, JRE, or ServerJRE +, pluginSupport ? true +, installjce ? false +, glib +, libxml2 +, ffmpeg_2 +, libxslt +, mesa_noglu +, freetype +, fontconfig +, gtk2 +, pango +, cairo +, alsaLib +, atk +, gdk_pixbuf +, zlib +, elfutils +, setJavaClassPath +}: + +assert stdenv.system == "x86_64-linux"; +assert swingSupport -> xorg != null; + +let + version = "9"; + + downloadUrlBase = http://www.oracle.com/technetwork/java/javase/downloads; + + jce = + if installjce then + requireFile { + name = "jce_policy-8.zip"; + url = "${downloadUrlBase}/jce8-download-2133166.html"; + sha256 = "0n8b6b8qmwb14lllk2lk1q1ahd3za9fnjigz5xn65mpg48whl0pk"; + } + else + ""; + + rSubPaths = [ + "lib/jli" + "lib/server" + "lib" + ]; + +in + +let result = stdenv.mkDerivation rec { + name = if packageType == "JDK" then "oraclejdk-${version}" + else if packageType == "JRE" then "oraclejre-${version}" + else if packageType == "ServerJRE" then "oracleserverjre-${version}" + else abort "unknown package Type ${packageType}"; + + src = + if packageType == "JDK" then + requireFile { + name = "jdk-${version}_linux-x64_bin.tar.gz"; + url = "${downloadUrlBase}/jdk9-downloads-3848520.html"; + sha256 = "0vbgy7h9h089l3xh6sl57v57g28x1djyiigqs4z6gh7wahx7hv8w"; + } + else if packageType == "JRE" then + requireFile { + name = "jre-${version}_linux-x64_bin.tar.gz"; + url = "${downloadUrlBase}/jre9-downloads-3848532.html"; + sha256 = "18i4jjb6sby67xg5ql6dkk3ja1nackbb23g1bnp522450nclpxdb"; + } + else if packageType == "ServerJRE" then + requireFile { + name = "serverjre-${version}_linux-x64_bin.tar.gz"; + url = "${downloadUrlBase}/server-jre9-downloads-3848530.html"; + sha256 = "01bxi7lx13lhlpbifw93b6r7a9bayiykw8kzwlyyqi8pz3pw8c5h"; + } + else abort "unknown package Type ${packageType}"; + + nativeBuildInputs = [ file ] + ++ stdenv.lib.optional installjce unzip; + + buildInputs = [ makeWrapper ]; + + # See: https://github.com/NixOS/patchelf/issues/10 + dontStrip = 1; + + installPhase = '' + cd .. + + # Set PaX markings + exes=$(file $sourceRoot/bin/* 2> /dev/null | grep -E 'ELF.*(executable|shared object)' | sed -e 's/: .*$//') + for file in $exes; do + paxmark m "$file" + # On x86 for heap sizes over 700MB disable SEGMEXEC and PAGEEXEC as well. + ${stdenv.lib.optionalString stdenv.isi686 ''paxmark msp "$file"''} + done + + mv $sourceRoot $out + + shopt -s extglob + for file in $out/* + do + if test -f $file ; then + rm $file + fi + done + + if test -n "${jce}"; then + unzip ${jce} + cp -v UnlimitedJCEPolicy*/*.jar $out/lib/security + fi + + if test -z "$pluginSupport"; then + rm -f $out/bin/javaws + fi + + mkdir $out/lib/plugins + ln -s $out/lib/libnpjp2.so $out/lib/plugins + + # for backward compatibility + ln -s $out $out/jre + + mkdir -p $out/nix-support + printWords ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs + + # Set JAVA_HOME automatically. + cat <<EOF >> $out/nix-support/setup-hook + if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out; fi + EOF + ''; + + postFixup = '' + rpath+="''${rpath:+:}${stdenv.lib.concatStringsSep ":" (map (a: "$out/${a}") rSubPaths)}" + + # set all the dynamic linkers + find $out -type f -perm -0100 \ + -exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ + --set-rpath "$rpath" {} \; + + find $out -name "*.so" -exec patchelf --set-rpath "$rpath" {} \; + + # Oracle Java Mission Control needs to know where libgtk-x11 and related is + if test -x $out/bin/jmc; then + wrapProgram "$out/bin/jmc" \ + --suffix-each LD_LIBRARY_PATH ':' "$rpath" + fi + ''; + + /** + * libXt is only needed on amd64 + */ + libraries = + [stdenv.cc.libc glib libxml2 ffmpeg_2 libxslt mesa_noglu xorg.libXxf86vm alsaLib fontconfig freetype pango gtk2 cairo gdk_pixbuf atk zlib elfutils] ++ + (if swingSupport then [xorg.libX11 xorg.libXext xorg.libXtst xorg.libXi xorg.libXp xorg.libXt xorg.libXrender stdenv.cc.cc] else []); + + rpath = stdenv.lib.strings.makeLibraryPath libraries; + + passthru.mozillaPlugin = "/lib/plugins"; + + passthru.jre = result; # FIXME: use multiple outputs or return actual JRE package + + passthru.home = result; + + # for backward compatibility + passthru.architecture = ""; + + meta = with stdenv.lib; { + license = licenses.unfree; + platforms = [ "x86_64-linux" ]; # some inherit jre.meta.platforms + }; + +}; in result diff --git a/pkgs/development/compilers/ponyc/default.nix b/pkgs/development/compilers/ponyc/default.nix index 69a8243b6662..19ebd522a4f7 100644 --- a/pkgs/development/compilers/ponyc/default.nix +++ b/pkgs/development/compilers/ponyc/default.nix @@ -3,13 +3,13 @@ stdenv.mkDerivation ( rec { name = "ponyc-${version}"; - version = "0.19.1"; + version = "0.19.2"; src = fetchFromGitHub { owner = "ponylang"; repo = "ponyc"; rev = version; - sha256 = "1zd051syn0n6ign4nnxb40xj2s5vqp0s349nkjqv7051xzvlzf1p"; + sha256 = "04vbhkkgpjh19pv2bq4b60lgnk5ck8axqs6fgw4l44j3lvxwlwrh"; }; buildInputs = [ llvm makeWrapper which ]; diff --git a/pkgs/development/compilers/solc/default.nix b/pkgs/development/compilers/solc/default.nix index 43d10bbfb93d..078cf3e36c27 100644 --- a/pkgs/development/compilers/solc/default.nix +++ b/pkgs/development/compilers/solc/default.nix @@ -1,9 +1,9 @@ { stdenv, fetchzip, fetchgit, boost, cmake, z3 }: let - version = "0.4.16"; - rev = "d7661dd97460250b4e1127b9e7ea91e116143780"; - sha256 = "1fd69pdhkkkvbkrxipkck1icpqkpdskjzar48a1yzdsx3l8s4lil"; + version = "0.4.17"; + rev = "bdeb9e52a2211510644fb53df93fb98258b40a65"; + sha256 = "1x6q2rlq6gxggidgsy6li7m4phwr1hcfi65pq9yimz64ddqfiira"; jsoncppURL = https://github.com/open-source-parsers/jsoncpp/archive/1.7.7.tar.gz; jsoncpp = fetchzip { url = jsoncppURL; @@ -23,7 +23,7 @@ stdenv.mkDerivation { patchPhase = '' echo >commit_hash.txt '${rev}' echo >prerelease.txt - substituteInPlace deps/jsoncpp.cmake \ + substituteInPlace cmake/jsoncpp.cmake \ --replace '${jsoncppURL}' ${jsoncpp} substituteInPlace cmake/EthCompilerSettings.cmake \ --replace 'add_compile_options(-Werror)' "" diff --git a/pkgs/development/compilers/swift/default.nix b/pkgs/development/compilers/swift/default.nix index 96b22b630f4f..6cc9f372b978 100644 --- a/pkgs/development/compilers/swift/default.nix +++ b/pkgs/development/compilers/swift/default.nix @@ -259,7 +259,7 @@ stdenv.mkDerivation rec { meta = with stdenv.lib; { description = "The Swift Programming Language"; homepage = https://github.com/apple/swift; - maintainers = with maintainers; [ jb55 dtzWill ]; + maintainers = with maintainers; [ dtzWill ]; license = licenses.asl20; # Swift doesn't support 32bit Linux, unknown on other platforms. platforms = [ "x86_64-linux" ]; diff --git a/pkgs/development/compilers/tinycc/default.nix b/pkgs/development/compilers/tinycc/default.nix index 8e56c1ee50b3..4d6555213345 100644 --- a/pkgs/development/compilers/tinycc/default.nix +++ b/pkgs/development/compilers/tinycc/default.nix @@ -2,9 +2,9 @@ with stdenv.lib; let - date = "20170911"; - rev = "870271ea071971002fa556e09e1873db316fa1a9"; - sha256 = "1a9djm0p7cd5nzqdhch9y48c4wai76x6d4nwx0bj5jz46ws39bs9"; + date = "20170924"; + rev = "1443039416dd02750765efde1af35e31c8d41be3"; + sha256 = "060l0f77hirq3i5bg294gxcszlvyn89ds2q21jwgy3ryrapfbl8i"; version = "0.9.27pre-${date}"; in diff --git a/pkgs/development/compilers/urweb/default.nix b/pkgs/development/compilers/urweb/default.nix index 7145a8f2fa04..74ca5dc4c4b0 100644 --- a/pkgs/development/compilers/urweb/default.nix +++ b/pkgs/development/compilers/urweb/default.nix @@ -1,5 +1,5 @@ { stdenv, lib, fetchurl, file, openssl, mlton -, mysql, postgresql, sqlite +, mysql, postgresql, sqlite, gcc }: stdenv.mkDerivation rec { @@ -24,8 +24,10 @@ stdenv.mkDerivation rec { export MSHEADER="${lib.getDev mysql.client}/include/mysql/mysql.h"; export SQHEADER="${sqlite.dev}/include/sqlite3.h"; + export CC="${gcc}/bin/gcc"; export CCARGS="-I$out/include \ - -L${lib.getLib mysql.client}/lib/mysql \ + -L${openssl.out}/lib \ + -L${lib.getLib mysql.client}/lib \ -L${postgresql.lib}/lib \ -L${sqlite.out}/lib"; ''; @@ -37,7 +39,7 @@ stdenv.mkDerivation rec { description = "Advanced purely-functional web programming language"; homepage = "http://www.impredicative.com/ur/"; license = stdenv.lib.licenses.bsd3; - platforms = stdenv.lib.platforms.linux; + platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; maintainers = [ stdenv.lib.maintainers.thoughtpolice stdenv.lib.maintainers.sheganinans ]; }; } |