diff --git a/pkgs/development/libraries/haskell/cabal/cabal.nix b/pkgs/development/libraries/haskell/cabal/cabal.nix index 154463e04dc..1e08a819c0e 100644 --- a/pkgs/development/libraries/haskell/cabal/cabal.nix +++ b/pkgs/development/libraries/haskell/cabal/cabal.nix @@ -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" ''; diff --git a/pkgs/development/tools/documentation/haddock/default.nix b/pkgs/development/tools/documentation/haddock/default.nix index a38db0977d6..86d07b240a5 100644 --- a/pkgs/development/tools/documentation/haddock/default.nix +++ b/pkgs/development/tools/documentation/haddock/default.nix @@ -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 - ''; }) diff --git a/pkgs/development/tools/parsing/happy/happy-1.17.nix b/pkgs/development/tools/parsing/happy/happy-1.17.nix index 663dc15bc51..b7fa22ccb80 100644 --- a/pkgs/development/tools/parsing/happy/happy-1.17.nix +++ b/pkgs/development/tools/parsing/happy/happy-1.17.nix @@ -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]; }) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5a4a849df42..1b201910863 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 {