- update leiningen to 1.7.1

- apply patch (applied upstream) to assume rlwrap is present
- update expression to depend on rlwrap
- rebase the nix-specific patch to apply cleanly

svn path=/nixpkgs/trunk/; revision=34056
This commit is contained in:
Michel Alexandre Salim 2012-05-11 03:36:13 +00:00
parent b6917d3b73
commit 2c64c7fe9d
4 changed files with 68 additions and 11 deletions

View file

@ -12,11 +12,16 @@ cp -v $src $out_bin
cp -v $jarsrc $out/lib
cp -v $clojuresrc $out/lib
patch --verbose $out_bin -p0 < $patches
for p in $patches;
do
patch --verbose $out_bin -p0 < $p
done
chmod -v 755 $out_bin
patchShebangs $out
wrapProgram $out_bin --prefix PATH ":" ${rlwrap}/bin
echo "Testing out \"lein version\"..."
$out_bin version
echo "Success."

View file

@ -1,18 +1,18 @@
{stdenv, fetchurl, openjdk}:
{stdenv, fetchurl, makeWrapper, openjdk, rlwrap}:
stdenv.mkDerivation rec {
pname = "leiningen";
version = "1.7.0";
version = "1.7.1";
name = "${pname}-${version}";
src = fetchurl {
url = "https://raw.github.com/technomancy/leiningen/1.7.0/bin/lein-pkg";
sha256 = "1339f6ffc7bae3171174fc9eae990f5b9710ff2804038e931d531632c57f189c";
url = "https://raw.github.com/technomancy/leiningen/${version}/bin/lein-pkg";
sha256 = "7684b899edd6004abafd8e26d2b43d5691217f1aaca535fb94bde1594c8129a5";
};
jarsrc = fetchurl {
url = "https://github.com/downloads/technomancy/leiningen/leiningen-1.7.0-standalone.jar";
sha256 = "501eaa1c2a19ca4ffc2fde1776552cb513d69ee874abb547c40cee92156e50bf";
url = "https://github.com/downloads/technomancy/leiningen/leiningen-${version}-standalone.jar";
sha256 = "5d167b7572b9652d44c2b58a13829704842d976fd2236530ef552194e6c12150";
};
clojuresrc = fetchurl {
@ -20,10 +20,14 @@ stdenv.mkDerivation rec {
sha256 = "b38853254a2df9138b2e2c12be0dca3600fa7e2a951fed05fc3ba2d9141a3fb0";
};
patches = [ ./lein.patch ];
patches = [ ./lein-rlwrap.patch ./lein.patch ];
inherit rlwrap;
builder = ./builder.sh;
buildInputs = [ makeWrapper ];
propagatedBuildInputs = [ openjdk ];
meta = {

View file

@ -0,0 +1,45 @@
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,6 +1,6 @@
--- lein-pkg 2012-02-28 15:26:40.000000000 -0800
+++ lein-pkg-nix 2012-02-28 17:17:02.000000000 -0800
@@ -71,30 +71,14 @@
--- 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/"
@ -30,3 +30,6 @@
- CLASSPATH="$CLASSPATH":/usr/share/java/leiningen-$LEIN_VERSION.jar
-fi
+CLASSPATH="$CLASSPATH:$(dirname $0)/../lib/*"
if [ $DEBUG ]; then
echo $CLASSPATH