diff options
author | Andres Löh <mail@andres-loeh.de> | 2006-01-30 11:18:38 +0000 |
---|---|---|
committer | Andres Löh <mail@andres-loeh.de> | 2006-01-30 11:18:38 +0000 |
commit | 70c36821c6140ac0e61b66fab917395aea7950e0 (patch) | |
tree | f11193db384dbe9b323447acb765cb1adc83246f /pkgs/build-support | |
parent | 105150e28141207ba3a06975c2ef34529042b279 (diff) |
* updated darcs to 1.0.5, added curl dependency
* added an experimental fetchdarcs function, based on fetchsvn (there are no expressions yet that use this function) svn path=/nixpkgs/trunk/; revision=4615
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/fetchdarcs/builder.sh | 22 | ||||
-rw-r--r-- | pkgs/build-support/fetchdarcs/default.nix | 16 |
2 files changed, 38 insertions, 0 deletions
diff --git a/pkgs/build-support/fetchdarcs/builder.sh b/pkgs/build-support/fetchdarcs/builder.sh new file mode 100644 index 0000000000000..3ea36f57f99d0 --- /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 0000000000000..efb37bea52227 --- /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; +} |