Username: Password: Remember me
# Maintainer: Mark Haferkamp <chakralinux dot org at refola dot com>
# Contributor: Elvis Angelaccio <elvis dot angelaccio at kdemail dot net>
# Contributor: Inkane <neoinkaneglade@aol.com>
# Contributor: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Thomas Dziedzic < gostrc at gmail >
# Contributor: Chris O'Donnell <christopher.p.odonnell@gmail.com>
# Contributor: Sam May <sam.m4y@gmail.com>
 
pkgname=clojure
pkgver=1.10.1
_toolver=478
pkgrel=1
pkgdesc='A LISP dialect for the JVM.'
url='https://www.clojure.org'
arch=('any')
license=('EPL')
depends=('java-environment')
optdepends=('rlwrap: for a friendlier shell with readline support')
install='clojure.install'
source=("https://download.clojure.org/install/clojure-tools-$pkgver.$_toolver.tar.gz"
        "clojure.sh")
sha256sums=('4c49f31fed5ae5562d497dc4c9cb4930896add7cca2f05f60eebaa9a57bf6060'
            'b3fa6257dad10fb39851e87563269b80b2473623126595d9c279bbd90e97f052')
 
prepare() {
  local clojure_lib_dir="/usr/share/clojure"
  sed -i -e 's@PREFIX@'"$clojure_lib_dir"'@g' clojure-tools/clojure
}
 
package() {
  install -Dm755 clojure.sh "$pkgdir/etc/profile.d/clojure.sh"
 
  # Make modified stuff from upstream script work
  cd clojure-tools
  local clojure_lib_dir="$pkgdir/usr/share/clojure"
  local bin_dir="$pkgdir/usr/bin"
  local man_dir="$pkgdir/usr/share/man/man1"
 
  # Originally from
  # https://download.clojure.org/install/linux-install-1.10.1.478.sh
 
  #echo "Installing libs into $clojure_lib_dir"
  install -Dm644 deps.edn "$clojure_lib_dir/deps.edn"
  install -Dm644 example-deps.edn \
          "$clojure_lib_dir/example-deps.edn"
  install -Dm644 "clojure-tools-$pkgver.$_toolver.jar" \
          "$clojure_lib_dir/libexec/clojure-tools-$pkgver.$_toolver.jar"
 
  #echo "Installing clojure and clj into $bin_dir"
  install -Dm755 clojure "$bin_dir/clojure"
  install -Dm755 clj "$bin_dir/clj"
 
  #echo "Installing man pages into $man_dir"
  install -Dm644 clojure.1 "$man_dir/clojure.1"
  install -Dm644 clj.1 "$man_dir/clj.1"
}