2015-09-22 09:35:21 +01:00
|
|
|
{ mkDerivation, ansi-wl-pprint, base, Cabal, containers
|
|
|
|
, distribution-nixpkgs, language-nix, lens, optparse-applicative
|
|
|
|
, pretty, pretty-show, stdenv, text, yaml
|
|
|
|
, nix-prefetch-scripts, makeWrapper, fetchFromGitHub
|
2015-09-02 16:29:20 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
mkDerivation rec {
|
|
|
|
pname = "cabal2nix";
|
2016-04-06 10:33:55 +01:00
|
|
|
version = "20160406";
|
2015-09-02 16:29:20 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nixos";
|
|
|
|
repo = "cabal2nix";
|
|
|
|
rev = "v${version}";
|
2016-04-06 10:33:55 +01:00
|
|
|
sha256 = "02dn2zllanf3rl16ny17j80h7p6gcdqkhadh3ypkr38gd9w16pc6";
|
2015-09-02 16:29:20 +01:00
|
|
|
};
|
|
|
|
postUnpack = "sourceRoot+=/${pname}";
|
|
|
|
isLibrary = false;
|
|
|
|
isExecutable = true;
|
|
|
|
enableSharedExecutables = false;
|
|
|
|
executableHaskellDepends = [
|
|
|
|
ansi-wl-pprint base Cabal containers distribution-nixpkgs
|
2015-09-22 09:35:21 +01:00
|
|
|
language-nix lens optparse-applicative pretty pretty-show text yaml
|
2015-09-02 16:29:20 +01:00
|
|
|
];
|
|
|
|
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;
|
2016-05-16 21:30:20 +01:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ peti ];
|
2015-09-02 16:29:20 +01:00
|
|
|
}
|