* converted happy and haddock to use generic Cabal builder

svn path=/nixpkgs/trunk/; revision=10252
This commit is contained in:
Andres Löh 2008-01-22 21:10:19 +00:00
parent 67eb3a64e2
commit 84e7b463f5
4 changed files with 25 additions and 53 deletions

View File

@ -27,9 +27,10 @@ attrs :
};
# default buildInputs are just ghc, if more buildInputs are required
# buildInputs can be extended by the client, but often propagatedBuildInputs
# is preferable anyway
buildInputs = [attrs.ghc];
# buildInputs can be extended by the client by using extraBuildInputs,
# but often propagatedBuildInputs is preferable anyway
buildInputs = [attrs.ghc] ++ self.extraBuildInputs;
extraBuildInputs = [];
# we make sure that propagatedBuildInputs is defined, so that we don't
# have to check for its existence
@ -79,11 +80,13 @@ attrs :
./Setup copy
./Setup register --gen-script
mkdir -p $out/nix-support
sed -i 's/|.*\(ghc-pkg update\)/| \1/' register.sh
cp register.sh $out/nix-support/register-ghclib.sh
sed -i 's/\(ghc-pkg update\)/\1 --user/' register.sh
mkdir -p $out/bin
cp register.sh $out/bin/register-${self.name}.sh
if test -f register.sh; then
sed -i 's/|.*\(ghc-pkg update\)/| \1/' register.sh
cp register.sh $out/nix-support/register-ghclib.sh
sed -i 's/\(ghc-pkg update\)/\1 --user/' register.sh
mkdir -p $out/bin
cp register.sh $out/bin/register-${self.name}.sh
fi
eval "$postInstall"
'';

View File

@ -1,25 +1,11 @@
{stdenv, fetchurl, ghc}:
{cabal}:
stdenv.mkDerivation (rec {
cabal.mkDerivation (self : {
pname = "haddock";
version = "2.0.0.0";
name = "${pname}-${version}";
src = fetchurl {
url = "http://hackage.haskell.org/packages/archive/${pname}/${version}/${name}.tar.gz";
sha256 = "a2ea5bdc127bc8b189a8d869f582ec774fea0933e7f5ca89549a6c142b9993df";
name = self.fname;
sha256 = "a2ea5bdc127bc8b189a8d869f582ec774fea0933e7f5ca89549a6c142b9993df";
meta = {
description = "a tool for automatically generating documentation from annotated Haskell source code";
};
buildInputs = [ghc];
configurePhase = ''
ghc --make Setup.lhs
./Setup configure -v --prefix="$out"
'';
buildPhase = ''
./Setup build
'';
installPhase = ''
./Setup install
'';
})

View File

@ -1,28 +1,12 @@
{stdenv, fetchurl, perl, ghc}:
{cabal, perl}:
stdenv.mkDerivation (rec {
cabal.mkDerivation (self : {
# requires cabal-1.2 (and therefore, in Nix, currently ghc-6.8)
pname = "happy";
version = "1.17";
name = "${pname}-${version}";
src = fetchurl {
url = "http://www.haskell.org/happy/dist/${version}/${name}.tar.gz";
sha256 = "dca4e47d17e5d538335496236b3d2c3cbff644cf7380c987a4714e7784c70a2b";
};
buildInputs = [ghc perl];
configurePhase = "
ghc --make Setup.lhs
./Setup configure --prefix=\"\${out}\"
";
buildPhase = "
./Setup build
";
installPhase = "
./Setup install
";
name = self.fname;
sha256 = "dca4e47d17e5d538335496236b3d2c3cbff644cf7380c987a4714e7784c70a2b";
extraBuildInputs = [perl];
})

View File

@ -1498,8 +1498,7 @@ rec {
};
haddock = import ../development/tools/documentation/haddock {
inherit fetchurl stdenv;
ghc = ghc68;
cabal = cabal68;
};
happy = import ../development/tools/parsing/happy {
@ -1507,8 +1506,8 @@ rec {
};
happy117 = import ../development/tools/parsing/happy/happy-1.17.nix {
inherit fetchurl stdenv perl;
ghc = ghc68; # because happy-1.17 depends on cabal-1.2
inherit perl;
cabal = cabal68; # because happy-1.17 depends on cabal-1.2
};
help2man = import ../development/tools/misc/help2man {