From 83624524e2b07c1b10562a90b067c490b7de368f Mon Sep 17 00:00:00 2001 From: Doug Beardsley Date: Tue, 25 Dec 2018 12:19:24 -0500 Subject: [PATCH 1/2] Add a callHackage variant that doesn't require all-cabal-hashes --- pkgs/development/haskell-modules/make-package-set.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/development/haskell-modules/make-package-set.nix b/pkgs/development/haskell-modules/make-package-set.nix index e36933a81944..0160a72cecdf 100644 --- a/pkgs/development/haskell-modules/make-package-set.nix +++ b/pkgs/development/haskell-modules/make-package-set.nix @@ -176,6 +176,17 @@ in package-set { inherit pkgs stdenv callPackage; } self // { callHackage = name: version: callPackageKeepDeriver (self.hackage2nix name version); + # This function does not depend on all-cabal-hashes and therefore will work + # 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}@args: + let pkgver = "${pkg}-${ver}"; + in self.callCabal2nix pkg (pkgs.fetchzip { + url = "http://hackage.haskell.org/package/${pkgver}/${pkgver}.tar.gz"; + inherit sha256; + }) {}; + # Creates a Haskell package from a source package by calling cabal2nix on the source. callCabal2nixWithOptions = name: src: extraCabal2nixOptions: args: let From 0cb5b013c01d52b56b1c6b7f5d6b15dd48ea9034 Mon Sep 17 00:00:00 2001 From: Doug Beardsley Date: Sun, 27 Jan 2019 12:28:01 -0500 Subject: [PATCH 2/2] Overrides can be passed to callHackageDirect --- pkgs/development/haskell-modules/make-package-set.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/haskell-modules/make-package-set.nix b/pkgs/development/haskell-modules/make-package-set.nix index 0160a72cecdf..b4cd7fee311b 100644 --- a/pkgs/development/haskell-modules/make-package-set.nix +++ b/pkgs/development/haskell-modules/make-package-set.nix @@ -185,7 +185,7 @@ in package-set { inherit pkgs stdenv callPackage; } self // { in self.callCabal2nix pkg (pkgs.fetchzip { url = "http://hackage.haskell.org/package/${pkgver}/${pkgver}.tar.gz"; inherit sha256; - }) {}; + }); # Creates a Haskell package from a source package by calling cabal2nix on the source. callCabal2nixWithOptions = name: src: extraCabal2nixOptions: args: