summaryrefslogtreecommitdiff
path: root/libre/clojure/PKGBUILD
blob: 9e1fde3c6a014acd5422a81a03b74b235bb05f33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

pkgname=clojure
pkgver=1.8.0
pkgrel=1.parabola2
pkgdesc='LISP for the JVM'
url='http://clojure.org/'
arch=('any')
license=('EPL')
depends=('java-environment' 'bash' 'java-asm')
makedepends=('apache-ant' 'classpath' 'git' 'java-asm' 'jh')
optdepends=('rlwrap: friendlier shell with readline support')
install='clojure.install'
source=("$pkgname::git://github.com/clojure/clojure.git#tag=$pkgname-$pkgver"
        'clojure-replace_asm.patch'
        'LICENSE.txt'
        'clj.sh' "$pkgname.sh")
sha256sums=('SKIP'
            'eb5323ca0ff21d1fb3110f059ff1ce47251f1421d1b1b4e4a6958f3c1d0ab8b3'
            '9bcd4c6eac491d1c9bbade5b35182a778fc7e08021de30edc387ac2adce75035'
            'd51083832d169df8cc61bd13c049e224178c2ad1c35c720509db55f4d090436b'
            'e4b82b88a32982079eb3d30b56332cb4f9f10068b8b1217c4e963081c11a04e0')

prepare() {
  cd "$pkgname"
  rm -rv "src/jvm/clojure/asm"
  patch -Np1 -i ../clojure-replace_asm.patch
}

build() {
  cd "$pkgname"

  ant jar javadoc
}

package() {
  cd "$pkgname"
  # Install license file
  install -Dm644 "${srcdir}/LICENSE.txt" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"

  # Install documentation
  install -d "${pkgdir}/usr/share/doc/${pkgname}"
  cp -r "target/javadoc" "${pkgdir}/usr/share/doc/${pkgname}"

  # Install Maven artifacts
  export DESTDIR=${pkgdir}
  jh mvn-install "org.${pkgname}" ${pkgname} ${pkgver} \
    "pom.xml" \
    "${pkgname}-${pkgver}.jar" \
    "${pkgname}-${pkgver}.jar"

  ln -s "/usr/share/java/${pkgname}-${pkgver}.jar" \
    "${pkgdir}/usr/share/java/${pkgname}.jar"

  install -Dm755 "${srcdir}/clj.sh" "$pkgdir/usr/bin/clj"
  install -Dm755 "${srcdir}/clj.sh" "$pkgdir/usr/bin/clojure"
  install -Dm755 "${srcdir}/$pkgname.sh" "$pkgdir/etc/profile.d/$pkgname.sh"
}