diff --git a/pkgs/applications/version-management/darcs/default.nix b/pkgs/applications/version-management/darcs/default.nix index 8a2e80f2401..b14793f867f 100644 --- a/pkgs/applications/version-management/darcs/default.nix +++ b/pkgs/applications/version-management/darcs/default.nix @@ -1,10 +1,10 @@ -{stdenv, fetchurl, ghc, zlib, ncurses}: +{stdenv, fetchurl, ghc, zlib, ncurses, curl}: stdenv.mkDerivation { - name = "darcs-1.0.3"; + name = "darcs-1.0.5"; src = fetchurl { - url = http://abridgegame.org/darcs/darcs-1.0.3.tar.gz; - md5 = "d3fc141d1c91044e45ae74b74fc54728"; + url = http://abridgegame.org/darcs/darcs-1.0.5.tar.gz; + md5 = "9a9a4f84ed5b6258f7ab321713adf20b"; }; - buildInputs = [ghc zlib ncurses]; + buildInputs = [ghc zlib ncurses curl]; } diff --git a/pkgs/build-support/fetchdarcs/builder.sh b/pkgs/build-support/fetchdarcs/builder.sh new file mode 100644 index 00000000000..3ea36f57f99 --- /dev/null +++ b/pkgs/build-support/fetchdarcs/builder.sh @@ -0,0 +1,22 @@ +source $stdenv/setup + +tagtext="" +tagflags="" +if test -n "$tag"; then + tagtext="(tag $tag) " + tagflags="--tag=$tag" +fi + +header "getting $url ${tagtext}into $out" + +darcs get --no-pristine-tree $tagflags "$url" "$out" +# remove metadata, because it can change +rm -rf "$out/_darcs" + +actual=$(nix-hash $out) +if test "$actual" != "$outputHash"; then + echo "hash is $actual, expected $outputHash" >&2 + exit 1 +fi + +stopNest diff --git a/pkgs/build-support/fetchdarcs/default.nix b/pkgs/build-support/fetchdarcs/default.nix new file mode 100644 index 00000000000..efb37bea522 --- /dev/null +++ b/pkgs/build-support/fetchdarcs/default.nix @@ -0,0 +1,16 @@ +{stdenv, darcs, nix}: {url, tag ? null, md5}: + +stdenv.mkDerivation { + name = "fetchdarcs"; + builder = ./builder.sh; + buildInputs = [darcs nix]; + + # Nix <= 0.7 compatibility. + id = md5; + + outputHashAlgo = "md5"; + outputHashMode = "recursive"; + outputHash = md5; + + inherit url tag; +} diff --git a/pkgs/system/all-packages-generic.nix b/pkgs/system/all-packages-generic.nix index 59d220e5fad..9267e3ae8dd 100644 --- a/pkgs/system/all-packages-generic.nix +++ b/pkgs/system/all-packages-generic.nix @@ -38,6 +38,10 @@ rec { inherit stdenv subversion nix; }; + fetchdarcs = (import ../build-support/fetchdarcs) { + inherit stdenv darcs nix; + }; + substituter = ../build-support/substitute/substitute.sh; makeWrapper = ../build-support/make-wrapper/make-wrapper.sh; @@ -1271,7 +1275,7 @@ rec { uulib = import ../development/libraries/haskell/uulib { inherit stdenv fetchurl ghc; }; - + ### DEVELOPMENT / PERL MODULES perlBerkeleyDB = import ../development/perl-modules/BerkeleyDB { @@ -1771,7 +1775,7 @@ rec { }; darcs = import ../applications/version-management/darcs { - inherit fetchurl stdenv ghc zlib ncurses; + inherit fetchurl stdenv ghc zlib ncurses curl; }; pan = (import ../applications/networking/newsreaders/pan) {