From 6a6b8fa36fa21a8163e47d948ff79c50cbad2a78 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Tue, 5 Jul 2016 22:49:26 +0200 Subject: [PATCH] cabal2nix: update to version 2.0 from Hackage I've realized that publishing updates to Hackage is far easier than publishing updates in Nixpkgs, and since all Hackage updates show up in Nix automatically I've decided to go back to publishing cabal2nix on Hackage again. Unfortunately, this means that I'll have to change the version numbering scheme to comply with the expectations of the Haskell PVP (which is used by Stackage), so the new version 2.0 looks like a downgrade to Nix, which used to have version 20160406. :-( If in doubt, run "nix-env -u --always" to force the update. I am sorry about the inconvenience. --- .../haskell-modules/configuration-common.nix | 3 -- .../tools/haskell/cabal2nix/default.nix | 45 ------------------- pkgs/top-level/all-packages.nix | 14 +++++- 3 files changed, 13 insertions(+), 49 deletions(-) delete mode 100644 pkgs/development/tools/haskell/cabal2nix/default.nix diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 6c6864f0c4a..19a5581480c 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -653,9 +653,6 @@ self: super: { # Test suite won't compile against tasty-hunit 0.9.x. zlib = dontCheck super.zlib; - # Override the obsolete version from Hackage with our more up-to-date copy. - cabal2nix = self.callPackage ../tools/haskell/cabal2nix {}; - # https://github.com/ndmitchell/shake/issues/206 # https://github.com/ndmitchell/shake/issues/267 shake = overrideCabal super.shake (drv: { doCheck = !pkgs.stdenv.isDarwin && false; }); diff --git a/pkgs/development/tools/haskell/cabal2nix/default.nix b/pkgs/development/tools/haskell/cabal2nix/default.nix deleted file mode 100644 index 3e6c9019f6d..00000000000 --- a/pkgs/development/tools/haskell/cabal2nix/default.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ mkDerivation, aeson, ansi-wl-pprint, base, bytestring, Cabal -, containers, deepseq, directory, distribution-nixpkgs, fetchFromGitHub -, filepath, hackage-db, language-nix, lens, monad-par -, monad-par-extras, mtl, optparse-applicative, pretty, process, SHA -, split, stackage-types, stdenv, text, time, transformers -, utf8-string, yaml, makeWrapper, nix-prefetch-scripts -}: -mkDerivation rec { - pname = "cabal2nix"; - version = "20160613-10-g57dddc7"; - src = fetchFromGitHub { - owner = "nixos"; - repo = "cabal2nix"; - rev = "v${version}"; - sha256 = "1nlybd4im80dwq70wqa5k4lji5g353cn6aqiz4v3x4v3fpn2i3qb"; - }; - isExecutable = true; - enableSharedExecutables = false; - libraryHaskellDepends = [ - aeson ansi-wl-pprint base bytestring Cabal containers deepseq - directory distribution-nixpkgs filepath hackage-db language-nix - lens optparse-applicative pretty process SHA split text - transformers yaml - ]; - executableHaskellDepends = [ - aeson ansi-wl-pprint base bytestring Cabal containers deepseq - directory distribution-nixpkgs filepath hackage-db language-nix - lens monad-par monad-par-extras mtl optparse-applicative pretty - process SHA split stackage-types text time transformers utf8-string - yaml - ]; - executableToolDepends = [ makeWrapper ]; - postInstall = '' - exe=$out/libexec/${pname}-${version}/${pname} - install -D $out/bin/${pname} $exe - rm -rf $out/{bin,lib,share} - makeWrapper $exe $out/bin/${pname} --prefix PATH ":" "${nix-prefetch-scripts}/bin" - mkdir -p $out/share/bash-completion/completions - $exe --bash-completion-script $exe >$out/share/bash-completion/completions/${pname} - ''; - homepage = "https://github.com/nixos/cabal2nix#readme"; - description = "Convert Cabal files into Nix build instructions"; - license = stdenv.lib.licenses.bsd3; - maintainers = [stdenv.lib.maintainers.peti]; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b056fa69990..26b292f9374 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -640,7 +640,19 @@ in libtorrentRasterbar = libtorrentRasterbar_1_09; }; - cabal2nix = self.haskellPackages.cabal2nix; + cabal2nix = self.haskell.lib.overrideCabal self.haskellPackages.cabal2nix (drv: { + isLibrary = false; + enableSharedExecutables = false; + executableToolDepends = [ self.makeWrapper ]; + postInstall = '' + exe=$out/libexec/${drv.pname}-${drv.version}/${drv.pname} + install -D $out/bin/${drv.pname} $exe + rm -rf $out/{bin,lib,share} + makeWrapper $exe $out/bin/${drv.pname} --prefix PATH ":" "${self.nix-prefetch-scripts}/bin" + mkdir -p $out/share/bash-completion/completions + $exe --bash-completion-script $exe >$out/share/bash-completion/completions/${drv.pname} + ''; + }); caddy = callPackage ../servers/caddy { };