Ticket #31453: port-leiningen_1.6.1.1_update.diff

File port-leiningen_1.6.1.1_update.diff, 7.0 KB (added by anddam (Andrea D'Amore), 13 years ago)
  • files/patch-bin-lein.diff

     
    1 diff --git a/bin/lein b/bin/lein
    2 index 21eef64..26f655e 100755
    3 --- a/bin/lein
    4 +++ b/bin/lein
    5 @@ -1,5 +1,6 @@
    6  #!/bin/sh
    7  
    8 +PREFIX=__PREFIX__
    9  export LEIN_VERSION="1.3.1"
    10  
    11  case $LEIN_VERSION in
    12 @@ -31,14 +32,15 @@ do
    13  done
    14  
    15  if [ "$LEIN_HOME" = "" ]; then
    16 -    LEIN_HOME="$HOME/.lein"
    17 +    LEIN_HOME="$PREFIX/share/java/leiningen"
    18  fi
    19  
    20 +CLASSPATH="$(find -H $PREFIX -name \*.jar 2> /dev/null -print0 | tr \\0 \:)"
    21  LEIN_PLUGINS="$(ls -1 lib/dev/*jar 2> /dev/null | tr \\n \:)"
    22  LEIN_USER_PLUGINS="$(ls -1 $LEIN_HOME/plugins/*jar 2> /dev/null | tr \\n \:)"
    23  CLASSPATH=$LEIN_USER_PLUGINS:$LEIN_PLUGINS:src/:$CLASSPATH
    24  LEIN_JAR="$HOME/.m2/repository/leiningen/leiningen/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.jar"
    25 -CLOJURE_JAR="$HOME/.m2/repository/org/clojure/clojure/1.2.0/clojure-1.2.0.jar"
    26 +CLOJURE_JAR="$PREFIX/share/java/clojure/lib/clojure.jar"
    27  NULL_DEVICE=/dev/null
    28  
    29  # normalize $0 on certain BSDs
    30 @@ -87,82 +89,38 @@ fi
    31  
    32  JAVA_CMD=${JAVA_CMD:-"java"}
    33  
    34 -# If you're packaging this for a package manager (.deb, homebrew, etc)
    35 -# you need to remove the self-install and upgrade functionality.
    36 -if [ "$1" = "self-install" ]; then
    37 -    echo "Downloading Leiningen now..."
    38 -    LEIN_DIR=`dirname "$LEIN_JAR"`
    39 -    mkdir -p "$LEIN_DIR"
    40 -    LEIN_URL="http://github.com/downloads/technomancy/leiningen/leiningen-$LEIN_VERSION-standalone.jar"
    41 -    $HTTP_CLIENT "$LEIN_JAR" "$LEIN_URL"
    42 -    if [ $? != 0 ]; then
    43 -        echo "Failed to download $LEIN_URL"
    44 -        if [ $SNAPSHOT = "YES" ]; then
    45 -            echo "See README.md for SNAPSHOT build instructions."
    46 -        fi
    47 -        rm $LEIN_JAR
    48 -        exit 1
    49 -    fi
    50 -elif [ "$1" = "upgrade" ]; then
    51 -    if [ $SNAPSHOT = "YES" ]; then
    52 -        echo "The upgrade task is only meant for stable releases."
    53 -        echo "See the \"Hacking\" section of the README."
    54 -        exit 1
    55 -    fi
    56 -    if [ ! -w "$SCRIPT" ]; then
    57 -        echo "You do not have permission to upgrade the installation in $SCRIPT"
    58 -        exit 1
    59 -    else
    60 -        echo "The script at $SCRIPT will be upgraded to the latest stable version."
    61 -        echo -n "Do you want to continue [Y/n]? "
    62 -        read RESP
    63 -        case "$RESP" in
    64 -            y|Y|"")
    65 -                echo
    66 -                echo "Upgrading..."
    67 -                LEIN_SCRIPT_URL="http://github.com/technomancy/leiningen/raw/stable/bin/lein"
    68 -                $HTTP_CLIENT "$SCRIPT" "$LEIN_SCRIPT_URL" \
    69 -                    && chmod +x "$SCRIPT" \
    70 -                    && echo && $SCRIPT self-install && echo && echo "Now running" `$SCRIPT version`
    71 -                exit $?;;
    72 -            *)
    73 -                echo "Aborted."
    74 -                exit 1;;
    75 -        esac
    76 -    fi
    77 -else
    78 -    if [ "$OSTYPE" = "cygwin" ]; then
    79 -        # When running on Cygwin, use Windows-style paths for java
    80 -        CLOJURE_JAR=`cygpath -w "$CLOJURE_JAR"`
    81 -        CLASSPATH=`cygpath -wp "$CLASSPATH"`
    82 -        NULL_DEVICE=NUL
    83 -    fi
    84 +if [ "$OSTYPE" = "cygwin" ]; then
    85 +    # When running on Cygwin, use Windows-style paths for java
    86 +    CLOJURE_JAR=`cygpath -w "$CLOJURE_JAR"`
    87 +    CLASSPATH=`cygpath -wp "$CLASSPATH"`
    88 +    NULL_DEVICE=NUL
    89 +fi
    90  
    91 -    if [ $DEBUG ]; then
    92 -        echo $CLASSPATH
    93 -        echo $CLOJURE_JAR
    94 -    fi
    95 +if [ $DEBUG ]; then
    96 +    echo $CLASSPATH
    97 +    echo $CLOJURE_JAR
    98 +fi
    99  
    100 -    if ([ "$1" = "repl" ] || [ "$1" = "interactive" ] || [ "$1" = "int" ]) &&
    101 -        [ -z $INSIDE_EMACS ] && [ "$TERM" != "dumb" ]; then
    102 -        # Use rlwrap if it's available, otherwise fall back to JLine
    103 -        RLWRAP=`which rlwrap`
    104 -        if [ $? -eq 1 ]; then
    105 -            JLINE=jline.ConsoleRunner
    106 -            if [ "$OSTYPE" = "cygwin" ]; then
    107 -               JLINE="-Djline.terminal=jline.UnixTerminal jline.ConsoleRunner"
    108 -               CYGWIN_JLINE=y
    109 -            fi
    110 +if ([ "$1" = "repl" ] || [ "$1" = "interactive" ] || [ "$1" = "int" ]) &&
    111 +    [ -z $INSIDE_EMACS ] && [ "$TERM" != "dumb" ]; then
    112 +    # Use rlwrap if it's available, otherwise fall back to JLine
    113 +    RLWRAP=`which rlwrap`
    114 +    if [ $? -eq 1 ]; then
    115 +        JLINE=jline.ConsoleRunner
    116 +        if [ "$OSTYPE" = "cygwin" ]; then
    117 +    JLINE="-Djline.terminal=jline.UnixTerminal jline.ConsoleRunner"
    118 +    CYGWIN_JLINE=y
    119          fi
    120      fi
    121 -
    122 -    # The -Xbootclasspath argument is optional here: if the jar
    123 -    # doesn't exist everything will still work, it will just have a
    124 -    # slower JVM boot.
    125 -    # TODO: add more to the boot classpath
    126 -    test $CYGWIN_JLINE && stty -icanon min 1 -echo
    127 -    exec $RLWRAP $JAVA_CMD -Xbootclasspath/a:"$CLOJURE_JAR" -client $JAVA_OPTS \
    128 -        -cp "$CLASSPATH" $JLINE clojure.main -e "(use 'leiningen.core)(-main)" \
    129 -        $NULL_DEVICE $@
    130 -    test $CYGWIN_JLINE && stty icanon echo
    131  fi
    132 +
    133 +# The -Xbootclasspath argument is optional here: if the jar
    134 +# doesn't exist everything will still work, it will just have a
    135 +# slower JVM boot.
    136 +# TODO: add more to the boot classpath
    137 +test $CYGWIN_JLINE && stty -icanon min 1 -echo
    138 +exec $RLWRAP $JAVA_CMD -Xbootclasspath/a:"$CLOJURE_JAR" -client $JAVA_OPTS \
    139 +    -cp "$CLASSPATH" $JLINE clojure.main -e "(use 'leiningen.core)(-main)" \
    140 +    $NULL_DEVICE $@
    141 +test $CYGWIN_JLINE && stty icanon echo
    142 +
  • Portfile

     
    33PortSystem          1.0
    44
    55name                leiningen
    6 version             1.3.1
    7 revision            0
     6version             1.6.1.1
    87categories          devel java
    9 maintainers         gmail.com:ian.eure
     8maintainers         ieure
    109platforms           darwin
    1110description         A build tool for Clojure designed to not set your hair on fire.
    1211long_description    ${description}
    1312
    1413homepage            http://github.com/technomancy/${name}
    15 master_sites        http://download.github.com/
     14master_sites        https://nodeload.github.com/technomancy/leiningen/tarball
     15distfiles           ${version}
     16worksrcdir          technomancy-${name}-0e43e4d
     17checksums           md5     dbd6ac1df529e1e3b84814b8c44265ed \
     18                    sha1    0c0a0f5ce680c508b4cc3422ec32904cac16fade \
     19                    rmd160  513a7a42df88ab0658e3c33115432e74f161a917
    1620
    17 distname            technomancy-${name}-${version}-0-g2ea4b63
    18 worksrcdir          technomancy-${name}-2ea4b63
    19 checksums           md5 707fb0da7b89b44d9d37a9bac2bf3b3f \
    20     sha1 dc8d681f72f325f3b75e8c477bffc2cea52976d8 \
    21     rmd160 e38ee084d46c09f8b622703e04a9e41acadbf531
    22 
    2321depends_build       port:clojure \
    2422                    port:clojure-contrib \
    2523                    port:apache-ant \
     
    2725                    port:maven-ant-tasks
    2826depends_run         port:jline
    2927
    30 patchfiles          patch-bin-lein.diff
    31 patch.pre_args      -p1
    32 
    3328post-patch {
    3429    copy ${filespath}/build.xml ${worksrcpath}
    3530    reinplace "s|__PREFIX__|${prefix}/share/java|" ${worksrcpath}/build.xml