tests.haskell-setBuildTarget: inline haskell package def to avoid IFD

This commit is contained in:
(cdep)illabout 2021-04-30 12:12:07 +09:00
parent ba354d5ad8
commit 88d9f2419e
No known key found for this signature in database
GPG key ID: 462E0C03D11422F4

View file

@ -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"