diff --git a/pkgs/test/haskell/setBuildTarget/default.nix b/pkgs/test/haskell/setBuildTarget/default.nix index 161cecd9ec37..b1335e2a74cf 100644 --- a/pkgs/test/haskell/setBuildTarget/default.nix +++ b/pkgs/test/haskell/setBuildTarget/default.nix @@ -1,11 +1,23 @@ -{ pkgs, haskellPackages }: with pkgs.haskell.lib; - +{ pkgs, haskellPackages }: let - drv = haskellPackages.callCabal2nix "haskell-setBuildTarget" ./. {}; - test = target: excluded: + # This can be regenerated by running `cabal2nix .` in the current directory. + 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 '' if [[ ! -f "${only}/bin/${target}" ]]; then echo "${target} was not built"