summary refs log tree commit diff
path: root/pkgs/development/haskell-modules/generic-builder.nix
diff options
context:
space:
mode:
authorIsaac Shapira <fresheyeball@protonmail.com>2021-04-23 13:55:38 -0600
committer(cdep)illabout <cdep.illabout@gmail.com>2021-05-02 13:35:07 +0900
commitd725ac794286e3464d80f5bce69da98ff4b2ebbf (patch)
tree5e617d1c5230b3406acd98e5102046d3f60bd40e /pkgs/development/haskell-modules/generic-builder.nix
parent111151c4bc57287ef449eb4f06083d6aedccaa19 (diff)
downloadnixpkgs-d725ac794286e3464d80f5bce69da98ff4b2ebbf.tar
nixpkgs-d725ac794286e3464d80f5bce69da98ff4b2ebbf.tar.gz
nixpkgs-d725ac794286e3464d80f5bce69da98ff4b2ebbf.tar.bz2
nixpkgs-d725ac794286e3464d80f5bce69da98ff4b2ebbf.tar.lz
nixpkgs-d725ac794286e3464d80f5bce69da98ff4b2ebbf.tar.xz
nixpkgs-d725ac794286e3464d80f5bce69da98ff4b2ebbf.tar.zst
nixpkgs-d725ac794286e3464d80f5bce69da98ff4b2ebbf.zip
Add haskell.lib.setBuiltTarget, and support non library compiling of a single target
Diffstat (limited to 'pkgs/development/haskell-modules/generic-builder.nix')
-rw-r--r--pkgs/development/haskell-modules/generic-builder.nix7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix
index faf80da0c7d..2f9127e30f3 100644
--- a/pkgs/development/haskell-modules/generic-builder.nix
+++ b/pkgs/development/haskell-modules/generic-builder.nix
@@ -464,7 +464,12 @@ stdenv.mkDerivation ({
   installPhase = ''
     runHook preInstall
 
-    ${if !isLibrary then "${setupCommand} install" else ''
+    ${if !isLibrary && buildTarget == "" then "${setupCommand} install"
+      # ^^ if the project is not a library, and no build target is specified, we can just use "install".
+      else if !isLibrary then "${setupCommand} copy ${buildTarget}"
+      # ^^ if the project is not a library, and we have a build target, then use "copy" to install
+      # just the target specified; "install" will error here, since not all targets have been built.
+    else ''
       ${setupCommand} copy
       local packageConfDir="$out/lib/${ghc.name}/package.conf.d"
       local packageConfFile="$packageConfDir/${pname}-${version}.conf"