Merge master into staging-next
This commit is contained in:
@@ -1,26 +1,43 @@
|
||||
let
|
||||
version = "11";
|
||||
buildNumber = "28";
|
||||
baseUrl = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-${version}%2B${buildNumber}";
|
||||
makePackage = { packageType, vmType, sha256 }: import ./jdk-darwin-base.nix {
|
||||
makePackage = { version, buildNumber, packageType, vmType, sha256 }: import ./jdk-darwin-base.nix {
|
||||
name = if packageType == "jdk"
|
||||
then
|
||||
"adoptopenjdk-${vmType}-bin-${version}"
|
||||
else
|
||||
"adoptopenjdk-${packageType}-${vmType}-bin-${version}";
|
||||
url = "${baseUrl}/OpenJDK${version}-${packageType}_x64_mac_${vmType}_${version}_${buildNumber}.tar.gz";
|
||||
|
||||
url = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-${version}%2B${buildNumber}/OpenJDK11-${packageType}_x64_mac_${vmType}_${version}_${buildNumber}.tar.gz";
|
||||
|
||||
inherit sha256;
|
||||
};
|
||||
in
|
||||
{
|
||||
jdk-hotspot = makePackage {
|
||||
version = "11";
|
||||
buildNumber = "28";
|
||||
packageType = "jdk";
|
||||
vmType = "hotspot";
|
||||
sha256 = "ca0ec49548c626904061b491cae0a29b9b4b00fb34d8973dc217e10ab21fb0f3";
|
||||
};
|
||||
jre-hotspot = makePackage {
|
||||
version = "11";
|
||||
buildNumber = "28";
|
||||
packageType = "jre";
|
||||
vmType = "hotspot";
|
||||
sha256 = "ef4dbfe5aed6ab2278fcc14db6cc73abbaab56e95f6ebb023790a7ebc6d7f30c";
|
||||
};
|
||||
jdk-openj9 = makePackage {
|
||||
version = "11.0.1";
|
||||
buildNumber = "13";
|
||||
packageType = "jdk";
|
||||
vmType = "openj9";
|
||||
sha256 = "c5e9b588b4ac5b0bd5b4edd69d59265d1199bb98af7ca3270e119b264ffb6e3f";
|
||||
};
|
||||
jre-openj9 = makePackage {
|
||||
version = "11.0.1";
|
||||
buildNumber = "13";
|
||||
packageType = "jre";
|
||||
vmType = "openj9";
|
||||
sha256 = "0901dc5946fdf967f92f7b719ddfffdcdde5bd3fef86a83d7a3f2f39ddbef1f8";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,36 +1,43 @@
|
||||
let
|
||||
version = "11";
|
||||
buildNumber = "28";
|
||||
baseUrl = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-${version}%2B${buildNumber}";
|
||||
makePackage = { packageType, vmType, sha256 }: import ./jdk-linux-base.nix {
|
||||
makePackage = { version, buildNumber, packageType, vmType, sha256 }: import ./jdk-linux-base.nix {
|
||||
name = if packageType == "jdk"
|
||||
then
|
||||
"adoptopenjdk-${vmType}-bin-${version}"
|
||||
else
|
||||
"adoptopenjdk-${packageType}-${vmType}-bin-${version}";
|
||||
url = "${baseUrl}/OpenJDK${version}-${packageType}_x64_linux_${vmType}_${version}_${buildNumber}.tar.gz";
|
||||
|
||||
url = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-${version}%2B${buildNumber}/OpenJDK11-${packageType}_x64_linux_${vmType}_${version}_${buildNumber}.tar.gz";
|
||||
|
||||
inherit sha256;
|
||||
};
|
||||
in
|
||||
{
|
||||
jdk-hotspot = makePackage {
|
||||
version = "11";
|
||||
buildNumber = "28";
|
||||
packageType = "jdk";
|
||||
vmType = "hotspot";
|
||||
sha256 = "e1e18fc9ce2917473da3e0acb5a771bc651f600c0195a3cb40ef6f22f21660af";
|
||||
};
|
||||
jre-hotspot = makePackage {
|
||||
version = "11";
|
||||
buildNumber = "28";
|
||||
packageType = "jre";
|
||||
vmType = "hotspot";
|
||||
sha256 = "346448142d46c6e51d0fadcaadbcde31251d7678922ec3eb010fcb1b6e17804c";
|
||||
};
|
||||
jdk-openj9 = makePackage {
|
||||
version = "11.0.1";
|
||||
buildNumber = "13";
|
||||
packageType = "jdk";
|
||||
vmType = "openj9";
|
||||
sha256 = "fd77f22eb74078bcf974415abd888296284d2ceb81dbaca6ff32f59416ebc57f";
|
||||
sha256 = "765947ab9457a29d2aa9d11460a4849611343c1e0ea3b33b9c08409cd4672251";
|
||||
};
|
||||
jre-openj9 = makePackage {
|
||||
version = "11.0.1";
|
||||
buildNumber = "13";
|
||||
packageType = "jre";
|
||||
vmType = "openj9";
|
||||
sha256 = "83a7c95e6b2150a739bdd5e8a6fe0315904fd13d8867c95db67c0318304a2c42";
|
||||
sha256 = "a016413fd8415429b42e543fed7a1bee5010b1dbaf71d29a26e1c699f334c6ff";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ lib, stdenv, makeWrapper, fetchurl, requireFile, perl, ncurses, expat, python27, zlib
|
||||
, gcc48, gcc49, gcc5, gcc6
|
||||
, gcc48, gcc49, gcc5, gcc6, gcc7
|
||||
, xorg, gtk2, glib, fontconfig, freetype, unixODBC, alsaLib, glibc
|
||||
}:
|
||||
|
||||
@@ -229,7 +229,7 @@ in rec {
|
||||
sha256 = "1kx6l4yzsamk6q1f4vllcpywhbfr2j5wfl4h5zx8v6dgfpsjm2lw";
|
||||
})
|
||||
];
|
||||
gcc = gcc6;
|
||||
gcc = gcc7;
|
||||
};
|
||||
|
||||
cudatoolkit_9 = cudatoolkit_9_2;
|
||||
@@ -239,7 +239,7 @@ in rec {
|
||||
url = "https://developer.nvidia.com/compute/cuda/10.0/Prod/local_installers/cuda_10.0.130_410.48_linux";
|
||||
sha256 = "16p3bv1lwmyqpxil8r951h385sy9asc578afrc7lssa68c71ydcj";
|
||||
|
||||
gcc = gcc6;
|
||||
gcc = gcc7;
|
||||
};
|
||||
|
||||
cudatoolkit_10 = cudatoolkit_10_0;
|
||||
|
||||
@@ -177,14 +177,14 @@ stdenv.mkDerivation ({
|
||||
|
||||
inherit patches;
|
||||
|
||||
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
|
||||
|
||||
outputs = [ "out" "lib" "man" "info" ];
|
||||
setOutputFlags = false;
|
||||
NIX_NO_SELF_RPATH = true;
|
||||
|
||||
libc_dev = stdenv.cc.libc_dev;
|
||||
|
||||
hardeningDisable = [ "format" ];
|
||||
|
||||
postPatch =
|
||||
if targetPlatform != hostPlatform || stdenv.cc.libc != null then
|
||||
# On NixOS, use the right path to the dynamic linker instead of
|
||||
|
||||
@@ -185,6 +185,8 @@ stdenv.mkDerivation ({
|
||||
|
||||
inherit patches;
|
||||
|
||||
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
|
||||
|
||||
outputs = if langJava || langGo then ["out" "man" "info"]
|
||||
else [ "out" "lib" "man" "info" ];
|
||||
setOutputFlags = false;
|
||||
@@ -192,8 +194,6 @@ stdenv.mkDerivation ({
|
||||
|
||||
libc_dev = stdenv.cc.libc_dev;
|
||||
|
||||
hardeningDisable = [ "format" ];
|
||||
|
||||
postPatch =
|
||||
if targetPlatform != hostPlatform || stdenv.cc.libc != null then
|
||||
# On NixOS, use the right path to the dynamic linker instead of
|
||||
|
||||
@@ -178,7 +178,7 @@ stdenv.mkDerivation ({
|
||||
|
||||
libc_dev = stdenv.cc.libc_dev;
|
||||
|
||||
hardeningDisable = [ "format" ];
|
||||
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
|
||||
|
||||
# This should kill all the stdinc frameworks that gcc and friends like to
|
||||
# insert into default search paths.
|
||||
|
||||
@@ -178,7 +178,7 @@ stdenv.mkDerivation ({
|
||||
|
||||
libc_dev = stdenv.cc.libc_dev;
|
||||
|
||||
hardeningDisable = [ "format" ];
|
||||
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
|
||||
|
||||
# This should kill all the stdinc frameworks that gcc and friends like to
|
||||
# insert into default search paths.
|
||||
|
||||
@@ -149,7 +149,7 @@ stdenv.mkDerivation ({
|
||||
|
||||
libc_dev = stdenv.cc.libc_dev;
|
||||
|
||||
hardeningDisable = [ "format" ];
|
||||
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
|
||||
|
||||
# This should kill all the stdinc frameworks that gcc and friends like to
|
||||
# insert into default search paths.
|
||||
|
||||
@@ -143,7 +143,7 @@ stdenv.mkDerivation ({
|
||||
|
||||
libc_dev = stdenv.cc.libc_dev;
|
||||
|
||||
hardeningDisable = [ "format" ];
|
||||
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
|
||||
|
||||
# This should kill all the stdinc frameworks that gcc and friends like to
|
||||
# insert into default search paths.
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
{ stdenv
|
||||
, fetchurl, perl
|
||||
, ncurses5, gmp, libiconv
|
||||
, gcc, llvm_35
|
||||
}:
|
||||
|
||||
# Prebuilt only does native
|
||||
assert stdenv.targetPlatform == stdenv.hostPlatform;
|
||||
|
||||
let
|
||||
libPath = stdenv.lib.makeLibraryPath ([
|
||||
ncurses5 gmp
|
||||
] ++ stdenv.lib.optional (stdenv.hostPlatform.isDarwin) libiconv);
|
||||
|
||||
libEnvVar = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin "DY"
|
||||
+ "LD_LIBRARY_PATH";
|
||||
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "7.10.3";
|
||||
|
||||
name = "ghc-${version}-binary";
|
||||
|
||||
src = fetchurl ({
|
||||
"i686-linux" = {
|
||||
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}b-i386-deb7-linux.tar.bz2";
|
||||
sha256 = "20b32912fb7e57910a3c908f99a9519b57a4872e1ea0f4f2265b2f7b30e8a3cd";
|
||||
};
|
||||
"x86_64-linux" = {
|
||||
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}b-x86_64-deb8-linux.tar.bz2";
|
||||
sha256 = "5e163c557e9236cce68be41c984eab0fcdbdc1602e39040ca9ae325e6bdec1c3";
|
||||
};
|
||||
"armv7l-linux" = {
|
||||
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-armv7-deb8-linux.tar.bz2";
|
||||
sha256 = "2913763eef88e4d1843a1e4c34225afb1866310d1a1956c08a4131f4593518f6";
|
||||
};
|
||||
"x86_64-darwin" = {
|
||||
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}b-x86_64-apple-darwin.tar.bz2";
|
||||
sha256 = "4b537228d49b5ea0f8e8dbcc440a5b3c3cb19a92579d607291cc0041422fa5c3";
|
||||
};
|
||||
}.${stdenv.hostPlatform.system}
|
||||
or (throw "cannot bootstrap GHC on this platform"));
|
||||
|
||||
nativeBuildInputs = [ perl ];
|
||||
buildInputs = stdenv.lib.optionals stdenv.targetPlatform.isAarch32 [ llvm_35 ];
|
||||
|
||||
# Cannot patchelf beforehand due to relative RPATHs that anticipate
|
||||
# the final install location/
|
||||
${libEnvVar} = libPath;
|
||||
|
||||
postUnpack =
|
||||
# GHC has dtrace probes, which causes ld to try to open /usr/lib/libdtrace.dylib
|
||||
# during linking
|
||||
stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
export NIX_LDFLAGS+=" -no_dtrace_dof"
|
||||
# not enough room in the object files for the full path to libiconv :(
|
||||
for exe in $(find . -type f -executable); do
|
||||
isScript $exe && continue
|
||||
ln -fs ${libiconv}/lib/libiconv.dylib $(dirname $exe)/libiconv.dylib
|
||||
install_name_tool -change /usr/lib/libiconv.2.dylib @executable_path/libiconv.dylib -change /usr/local/lib/gcc/5/libgcc_s.1.dylib ${gcc.cc.lib}/lib/libgcc_s.1.dylib $exe
|
||||
done
|
||||
'' +
|
||||
|
||||
# Some scripts used during the build need to have their shebangs patched
|
||||
''
|
||||
patchShebangs ghc-${version}/utils/
|
||||
patchShebangs ghc-${version}/configure
|
||||
'' +
|
||||
|
||||
# Strip is harmful, see also below. It's important that this happens
|
||||
# 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 ''
|
||||
find . -name base.buildinfo \
|
||||
-exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${libiconv}/lib@" {} \;
|
||||
'' +
|
||||
# Rename needed libraries and binaries, fix interpreter
|
||||
stdenv.lib.optionalString stdenv.isLinux ''
|
||||
find . -type f -perm -0100 -exec patchelf \
|
||||
--replace-needed libncurses${stdenv.lib.optionalString stdenv.is64bit "w"}.so.5 libncurses.so \
|
||||
--replace-needed libtinfo.so libtinfo.so.5 \
|
||||
--interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" {} \;
|
||||
|
||||
paxmark m ./ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
|
||||
|
||||
sed -i "s|/usr/bin/perl|perl\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
|
||||
sed -i "s|/usr/bin/gcc|gcc\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
|
||||
'';
|
||||
|
||||
configurePlatforms = [ ];
|
||||
configureFlags = [
|
||||
"--with-gmp-libraries=${stdenv.lib.getLib gmp}/lib"
|
||||
"--with-gmp-includes=${stdenv.lib.getDev gmp}/include"
|
||||
] ++ stdenv.lib.optional stdenv.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}";
|
||||
|
||||
# Stripping combined with patchelf breaks the executables (they die
|
||||
# with a segfault or the kernel even refuses the execve). (NIXPKGS-85)
|
||||
dontStrip = true;
|
||||
|
||||
# No building is necessary, but calling make without flags ironically
|
||||
# calls install-strip ...
|
||||
dontBuild = true;
|
||||
|
||||
# On Linux, use patchelf to modify the executables so that they can
|
||||
# find editline/gmp.
|
||||
preFixup = stdenv.lib.optionalString stdenv.isLinux ''
|
||||
for p in $(find "$out" -type f -executable); do
|
||||
if isELF "$p"; then
|
||||
echo "Patchelfing $p"
|
||||
patchelf --set-rpath "${libPath}:$(patchelf --print-rpath $p)" $p
|
||||
fi
|
||||
done
|
||||
'' + stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
# not enough room in the object files for the full path to libiconv :(
|
||||
for exe in $(find "$out" -type f -executable); do
|
||||
isScript $exe && continue
|
||||
ln -fs ${libiconv}/lib/libiconv.dylib $(dirname $exe)/libiconv.dylib
|
||||
install_name_tool -change /usr/lib/libiconv.2.dylib @executable_path/libiconv.dylib -change /usr/local/lib/gcc/5/libgcc_s.1.dylib ${gcc.cc.lib}/lib/libgcc_s.1.dylib $exe
|
||||
done
|
||||
|
||||
for file in $(find "$out" -name setup-config); do
|
||||
substituteInPlace $file --replace /usr/bin/ranlib "$(type -P ranlib)"
|
||||
done
|
||||
'';
|
||||
|
||||
doInstallCheck = true;
|
||||
installCheckPhase = ''
|
||||
unset ${libEnvVar}
|
||||
# Sanity check, can ghc create executables?
|
||||
cd $TMP
|
||||
mkdir test-ghc; cd test-ghc
|
||||
cat > main.hs << EOF
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
module Main where
|
||||
main = putStrLn \$([|"yes"|])
|
||||
EOF
|
||||
$out/bin/ghc --make main.hs || exit 1
|
||||
echo compilation ok
|
||||
[ $(./main) == "yes" ]
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
targetPrefix = "";
|
||||
enableShared = true;
|
||||
};
|
||||
|
||||
meta.license = stdenv.lib.licenses.bsd3;
|
||||
meta.platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin" "armv7l-linux"];
|
||||
}
|
||||
@@ -75,6 +75,7 @@ stdenv.mkDerivation rec {
|
||||
# Some scripts used during the build need to have their shebangs patched
|
||||
''
|
||||
patchShebangs ghc-${version}/utils/
|
||||
patchShebangs ghc-${version}/configure
|
||||
'' +
|
||||
|
||||
# Strip is harmful, see also below. It's important that this happens
|
||||
|
||||
232
pkgs/development/compilers/ghc/8.6.2.nix
Normal file
232
pkgs/development/compilers/ghc/8.6.2.nix
Normal file
@@ -0,0 +1,232 @@
|
||||
{ stdenv, targetPackages
|
||||
|
||||
# build-tools
|
||||
, bootPkgs
|
||||
, autoconf, automake, coreutils, fetchurl, fetchpatch, perl, python3, m4
|
||||
|
||||
, libiconv ? null, ncurses
|
||||
|
||||
, useLLVM ? !stdenv.targetPlatform.isx86 || (stdenv.targetPlatform.isMusl && stdenv.hostPlatform != stdenv.targetPlatform)
|
||||
, # LLVM is conceptually a run-time-only depedendency, but for
|
||||
# non-x86, we need LLVM to bootstrap later stages, so it becomes a
|
||||
# build-time dependency too.
|
||||
buildLlvmPackages, llvmPackages
|
||||
|
||||
, # If enabled, GHC will be built with the GPL-free but slower integer-simple
|
||||
# library instead of the faster but GPLed integer-gmp library.
|
||||
enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
|
||||
|
||||
, # If enabled, use -fPIC when compiling static libs.
|
||||
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
|
||||
|
||||
, # Whether to build dynamic libs for the standard library (on the target
|
||||
# platform). Static libs are always built.
|
||||
enableShared ? !stdenv.targetPlatform.isWindows && !stdenv.targetPlatform.useiOSPrebuilt
|
||||
|
||||
, # Whetherto build terminfo.
|
||||
enableTerminfo ? !stdenv.targetPlatform.isWindows
|
||||
|
||||
, # What flavour to build. An empty string indicates no
|
||||
# specific flavour and falls back to ghc default values.
|
||||
ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) "perf-cross"
|
||||
}:
|
||||
|
||||
assert !enableIntegerSimple -> gmp != null;
|
||||
|
||||
let
|
||||
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
|
||||
|
||||
inherit (bootPkgs) ghc;
|
||||
|
||||
# TODO(@Ericson2314) Make unconditional
|
||||
targetPrefix = stdenv.lib.optionalString
|
||||
(targetPlatform != hostPlatform)
|
||||
"${targetPlatform.config}-";
|
||||
|
||||
buildMK = ''
|
||||
BuildFlavour = ${ghcFlavour}
|
||||
ifneq \"\$(BuildFlavour)\" \"\"
|
||||
include mk/flavours/\$(BuildFlavour).mk
|
||||
endif
|
||||
DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
|
||||
INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"}
|
||||
'' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
|
||||
Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
|
||||
CrossCompilePrefix = ${targetPrefix}
|
||||
HADDOCK_DOCS = NO
|
||||
BUILD_SPHINX_HTML = NO
|
||||
BUILD_SPHINX_PDF = NO
|
||||
'' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
|
||||
GhcLibHcOpts += -fPIC
|
||||
GhcRtsHcOpts += -fPIC
|
||||
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
|
||||
EXTRA_CC_OPTS += -std=gnu99
|
||||
'';
|
||||
|
||||
# Splicer will pull out correct variations
|
||||
libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ]
|
||||
++ stdenv.lib.optional (!enableIntegerSimple) gmp
|
||||
++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
|
||||
|
||||
toolsForTarget =
|
||||
if hostPlatform == buildPlatform then
|
||||
[ targetPackages.stdenv.cc ] ++ stdenv.lib.optional useLLVM llvmPackages.llvm
|
||||
else assert targetPlatform == hostPlatform; # build != host == target
|
||||
[ stdenv.cc ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm;
|
||||
|
||||
targetCC = builtins.head toolsForTarget;
|
||||
|
||||
in
|
||||
stdenv.mkDerivation (rec {
|
||||
version = "8.6.2";
|
||||
name = "${targetPrefix}ghc-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.xz";
|
||||
sha256 = "1mbn3n2ynmpfpb7jfnhpzzli31qqxqyi8ws71blws3i846fq3ana";
|
||||
};
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
outputs = [ "out" "doc" ];
|
||||
|
||||
patches = [(fetchpatch rec { # https://phabricator.haskell.org/D5123
|
||||
url = "http://tarballs.nixos.org/sha256/${sha256}";
|
||||
name = "D5123.diff";
|
||||
sha256 = "0nhqwdamf2y4gbwqxcgjxs0kqx23w9gv5kj0zv6450dq19rji82n";
|
||||
})];
|
||||
|
||||
postPatch = "patchShebangs .";
|
||||
|
||||
# GHC is a bit confused on its cross terminology.
|
||||
preConfigure = ''
|
||||
for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
|
||||
export "''${env#TARGET_}=''${!env}"
|
||||
done
|
||||
# GHC is a bit confused on its cross terminology, as these would normally be
|
||||
# the *host* tools.
|
||||
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
|
||||
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
|
||||
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
|
||||
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString targetPlatform.isAarch32 ".gold"}"
|
||||
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
|
||||
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
|
||||
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
|
||||
export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
|
||||
export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
|
||||
export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
|
||||
|
||||
echo -n "${buildMK}" > mk/build.mk
|
||||
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
||||
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
|
||||
export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
|
||||
'' + stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
export NIX_LDFLAGS+=" -no_dtrace_dof"
|
||||
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
|
||||
sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
|
||||
'' + stdenv.lib.optionalString targetPlatform.isMusl ''
|
||||
echo "patching llvm-targets for musl targets..."
|
||||
echo "Cloning these existing '*-linux-gnu*' targets:"
|
||||
grep linux-gnu llvm-targets | sed 's/^/ /'
|
||||
echo "(go go gadget sed)"
|
||||
sed -i 's,\(^.*linux-\)gnu\(.*\)$,\0\n\1musl\2,' llvm-targets
|
||||
echo "llvm-targets now contains these '*-linux-musl*' targets:"
|
||||
grep linux-musl llvm-targets | sed 's/^/ /'
|
||||
|
||||
echo "And now patching to preserve '-musleabi' as done with '-gnueabi'"
|
||||
# (aclocal.m4 is actual source, but patch configure as well since we don't re-gen)
|
||||
for x in configure aclocal.m4; do
|
||||
substituteInPlace $x \
|
||||
--replace '*-android*|*-gnueabi*)' \
|
||||
'*-android*|*-gnueabi*|*-musleabi*)'
|
||||
done
|
||||
'';
|
||||
|
||||
# TODO(@Ericson2314): Always pass "--target" and always prefix.
|
||||
configurePlatforms = [ "build" "host" ]
|
||||
++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
|
||||
# `--with` flags for libraries needed for RTS linker
|
||||
configureFlags = [
|
||||
"--datadir=$doc/share/doc/ghc"
|
||||
"--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
|
||||
] ++ stdenv.lib.optional (targetPlatform == hostPlatform && !enableIntegerSimple) [
|
||||
"--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
|
||||
] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
|
||||
"--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
|
||||
] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
|
||||
"--enable-bootstrap-with-devel-snapshot"
|
||||
] ++ stdenv.lib.optionals (targetPlatform.isAarch32) [
|
||||
"CFLAGS=-fuse-ld=gold"
|
||||
"CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
|
||||
"CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
|
||||
] ++ stdenv.lib.optionals (targetPlatform.isDarwin && targetPlatform.isAarch64) [
|
||||
# fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
|
||||
"--disable-large-address-space"
|
||||
];
|
||||
|
||||
# Make sure we never relax`$PATH` and hooks support for compatability.
|
||||
strictDeps = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
perl autoconf automake m4 python3
|
||||
ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
|
||||
];
|
||||
|
||||
# For building runtime libs
|
||||
depsBuildTarget = toolsForTarget;
|
||||
|
||||
buildInputs = libDeps hostPlatform;
|
||||
|
||||
propagatedBuildInputs = [ targetPackages.stdenv.cc ]
|
||||
++ stdenv.lib.optional useLLVM llvmPackages.llvm;
|
||||
|
||||
depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform);
|
||||
depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform);
|
||||
|
||||
# required, because otherwise all symbols from HSffi.o are stripped, and
|
||||
# that in turn causes GHCi to abort
|
||||
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
|
||||
|
||||
checkTarget = "test";
|
||||
|
||||
hardeningDisable = [ "format" ];
|
||||
|
||||
postInstall = ''
|
||||
for bin in "$out"/lib/${name}/bin/*; do
|
||||
isELF "$bin" || continue
|
||||
paxmark m "$bin"
|
||||
done
|
||||
|
||||
# Install the bash completion file.
|
||||
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
|
||||
|
||||
# Patch scripts to include "readelf" and "cat" in $PATH.
|
||||
for i in "$out/bin/"*; do
|
||||
test ! -h $i || continue
|
||||
egrep --quiet '^#!' <(head -n 1 $i) || continue
|
||||
sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
|
||||
done
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit bootPkgs targetPrefix;
|
||||
|
||||
inherit llvmPackages;
|
||||
inherit enableShared;
|
||||
|
||||
# Our Cabal compiler name
|
||||
haskellCompilerName = "ghc-8.6.2";
|
||||
};
|
||||
|
||||
meta = {
|
||||
homepage = http://haskell.org/ghc;
|
||||
description = "The Glasgow Haskell Compiler";
|
||||
maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ];
|
||||
inherit (ghc.meta) license platforms;
|
||||
};
|
||||
|
||||
} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
|
||||
dontStrip = true;
|
||||
dontPatchELF = true;
|
||||
noAuditTmpdir = true;
|
||||
})
|
||||
@@ -50,6 +50,9 @@ let
|
||||
rec { sha1 = "280c265b789e041c02e5c97815793dfc283fb1e6"; name = "LIBFFI_${sha1}/libffi.tar.gz"; url = https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/libffi-3.2.1.tar.gz; }
|
||||
rec { sha1 = "8819cea8bfe22c9c63f55465e296b3855ea41786"; name = "TruffleJSON_${sha1}/trufflejson.jar"; url = https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/trufflejson-20180130.jar; }
|
||||
rec { sha1 = "9712a8124c40298015f04a74f61b3d81a51513af"; name = "CHECKSTYLE_8.8_${sha1}/checkstyle-8.8.jar"; url = https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/checkstyle-8.8-all.jar; }
|
||||
rec { sha1 = "a828a4f32caf9ac0b74f2548f87310959558c526"; name = "VISUALVM_COMMON_${sha1}/visualvm-common.tar.gz"; url = https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/visualvm-612.tar.gz; }
|
||||
rec { sha1 = "7ac829f0c9a37f5cc39afd2265588a365480720d"; name = "VISUALVM_PLATFORM_SPECIFIC_${sha1}/visualvm-platform-specific.tar.gz"; url = https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/visualvm-612-linux-amd64.tar.gz; }
|
||||
rec { sha1 = "e6e60889b7211a80b21052a249bd7e0f88f79fee"; name = "Java-WebSocket_${sha1}/java-websocket.jar"; url = mirror://maven/org/java-websocket/Java-WebSocket/1.3.9/Java-WebSocket-1.3.9.jar; }
|
||||
];
|
||||
|
||||
findbugs = fetchzip {
|
||||
@@ -61,13 +64,13 @@ let
|
||||
in rec {
|
||||
|
||||
mx = stdenv.mkDerivation rec {
|
||||
version = "5.176.4";
|
||||
version = "5.192.0";
|
||||
name = "mx";
|
||||
src = fetchFromGitHub {
|
||||
owner = "graalvm";
|
||||
repo = "mx";
|
||||
rev = version;
|
||||
sha256 = "0xmx4hpnd6m9hk49lgwnvwd0q11s2m4d8axwq7zzc8wm10d692xw";
|
||||
sha256 = "04gdf1gzlc8a6li8lcnrs2j9zicj11fs1vqqf7cmhb4pm2h72hml";
|
||||
};
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildPhase = ''
|
||||
@@ -79,6 +82,11 @@ in rec {
|
||||
'def download(path, urls, verbose=False, abortOnError=True, verifyOnly=False):
|
||||
print("FAKE download(path={} urls={} verbose={} abortOnError={} verifyOnly={})".format(path, urls, verbose, abortOnError, verifyOnly))
|
||||
return True'
|
||||
|
||||
# avoid crash with 'ValueError: ZIP does not support timestamps before 1980'
|
||||
substituteInPlace mx.py --replace \
|
||||
'zipfile.ZipInfo(arcname, time.localtime(os.path.getmtime(join(root, f)))[:6])' \
|
||||
'zipfile.ZipInfo(arcname, time.strptime ("1 Jan 1980", "%d %b %Y" )[:6])'
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
@@ -97,9 +105,9 @@ in rec {
|
||||
|
||||
# copy of pkgs.oraclejvm8 with JVMCI interface (TODO: it should work with pkgs.openjdk8 too)
|
||||
jvmci8 = stdenv.mkDerivation rec {
|
||||
version = "0.45";
|
||||
version = "0.49";
|
||||
name = let
|
||||
n = "jvmci8u171-${version}";
|
||||
n = "jvmci${/*"8u191"*/ lib.removePrefix "oraclejdk-" oraclejdk8.name}-${version}";
|
||||
in if (lib.stringLength n) == (lib.stringLength oraclejdk8.name) then
|
||||
n
|
||||
else
|
||||
@@ -108,7 +116,7 @@ in rec {
|
||||
owner = "graalvm";
|
||||
repo = "graal-jvmci-8";
|
||||
rev = "jvmci-${version}";
|
||||
sha256 = "1nppk9dpamisiadss1iy82i3rf6igndbf1vax85w9lz310kh0d12";
|
||||
sha256 = "1zgin0w1qa7wmfhcisx470fhnmddfxxp5nyyix31yaa7dznql82k";
|
||||
};
|
||||
buildInputs = [ mx mercurial ];
|
||||
postUnpack = ''
|
||||
@@ -146,7 +154,7 @@ in rec {
|
||||
};
|
||||
|
||||
graalvm8 = stdenv.mkDerivation rec {
|
||||
version = "1.0.0-rc3";
|
||||
version = "1.0.0-rc8";
|
||||
name = let
|
||||
n = "graal-${version}";
|
||||
in if (lib.stringLength n) == (lib.stringLength jvmci8.name) then
|
||||
@@ -157,7 +165,7 @@ in rec {
|
||||
owner = "oracle";
|
||||
repo = "graal";
|
||||
rev = "vm-${version}";
|
||||
sha256 = "1hcs4m6ailapgi3bikav1i517vqn5pn595cyqqjfvlnkjwihbnc3";
|
||||
sha256 = "1fada4awrr8bhw294xdiq4bagvgrlcr44mw6338gaal0ky3vkm0p";
|
||||
};
|
||||
buildInputs = [ mx zlib mercurial jvmci8 ];
|
||||
postUnpack = ''
|
||||
@@ -170,6 +178,17 @@ in rec {
|
||||
hg checkout ${lib.escapeShellArg src.rev}
|
||||
)
|
||||
'';
|
||||
postPatch = ''
|
||||
substituteInPlace substratevm/src/com.oracle.svm.core.posix/src/com/oracle/svm/core/posix/headers/PosixDirectives.java \
|
||||
--replace '<zlib.h>' '<${zlib.dev}/include/zlib.h>'
|
||||
substituteInPlace substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/CCLinkerInvocation.java \
|
||||
--replace 'cmd.add("-v");' 'cmd.add("-v"); cmd.add("-L${zlib}/lib");'
|
||||
substituteInPlace substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/c/codegen/CCompilerInvoker.java \
|
||||
--replace 'command.add(Platform.includedIn(Platform.WINDOWS.class) ? "CL" : "gcc");' \
|
||||
'command.add(Platform.includedIn(Platform.WINDOWS.class) ? "CL" : "${stdenv.cc}/bin/gcc");'
|
||||
substituteInPlace substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/CCLinkerInvocation.java \
|
||||
--replace 'protected String compilerCommand = "cc";' 'protected String compilerCommand = "${stdenv.cc}/bin/cc";'
|
||||
'';
|
||||
buildPhase = ''
|
||||
# make a copy of jvmci8
|
||||
cp -dpR ${jvmci8} $out
|
||||
@@ -178,13 +197,14 @@ in rec {
|
||||
|
||||
export MX_ALT_OUTPUT_ROOT=$NIX_BUILD_TOP/mxbuild
|
||||
export MX_CACHE_DIR=${makeMxCache graal-mxcache}
|
||||
|
||||
( cd substratevm
|
||||
|
||||
mkdir -p clibraries
|
||||
mx --java-home $out build
|
||||
|
||||
# bootstrap native-image (that was removed from mx build in https://github.com/oracle/graal/commit/140d7a7edf54ec5872a8ff45869cd1ae499efde4)
|
||||
mx --java-home $out native-image -cp $MX_ALT_OUTPUT_ROOT/substratevm/dists/svm-driver.jar com.oracle.svm.driver.NativeImage
|
||||
mx --java-home $out native-image -cp $MX_ALT_OUTPUT_ROOT/substratevm/dists/jdk1.8/svm-driver.jar com.oracle.svm.driver.NativeImage
|
||||
)
|
||||
( cd tools
|
||||
mx --java-home $out build
|
||||
@@ -195,17 +215,17 @@ in rec {
|
||||
mkdir -p $out/jre/tools/{profiler,chromeinspector,truffle/builder} $out/jre/lib/{graal,include,truffle/include}
|
||||
cp -vpLR substratevm/svmbuild/native-image-root/lib/* $out/jre/lib/ || true # ignore "same file" error when dereferencing symlinks
|
||||
cp -vp $MX_ALT_OUTPUT_ROOT/truffle/linux-amd64/truffle-nfi-native/bin/* $out/jre/lib/amd64/
|
||||
cp -vp $MX_ALT_OUTPUT_ROOT/compiler/dists/graal-*processor*.jar $out/jre/lib/graal/
|
||||
cp -vp $MX_ALT_OUTPUT_ROOT/compiler/dists/jdk1.8/graal-*processor*.jar $out/jre/lib/graal/
|
||||
cp -vp $MX_ALT_OUTPUT_ROOT/truffle/linux-amd64/truffle-nfi-native/include/* $out/jre/lib/include/
|
||||
cp -vp $MX_ALT_OUTPUT_ROOT/compiler/dists/graal-management.jar $out/jre/lib/jvmci/
|
||||
cp -vp $MX_ALT_OUTPUT_ROOT/compiler/dists/jdk1.8/graal-management.jar $out/jre/lib/jvmci/
|
||||
cp -vdpR $out/jre/lib/svm/clibraries $out/jre/lib/svm/builder/
|
||||
cp -vpR $MX_ALT_OUTPUT_ROOT/truffle/dists/* $out/jre/lib/truffle/
|
||||
cp -vpR $MX_ALT_OUTPUT_ROOT/truffle/dists/jdk1.8/* $out/jre/lib/truffle/
|
||||
cp -vp $MX_ALT_OUTPUT_ROOT/truffle/linux-amd64/truffle-nfi-native/include/* $out/jre/lib/truffle/include/
|
||||
cp -vpLR substratevm/svmbuild/native-image-root/tools/* $out/jre/tools/
|
||||
cp -vpR $MX_ALT_OUTPUT_ROOT/tools/dists/chromeinspector* $out/jre/tools/chromeinspector/
|
||||
cp -vpR $MX_ALT_OUTPUT_ROOT/tools/dists/truffle-profiler* $out/jre/tools/profiler/
|
||||
cp -vpR $MX_ALT_OUTPUT_ROOT/truffle/linux-amd64/truffle-nfi-native/* $out/jre/tools/truffle/
|
||||
cp -vp $MX_ALT_OUTPUT_ROOT/truffle/dists/truffle-nfi.jar $out/jre/tools/truffle/builder/
|
||||
cp -vp $MX_ALT_OUTPUT_ROOT/truffle/dists/jdk1.8/truffle-nfi.jar $out/jre/tools/truffle/builder/
|
||||
|
||||
echo "name=GraalVM ${version}" > $out/jre/lib/amd64/server/vm.properties
|
||||
echo -n "graal" > $out/jre/lib/jvmci/compiler-name
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{ stdenv, fetchurl, makeWrapper, jre, unzip }:
|
||||
|
||||
let
|
||||
version = "1.2.71";
|
||||
version = "1.3.0";
|
||||
in stdenv.mkDerivation rec {
|
||||
inherit version;
|
||||
name = "kotlin-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/JetBrains/kotlin/releases/download/v${version}/kotlin-compiler-${version}.zip";
|
||||
sha256 = "0yzanv2jkjx3vfixzvjsihfi00khs7zr47y01cil8bylzvyr50p4";
|
||||
sha256 = "14i5qmni1dzfamab6y659b5nvgp99m1abx71i83zcbfi9nw1r1gz";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ jre ] ;
|
||||
|
||||
@@ -8,16 +8,16 @@ in
|
||||
stdenv.mkDerivation rec {
|
||||
|
||||
name = "ber-metaocaml-${version}";
|
||||
version = "104";
|
||||
version = "107";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://caml.inria.fr/pub/distrib/ocaml-4.04/ocaml-4.04.0.tar.gz";
|
||||
sha256 = "1pi2hdm9lxhn45qvfqfss1hpa4jijm14qgmrgajsadxqdiplhqyb";
|
||||
url = "https://caml.inria.fr/pub/distrib/ocaml-4.07/ocaml-4.07.1.tar.gz";
|
||||
sha256 = "1x4sln131mcspisr22qc304590rvg720rbl7g2i4xiymgvhkpm1a";
|
||||
};
|
||||
|
||||
metaocaml = fetchurl {
|
||||
url = "http://okmij.org/ftp/ML/ber-metaocaml-104.tar.gz";
|
||||
sha256 = "1gmwlxairxqcmqa2r6kbf8b4dxc7pfhfbh48g1s14d3z20rj8nib";
|
||||
url = "http://okmij.org/ftp/ML/ber-metaocaml-107.tar.gz";
|
||||
sha256 = "0xy6n0yj1f53pk612zfmn49pn04bd75qa40xgmr0w0lzx6dqsfmm";
|
||||
};
|
||||
|
||||
# Needed to avoid a SIGBUS on the final executable on mips
|
||||
@@ -4,13 +4,13 @@ with lib;
|
||||
|
||||
mkDerivation rec {
|
||||
pname = "psc-package";
|
||||
version = "0.4.1";
|
||||
version = "0.4.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "purescript";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "1pbgijglyqrm998a6z5ahp4phd72crzr3s8vq17a9dz3i0a9hcj5";
|
||||
sha256 = "0xvnmpfj4c6h4gmc2c3d4gcs44527jrgfl11l2fs4ai1mc69w5zg";
|
||||
};
|
||||
|
||||
isLibrary = false;
|
||||
|
||||
@@ -21,12 +21,9 @@ stdenv.mkDerivation rec {
|
||||
|
||||
buildFlags = [ "build" ]; # do not "make tests" before reason lib is installed
|
||||
|
||||
installPhase = ''
|
||||
for p in reason rtop
|
||||
do
|
||||
${dune.installPhase} $p.install
|
||||
done
|
||||
inherit (dune) installPhase;
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/rtop \
|
||||
--prefix PATH : "${utop}/bin" \
|
||||
--set OCAMLPATH $out/lib/ocaml/${ocaml.version}/site-lib:$OCAMLPATH
|
||||
|
||||
Reference in New Issue
Block a user