From 259f027a4b9b39b0f552673c74caeea3ddf8f79f Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Wed, 4 Aug 2021 11:41:08 +0200 Subject: [PATCH] cabal2nix: 2.17.0 -> 2.18.0 https://github.com/NixOS/cabal2nix/blob/v2.18.0/CHANGELOG.md 2.18.0 mostly brings bug fixes, especially the one fixing the unclear error message if a cabal file was missing (which was forgotten in the changelog). It is not technically a non-breaking change since the Haskell API changed. Since there shouldn't be any breakage for users and all known reverse dependencies of cabal2nix have been broken for a while, the benefits of backporting outweigh the risks. --- .../haskell-modules/non-hackage-packages.nix | 6 ++++ pkgs/development/misc/haskell/cabal2nix.nix | 35 +++++++++++++++++++ .../misc/haskell/distribution-nixpkgs.nix | 19 ++++++++++ 3 files changed, 60 insertions(+) create mode 100644 pkgs/development/misc/haskell/cabal2nix.nix create mode 100644 pkgs/development/misc/haskell/distribution-nixpkgs.nix diff --git a/pkgs/development/haskell-modules/non-hackage-packages.nix b/pkgs/development/haskell-modules/non-hackage-packages.nix index e8007a91d03..56ad1b8c25f 100644 --- a/pkgs/development/haskell-modules/non-hackage-packages.nix +++ b/pkgs/development/haskell-modules/non-hackage-packages.nix @@ -49,5 +49,11 @@ self: super: { arion-compose = self.callPackage ../../applications/virtualization/arion/arion-compose.nix {}; # cabal2nix cabal://ap-normalize-0.1.0.1 ap-normalize = self.callPackage ../misc/haskell/ap-normalize {}; + # cabal2nix cabal://distribution-nixpkgs + distribution-nixpkgs_1_6_0 = self.callPackage ../misc/haskell/distribution-nixpkgs.nix {}; + # cabal2nix cabal://cabal2nix-2.18.0 + cabal2nix = self.callPackage ../misc/haskell/cabal2nix.nix { + distribution-nixpkgs = self.distribution-nixpkgs_1_6_0; + }; } diff --git a/pkgs/development/misc/haskell/cabal2nix.nix b/pkgs/development/misc/haskell/cabal2nix.nix new file mode 100644 index 00000000000..05a621856d0 --- /dev/null +++ b/pkgs/development/misc/haskell/cabal2nix.nix @@ -0,0 +1,35 @@ +{ mkDerivation, aeson, ansi-wl-pprint, base, bytestring, Cabal +, containers, deepseq, directory, distribution-nixpkgs, filepath +, hackage-db, hopenssl, hpack, language-nix, lens, lib, monad-par +, monad-par-extras, mtl, optparse-applicative, pretty, process +, split, tasty, tasty-golden, text, time, transformers, yaml +}: +mkDerivation { + pname = "cabal2nix"; + version = "2.18.0"; + sha256 = "4b90602dc0878c2e4a3e7def2c2ae0e99782b2f0d53d8e3914adaa43038b1f86"; + isLibrary = true; + isExecutable = true; + libraryHaskellDepends = [ + aeson ansi-wl-pprint base bytestring Cabal containers deepseq + directory distribution-nixpkgs filepath hackage-db hopenssl hpack + language-nix lens optparse-applicative pretty process split text + time transformers yaml + ]; + executableHaskellDepends = [ + aeson base bytestring Cabal containers directory + distribution-nixpkgs filepath hopenssl language-nix lens monad-par + monad-par-extras mtl optparse-applicative pretty + ]; + testHaskellDepends = [ + base Cabal containers directory filepath language-nix lens pretty + process tasty tasty-golden + ]; + preCheck = '' + export PATH="$PWD/dist/build/cabal2nix:$PATH" + export HOME="$TMPDIR/home" + ''; + homepage = "https://github.com/nixos/cabal2nix#readme"; + description = "Convert Cabal files into Nix build instructions"; + license = lib.licenses.bsd3; +} diff --git a/pkgs/development/misc/haskell/distribution-nixpkgs.nix b/pkgs/development/misc/haskell/distribution-nixpkgs.nix new file mode 100644 index 00000000000..92b2b89b2c6 --- /dev/null +++ b/pkgs/development/misc/haskell/distribution-nixpkgs.nix @@ -0,0 +1,19 @@ +{ mkDerivation, aeson, base, bytestring, Cabal, containers, deepseq +, hspec, language-nix, lens, lib, pretty, process, split +}: +mkDerivation { + pname = "distribution-nixpkgs"; + version = "1.6.0"; + sha256 = "d1804dcb731858d40859f1cf55ea81b3f6bc63a353437c1009c158e0f9e03354"; + revision = "1"; + editedCabalFile = "0j35y7ws7rbc68vkmyvpa4m2dyfpzpzzvm4lv7h6r7x34w331dgg"; + enableSeparateDataOutput = true; + libraryHaskellDepends = [ + aeson base bytestring Cabal containers deepseq language-nix lens + pretty process split + ]; + testHaskellDepends = [ base deepseq hspec lens ]; + homepage = "https://github.com/NixOS/distribution-nixpkgs"; + description = "Types and functions to manipulate the Nixpkgs distribution"; + license = lib.licenses.bsd3; +}