Merge branch 'master' into stdenv-updates

Conflicts:
	pkgs/top-level/all-packages.nix
This commit is contained in:
Mathijs Kwik
2013-11-01 08:31:54 +01:00
272 changed files with 4690 additions and 2945 deletions

View File

@@ -25,9 +25,15 @@ setLisp () {
fi
}
collectNixLispLDLP () {
if echo "$1/lib"/lib*.so* | grep . > /dev/null; then
export NIX_LISP_LD_LIBRARY_PATH="$NIX_LISP_LD_LIBRARY_PATH${NIX_LISP_LD_LIBRARY_PATH:+:}$1/lib"
fi
}
export NIX_LISP_COMMAND NIX_LISP CL_SOURCE_REGISTRY NIX_LISP_ASDF
envHooks=(envHooks[@] addASDFPaths setLisp)
envHooks=(envHooks[@] addASDFPaths setLisp collectNixLispLDLP)
mkdir -p "$HOME"/.cache/common-lisp || HOME="$TMP/.temp-$USER-home"
mkdir -p "$HOME"/.cache/common-lisp

View File

@@ -9,6 +9,10 @@ let
echo "export NIX_LISP_COMMAND='$NIX_LISP_COMMAND'" >> "$config_script"
echo "export NIX_LISP_ASDF='$NIX_LISP_ASDF'" >> "$config_script"
echo "export CL_SOURCE_REGISTRY="\$CL_SOURCE_REGISTRY\''${CL_SOURCE_REGISTRY:+:}"'$CL_SOURCE_REGISTRY:$out/lib/common-lisp/${args.baseName}/'" >> "$config_script"
test -n "$LD_LIBRARY_PATH" &&
echo "export LD_LIBRARY_PATH=\"\$LD_LIBRARY_PATH\''${LD_LIBRARY_PATH:+:}\"'$LD_LIBRARY_PATH'" >> "$config_script"
test -n "$NIX_LISP_LD_LIBRARY_PATH" &&
echo "export NIX_LISP_LD_LIBRARY_PATH=\"\$NIX_LISP_LD_LIBRARY_PATH\''${NIX_LISP_LD_LIBRARY_PATH:+:}\"'$NIX_LISP_LD_LIBRARY_PATH'" >> "$config_script"
'';
deployLaunchScript = ''
launch_script="$out"/bin/${args.baseName}-lisp-launcher.sh
@@ -17,6 +21,7 @@ let
chmod a+x "$launch_script"
echo "#! /bin/sh" >> "$launch_script"
echo "source '$config_script'" >> "$launch_script"
echo "export LD_LIBRARY_PATH=\"\$NIX_LISP_LD_LIBRARY_PATH\''${NIX_LISP_LD_LIBRARY_PATH:+:}\$LD_LIBRARY_PATH\"" >> "$launch_script"
echo '"${clwrapper}/bin/common-lisp.sh" "$@"' >> "$launch_script"
'';
basePackage = {

View File

@@ -0,0 +1,16 @@
#! /bin/sh
[ -z "$NIX_QUICKLISP_DIR" ] && {
export NIX_QUICKLISP_DIR="$(mktemp -d --tmpdir nix-quicklisp.XXXXXX)"
}
[ -f "$NIX_QUICKLISP_DIR/setup.lisp" ] || {
"$(dirname "$0")/quicklisp-beta-env.sh" "$NIX_QUICKLISP_DIR" &> /dev/null < /dev/null
}
name="$1"
sbcl --noinform --load "$NIX_QUICKLISP_DIR"/setup.lisp --eval "(ql:quickload :$name)" \
--eval "(format t \"~a~%\" (or (asdf::system-description (asdf::find-system \"$name\")) \"\"))" \
--eval '(quit)' --script |
tee /dev/stderr | tail -n 1

View File

@@ -0,0 +1,78 @@
#! /bin/sh
name="$1"
nix-instantiate "$(dirname "$0")"/../../../../ -A "lispPackages.$name" > /dev/null && exit
[ "$NIX_LISP_PACKAGES_DEFINED" != "${NIX_LISP_PACKAGES_DEFINED/$name/@@}" ] && exit
NIX_LISP_PACKAGES_DEFINED="$NIX_LISP_PACKAGES_DEFINED $1 "
[ -z "$NIX_QUICKLISP_DIR" ] && {
export NIX_QUICKLISP_DIR="$(mktemp -d --tmpdir nix-quicklisp.XXXXXX)"
}
[ -f "$NIX_QUICKLISP_DIR/setup.lisp" ] || {
"$(dirname "$0")/quicklisp-beta-env.sh" "$NIX_QUICKLISP_DIR" &> /dev/null < /dev/null
}
description="$("$(dirname "$0")/asdf-description.sh" "$name")"
[ -z "$description" ] && {
description="$(curl -L https://github.com/quicklisp/quicklisp-projects/raw/master/"$name"/description.txt)"
[ "$(echo "$description" | wc -l)" -gt 10 ] && description=""
}
dependencies="$("$(dirname "$0")/quicklisp-dependencies.sh" "$name" | xargs)"
ql_src="$(curl -L https://github.com/quicklisp/quicklisp-projects/raw/master/"$name"/source.txt)"
ql_src_type="${ql_src%% *}"
url="${ql_src##* }"
[ "$ql_src_type" = git ] && {
fetcher="pkgs.fetchgit"
[ "${url#git://github.com/}" != "$url" ] && {
url="${url/git:/https:}"
url="${url%.git}"
rev=$("$(dirname "$0")/../../../build-support/upstream-updater/urls-from-page.sh" "$url/commits" | grep /commit/ | head -n 1 | xargs basename)
hash=$("$(dirname "$0")/../../../build-support/fetchgit/nix-prefetch-git" "$url" "$rev")
version="git-$(date +%Y%m%d)";
}
[ "${url#git://common-lisp.net/}" != "$url" ] && {
http_repo_url="$url"
http_repo_url="${http_repo_url/git:/http:}"
http_repo_url="${http_repo_url/\/projects\// /r/projects/}"
http_repo_head="$http_repo_url/refs/heads/master"
echo "$http_repo_head" >&2
rev=$(curl -L "$http_repo_head");
hash=$("$(dirname "$0")/../../../build-support/fetchgit/nix-prefetch-git" "$url" "$rev")
version="git-$(date +%Y%m%d)";
}
}
[ "$ql_src_type" = cvs ] && {
fetcher="pkgs.fetchcvs"
date="$(date -d yesterday +%Y-%m-%d)"
version="cvs-$date"
module="${module:-$name}"
hash=$(USE_DATE=1 "$(dirname "$0")/../../../build-support/fetchcvs/nix-prefetch-cvs" "$url" "$module" "$date")
cvsRoot="$url"
unset url
}
cat << EOF
$name = buildLispPackage rec {
baseName = "$name";
version = "${version:-\${Set me //}";
description = "$description";
deps = [$dependencies];
src = ${fetcher:-pkgs.fetchurl} {
${url:+url = ''$url'';}
sha256 = "${hash:-0000000000000000000000000000000000000000000000000000000000000000}";
${rev:+rev = ''$rev'';}
${date:+date = ''$date'';}
${module:+module = ''$module'';}
${cvsRoot:+cvsRoot = ''$cvsRoot'';}
};
};
EOF
for i in $dependencies; do "$0" "$i"; done

View File

@@ -0,0 +1,16 @@
#! /bin/sh
WORK_DIR=$(mktemp -d "/tmp/ql-venv-XXXXXX")
mkdir -p "${1:-.}"
TARGET="$(cd "${1:-.}"; pwd)"
curl http://beta.quicklisp.org/quicklisp.lisp > "$WORK_DIR/ql.lisp"
sbcl --noinform \
--load "$WORK_DIR/ql.lisp" \
--eval "(quicklisp-quickstart:install :path \"$TARGET/\")" \
--eval "(cl-user::quit)" \
--script
rm -rf "$WORK_DIR"

View File

@@ -0,0 +1,11 @@
#! /bin/sh
[ -z "$NIX_QUICKLISP_DIR" ] && {
export NIX_QUICKLISP_DIR="$(mktemp -d --tmpdir nix-quicklisp.XXXXXX)"
}
[ -f "$NIX_QUICKLISP_DIR/setup.lisp" ] || {
"$(dirname "$0")/quicklisp-beta-env.sh" "$NIX_QUICKLISP_DIR" &> /dev/null < /dev/null
}
sbcl --noinform --eval "(with-output-to-string (*standard-output*) (load \"$NIX_QUICKLISP_DIR/setup.lisp\"))" --eval "(with-output-to-string (*standard-output*) (with-output-to-string (*error-output*) (with-output-to-string (*trace-output*) (ql:quickload :$1))))" --eval "(format t \"~{~a~%~}\" (mapcar 'ql::name (mapcar 'car (cdr (ql::dependency-tree \"$1\")))))" --eval '(quit)' --script

View File

@@ -45,5 +45,59 @@ let lispPackages = rec {
};
stumpwm = callPackage ./stumpwm {};
alexandria = buildLispPackage rec {
baseName = "alexandria";
version = "git-20131029";
description = "Alexandria is a collection of portable public domain utilities.";
deps = [];
src = pkgs.fetchgit {
url = "git://common-lisp.net/projects/alexandria/alexandria.git";
sha256 = "1d981a243f9d4d3c9fd86cc47698050507ff615b87b9a710449abdb4234e501b";
rev = ''2b1eb4067fb34bc501e527de75d09166a8ba9ceb'';
};
};
esrap-peg = buildLispPackage rec {
baseName = "esrap-peg";
version = "git-20131029";
description = "A wrapper around Esrap to allow generating Esrap grammars from PEG definitions";
deps = [alexandria cl-unification esrap iterate];
src = pkgs.fetchgit {
url = "https://github.com/fb08af68/esrap-peg";
sha256 = "48e616a697aca95e90e55052fdc9a7f96bf29b3208b1b4012fcd3189c2eceeb1";
rev = ''1f2f21e32e618f71ed664cdc5e7005f8b6b0f7c8'';
};
};
cl-unification = buildLispPackage rec {
baseName = "cl-unification";
version = "cvs-2013-10-28";
description = "";
deps = [];
src = pkgs.fetchcvs {
sha256 = "a574b7f9615232366e3e5e7ee400d60dbff23f6d0e1def5a3c77aafdfd786e6a";
date = ''2013-10-28'';
module = ''cl-unification'';
cvsRoot = '':pserver:anonymous:anonymous@common-lisp.net:/project/cl-unification/cvsroot'';
};
};
esrap = buildLispPackage rec {
baseName = "esrap";
version = "git-20131029";
description = "A Packrat / Parsing Grammar / TDPL parser for Common Lisp.";
deps = [alexandria];
src = pkgs.fetchgit {
url = "https://github.com/scymtym/esrap";
sha256 = "c56616ac01be0f69e72902f9fd830a8af2c2fa9018b66747a5da3988ae38817f";
rev = ''c71933b84e220f21e8a509ec26afe3e3871e2e26'';
};
};
};
in lispPackages