summary refs log tree commit diff
path: root/pkgs/development/lisp-modules/from-quicklisp
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2014-11-13 09:08:53 +0300
committerMichael Raskin <7c6f434c@mail.ru>2014-11-13 11:17:47 +0300
commitd541ef3ada45b1ca3373b6feb9789d6ba366677f (patch)
tree10a20d4d42a366e150f68461713e5e61faa81361 /pkgs/development/lisp-modules/from-quicklisp
parentf1b8880a2f4d8cbce524b6fde0fb582ff29cc634 (diff)
downloadnixpkgs-d541ef3ada45b1ca3373b6feb9789d6ba366677f.tar
nixpkgs-d541ef3ada45b1ca3373b6feb9789d6ba366677f.tar.gz
nixpkgs-d541ef3ada45b1ca3373b6feb9789d6ba366677f.tar.bz2
nixpkgs-d541ef3ada45b1ca3373b6feb9789d6ba366677f.tar.lz
nixpkgs-d541ef3ada45b1ca3373b6feb9789d6ba366677f.tar.xz
nixpkgs-d541ef3ada45b1ca3373b6feb9789d6ba366677f.tar.zst
nixpkgs-d541ef3ada45b1ca3373b6feb9789d6ba366677f.zip
Allow generate update expressions and support darcs
Diffstat (limited to 'pkgs/development/lisp-modules/from-quicklisp')
-rwxr-xr-xpkgs/development/lisp-modules/from-quicklisp/barebones-quicklisp-expression.sh33
1 files changed, 30 insertions, 3 deletions
diff --git a/pkgs/development/lisp-modules/from-quicklisp/barebones-quicklisp-expression.sh b/pkgs/development/lisp-modules/from-quicklisp/barebones-quicklisp-expression.sh
index a9e443b6635..5aaf7bc81e3 100755
--- a/pkgs/development/lisp-modules/from-quicklisp/barebones-quicklisp-expression.sh
+++ b/pkgs/development/lisp-modules/from-quicklisp/barebones-quicklisp-expression.sh
@@ -4,7 +4,11 @@ name="$1"
 
 [ -z "$NIX_LISP_PACKAGES_DEFINED_LIST" ] && export NIX_LISP_PACKAGES_DEFINED_LIST="$(mktemp)"
 
-nix-instantiate "$(dirname "$0")"/../../../../ -A "lispPackages.$name" > /dev/null && exit
+if [ -n "$NIX_LISP_UPDATE_PACKAGE" ] || [ -n "$NIX_LISP_UPDATE_PACKAGES" ]; then
+  export NIX_LISP_UPDATE_PACKAGE=
+else
+  nix-instantiate "$(dirname "$0")"/../../../../ -A "lispPackages.$name" > /dev/null && exit
+fi
 grep "^$name\$" "$NIX_LISP_PACKAGES_DEFINED_LIST" > /dev/null && exit
 
 echo "$name" >> "$NIX_LISP_PACKAGES_DEFINED_LIST"
@@ -30,7 +34,7 @@ url="${ql_src##* }"
 
 [ "$ql_src_type" = "kmr-git" ] && {
   ql_src_type=git
-  url="http://git.b9.com/$url.git" 
+  url="http://git.b9.com/$url.git"
   export NIX_PREFETCH_GIT_DEEP_CLONE=1
 }
 
@@ -93,6 +97,29 @@ url="${ql_src##* }"
   unset url
 }
 
+[ "$ql_src_type" = clnet-darcs ] && {
+  ql_src_type=darcs
+  url="http://common-lisp.net/project/$url/darcs/$url/"
+}
+
+[ "$ql_src_type" = darcs ] && {
+  fetcher="pkgs.fetchdarcs"
+  [ -z "$version" ] &&
+  version="$(curl "$url/_darcs/inventory" | grep '\[TAG ' | tail -n 1 | sed -e 's/.* //')"
+  [ -z "$version" ] &&
+  version="$(curl "$url/_darcs/hashed_inventory" | grep '\[TAG ' | tail -n 1 | sed -e 's/.* //')"
+  rev="$version";
+  hash=$(echo "
+  with (import <nixpkgs> {});
+      fetchdarcs {
+        url=''$url'';
+	rev=''$version'';
+	sha256=''0000000000000000000000000000000000000000000000000000000000000000'';
+    }" | nix-instantiate - | tail -n 1 |
+    xargs nix-store -r 2>&1 | tee /dev/stderr | grep 'instead has' | tail -n 1 |
+    sed -e 's/.* instead has .//;s/[^0-9a-z].*//')
+}
+
 [ "$ql_src_type" = froydware-http ] && {
   dirurl = "http://method-combination.net/lisp/files/";
   url="$("$(dirname "$0")/../../../build-support/upstream-updater/urls-from-page.sh" "$dirurl" | grep "/$url_" | tail -n 1)"
@@ -111,7 +138,7 @@ url="${ql_src##* }"
   hash="$(nix-prefetch-url "$url" | grep . | tail -n 1)"
 }
 
-if [ "$ql_src" = '{"error":"Not Found"}' ]; then 
+if [ "$ql_src" = '{"error":"Not Found"}' ]; then
 	echo "# $name: not found"
 else
 cat << EOF | grep -Ev '^[ ]+$'