Unverified Commit c728b537 authored by Thomas Tuegel's avatar Thomas Tuegel
Browse files

Remove Nix expressions

Including Nix expressions in Haskell projects, particularly core infrastructure,
is harmful for the following reasons:

1. The expressions are never maintained. In this case, I should know since I'm
the one who isn't maintaining them.
2. In the unlikely event a Nix expression is up-to-date, it still only works
with a particular version of Nixpkgs. Unless Nixpkgs is included in a submodule,
this is of no use to anybody.
3. Creating Nix expressions for Haskell packages is automated anyway and anyone
who is interested in having them knows how to generate them.
4. We who are working on Cabal need to be "eating our own dog food" or "wearing
the hair shirt" as the case may be.

[ci skip]
parent 90f2799b
{ mkDerivation, array, base, base-compat, base-orphans, binary
, bytestring, containers, deepseq, Diff, directory, filepath
, parsec, pretty, process, QuickCheck, stdenv, tagged, tar, tasty
, tasty-golden, tasty-hunit, tasty-quickcheck, time, transformers
, unix
}:
mkDerivation {
pname = "Cabal";
version = "2.1.0.0";
src = ./.;
libraryHaskellDepends = [
array base binary bytestring containers deepseq directory filepath
parsec pretty process time transformers unix
];
testHaskellDepends = [
array base base-compat base-orphans bytestring containers Diff
directory filepath pretty QuickCheck tagged tar tasty tasty-golden
tasty-hunit tasty-quickcheck
];
doCheck = false;
homepage = "http://www.haskell.org/cabal/";
description = "A framework for packaging Haskell software";
license = stdenv.lib.licenses.bsd3;
}
(import ../.).Cabal.env
{ mkDerivation, array, async, base, base16-bytestring, binary
, bytestring, Cabal, containers, cryptohash-sha256, deepseq
, directory, echo, edit-distance, filepath, hackage-security
, hashable, HTTP, mtl, network, network-uri, pretty, pretty-show
, process, QuickCheck, random, stdenv, stm, tagged, tar, tasty
, tasty-hunit, tasty-quickcheck, time, unix, zlib
}:
mkDerivation {
pname = "cabal-install";
version = "2.1.0.0";
src = ./.;
isLibrary = false;
isExecutable = true;
setupHaskellDepends = [ base Cabal filepath process ];
libraryHaskellDepends = [
array async base base16-bytestring binary bytestring Cabal
containers cryptohash-sha256 deepseq directory echo edit-distance
filepath hackage-security hashable HTTP mtl network network-uri
pretty process random stm tar time unix zlib
];
executableHaskellDepends = [
array async base base16-bytestring binary bytestring Cabal
containers cryptohash-sha256 deepseq directory echo edit-distance
filepath hackage-security hashable HTTP mtl network network-uri
pretty process random stm tar time unix zlib
];
testHaskellDepends = [
array async base bytestring Cabal containers deepseq directory
edit-distance filepath hashable mtl network network-uri pretty-show
QuickCheck random tagged tar tasty tasty-hunit tasty-quickcheck
time zlib
];
doCheck = false;
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;
}
(import ../.).cabal-install.env
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 {});
cabal-install =
filterSource (lib.dontCheck (self.callPackage ./cabal-install {}));
hackage-security =
lib.dontCheck super.hackage-security;
};
}
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