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.
This commit is contained in:
Peter Simons 2016-07-05 22:49:26 +02:00
parent a828d79a8a
commit 6a6b8fa36f
3 changed files with 13 additions and 49 deletions

View File

@ -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; });

View File

@ -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];
}

View File

@ -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 { };