1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-30 09:31:01 +00:00
nixpkgs/pkgs/test/haskell/shellFor/default.nix
sternenseemann 9a0dc0fa3e tests.haskell.shellFor: replace database-id-class with linear
Contrary to database-id-class, linear is part of stackage and actively
maintained, so the test is less likely to fail due to version
constraint issues as it is currently.
2021-05-01 22:58:35 +02:00

34 lines
1 KiB
Nix

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