pkg(clojure-1.10.3): Add clojure 1.10.3

This commit is contained in:
Vargas, Dan 2021-03-19 13:45:59 -05:00
parent c69af5bc6d
commit ca109128b7
5 changed files with 64 additions and 0 deletions

43
packages/clojure/1.10.3/build.sh vendored Executable file
View File

@ -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

6
packages/clojure/1.10.3/environment vendored Normal file
View File

@ -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

6
packages/clojure/1.10.3/metadata.json vendored Normal file
View File

@ -0,0 +1,6 @@
{
"language": "clojure",
"version": "1.10.3",
"aliases": ["clojure","clj"],
"author": "Dan Vargas <danvargas46@gmail.com>"
}

4
packages/clojure/1.10.3/run vendored Normal file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
# Run clojure with Java referencing the clojure jar location
java -jar $CLOJURE_PATH/clojure.jar "$@"

5
packages/clojure/1.10.3/test.clj vendored Normal file
View File

@ -0,0 +1,5 @@
(ns clojure.examples.main
(:gen-class))
(defn main []
(println "OK"))
(main)