about summary refs log tree commit diff
path: root/pkgs/development/haskell-modules
diff options
context:
space:
mode:
authormaralorn <mail@maralorn.de>2024-02-26 12:19:15 +0100
committerGitHub <noreply@github.com>2024-02-26 12:19:15 +0100
commite5339288169db48b3e0666e2a4d98263491fb624 (patch)
tree8a163de84441e6ed14acbc191f1268dc6db4b027 /pkgs/development/haskell-modules
parent70706e07eff9311e2608a9aa773c703e8afe0e0e (diff)
parent747424168cd2231153560290a14b19d5d1b047bb (diff)
downloadnixlib-e5339288169db48b3e0666e2a4d98263491fb624.tar
nixlib-e5339288169db48b3e0666e2a4d98263491fb624.tar.gz
nixlib-e5339288169db48b3e0666e2a4d98263491fb624.tar.bz2
nixlib-e5339288169db48b3e0666e2a4d98263491fb624.tar.lz
nixlib-e5339288169db48b3e0666e2a4d98263491fb624.tar.xz
nixlib-e5339288169db48b3e0666e2a4d98263491fb624.tar.zst
nixlib-e5339288169db48b3e0666e2a4d98263491fb624.zip
Merge pull request #284490 from wolfgangwalther/hackage-direct-revision
haskell-modules: Add revision argument to callHackageDirect
Diffstat (limited to 'pkgs/development/haskell-modules')
-rw-r--r--pkgs/development/haskell-modules/make-package-set.nix16
1 files changed, 10 insertions, 6 deletions
diff --git a/pkgs/development/haskell-modules/make-package-set.nix b/pkgs/development/haskell-modules/make-package-set.nix
index 294ca295f22b..52d0af869cec 100644
--- a/pkgs/development/haskell-modules/make-package-set.nix
+++ b/pkgs/development/haskell-modules/make-package-set.nix
@@ -199,12 +199,16 @@ in package-set { inherit pkgs lib callPackage; } self // {
     # for any version that has been released on hackage as opposed to only
     # versions released before whatever version of all-cabal-hashes you happen
     # to be currently using.
-    callHackageDirect = {pkg, ver, sha256}:
+    callHackageDirect = {pkg, ver, sha256, rev ? { revision = null; sha256 = null; }}: args:
       let pkgver = "${pkg}-${ver}";
-      in self.callCabal2nix pkg (pkgs.fetchzip {
-           url = "mirror://hackage/${pkgver}/${pkgver}.tar.gz";
-           inherit sha256;
-         });
+          firstRevision = self.callCabal2nix pkg (pkgs.fetchzip {
+            url = "mirror://hackage/${pkgver}/${pkgver}.tar.gz";
+            inherit sha256;
+          }) args;
+      in overrideCabal (orig: {
+        revision = rev.revision;
+        editedCabalFile = rev.sha256;
+      }) firstRevision;
 
     # Creates a Haskell package from a source package by calling cabal2nix on the source.
     callCabal2nixWithOptions = name: src: extraCabal2nixOptions: args:
@@ -635,7 +639,7 @@ in package-set { inherit pkgs lib callPackage; } self // {
 
       Type: drv -> drv
     */
-    forceLlvmCodegenBackend = haskellLib.overrideCabal (drv: {
+    forceLlvmCodegenBackend = overrideCabal (drv: {
       configureFlags = drv.configureFlags or [ ] ++ [ "--ghc-option=-fllvm" ];
       buildTools = drv.buildTools or [ ] ++ [ self.llvmPackages.llvm ];
     });