Synchronize Haskell infrastructure with 'master' at b923fd5253.

This commit is contained in:
Peter Simons
2017-03-02 23:02:16 +01:00
parent 5435ad7f68
commit aa4a99c48c
11 changed files with 6840 additions and 2512 deletions

View File

@@ -1,9 +1,10 @@
{ stdenv, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
{ stdenv, lib, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
, hscolour, patchutils, sphinx
# If enabled GHC will be build with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library.
, enableIntegerSimple ? false, gmp
, cross ? null
}:
let
@@ -44,7 +45,9 @@ stdenv.mkDerivation rec {
"--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
] ++ stdenv.lib.optional stdenv.isDarwin [
"--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
];
] ++
# fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
# required, because otherwise all symbols from HSffi.o are stripped, and
# that in turn causes GHCi to abort

View File

@@ -1,4 +1,4 @@
{ stdenv, fetchgit, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
{ stdenv, lib, fetchgit, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
, autoconf, automake, happy, alex, python3, buildPlatform, targetPlatform
, selfPkgs, cross ? null
@@ -105,7 +105,9 @@ in stdenv.mkDerivation (rec {
"RANLIB=${stdenv.binutilsCross}/bin/${cross.config}-ranlib"
"--target=${cross.config}"
"--enable-bootstrap-with-devel-snapshot"
];
] ++
# fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
buildInputs = commonBuildInputs ++ [ stdenv.ccCross stdenv.binutilsCross ];

View File

@@ -1,4 +1,5 @@
{ mkDerivation
, lib
, broken ? false
, test-framework
, test-framework-hunit
@@ -94,6 +95,11 @@
]
, stage2 ? import ./stage2.nix
, patches ? [ ./ghcjs.patch ]
# used for resolving compiler plugins
, ghcLibdir ? null
}:
let
inherit (bootPkgs) ghc;
@@ -122,7 +128,7 @@ in mkDerivation (rec {
testDepends = [
HUnit test-framework test-framework-hunit
];
patches = [ ./ghcjs.patch ];
inherit patches;
postPatch = ''
substituteInPlace Setup.hs \
--replace "/usr/bin/env" "${coreutils}/bin/env"
@@ -165,6 +171,8 @@ in mkDerivation (rec {
--with-cabal ${cabal-install}/bin/cabal \
--with-gmp-includes ${gmp.dev}/include \
--with-gmp-libraries ${gmp.out}/lib
'' + lib.optionalString (ghcLibdir != null) ''
printf '%s' '${ghcLibdir}' > "$out/lib/ghcjs-${version}/ghc_libdir"
'';
passthru = {
inherit bootPkgs;

View File

@@ -59,14 +59,13 @@ self: super: {
# Link the proper version.
zeromq4-haskell = super.zeromq4-haskell.override { zeromq = pkgs.zeromq4; };
# The Hackage tarball is purposefully broken. Mr. Hess wants people to build
# his package from the Git repo because that is, like, better!
# The Hackage tarball is purposefully broken, because it's not intended to be, like, useful.
# https://git-annex.branchable.com/bugs/bash_completion_file_is_missing_in_the_6.20160527_tarball_on_hackage/
git-annex = ((overrideCabal super.git-annex (drv: {
src = pkgs.fetchFromGitHub {
owner = "joeyh";
repo = "git-annex";
sha256 = "0f79i2i1cr8j02vc4ganw92prbkv9ca1yl9jgkny0rxf28wdlc6v";
rev = drv.version;
src = pkgs.fetchgit {
url = "git://git-annex.branchable.com/";
rev = "refs/tags/" + drv.version;
sha256 = "0irvzwpwxxdy6qs7jj81r6qk7i1gkkqyaza4wcm0phyyn07yh2sz";
};
}))).override {
dbus = if pkgs.stdenv.isLinux then self.dbus else null;
@@ -700,22 +699,6 @@ self: super: {
# The latest Hoogle needs versions not yet in LTS Haskell 7.x.
hoogle = super.hoogle.override { haskell-src-exts = self.haskell-src-exts_1_19_1; };
# To be in sync with Hoogle.
lambdabot-haskell-plugins = (overrideCabal super.lambdabot-haskell-plugins (drv: {
patches = [
(pkgs.fetchpatch {
url = "https://github.com/lambdabot/lambdabot/commit/78a2361024724acb70bc1c12c42f3a16015bb373.patch";
sha256 = "0aw0jpw07idkrg8pdn3y3qzhjfrxsvmx3plg51m1aqgbzs000yxf";
stripLen = 2;
addPrefixes = true;
})
];
jailbreak = true;
})).override {
haskell-src-exts = self.haskell-src-exts-simple;
};
# Needs new version.
haskell-src-exts-simple = super.haskell-src-exts-simple.override { haskell-src-exts = self.haskell-src-exts_1_19_1; };
@@ -883,4 +866,8 @@ self: super: {
# https://github.com/dan-t/cabal-lenses/issues/6
cabal-lenses = doJailbreak super.cabal-lenses;
# https://github.com/snoyberg/yaml/issues/106
yaml = disableCabalFlag super.yaml "system-libyaml";
}

View File

@@ -42,6 +42,10 @@ self: super: {
# Build jailbreak-cabal with the latest version of Cabal.
jailbreak-cabal = super.jailbreak-cabal.override { Cabal = self.Cabal_1_24_2_0; };
gtk2hs-buildtools = super.gtk2hs-buildtools.override { Cabal = self.Cabal_1_24_2_0; };
megaparsec = addBuildDepend super.megaparsec self.fail;
Extra = appendPatch super.Extra (pkgs.fetchpatch {
url = "https://github.com/seereason/sr-extra/commit/29787ad4c20c962924b823d02a7335da98143603.patch";
sha256 = "193i1xmq6z0jalwmq0mhqk1khz6zz0i1hs6lgfd7ybd6qyaqnf5f";

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@
let
inherit (stdenv.lib) fix' extends makeOverridable;
inherit (stdenv.lib) fix' extends makeOverridable makeExtensible;
inherit (import ./lib.nix { inherit pkgs; }) overrideCabal;
haskellPackages = self:
@@ -108,7 +108,7 @@ let
in
fix'
makeExtensible
(extends overrides
(extends packageSetConfig
(extends compilerConfig

View File

@@ -9,11 +9,11 @@
, src ? fetchurl { url = "mirror://hackage/${pname}-${version}.tar.gz"; inherit sha256; }
, buildDepends ? [], setupHaskellDepends ? [], libraryHaskellDepends ? [], executableHaskellDepends ? []
, buildTarget ? ""
, buildTools ? [], libraryToolDepends ? [], executableToolDepends ? [], testToolDepends ? [], benchToolDepends ? []
, buildTools ? [], libraryToolDepends ? [], executableToolDepends ? [], testToolDepends ? [], benchmarkToolDepends ? []
, configureFlags ? []
, description ? ""
, doCheck ? !isCross && (stdenv.lib.versionOlder "7.4" ghc.version)
, doBench ? false
, withBenchmarkDepends ? false
, doHoogle ? true
, editedCabalFile ? null
, enableLibraryProfiling ? false
@@ -37,9 +37,9 @@
# TODO Do we care about haddock when cross-compiling?
, doHaddock ? !isCross && (!stdenv.isDarwin || stdenv.lib.versionAtLeast ghc.version "7.8")
, passthru ? {}
, pkgconfigDepends ? [], libraryPkgconfigDepends ? [], executablePkgconfigDepends ? [], testPkgconfigDepends ? [], benchPkgconfigDepends ? []
, pkgconfigDepends ? [], libraryPkgconfigDepends ? [], executablePkgconfigDepends ? [], testPkgconfigDepends ? [], benchmarkPkgconfigDepends ? []
, testDepends ? [], testHaskellDepends ? [], testSystemDepends ? []
, benchDepends ? [], benchHaskellDepends ? [], benchSystemDepends ? []
, benchmarkDepends ? [], benchmarkHaskellDepends ? [], benchmarkSystemDepends ? []
, testTarget ? ""
, broken ? false
, preCompileBuildDriver ? "", postCompileBuildDriver ? ""
@@ -141,14 +141,14 @@ let
isSystemPkg = x: !isHaskellPkg x;
allPkgconfigDepends = pkgconfigDepends ++ libraryPkgconfigDepends ++ executablePkgconfigDepends ++
optionals doCheck testPkgconfigDepends ++ optionals doBench benchPkgconfigDepends;
optionals doCheck testPkgconfigDepends ++ optionals withBenchmarkDepends benchmarkPkgconfigDepends;
propagatedBuildInputs = buildDepends ++ libraryHaskellDepends ++ executableHaskellDepends;
otherBuildInputs = extraLibraries ++ librarySystemDepends ++ executableSystemDepends ++ setupHaskellDepends ++
buildTools ++ libraryToolDepends ++ executableToolDepends ++
optionals (allPkgconfigDepends != []) ([pkgconfig] ++ allPkgconfigDepends) ++
optionals doCheck (testDepends ++ testHaskellDepends ++ testSystemDepends ++ testToolDepends) ++
optionals doBench (benchDepends ++ benchHaskellDepends ++ benchSystemDepends ++ benchToolDepends);
optionals withBenchmarkDepends (benchmarkDepends ++ benchmarkHaskellDepends ++ benchmarkSystemDepends ++ benchmarkToolDepends);
allBuildInputs = propagatedBuildInputs ++ otherBuildInputs;
haskellBuildInputs = stdenv.lib.filter isHaskellPkg allBuildInputs;
@@ -193,11 +193,13 @@ stdenv.mkDerivation ({
${jailbreak-cabal}/bin/jailbreak-cabal ${pname}.cabal
'' + postPatch;
# for ghcjs, we want to put ghcEnv on PATH so compiler plugins will be available.
# TODO(cstrahan): would the same be of benefit to native ghc?
setupCompilerEnvironmentPhase = ''
runHook preSetupCompilerEnvironment
echo "Build with ${ghc}."
export PATH="${ghc}/bin:$PATH"
export PATH="${if ghc.isGhcjs or false then ghcEnv else ghc}/bin:$PATH"
${optionalString (hasActiveLibrary && hyperlinkSource) "export PATH=${hscolour}/bin:$PATH"}
packageConfDir="$TMPDIR/package.conf.d"
@@ -303,7 +305,7 @@ stdenv.mkDerivation ({
passthru = passthru // {
inherit pname version ghcEnv haskellBuildInputs;
inherit pname version;
isHaskellLibrary = hasActiveLibrary;
@@ -344,7 +346,7 @@ stdenv.mkDerivation ({
// optionalAttrs (preBuild != "") { inherit preBuild; }
// optionalAttrs (postBuild != "") { inherit postBuild; }
// optionalAttrs (doCheck) { inherit doCheck; }
// optionalAttrs (doBench) { inherit doBench; }
// optionalAttrs (withBenchmarkDepends) { inherit withBenchmarkDepends; }
// optionalAttrs (checkPhase != "") { inherit checkPhase; }
// optionalAttrs (preCheck != "") { inherit preCheck; }
// optionalAttrs (postCheck != "") { inherit postCheck; }

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,12 @@
{ stdenv, lib, ghc, llvmPackages, packages, buildEnv, makeWrapper
{ stdenv, lib, ghc, llvmPackages, packages, symlinkJoin, makeWrapper
, ignoreCollisions ? false, withLLVM ? false
, postBuild ? ""
, haskellPackages
, ghcLibdir ? null # only used by ghcjs, when resolving plugins
}:
assert ghcLibdir != null -> (ghc.isGhcjs or false);
# This wrapper works only with GHC 6.12 or later.
assert lib.versionOlder "6.12" ghc.version || ghc.isGhcjs;
@@ -48,7 +51,7 @@ let
++ lib.optional stdenv.isDarwin llvmPackages.clang);
in
if paths == [] && !withLLVM then ghc else
buildEnv {
symlinkJoin {
# this makes computing paths from the name attribute impossible;
# if such a feature is needed, the real compiler name should be saved
# as a dedicated drv attribute, like `compiler-name`
@@ -59,14 +62,6 @@ buildEnv {
postBuild = ''
. ${makeWrapper}/nix-support/setup-hook
# Work around buildEnv sometimes deciding to make bin a symlink
if test -L "$out/bin"; then
binTarget="$(readlink -f "$out/bin")"
rm "$out/bin"
cp -r "$binTarget" "$out/bin"
chmod u+w "$out/bin"
fi
# wrap compiler executables with correct env variables
for prg in ${ghcCommand} ${ghcCommand}i ${ghcCommand}-${ghc.version} ${ghcCommand}i-${ghc.version}; do
@@ -102,6 +97,12 @@ buildEnv {
done
${lib.optionalString hasLibraries "$out/bin/${ghcCommand}-pkg recache"}
${# ghcjs will read the ghc_libdir file when resolving plugins.
lib.optionalString (isGhcjs && ghcLibdir != null) ''
mkdir -p "${libDir}"
rm -f "${libDir}/ghc_libdir"
printf '%s' '${ghcLibdir}' > "${libDir}/ghc_libdir"
''}
$out/bin/${ghcCommand}-pkg check
'' + postBuild;
passthru = {

View File

@@ -7,12 +7,12 @@
}:
mkDerivation {
pname = "tinc";
version = "20161119";
version = "20170228";
src = fetchFromGitHub {
owner = "sol";
repo = "tinc";
rev = "8e31ed920ad1660b3bc458b4f6b281bacaf4bd14";
sha256 = "0y9pvr20p9z4dddbfxgy9hl3ny7pxixxjg8ij7g8l14br6mcak30";
rev = "e829926a043a68a8a4dc551485c4d666837474af";
sha256 = "1zdp1mqp3jn2faw0d3jlcbrkp4azgl5ahhq5pxdn24gyq70zkchc";
};
isLibrary = false;
isExecutable = true;