From ca109128b745bfda42de4e01bab50e2f6d4eedbf Mon Sep 17 00:00:00 2001 From: "Vargas, Dan" Date: Fri, 19 Mar 2021 13:45:59 -0500 Subject: [PATCH] pkg(clojure-1.10.3): Add clojure 1.10.3 --- packages/clojure/1.10.3/build.sh | 43 +++++++++++++++++++++++++++ packages/clojure/1.10.3/environment | 6 ++++ packages/clojure/1.10.3/metadata.json | 6 ++++ packages/clojure/1.10.3/run | 4 +++ packages/clojure/1.10.3/test.clj | 5 ++++ 5 files changed, 64 insertions(+) create mode 100755 packages/clojure/1.10.3/build.sh create mode 100644 packages/clojure/1.10.3/environment create mode 100644 packages/clojure/1.10.3/metadata.json create mode 100644 packages/clojure/1.10.3/run create mode 100644 packages/clojure/1.10.3/test.clj diff --git a/packages/clojure/1.10.3/build.sh b/packages/clojure/1.10.3/build.sh new file mode 100755 index 0000000..4633daf --- /dev/null +++ b/packages/clojure/1.10.3/build.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash + +# Installation location +PREFIX=$(realpath $(dirname $0)) + +# Clojure depends on Java (build and runtime) +mkdir -p java +cd java +curl "https://download.java.net/java/GA/jdk15.0.2/0d1cfde4252546c6931946de8db48ee2/7/GPL/openjdk-15.0.2_linux-x64_bin.tar.gz" -o java.tar.gz +tar xzf java.tar.gz --strip-components=1 +rm java.tar.gz +cd .. + +# Clojure depends on Maven (build) +mkdir -p maven +cd maven +curl "https://apache.claz.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz" -o maven.tar.gz +tar xzf maven.tar.gz --strip-components=1 +rm maven.tar.gz +cd .. + +# Adding java and maven to the path for building +export PATH=$PWD/java/bin:$PWD/maven/bin:$PATH +export JAVA_HOME=$PWD/java + +# Clojure download +mkdir -p build +cd build +git clone -q "https://github.com/clojure/clojure.git" . +git checkout -b clojure-1.10.3 aaf73b12467df80f5db3e086550a33fee0e1b39e # commit for 1.10.3 release + +# Build using maven +mvn -Plocal -Dmaven.test.skip=true package + +# Get ridda that m2 bloat from Maven and remove Maven itself +cd ../ +rm -rf ~/.m2 +rm -rf maven/ + +# Move the jar for easier reference and cleanup +mkdir -p bin +mv build/clojure.jar bin +rm -rf build diff --git a/packages/clojure/1.10.3/environment b/packages/clojure/1.10.3/environment new file mode 100644 index 0000000..e7ef3b1 --- /dev/null +++ b/packages/clojure/1.10.3/environment @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +# Clojure requires JAVA_HOME to be set and java binary to be in the path +export JAVA_HOME=$PWD/java +export CLOJURE_PATH=$PWD/bin +export PATH=$PWD/java/bin:$PATH diff --git a/packages/clojure/1.10.3/metadata.json b/packages/clojure/1.10.3/metadata.json new file mode 100644 index 0000000..64f83fa --- /dev/null +++ b/packages/clojure/1.10.3/metadata.json @@ -0,0 +1,6 @@ +{ + "language": "clojure", + "version": "1.10.3", + "aliases": ["clojure","clj"], + "author": "Dan Vargas " +} diff --git a/packages/clojure/1.10.3/run b/packages/clojure/1.10.3/run new file mode 100644 index 0000000..a8901af --- /dev/null +++ b/packages/clojure/1.10.3/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Run clojure with Java referencing the clojure jar location +java -jar $CLOJURE_PATH/clojure.jar "$@" diff --git a/packages/clojure/1.10.3/test.clj b/packages/clojure/1.10.3/test.clj new file mode 100644 index 0000000..7f50202 --- /dev/null +++ b/packages/clojure/1.10.3/test.clj @@ -0,0 +1,5 @@ +(ns clojure.examples.main + (:gen-class)) +(defn main [] + (println "OK")) +(main) \ No newline at end of file