2021-05-20 23:08:51 +00:00
|
|
|
{ lib, writeText, haskellPackages, cabal-install }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-10-07 09:15:18 +00:00
|
|
|
(haskellPackages.shellFor {
|
2021-05-20 23:08:51 +00:00
|
|
|
packages = p: [ p.constraints p.linear ];
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [ cabal-install ];
|
|
|
|
phases = [ "unpackPhase" "buildPhase" "installPhase" ];
|
|
|
|
unpackPhase = ''
|
|
|
|
sourceRoot=$(pwd)/scratch
|
|
|
|
mkdir -p "$sourceRoot"
|
|
|
|
cd "$sourceRoot"
|
2020-10-07 09:15:18 +00:00
|
|
|
tar -xf ${haskellPackages.constraints.src}
|
2021-05-20 23:08:51 +00:00
|
|
|
tar -xf ${haskellPackages.linear.src}
|
|
|
|
cp ${writeText "cabal.project" "packages: constraints* linear*"} cabal.project
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
buildPhase = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
mkdir -p $HOME/.cabal
|
|
|
|
touch $HOME/.cabal/config
|
2021-05-20 23:08:51 +00:00
|
|
|
cabal v2-build --offline --verbose constraints linear --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; };
|
|
|
|
})
|