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
# When updating: Compare these numbers to the ones in the `curl` line
# in the example code at
# https://www.clojure.org/guides/getting_started#_installation_on_linux
pkgver=1.10.1
_toolver=697
pkgrel=2
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")
b2sums=('ed106d80d2ccec4dc4f084765d6433c1cf97d7a56ef07bc40ad7e40d5e45eaafedf9bd3604de5d52fa5fc2864ea10abb0823628dc07f519875cb329b5c19b1f7'
        'c3d7f294fbc239e42e83f3833199b44c446a3ca3be00a9f8b27f57ee3427b5f39d6adc274e15355f0688296cabb59204cea5a3fd732f91313d30d02a6dd55664')
 
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"
}