2020-10-07 09:15:18 +00:00
|
|
|
{ lib, stdenv, haskellPackages, cabal-install }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-10-07 09:15:18 +00:00
|
|
|
(haskellPackages.shellFor {
|
|
|
|
packages = p: [ p.database-id-class p.constraints ];
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [ cabal-install ];
|
|
|
|
phases = [ "unpackPhase" "buildPhase" "installPhase" ];
|
|
|
|
unpackPhase = ''
|
|
|
|
sourceRoot=$(pwd)/scratch
|
|
|
|
mkdir -p "$sourceRoot"
|
|
|
|
cd "$sourceRoot"
|
|
|
|
tar -xf ${haskellPackages.database-id-class.src}
|
2020-10-07 09:15:18 +00:00
|
|
|
tar -xf ${haskellPackages.constraints.src}
|
|
|
|
cp ${builtins.toFile "cabal.project" "packages: database-id-class* constraints*"} cabal.project
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
buildPhase = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
mkdir -p $HOME/.cabal
|
|
|
|
touch $HOME/.cabal/config
|
2020-10-07 09:15:18 +00:00
|
|
|
cabal v2-build --offline --verbose database-id-class constraints --ghc-options="-O0 -j$NIX_BUILD_CORES"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
installPhase = ''
|
|
|
|
touch $out
|
|
|
|
'';
|
2020-10-07 09:15:18 +00:00
|
|
|
}).overrideAttrs (oldAttrs: {
|
|
|
|
meta =
|
|
|
|
let
|
|
|
|
oldMeta = oldAttrs.meta or {};
|
|
|
|
oldMaintainers = oldMeta.maintainers or [];
|
|
|
|
additionalMaintainers = with lib.maintainers; [ cdepillabout ];
|
|
|
|
allMaintainers = oldMaintainers ++ additionalMaintainers;
|
|
|
|
in
|
|
|
|
oldMeta // { maintainers = allMaintainers; };
|
|
|
|
})
|