diff options
author | Bjorn Neergaard | 2015-06-09 08:24:57 -0700 |
---|---|---|
committer | Bjorn Neergaard | 2015-06-09 08:24:57 -0700 |
commit | 3c759edfdddf2eb01d18f38f5a8f5966a267e365 (patch) | |
tree | b10bcfe0e474c67fc91b47304cefb8939e66e5be | |
download | aur-3c759edfdddf2eb01d18f38f5a8f5966a267e365.tar.gz |
Initial import.
-rw-r--r-- | .SRCINFO | 26 | ||||
-rw-r--r-- | PKGBUILD | 65 | ||||
-rw-r--r-- | clj | 138 | ||||
-rw-r--r-- | clojure-git.install | 7 | ||||
-rw-r--r-- | clojure.sh | 1 |
5 files changed, 237 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..e215541fba9e --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,26 @@ +pkgbase = clojure-git + pkgdesc = LISP dialect for the JVM (development version) + pkgver = latest + pkgrel = 1 + url = http://clojure.org + install = clojure-git.install + arch = i686 + arch = x86_64 + license = CPL + makedepends = git + makedepends = apache-ant + makedepends = maven + depends = java-environment + depends = sh + optdepends = rlwrap: friendlier shell with readline support + provides = clojure + conflicts = clojure + source = git+https://github.com/clojure/clojure.git + source = clj + source = clojure.sh + sha256sums = SKIP + sha256sums = 0d0f9e7db77f4b5f507ee18e140c29138b7bff5c4ca9d0b963dfd657c6e3c157 + sha256sums = b3fa6257dad10fb39851e87563269b80b2473623126595d9c279bbd90e97f052 + +pkgname = clojure-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..b1bc09421aa3 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,65 @@ +# Maintainer: Bjorn Neergaard (neersighted) <bjorn@neersighted.com> +# Contributor: Chris O'Donnell <christopher.p.odonnell@gmail.com> +# Contributor: Sven-Hendrik Haase <sh@lutzhaase.com> + +_pkgname=clojure +pkgname=clojure-git +pkgver=latest +pkgrel=1 +pkgdesc='LISP dialect for the JVM (development version)' +url='http://clojure.org' +arch=('i686' 'x86_64') +license=('CPL') +install=clojure-git.install +source=('git+https://github.com/clojure/clojure.git' + 'clj' + 'clojure.sh') +sha256sums=('SKIP' + '0d0f9e7db77f4b5f507ee18e140c29138b7bff5c4ca9d0b963dfd657c6e3c157' + 'b3fa6257dad10fb39851e87563269b80b2473623126595d9c279bbd90e97f052') +depends=('java-environment' 'sh') +makedepends=('git' 'apache-ant' 'maven') +optdepends=('rlwrap: friendlier shell with readline support') +provides=('clojure') +conflicts=('clojure') + +pkgver() { + cd "${srcdir}/${_pkgname}" + + # Get the version number. + git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g' +} + +prepare() { + cd "${srcdir}/${_pkgname}" + + # Use maven to download and configure dependencies for ant. + ./antsetup.sh +} + +build() { + cd "${srcdir}/${_pkgname}" + + # Build it! + ant jar +} + +check() { + cd "${srcdir}/${_pkgname}" + + # Run the test suite. + ant test +} + +package() { + cd "${srcdir}/${_pkgname}" + + # Install the program. + install -Dm644 clojure.jar "${pkgdir}/usr/share/clojure/clojure.jar" + install -Dm755 "${srcdir}/clj" "${pkgdir}/usr/bin/clj" + + # Install shell runtime files. + install -Dm755 "${srcdir}/clojure.sh" "${pkgdir}/etc/profile.d/clojure.sh" +} + +# vim: ft=sh ts=2 sw=2 et @@ -0,0 +1,138 @@ +#!/bin/sh +# +# A launcher script for Clojure programs. These environment variables can be +# used to configure the script: +# +# CLOJURE_HOME +# The root directory where Clojure is installed. +# CLOJURE_JAVA +# The name of the java executable used to run Clojure. +# CLOJURE_JAVA_OPTS +# Additional options to be passed to the java executable. +# CLOJURE_CLASSPATH +# A path to be added to Clojure's classpath. +# CLOJURE_LIBRARY_PATH +# A path to be searched for native code such as DLL's or JNI +# libraries. This gets added to the Java options as +# "-Djava.library.path=$CLOJURE_LIBRARY_PATH". +# CLOJURE_LIB +# This directory, and any jars inside it, will be automatically +# added to Clojure's classpath. +# +# CLOJURE_JLINE +# This should be the path to Jline jar. +# TODO: +# make CLOJURE_LIB a path instead of a single directory +# allow for adding to CLOJURE_LIB from the command line + +usage="\ +usage: clojure [options] [file1 [file2] ...] + +Options: + --help, -h show this message + --java-cmd, -J the Java executable to use + --java-opts, -j add options to be passed on to the JVM + --classpath, -cp add to Clojure's classpath + --library-path, -L add to the path to search for native libraries + --verbose, -v print initialization information +" +## read ~/.clojurerc for home configuration +[ -e ~/.clojurerc ] && . ~/.clojurerc + +## read ./.clojurerc for project specific configuration +[ -e ./.clojurerc ] && . ./.clojurerc + +if [ ! "$CLOJURE_HOME" ]; then + # Find the real path to Clojure's home directory if $0 is a symlink + #program="$0" + #while [ -h "$program" ]; do + # ls=`ls -ld "$program"` + # link=`expr "$ls" : '.*-> \(.*\)$'` + # if expr "$link" : '.*/.*' >/dev/null; then + # program="$link" + # else + # program="`dirname $program`/$link" + # fi + #done + #script_dir=`dirname "$program"` + #relative_clojure_home=`dirname "$script_dir"` + #CLOJURE_HOME=`cd "$relative_clojure_home" && pwd` + . /etc/profile.d/clojure.sh +fi + +if [ ! "$CLOJURE_JAVA" ]; then + CLOJURE_JAVA="java"; +fi + +if [ ! "$CLOJURE_JAVA_OPTS" ]; then + CLOJURE_JAVA_OPTS="-Dpid=$$"; # set the pid for SLIME +fi + +if [ ! "$CLOJURE_CLASSPATH" ]; then + CLOJURE_CLASSPATH="." +fi + +## Add Clojure home jars. +for jar in "$CLOJURE_HOME"/*.jar; do + CLOJURE_CLASSPATH="$CLOJURE_CLASSPATH:$jar" +done + +if [ -d "$CLOJURE_LIB" ]; then + CLOJURE_CLASSPATH="$CLOJURE_CLASSPATH:$CLOJURE_LIB" + for jar in "$CLOJURE_LIB"/*.jar; do + CLOJURE_CLASSPATH="$CLOJURE_CLASSPATH:$jar" + done +fi + +# this is now the same for both the repl and for scripts +main="clojure.main" +repl=0 +verbose=0 + +while true; do + case $1 in + -h|--help) + echo "$usage"; exit 1;; + -J|--java-cmd) + CLOJURE_JAVA="$2"; shift; shift;; + -j|--java-opts) + CLOJURE_JAVA_OPTS="$CLOJURE_JAVA_OPTS $2"; shift; shift;; + -cp|--classpath) + CLOJURE_CLASSPATH="$CLOJURE_CLASSPATH:$2"; shift; shift;; + -L|--library-path) + if [ "$CLOJURE_LIBRARY_PATH" ]; then + CLOJURE_LIBRARY_PATH="$CLOJURE_LIBRARY_PATH:$2"; + else + CLOJURE_LIBRARY_PATH="$2"; + fi + shift; shift;; + -v|--verbose) + verbose=1; shift;; + *) break;; + esac +done + +[ $verbose -eq 1 ] && echo "$CLOJURE_CLASSPATH" + +# If we didn't get any files to load on the commandline, we want to run the +# repl, with command line editing if available. +[ $# -eq 0 ] && repl=1 + +# If the classpath contains the JLine jar, use the JLine console runner +if expr "$CLOJURE_CLASSPATH" : ".*jline.*\.jar" >/dev/null; then + [ $repl -eq 1 ] && jline="jline.ConsoleRunner" +fi + +# Enable rlwrap if present +if [ $repl -eq 1 ] && [ -z $jline ]; then + rlwrap=`type -p rlwrap` +fi + +## Add CLOJURE_LIBRARY_PATH to the Java options if necessary +if [ -n "$CLOJURE_LIBRARY_PATH" ]; then + CLOJURE_JAVA_OPTS="$CLOJURE_JAVA_OPTS -Djava.library.path=$CLOJURE_LIBRARY_PATH" +fi + +cmd=`echo $rlwrap "$CLOJURE_JAVA" "$CLOJURE_JAVA_OPTS" -cp "$CLOJURE_CLASSPATH" $jline $main "$@"` +[ $verbose -eq 1 ] && echo "$cmd" +exec `echo $cmd` diff --git a/clojure-git.install b/clojure-git.install new file mode 100644 index 000000000000..a141ead0b083 --- /dev/null +++ b/clojure-git.install @@ -0,0 +1,7 @@ +post_install() { + cat << MSG +==> Remember to relogin or source /etc/profile.d/clojure.sh manually. +MSG +} + +# vim: ft=sh ts=2 sw=2 et diff --git a/clojure.sh b/clojure.sh new file mode 100644 index 000000000000..5fd8395dc526 --- /dev/null +++ b/clojure.sh @@ -0,0 +1 @@ +export CLOJURE_HOME=/usr/share/clojure |