leiningen: Update to 2.0.0.

Patch thanks to Patrick Lee.
This commit is contained in:
Shea Levy 2013-01-27 20:38:32 -05:00
parent 9ac6c53cbf
commit 6ce14a6729
5 changed files with 13 additions and 94 deletions

View File

@ -10,7 +10,7 @@ out_bin=$out/bin/lein
cp -v $src $out_bin
cp -v $jarsrc $out/lib
cp -v $clojuresrc $out/lib
cp -v $clojure/lib/java/* $out/lib
for p in $patches;
do

View File

@ -1,34 +1,29 @@
{stdenv, fetchurl, makeWrapper, openjdk, rlwrap}:
{stdenv, fetchurl, makeWrapper, openjdk, rlwrap, clojure }:
stdenv.mkDerivation rec {
pname = "leiningen";
version = "1.7.1";
version = "2.0.0";
name = "${pname}-${version}";
src = fetchurl {
url = "https://raw.github.com/technomancy/leiningen/${version}/bin/lein-pkg";
sha256 = "7684b899edd6004abafd8e26d2b43d5691217f1aaca535fb94bde1594c8129a5";
sha256 = "0malymlswxwgh8amkw37qjb8n34ylw3chgbdxgxkq34rkvhv60hb";
};
jarsrc = fetchurl {
url = "https://github.com/downloads/technomancy/leiningen/leiningen-${version}-standalone.jar";
sha256 = "5d167b7572b9652d44c2b58a13829704842d976fd2236530ef552194e6c12150";
url = "https://leiningen.s3.amazonaws.com/downloads/leiningen-2.0.0-standalone.jar";
sha256 = "10jvk19mr5dcl5a9kzna9zslh77v3ixi8awhrhxi30dn1yj3r7ck";
};
clojuresrc = fetchurl {
url = "http://build.clojure.org/releases/org/clojure/clojure/1.2.1/clojure-1.2.1.jar";
sha256 = "b38853254a2df9138b2e2c12be0dca3600fa7e2a951fed05fc3ba2d9141a3fb0";
};
patches = ./lein_2.0.0.patch;
patches = [ ./lein-rlwrap.patch ./lein.patch ];
inherit rlwrap;
inherit rlwrap clojure;
builder = ./builder.sh;
buildInputs = [ makeWrapper ];
propagatedBuildInputs = [ openjdk ];
propagatedBuildInputs = [ openjdk clojure ];
meta = {
homepage = https://github.com/technomancy/leiningen;

View File

@ -1,45 +0,0 @@
From f14307932a316952fae8517c0fcb0962cd204e9a Mon Sep 17 00:00:00 2001
From: Michel Alexandre Salim <michel@sylvestre.me>
Date: Fri, 4 May 2012 10:56:38 +0700
Subject: [PATCH] lein-pkg: require rlwrap unconditionally, unless run inside
Emacs or a dumb terminal; chmod to 755 as this is an
executable script
---
bin/lein-pkg | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
mode change 100644 => 100755 bin/lein-pkg
diff --git a/bin/lein-pkg b/bin/lein-pkg
old mode 100644
new mode 100755
index 8563da6..1b90ebe
--- lein-pkg.orig
+++ lein-pkg
@@ -3,6 +3,11 @@
# This variant of the lein script is meant for downstream packagers.
# It has all the cross-platform stuff stripped out as well as the
# logic for running from checkouts and self-upgrading.
+#
+# Note to packagers:
+# rlwrap is now required unless running inside Emacs or in a dumb
+# terminal (this is to improve the 'lein repl' experience).
+# Make sure that your packaging pulls in rlwrap as a dependency
export LEIN_VERSION="1.7.1"
@@ -103,10 +108,7 @@ fi
# Use rlwrap if appropriate
if ([ -z $INSIDE_EMACS ] && [ "$TERM" != "dumb" ]); then
- which rlwrap > /dev/null
- if [ $? -eq 0 ]; then
- RLWRAP="rlwrap -r -m -q '\"'" # custom quote chars
- fi
+ RLWRAP="rlwrap -r -m -q '\"'" # custom quote chars
RLWRAP_CLJ_WORDS_FILE=${RLWRAP_CLJ_WORDS_FILE:-"${HOME}/.clj_completions"}
RLWRAP_CLJ_WORDS_OPTION=""
if [ -r "${RLWRAP_CLJ_WORDS_FILE}" ]; then
--
1.7.9.5

View File

@ -1,35 +0,0 @@
--- lein-pkg 2012-05-04 11:02:41.524912828 +0700
+++ lein-pkg-nix 2012-05-04 11:03:11.062543558 +0700
@@ -76,30 +76,14 @@
LEIN_PLUGIN_PATH="$(echo "$DEV_PLUGINS" | tr \\n :)"
LEIN_USER_PLUGIN_PATH="$(echo "$(unique_user_plugins)" | tr \\n :)"
CLASSPATH="$CLASSPATH:$LEIN_PLUGIN_PATH:$LEIN_USER_PLUGIN_PATH:test/:src/:resources/"
-CLOJURE_JAR="/usr/share/java/clojure-1.2.jar:/usr/share/java/asm3.jar:/usr/share/java/asm3-commons.jar"
+CLOJURE_JAR="$(dirname $0)/../lib/*clojure-1.2.1.jar"
# apply context specific CLASSPATH entries
if [ -f .lein-classpath ]; then
CLASSPATH="`cat .lein-classpath`:$CLASSPATH"
fi
-SHARE_JARS="ant ant-launcher classworlds clojure-1.2 clojure-contrib \
-lucene-memory maven-ant-tasks maven-artifact maven-artifact-manager \
-maven-error-diagnostics maven-model maven-settings maven-project maven-profile \
-maven-repository-metadata plexus-container-default-alpha plexus-interpolation \
-plexus-utils wagon-file wagon-http-lightweight wagon-http-shared wagon-provider-api \
-xml-apis lucene-core lucene-highlighter clucy robert-hooke lancet \
-backport-util-concurrent" # NFI why that last one is necessary
-for JAR in $SHARE_JARS; do
- CLASSPATH="$CLASSPATH":"/usr/share/java/$JAR.jar"
-done
-
-# Do not use installed leiningen jar during self-compilation
-if ! { [ "$1" = "compile" ] &&
- grep -qsE 'defproject leiningen[[:space:]]+"[[:digit:].]+"' \
- project.clj ;}; then
- CLASSPATH="$CLASSPATH":/usr/share/java/leiningen-$LEIN_VERSION.jar
-fi
+CLASSPATH="$CLASSPATH:$(dirname $0)/../lib/*"
if [ $DEBUG ]; then
echo $CLASSPATH

View File

@ -0,0 +1,4 @@
46c47
< LEIN_JAR=/usr/share/java/leiningen-$LEIN_VERSION-standalone.jar
---
> LEIN_JAR=$(find $(dirname $0)/../lib -name *-standalone.jar | head -n 1)