mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 23:22:37 +00:00
Revert "Merge pull request #27209 from nc6/nc/haskell-multiple-out"
This reverts commitdfb0f25484
, reversing changes made to7f8ff02437
. These changes broke the ghcWithPackages wrapper: nix-shell -p "haskellPackages.ghcWithPackages (ps: [ps.mtl])" --run "ghc-pkg list mtl" /nix/store/szz84j5k1dy3jdashis6ws28d8l8zxxb-ghc-8.0.2-with-packages/lib/ghc-8.0.2/package.conf.d (no packages)
This commit is contained in:
parent
f2a76b6c29
commit
89f5d52cf4
@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "1x8m4rp2v7ydnrz6z9g8x7z3x3d3pxhv2pixy7i7hkbqbdsp7kal";
|
sha256 = "1x8m4rp2v7ydnrz6z9g8x7z3x3d3pxhv2pixy7i7hkbqbdsp7kal";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ ghc perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42 (stdenv.lib.getBin hscolour) ];
|
buildInputs = [ ghc perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42 hscolour ];
|
||||||
|
|
||||||
patches = [ ./relocation.patch ];
|
patches = [ ./relocation.patch ];
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
|
|||||||
./relocation.patch
|
./relocation.patch
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = [ ghc perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42 (stdenv.lib.getBin hscolour) ];
|
buildInputs = [ ghc perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42 hscolour ];
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
|
|||||||
(fetchFilteredPatch { url = https://git.haskell.org/ghc.git/patch/2f8cd14fe909a377b3e084a4f2ded83a0e6d44dd; sha256 = "06zvlgcf50ab58bw6yw3krn45dsmhg4cmlz4nqff8k4z1f1bj01v"; })
|
(fetchFilteredPatch { url = https://git.haskell.org/ghc.git/patch/2f8cd14fe909a377b3e084a4f2ded83a0e6d44dd; sha256 = "06zvlgcf50ab58bw6yw3krn45dsmhg4cmlz4nqff8k4z1f1bj01v"; })
|
||||||
] ++ stdenv.lib.optional stdenv.isLinux ./ghc-no-madv-free.patch;
|
] ++ stdenv.lib.optional stdenv.isLinux ./ghc-no-madv-free.patch;
|
||||||
|
|
||||||
buildInputs = [ ghc perl (stdenv.lib.getBin hscolour) sphinx];
|
buildInputs = [ ghc perl hscolour sphinx];
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
|
|||||||
++ stdenv.lib.optional stdenv.isLinux ./ghc-no-madv-free.patch
|
++ stdenv.lib.optional stdenv.isLinux ./ghc-no-madv-free.patch
|
||||||
++ stdenv.lib.optional stdenv.isDarwin ./ghc-8.0.2-no-cpp-warnings.patch;
|
++ stdenv.lib.optional stdenv.isDarwin ./ghc-8.0.2-no-cpp-warnings.patch;
|
||||||
|
|
||||||
buildInputs = [ ghc perl (stdenv.lib.getBin hscolour) sphinx ];
|
buildInputs = [ ghc perl hscolour sphinx ];
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ let
|
|||||||
inherit (bootPkgs) ghc;
|
inherit (bootPkgs) ghc;
|
||||||
version = "8.2.1";
|
version = "8.2.1";
|
||||||
preReleaseName = "ghc-8.2.1";
|
preReleaseName = "ghc-8.2.1";
|
||||||
commonBuildInputs = [ (stdenv.lib.getBin alex) autoconf automake ghc (stdenv.lib.getBin happy) (stdenv.lib.getBin hscolour) perl python3 sphinx ];
|
commonBuildInputs = [ alex autoconf automake ghc happy hscolour perl python3 sphinx ];
|
||||||
commonPreConfigure = ''
|
commonPreConfigure = ''
|
||||||
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
||||||
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
|
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
let
|
let
|
||||||
inherit (bootPkgs) ghc;
|
inherit (bootPkgs) ghc;
|
||||||
|
|
||||||
commonBuildInputs = [ ghc perl autoconf automake (stdenv.lib.getBin happy) (stdenv.lib.getBin alex) python3 ];
|
commonBuildInputs = [ ghc perl autoconf automake happy alex python3 ];
|
||||||
|
|
||||||
rev = "14457cf6a50f708eecece8f286f08687791d51f7";
|
rev = "14457cf6a50f708eecece8f286f08687791d51f7";
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ in mkDerivation (rec {
|
|||||||
lens optparse-applicative parallel safe shelly split
|
lens optparse-applicative parallel safe shelly split
|
||||||
stringsearch syb system-fileio system-filepath tar terminfo text-binary
|
stringsearch syb system-fileio system-filepath tar terminfo text-binary
|
||||||
unordered-containers vector wl-pprint-text yaml
|
unordered-containers vector wl-pprint-text yaml
|
||||||
(stdenv.lib.getBin alex) (stdenv.lib.getBin happy) git gnumake autoconf automake libtool patch gmp
|
alex happy git gnumake autoconf automake libtool patch gmp
|
||||||
base16-bytestring cryptohash executable-path haddock-api
|
base16-bytestring cryptohash executable-path haddock-api
|
||||||
transformers-compat QuickCheck haddock hspec xhtml
|
transformers-compat QuickCheck haddock hspec xhtml
|
||||||
regex-posix libiconv
|
regex-posix libiconv
|
||||||
|
@ -20,9 +20,9 @@ stdenv.mkDerivation rec {
|
|||||||
sed -ie 's|ld |${binutils}/bin/ld |g' src/scripts/ldkernel.in
|
sed -ie 's|ld |${binutils}/bin/ld |g' src/scripts/ldkernel.in
|
||||||
'';
|
'';
|
||||||
configureFlags = stdenv.lib.optional (!enableIntegerSimple) [ "--enable-gmp" ];
|
configureFlags = stdenv.lib.optional (!enableIntegerSimple) [ "--enable-gmp" ];
|
||||||
propagatedNativeBuildInputs = [ (stdenv.lib.getBin alex) (stdenv.lib.getBin happy) ];
|
propagatedNativeBuildInputs = [ alex happy ];
|
||||||
buildInputs =
|
buildInputs =
|
||||||
let haskellPkgs = [ (stdenv.lib.getBin alex) (stdenv.lib.getBin happy) (stdenv.lib.getBin bootPkgs.hscolour) bootPkgs.cabal-install bootPkgs.haddock bootPkgs.hpc
|
let haskellPkgs = [ alex happy bootPkgs.hscolour bootPkgs.cabal-install bootPkgs.haddock bootPkgs.hpc
|
||||||
]; in [ bootPkgs.ghc
|
]; in [ bootPkgs.ghc
|
||||||
automake perl git binutils
|
automake perl git binutils
|
||||||
autoconf xen zlib ncurses.dev
|
autoconf xen zlib ncurses.dev
|
||||||
|
@ -862,7 +862,6 @@ self: super: {
|
|||||||
# Don't install internal mkReadme tool.
|
# Don't install internal mkReadme tool.
|
||||||
hastache = overrideCabal super.hastache (drv: {
|
hastache = overrideCabal super.hastache (drv: {
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
enableSeparateBinOutput = false;
|
|
||||||
postInstall = "rm $out/bin/mkReadme && rmdir $out/bin";
|
postInstall = "rm $out/bin/mkReadme && rmdir $out/bin";
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -211,10 +211,7 @@ self: super: builtins.intersectAttrs super {
|
|||||||
|
|
||||||
# wxc supports wxGTX >= 3.0, but our current default version points to 2.8.
|
# wxc supports wxGTX >= 3.0, but our current default version points to 2.8.
|
||||||
# http://hydra.cryp.to/build/1331287/log/raw
|
# http://hydra.cryp.to/build/1331287/log/raw
|
||||||
wxc = (overrideCabal super.wxc (drv: {
|
wxc = (addBuildDepend super.wxc self.split).override { wxGTK = pkgs.wxGTK30; };
|
||||||
buildDepends = (drv.buildDepends or []) ++ [self.split];
|
|
||||||
postInstall = "cp -v dist/build/libwxc.so.0.92.3.0 $lib/lib/libwxc.so";
|
|
||||||
})).override { wxGTK = pkgs.wxGTK30; };
|
|
||||||
wxcore = super.wxcore.override { wxGTK = pkgs.wxGTK30; };
|
wxcore = super.wxcore.override { wxGTK = pkgs.wxGTK30; };
|
||||||
|
|
||||||
# Test suite wants to connect to $DISPLAY.
|
# Test suite wants to connect to $DISPLAY.
|
||||||
@ -492,47 +489,4 @@ self: super: builtins.intersectAttrs super {
|
|||||||
# Without this override, the builds lacks pkg-config.
|
# Without this override, the builds lacks pkg-config.
|
||||||
opencv-extra = addPkgconfigDepend super.opencv-extra (pkgs.opencv3.override { enableContrib = true; });
|
opencv-extra = addPkgconfigDepend super.opencv-extra (pkgs.opencv3.override { enableContrib = true; });
|
||||||
|
|
||||||
# Alex has some weird files in /usr/share that create a cyclic ref with
|
|
||||||
# its bin dir.
|
|
||||||
alex = hasNoBinOutput super.alex;
|
|
||||||
|
|
||||||
# Disable separate bin outputs for these specific packages that break with it.
|
|
||||||
H = hasNoBinOutput super.H;
|
|
||||||
cryptol = hasNoBinOutput super.cryptol;
|
|
||||||
hscolour = hasNoBinOutput super.hscolour;
|
|
||||||
sproxy = hasNoBinOutput super.sproxy;
|
|
||||||
sproxy2 = hasNoBinOutput super.sproxy2;
|
|
||||||
sproxy-web = hasNoBinOutput super.sproxy-web;
|
|
||||||
juandelacosa = hasNoBinOutput super.juandelacosa;
|
|
||||||
mywatch = hasNoBinOutput super.mywatch;
|
|
||||||
sugarhaskell = hasNoBinOutput super.sugarhaskell;
|
|
||||||
zerobin = hasNoBinOutput super.zerobin;
|
|
||||||
|
|
||||||
git-annex = overrideCabal super.git-annex (drv: {
|
|
||||||
enableSeparateBinOutput = false;
|
|
||||||
enableSeparateEtcOutput = false;
|
|
||||||
});
|
|
||||||
|
|
||||||
# Override a number of packages with specific references to $out in their
|
|
||||||
# derivations
|
|
||||||
stack = overrideCabal super.stack (drv: {
|
|
||||||
postInstall = ''
|
|
||||||
exe=$bin/bin/stack
|
|
||||||
mkdir -p $bin/share/bash-completion/completions
|
|
||||||
$exe --bash-completion-script $exe >$bin/share/bash-completion/completions/stack
|
|
||||||
'';
|
|
||||||
});
|
|
||||||
Agda = overrideCabal super.Agda (drv: {
|
|
||||||
postInstall = ''
|
|
||||||
files=("$out/share/"*"-ghc-"*"/Agda-"*"/lib/prim/Agda/"{Primitive.agda,Builtin"/"*.agda})
|
|
||||||
for f in "''${files[@]}" ; do
|
|
||||||
$bin/bin/agda $f
|
|
||||||
done
|
|
||||||
for f in "''${files[@]}" ; do
|
|
||||||
$bin/bin/agda -c --no-main $f
|
|
||||||
done
|
|
||||||
$bin/bin/agda-mode compile
|
|
||||||
'';
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -56,10 +56,6 @@ let isCross = (ghc.cross or null) != null; in
|
|||||||
, hardeningDisable ? lib.optional (ghc.isHaLVM or false) "all"
|
, hardeningDisable ? lib.optional (ghc.isHaLVM or false) "all"
|
||||||
, enableSeparateDataOutput ? false
|
, enableSeparateDataOutput ? false
|
||||||
, enableSeparateDocOutput ? doHaddock
|
, enableSeparateDocOutput ? doHaddock
|
||||||
, enableSeparateBinOutput ? isExecutable
|
|
||||||
, outputsToInstall ? []
|
|
||||||
, enableSeparateLibOutput ? true
|
|
||||||
, enableSeparateEtcOutput ? (stdenv.lib.versionOlder "7.7" ghc.version)
|
|
||||||
} @ args:
|
} @ args:
|
||||||
|
|
||||||
assert editedCabalFile != null -> revision != null;
|
assert editedCabalFile != null -> revision != null;
|
||||||
@ -83,6 +79,9 @@ let
|
|||||||
then "package-db"
|
then "package-db"
|
||||||
else "package-conf";
|
else "package-conf";
|
||||||
|
|
||||||
|
# the target dir for haddock documentation
|
||||||
|
docdir = docoutput: docoutput + "/share/doc";
|
||||||
|
|
||||||
newCabalFileUrl = "http://hackage.haskell.org/package/${pname}-${version}/revision/${revision}.cabal";
|
newCabalFileUrl = "http://hackage.haskell.org/package/${pname}-${version}/revision/${revision}.cabal";
|
||||||
newCabalFile = fetchurl {
|
newCabalFile = fetchurl {
|
||||||
url = newCabalFileUrl;
|
url = newCabalFileUrl;
|
||||||
@ -96,13 +95,6 @@ let
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
hasActiveLibrary = isLibrary && (enableStaticLibraries || enableSharedLibraries || enableLibraryProfiling);
|
hasActiveLibrary = isLibrary && (enableStaticLibraries || enableSharedLibraries || enableLibraryProfiling);
|
||||||
hasLibOutput = enableSeparateLibOutput && hasActiveLibrary;
|
|
||||||
libDir = if hasLibOutput then "$lib/lib/${ghc.name}" else "$out/lib/${ghc.name}";
|
|
||||||
binDir = if enableSeparateBinOutput then "$bin/bin" else "$out/bin";
|
|
||||||
libexecDir = if enableSeparateBinOutput then "$libexec/bin" else "$out/libexec";
|
|
||||||
etcDir = if enableSeparateEtcOutput then "$etc/etc" else "$out/etc";
|
|
||||||
docDir = if enableSeparateDocOutput then "$doc/share/doc" else "$out/share/doc";
|
|
||||||
dataDir = if enableSeparateDataOutput then "$data/share/${ghc.name}" else "$out/share/${ghc.name}";
|
|
||||||
|
|
||||||
# We cannot enable -j<n> parallelism for libraries because GHC is far more
|
# We cannot enable -j<n> parallelism for libraries because GHC is far more
|
||||||
# likely to generate a non-determistic library ID in that case. Further
|
# likely to generate a non-determistic library ID in that case. Further
|
||||||
@ -121,20 +113,12 @@ let
|
|||||||
stdenv.lib.optionalString isCross (" " + stdenv.lib.concatStringsSep " " crossCabalFlags);
|
stdenv.lib.optionalString isCross (" " + stdenv.lib.concatStringsSep " " crossCabalFlags);
|
||||||
|
|
||||||
defaultConfigureFlags = [
|
defaultConfigureFlags = [
|
||||||
"--verbose" "--prefix=$out"
|
"--verbose" "--prefix=$out" "--libdir=\\$prefix/lib/\\$compiler" "--libsubdir=\\$pkgid"
|
||||||
# Binary directory has to be $bin/bin instead of just $bin: this
|
(optionalString enableSeparateDataOutput "--datadir=$data/share/${ghc.name}")
|
||||||
# is so that the package is added to the PATH when it's used as a
|
(optionalString enableSeparateDocOutput "--docdir=${docdir "$doc"}")
|
||||||
# build input. Sadly mkDerivation won't add inputs that don't have
|
|
||||||
# bin subdirectory.
|
|
||||||
"--bindir=${binDir}"
|
|
||||||
"--libdir=${libDir}" "--libsubdir=\\$pkgid"
|
|
||||||
"--libexecdir=${libexecDir}"
|
|
||||||
(optionalString (enableSeparateEtcOutput) "--sysconfdir=${etcDir}") # Old versions of cabal don't support this flag.
|
|
||||||
"--datadir=${dataDir}"
|
|
||||||
"--docdir=${docDir}"
|
|
||||||
"--with-gcc=$CC" # Clang won't work without that extra information.
|
"--with-gcc=$CC" # Clang won't work without that extra information.
|
||||||
"--package-db=$packageConfDir"
|
"--package-db=$packageConfDir"
|
||||||
(optionalString (enableSharedExecutables && stdenv.isLinux) "--ghc-option=-optl=-Wl,-rpath=${libDir}/${pname}-${version}")
|
(optionalString (enableSharedExecutables && stdenv.isLinux) "--ghc-option=-optl=-Wl,-rpath=$out/lib/${ghc.name}/${pname}-${version}")
|
||||||
(optionalString (enableSharedExecutables && stdenv.isDarwin) "--ghc-option=-optl=-Wl,-headerpad_max_install_names")
|
(optionalString (enableSharedExecutables && stdenv.isDarwin) "--ghc-option=-optl=-Wl,-headerpad_max_install_names")
|
||||||
(optionalString enableParallelBuilding "--ghc-option=-j$NIX_BUILD_CORES")
|
(optionalString enableParallelBuilding "--ghc-option=-j$NIX_BUILD_CORES")
|
||||||
(optionalString useCpphs "--with-cpphs=${cpphs}/bin/cpphs --ghc-options=-cpp --ghc-options=-pgmP${cpphs}/bin/cpphs --ghc-options=-optP--cpp")
|
(optionalString useCpphs "--with-cpphs=${cpphs}/bin/cpphs --ghc-options=-cpp --ghc-options=-pgmP${cpphs}/bin/cpphs --ghc-options=-optP--cpp")
|
||||||
@ -168,8 +152,7 @@ let
|
|||||||
allPkgconfigDepends = pkgconfigDepends ++ libraryPkgconfigDepends ++ executablePkgconfigDepends ++
|
allPkgconfigDepends = pkgconfigDepends ++ libraryPkgconfigDepends ++ executablePkgconfigDepends ++
|
||||||
optionals doCheck testPkgconfigDepends ++ optionals withBenchmarkDepends benchmarkPkgconfigDepends;
|
optionals doCheck testPkgconfigDepends ++ optionals withBenchmarkDepends benchmarkPkgconfigDepends;
|
||||||
|
|
||||||
nativeBuildInputs = map stdenv.lib.getBin
|
nativeBuildInputs = buildTools ++ libraryToolDepends ++ executableToolDepends ++ [ removeReferencesTo ];
|
||||||
(buildTools ++ libraryToolDepends ++ executableToolDepends ++ [ removeReferencesTo ]);
|
|
||||||
propagatedBuildInputs = buildDepends ++ libraryHaskellDepends ++ executableHaskellDepends;
|
propagatedBuildInputs = buildDepends ++ libraryHaskellDepends ++ executableHaskellDepends;
|
||||||
otherBuildInputs = setupHaskellDepends ++ extraLibraries ++ librarySystemDepends ++ executableSystemDepends ++
|
otherBuildInputs = setupHaskellDepends ++ extraLibraries ++ librarySystemDepends ++ executableSystemDepends ++
|
||||||
optionals (allPkgconfigDepends != []) ([pkgconfig] ++ allPkgconfigDepends) ++
|
optionals (allPkgconfigDepends != []) ([pkgconfig] ++ allPkgconfigDepends) ++
|
||||||
@ -198,15 +181,7 @@ assert allPkgconfigDepends != [] -> pkgconfig != null;
|
|||||||
stdenv.mkDerivation ({
|
stdenv.mkDerivation ({
|
||||||
name = "${pname}-${version}";
|
name = "${pname}-${version}";
|
||||||
|
|
||||||
outputs = if (args ? outputs) then args.outputs else
|
outputs = if (args ? outputs) then args.outputs else ([ "out" ] ++ (optional enableSeparateDataOutput "data") ++ (optional enableSeparateDocOutput "doc"));
|
||||||
( (optional enableSeparateBinOutput "bin")
|
|
||||||
++ (optional enableSeparateBinOutput "libexec")
|
|
||||||
++ [ "out" ]
|
|
||||||
++ (optional enableSeparateDataOutput "data")
|
|
||||||
++ (optional enableSeparateDocOutput "doc")
|
|
||||||
++ (optional enableSeparateEtcOutput "etc")
|
|
||||||
++ (optional hasLibOutput "lib")
|
|
||||||
);
|
|
||||||
setOutputFlags = false;
|
setOutputFlags = false;
|
||||||
|
|
||||||
pos = builtins.unsafeGetAttrPos "pname" args;
|
pos = builtins.unsafeGetAttrPos "pname" args;
|
||||||
@ -230,7 +205,7 @@ stdenv.mkDerivation ({
|
|||||||
|
|
||||||
postPatch = optionalString jailbreak ''
|
postPatch = optionalString jailbreak ''
|
||||||
echo "Run jailbreak-cabal to lift version restrictions on build inputs."
|
echo "Run jailbreak-cabal to lift version restrictions on build inputs."
|
||||||
${stdenv.lib.getBin jailbreak-cabal}/bin/jailbreak-cabal ${pname}.cabal
|
${jailbreak-cabal}/bin/jailbreak-cabal ${pname}.cabal
|
||||||
'' + postPatch;
|
'' + postPatch;
|
||||||
|
|
||||||
setupCompilerEnvironmentPhase = ''
|
setupCompilerEnvironmentPhase = ''
|
||||||
@ -238,7 +213,7 @@ stdenv.mkDerivation ({
|
|||||||
|
|
||||||
echo "Build with ${ghc}."
|
echo "Build with ${ghc}."
|
||||||
export PATH="${ghc}/bin:$PATH"
|
export PATH="${ghc}/bin:$PATH"
|
||||||
${optionalString (hasActiveLibrary && hyperlinkSource) "export PATH=${stdenv.lib.getBin hscolour}/bin:$PATH"}
|
${optionalString (hasActiveLibrary && hyperlinkSource) "export PATH=${hscolour}/bin:$PATH"}
|
||||||
|
|
||||||
packageConfDir="$TMPDIR/package.conf.d"
|
packageConfDir="$TMPDIR/package.conf.d"
|
||||||
mkdir -p $packageConfDir
|
mkdir -p $packageConfDir
|
||||||
@ -265,7 +240,7 @@ stdenv.mkDerivation ({
|
|||||||
#
|
#
|
||||||
# Create a local directory with symlinks of the *.dylib (macOS shared
|
# Create a local directory with symlinks of the *.dylib (macOS shared
|
||||||
# libraries) from all the dependencies.
|
# libraries) from all the dependencies.
|
||||||
local dynamicLinksDir="${libDir}/links"
|
local dynamicLinksDir="$out/lib/links"
|
||||||
mkdir -p $dynamicLinksDir
|
mkdir -p $dynamicLinksDir
|
||||||
for d in $(grep dynamic-library-dirs "$packageConfDir/"*|awk '{print $2}'); do
|
for d in $(grep dynamic-library-dirs "$packageConfDir/"*|awk '{print $2}'); do
|
||||||
ln -s "$d/"*.dylib $dynamicLinksDir
|
ln -s "$d/"*.dylib $dynamicLinksDir
|
||||||
@ -337,7 +312,7 @@ stdenv.mkDerivation ({
|
|||||||
|
|
||||||
${if !hasActiveLibrary then "${setupCommand} install" else ''
|
${if !hasActiveLibrary then "${setupCommand} install" else ''
|
||||||
${setupCommand} copy
|
${setupCommand} copy
|
||||||
local packageConfDir="${libDir}/package.conf.d"
|
local packageConfDir="$out/lib/${ghc.name}/package.conf.d"
|
||||||
local packageConfFile="$packageConfDir/${pname}-${version}.conf"
|
local packageConfFile="$packageConfDir/${pname}-${version}.conf"
|
||||||
mkdir -p "$packageConfDir"
|
mkdir -p "$packageConfDir"
|
||||||
${setupCommand} register --gen-pkg-config=$packageConfFile
|
${setupCommand} register --gen-pkg-config=$packageConfFile
|
||||||
@ -345,7 +320,7 @@ stdenv.mkDerivation ({
|
|||||||
mv $packageConfFile $packageConfDir/$pkgId.conf
|
mv $packageConfFile $packageConfDir/$pkgId.conf
|
||||||
''}
|
''}
|
||||||
${optionalString isGhcjs ''
|
${optionalString isGhcjs ''
|
||||||
for exeDir in "${binDir}/"*.jsexe; do
|
for exeDir in "$out/bin/"*.jsexe; do
|
||||||
exe="''${exeDir%.jsexe}"
|
exe="''${exeDir%.jsexe}"
|
||||||
printWords '#!${nodejs}/bin/node' > "$exe"
|
printWords '#!${nodejs}/bin/node' > "$exe"
|
||||||
cat "$exeDir/all.js" >> "$exe"
|
cat "$exeDir/all.js" >> "$exe"
|
||||||
@ -354,68 +329,18 @@ stdenv.mkDerivation ({
|
|||||||
''}
|
''}
|
||||||
${optionalString doCoverage "mkdir -p $out/share && cp -r dist/hpc $out/share"}
|
${optionalString doCoverage "mkdir -p $out/share && cp -r dist/hpc $out/share"}
|
||||||
${optionalString (enableSharedExecutables && isExecutable && !isGhcjs && stdenv.isDarwin && stdenv.lib.versionOlder ghc.version "7.10") ''
|
${optionalString (enableSharedExecutables && isExecutable && !isGhcjs && stdenv.isDarwin && stdenv.lib.versionOlder ghc.version "7.10") ''
|
||||||
for exe in "${binDir}/"* ; do
|
for exe in "$out/bin/"* ; do
|
||||||
install_name_tool -add_rpath "${libDir}/${pname}-${version}" "$exe"
|
install_name_tool -add_rpath "$out/lib/ghc-${ghc.version}/${pname}-${version}" "$exe"
|
||||||
done
|
done
|
||||||
''}
|
''}
|
||||||
|
|
||||||
${optionalString enableSeparateDocOutput ''
|
${optionalString enableSeparateDocOutput ''
|
||||||
# Remove references back to $out but also back to $lib if we have
|
for x in ${docdir "$doc"}/html/src/*.html; do
|
||||||
# docs. $lib is needed as it stores path to haddock interfaces in the
|
remove-references-to -t $out $x
|
||||||
# conf file which creates a cycle if docs refer back to library
|
|
||||||
# path.
|
|
||||||
mkdir -p ${docDir}
|
|
||||||
|
|
||||||
for x in ${docDir}/html/src/*.html; do
|
|
||||||
remove-references-to -t $out -t ${libDir} -t ${binDir} ${optionalString enableSeparateDataOutput "-t $data"} $x
|
|
||||||
done
|
done
|
||||||
|
mkdir -p $doc
|
||||||
''}
|
''}
|
||||||
|
${optionalString enableSeparateDataOutput "mkdir -p $data"}
|
||||||
${optionalString hasLibOutput ''
|
|
||||||
# Even if we don't have binary output for the package, things like
|
|
||||||
# Paths files will embed paths to bin/libexec directories in themselves
|
|
||||||
# which results in .lib <-> $out cyclic store reference. We
|
|
||||||
# therefore patch out the paths from separate library if we don't have
|
|
||||||
# separate bin output too.
|
|
||||||
#
|
|
||||||
# If we _do_ have separate bin and lib outputs, we may still be in
|
|
||||||
# trouble in case of shared executables: executable contains path to
|
|
||||||
# .lib, .lib contains path (through Paths) to .bin and we have a
|
|
||||||
# cycle.
|
|
||||||
#
|
|
||||||
# Lastly we have to deal with references from .lib back into
|
|
||||||
# $out/share if we're not splitting out data directory.
|
|
||||||
#
|
|
||||||
# It may happen that we have hasLibOutput set but the library
|
|
||||||
# directory was not created: this happens in the case that library
|
|
||||||
# section is not exposing any modules. See "fail" package for an
|
|
||||||
# example where no modules are exposed for GHC >= 8.0.
|
|
||||||
if [ -d ${libDir} ]; then
|
|
||||||
find ${libDir} -type f -exec \
|
|
||||||
remove-references-to -t ${binDir} -t ${libexecDir} "{}" \;
|
|
||||||
fi
|
|
||||||
''}
|
|
||||||
|
|
||||||
${optionalString (hasLibOutput && ! enableSeparateDocOutput) ''
|
|
||||||
# If we don't have separate docs, we have to patch out the ref to
|
|
||||||
# docs in package conf. This will likely break Haddock
|
|
||||||
# cross-package links but is necessary to break store cycle…
|
|
||||||
find ${libDir}/ -type f -name '*.conf' -exec \
|
|
||||||
remove-references-to -t ${docDir} "{}" \;
|
|
||||||
''}
|
|
||||||
|
|
||||||
${optionalString (hasLibOutput && ! enableSeparateDataOutput) ''
|
|
||||||
# Just like for doc output path in $out potentially landing in
|
|
||||||
# *.conf, we have to also remove the data directory so that it
|
|
||||||
# doesn't appear under data-dir field creating a cycle.
|
|
||||||
find ${libDir}/ -type f -exec echo Removing ${dataDir} refs from "{}" \;
|
|
||||||
find ${libDir}/ -type f -exec \
|
|
||||||
remove-references-to -t ${dataDir} "{}" \;
|
|
||||||
''}
|
|
||||||
|
|
||||||
${optionalString enableSeparateDataOutput "mkdir -p ${dataDir}"}
|
|
||||||
${optionalString enableSeparateBinOutput "mkdir -p ${binDir} ${libexecDir}"}
|
|
||||||
${optionalString enableSeparateEtcOutput "mkdir -p ${etcDir}"}
|
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
@ -432,7 +357,7 @@ stdenv.mkDerivation ({
|
|||||||
# the directory containing the haddock documentation.
|
# the directory containing the haddock documentation.
|
||||||
# `null' if no haddock documentation was built.
|
# `null' if no haddock documentation was built.
|
||||||
# TODO: fetch the self from the fixpoint instead
|
# TODO: fetch the self from the fixpoint instead
|
||||||
haddockDir = self: if doHaddock then "${docDir}/html" else null;
|
haddockDir = self: if doHaddock then "${docdir self.doc}/html" else null;
|
||||||
|
|
||||||
env = stdenv.mkDerivation {
|
env = stdenv.mkDerivation {
|
||||||
name = "interactive-${pname}-${version}-environment";
|
name = "interactive-${pname}-${version}-environment";
|
||||||
@ -461,7 +386,6 @@ stdenv.mkDerivation ({
|
|||||||
// optionalAttrs (description != "") { inherit description; }
|
// optionalAttrs (description != "") { inherit description; }
|
||||||
// optionalAttrs (maintainers != []) { inherit maintainers; }
|
// optionalAttrs (maintainers != []) { inherit maintainers; }
|
||||||
// optionalAttrs (hydraPlatforms != platforms) { inherit hydraPlatforms; }
|
// optionalAttrs (hydraPlatforms != platforms) { inherit hydraPlatforms; }
|
||||||
// optionalAttrs (outputsToInstall != []) { inherit outputsToInstall; }
|
|
||||||
;
|
;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -142,8 +142,4 @@ rec {
|
|||||||
overrideSrc = drv: { src, version ? drv.version }:
|
overrideSrc = drv: { src, version ? drv.version }:
|
||||||
overrideCabal drv (_: { inherit src version; editedCabalFile = null; });
|
overrideCabal drv (_: { inherit src version; editedCabalFile = null; });
|
||||||
|
|
||||||
hasNoBinOutput = drv: overrideCabal drv (drv: { enableSeparateBinOutput = false; });
|
|
||||||
|
|
||||||
installOutputs = drv: outputs: overrideCabal drv
|
|
||||||
(drv: { outputsToInstall = outputs; });
|
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,6 @@ let
|
|||||||
isLibrary = false;
|
isLibrary = false;
|
||||||
doHaddock = false;
|
doHaddock = false;
|
||||||
hyperlinkSource = false; # Avoid depending on hscolour for this build.
|
hyperlinkSource = false; # Avoid depending on hscolour for this build.
|
||||||
enableSeparateEtcOutput = false; # The flag to support this is missing in old versions of cabal.
|
|
||||||
postFixup = "rm -rf $out/lib $out/share $out/nix-support";
|
postFixup = "rm -rf $out/lib $out/share $out/nix-support";
|
||||||
});
|
});
|
||||||
cpphs = overrideCabal (self.cpphs.overrideScope (self: super: {
|
cpphs = overrideCabal (self.cpphs.overrideScope (self: super: {
|
||||||
|
@ -798,10 +798,10 @@ with pkgs;
|
|||||||
enableSharedExecutables = false;
|
enableSharedExecutables = false;
|
||||||
executableToolDepends = [ makeWrapper ];
|
executableToolDepends = [ makeWrapper ];
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
exe=$libexec/bin/${drv.pname}-${drv.version}/${drv.pname}
|
exe=$out/libexec/${drv.pname}-${drv.version}/${drv.pname}
|
||||||
install -D $bin/bin/${drv.pname} $exe
|
install -D $out/bin/${drv.pname} $exe
|
||||||
rm -rf $bin/bin $out/lib $out/share
|
rm -rf $out/{bin,lib,share}
|
||||||
makeWrapper $exe $bin/bin/${drv.pname} \
|
makeWrapper $exe $out/bin/${drv.pname} \
|
||||||
--prefix PATH ":" "${nix}/bin" \
|
--prefix PATH ":" "${nix}/bin" \
|
||||||
--prefix PATH ":" "${nix-prefetch-scripts}/bin"
|
--prefix PATH ":" "${nix-prefetch-scripts}/bin"
|
||||||
mkdir -p $out/share/bash-completion/completions
|
mkdir -p $out/share/bash-completion/completions
|
||||||
@ -813,7 +813,7 @@ with pkgs;
|
|||||||
executableToolDepends = [ makeWrapper ];
|
executableToolDepends = [ makeWrapper ];
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
wrapProgram $out/bin/stack2nix \
|
wrapProgram $out/bin/stack2nix \
|
||||||
${lib.makeBinPath [ git cabal2nix cabal-install stack ]}
|
--prefix PATH ":" "${git}/bin:${cabal2nix}/bin:${cabal-install}/bin:${stack}/bin"
|
||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user