nixpkgs/pkgs/development/tools/haskell/cabal2nix/default.nix
Peter Simons 13dc24f5c3 cabal2nix: update to version 20150807-6-g9f58996
The generated shell.nix file accepts a string argument called "compiler" that
determines the package set used to instantiate the generated expression. For
example, running "nix-shell --argstr compiler ghc7102" would evaluate the build
inside of "pkgs.haskell.packages.ghc7102". Earlier versions of cabal2nix had the
current default compiler hard-coded in the expression, but after this change this
is no longer the case. When "compiler" remains unspecified, it defaults to
"default", and this value causes evaluation in "pkgs.haskellPackages", which is
the package set most people would like to use by default. That change has to
benefits:

 1) Generated expression no longer contain any particular compiler version. The
    choice of the default compiler depends on the version of Nixpkgs that's used
    to build the expression.

 2) When the default compiler is used, overrides configured for the default
    package set apply, which was not the case in earlier versions.
2015-08-07 23:08:13 +02:00

56 lines
2.3 KiB
Nix

{ mkDerivation, fetchgit, aeson, ansi-wl-pprint, base, bytestring, Cabal
, containers, deepseq, deepseq-generics, directory, doctest, filepath
, hackage-db, hspec, lens, monad-par, monad-par-extras, mtl
, optparse-applicative, pretty, process, QuickCheck, regex-posix, SHA, split
, stdenv, transformers, utf8-string, makeWrapper, gitMinimal, cartel
, nix-prefetch-scripts
}:
mkDerivation rec {
pname = "cabal2nix";
version = "20150807-6-g9f58996";
src = fetchgit {
url = "http://github.com/NixOS/cabal2nix.git";
rev = "9f589961fba9fa6a92900c37cf1ab16c597b0c69";
sha256 = "1w5ba7cdanpq4nr8xngk1jsj0p6b17c6ap24ldzggrln216f3f7d";
deepClone = true;
};
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
aeson ansi-wl-pprint base bytestring Cabal containers
deepseq-generics directory filepath hackage-db lens monad-par
monad-par-extras mtl optparse-applicative pretty process
regex-posix SHA split transformers utf8-string
];
executableHaskellDepends = [
aeson ansi-wl-pprint base bytestring Cabal containers
deepseq-generics directory filepath hackage-db lens monad-par
monad-par-extras mtl optparse-applicative pretty process
regex-posix SHA split transformers utf8-string
];
testHaskellDepends = [
aeson ansi-wl-pprint base bytestring Cabal containers deepseq
deepseq-generics directory doctest filepath hackage-db hspec lens
monad-par monad-par-extras mtl optparse-applicative pretty process
QuickCheck regex-posix SHA split transformers utf8-string
];
buildDepends = [ cartel ];
buildTools = [ gitMinimal makeWrapper ];
preConfigure = ''
git reset --hard # Re-create the index that fetchgit destroyed in the name of predictable hashes.
runhaskell $setupCompileFlags generate-cabal-file --release >cabal2nix.cabal
'';
postInstall = ''
exe=$out/libexec/${pname}-${version}/cabal2nix
install -D $out/bin/cabal2nix $exe
rm -rf $out/{bin,lib,share}
makeWrapper $exe $out/bin/cabal2nix --prefix PATH ":" "${nix-prefetch-scripts}/bin"
mkdir -p $out/share/bash-completion/completions
$exe --bash-completion-script $exe >$out/share/bash-completion/completions/cabal2nix
'';
homepage = "http://github.com/NixOS/cabal2nix/";
description = "Convert Cabal files into Nix build instructions";
license = stdenv.lib.licenses.bsd3;
}