Unverified Commit e120eb2a authored by ttuegel's avatar ttuegel
Browse files

Add Nix expressions for Cabal, cabal-install

parent 47987e2c
{ mkDerivation, array, base, binary, bytestring, containers
, deepseq, directory, exceptions, filepath, old-time, pretty
, process, QuickCheck, regex-posix, stdenv, tagged, tasty
, tasty-hunit, tasty-quickcheck, time, transformers, unix
}:
mkDerivation {
pname = "Cabal";
version = "1.25.0.0";
src = ./Cabal;
libraryHaskellDepends = [
array base binary bytestring containers deepseq directory filepath
pretty process time unix
];
testHaskellDepends = [
array base bytestring containers directory exceptions filepath
old-time pretty process QuickCheck regex-posix tagged tasty
tasty-hunit tasty-quickcheck time transformers unix
];
doCheck = false;
homepage = "http://www.haskell.org/cabal/";
description = "A framework for packaging Haskell software";
license = stdenv.lib.licenses.bsd3;
}
{ mkDerivation, array, async, base, base16-bytestring, binary
, bytestring, Cabal, containers, cryptohash-sha256, deepseq
, directory, filepath, hackage-security, hashable, HTTP, mtl
, network, network-uri, pretty, pretty-show, process, QuickCheck
, random, regex-posix, stdenv, stm, tagged, tar, tasty, tasty-hunit
, tasty-quickcheck, time, unix, zlib
}:
mkDerivation {
pname = "cabal-install";
version = "1.25.0.0";
src = ./cabal-install;
isLibrary = false;
isExecutable = true;
setupHaskellDepends = [ base Cabal filepath process ];
executableHaskellDepends = [
array async base base16-bytestring binary bytestring Cabal
containers cryptohash-sha256 deepseq directory filepath
hackage-security hashable HTTP mtl network network-uri pretty
process random stm tar time unix zlib
];
testHaskellDepends = [
array async base base16-bytestring binary bytestring Cabal
containers cryptohash-sha256 deepseq directory filepath
hackage-security hashable HTTP mtl network network-uri pretty
pretty-show process QuickCheck random regex-posix stm tagged tar
tasty tasty-hunit tasty-quickcheck time unix zlib
];
postInstall = ''
mkdir $out/etc
mv bash-completion $out/etc/bash_completion.d
'';
homepage = "http://www.haskell.org/cabal/";
description = "The command-line interface for Cabal and Hackage";
license = stdenv.lib.licenses.bsd3;
}
with (import <nixpkgs> {});
let
inherit (haskell) lib;
filterSource = drv: # only copy required source files to build directory
let
omitDirs = [ ".cabal-sandbox" ".git" "dist" ];
omitExts = [ ".o" ".hi" ];
hasExt = path: ext: stdenv.lib.hasSuffix ext path;
predicate = path: type:
if type == "directory"
then !(stdenv.lib.elem (baseNameOf path) omitDirs)
else !(stdenv.lib.any (hasExt path) omitExts);
in
lib.overrideCabal drv
(args: args // { src = builtins.filterSource predicate args.src; });
in
haskellPackages.override {
overrides = self: super: {
Cabal = filterSource (self.callPackage ./Cabal.nix {});
cabal-install = filterSource (lib.dontCheck (self.callPackage ./cabal-install.nix {}));
};
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment