tests.haskell-setBuildTarget: inline haskell package def to avoid IFD
This commit is contained in:
parent
ba354d5ad8
commit
88d9f2419e
|
@ -1,11 +1,23 @@
|
||||||
{ pkgs, haskellPackages }: with pkgs.haskell.lib;
|
{ pkgs, haskellPackages }:
|
||||||
|
|
||||||
|
|
||||||
let
|
let
|
||||||
drv = haskellPackages.callCabal2nix "haskell-setBuildTarget" ./. {};
|
# This can be regenerated by running `cabal2nix .` in the current directory.
|
||||||
test = target: excluded:
|
pkgDef =
|
||||||
|
{ mkDerivation, base, lib }:
|
||||||
|
mkDerivation {
|
||||||
|
pname = "haskell-setBuildTarget";
|
||||||
|
version = "0.1.0.0";
|
||||||
|
src = ./.;
|
||||||
|
isLibrary = false;
|
||||||
|
isExecutable = true;
|
||||||
|
executableHaskellDepends = [ base ];
|
||||||
|
license = lib.licenses.bsd3;
|
||||||
|
};
|
||||||
|
|
||||||
let only = setBuildTarget drv target;
|
drv = haskellPackages.callPackage pkgDef {};
|
||||||
|
|
||||||
|
test = target: excluded:
|
||||||
|
let only = pkgs.haskell.lib.setBuildTarget drv target;
|
||||||
in ''
|
in ''
|
||||||
if [[ ! -f "${only}/bin/${target}" ]]; then
|
if [[ ! -f "${only}/bin/${target}" ]]; then
|
||||||
echo "${target} was not built"
|
echo "${target} was not built"
|
||||||
|
|
Loading…
Reference in New Issue