summary refs log tree commit diff
path: root/pkgs/development/haskell-modules/make-package-set.nix
diff options
context:
space:
mode:
authorBas van Dijk <v.dijk.bas@gmail.com>2018-09-11 09:00:03 +0200
committerGitHub <noreply@github.com>2018-09-11 09:00:03 +0200
commitd05a8bb410fc21831c44b84240ef28e2fde9daba (patch)
tree1e68ca251143c82b0dba3b290ee4ad6a64a369b3 /pkgs/development/haskell-modules/make-package-set.nix
parenta33df7750ef16440e4810440d40f63937bafc3ba (diff)
parent4abb8be7abec422bb221816931148d9465e380f3 (diff)
downloadnixpkgs-d05a8bb410fc21831c44b84240ef28e2fde9daba.tar
nixpkgs-d05a8bb410fc21831c44b84240ef28e2fde9daba.tar.gz
nixpkgs-d05a8bb410fc21831c44b84240ef28e2fde9daba.tar.bz2
nixpkgs-d05a8bb410fc21831c44b84240ef28e2fde9daba.tar.lz
nixpkgs-d05a8bb410fc21831c44b84240ef28e2fde9daba.tar.xz
nixpkgs-d05a8bb410fc21831c44b84240ef28e2fde9daba.tar.zst
nixpkgs-d05a8bb410fc21831c44b84240ef28e2fde9daba.zip
Merge pull request #44424 from dhess/callCaball2nixWithOption
haskell-modules: add callCabal2nixWithOptions.
Diffstat (limited to 'pkgs/development/haskell-modules/make-package-set.nix')
-rw-r--r--pkgs/development/haskell-modules/make-package-set.nix29
1 files changed, 16 insertions, 13 deletions
diff --git a/pkgs/development/haskell-modules/make-package-set.nix b/pkgs/development/haskell-modules/make-package-set.nix
index 608fb3625b2..b33b29e82ef 100644
--- a/pkgs/development/haskell-modules/make-package-set.nix
+++ b/pkgs/development/haskell-modules/make-package-set.nix
@@ -177,19 +177,22 @@ in package-set { inherit pkgs stdenv callPackage; } self // {
     callHackage = name: version: callPackageKeepDeriver (self.hackage2nix name version);
 
     # Creates a Haskell package from a source package by calling cabal2nix on the source.
-    callCabal2nix = name: src: args: let
-      filter = path: type:
-                 pkgs.lib.hasSuffix "${name}.cabal" path ||
-                 baseNameOf path == "package.yaml";
-      expr = self.haskellSrc2nix {
-        inherit name;
-        src = if pkgs.lib.canCleanSource src
-                then pkgs.lib.cleanSourceWith { inherit src filter; }
-              else src;
-      };
-    in overrideCabal (callPackageKeepDeriver expr args) (orig: {
-         inherit src;
-       });
+    callCabal2nixWithOptions = name: src: extraCabal2nixOptions: args:
+      let
+        filter = path: type:
+                   pkgs.lib.hasSuffix "${name}.cabal" path ||
+                   baseNameOf path == "package.yaml";
+        expr = self.haskellSrc2nix {
+          inherit name extraCabal2nixOptions;
+          src = if pkgs.lib.canCleanSource src
+                  then pkgs.lib.cleanSourceWith { inherit src filter; }
+                else src;
+        };
+      in overrideCabal (callPackageKeepDeriver expr args) (orig: {
+           inherit src;
+         });
+
+    callCabal2nix = name: src: args: self.callCabal2nixWithOptions name src "" args;
 
     # : { root : Path
     #   , source-overrides : Defaulted (Either Path VersionNumber)