Partition all-cabal-hashes into case-insensitive-safe components.
OS X by default has a case-insensitive filesystem, and fetching all-cabal-hashes there fails due to a hash mismatch caused by package pairs like compactable and Compactable. This partitions the package set such that each partition contains no equivalent-up-to-case pairs.
This commit is contained in:
@@ -1,11 +1,33 @@
|
||||
{ fetchFromGitHub }:
|
||||
{ fetchFromGitHub
|
||||
, stdenv
|
||||
, pkgconfig
|
||||
, libarchive
|
||||
, glib
|
||||
, # Override this to use a different revision
|
||||
src-spec ?
|
||||
{ owner = "commercialhaskell";
|
||||
repo = "all-cabal-hashes";
|
||||
rev = "901c2522e6797270f5ded4495b1a529e6c16ef45";
|
||||
sha256 = "05jmwsgrk77nz9vvgfbpsps0l320qgjpkr2c9zhkn9sc3d275lfb";
|
||||
}
|
||||
, lib
|
||||
}:
|
||||
|
||||
# Use builtins.fetchTarball "https://github.com/commercialhaskell/all-cabal-hashes/archive/hackage.tar.gz"
|
||||
# instead if you want the latest Hackage automatically at the price of frequent re-downloads.
|
||||
|
||||
fetchFromGitHub {
|
||||
owner = "commercialhaskell";
|
||||
repo = "all-cabal-hashes";
|
||||
rev = "901c2522e6797270f5ded4495b1a529e6c16ef45";
|
||||
sha256 = "0wng314y3yn6bbwa5ar254l7p8y99gsvm8ll4z7f3wg77v5fzish";
|
||||
}
|
||||
let partition-all-cabal-hashes = stdenv.mkDerivation
|
||||
{ name = "partition-all-cabal-hashes";
|
||||
src = ./partition-all-cabal-hashes.c;
|
||||
unpackPhase = "true";
|
||||
buildInputs = [ pkgconfig libarchive glib ];
|
||||
buildPhase =
|
||||
"cc -O3 $(pkg-config --cflags --libs libarchive glib-2.0) $src -o partition-all-cabal-hashes";
|
||||
installPhase =
|
||||
''
|
||||
mkdir -p $out/bin
|
||||
install -m755 partition-all-cabal-hashes $out/bin
|
||||
'';
|
||||
};
|
||||
in fetchFromGitHub (src-spec //
|
||||
{ postFetch = "${partition-all-cabal-hashes}/bin/partition-all-cabal-hashes $downloadedFile $out";
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user