summaryrefslogtreecommitdiff
path: root/libre/clojure/PKGBUILD
blob: 203c6792e3c1933ee166958b9d820fc32700c579 (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.7.0
pkgrel=1.parabola1
pkgdesc='LISP for the JVM'
url='http://clojure.org/'
arch=('any')
license=('EPL')
depends=('java-environment' 'bash')
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'
            'b04cd1381bc78e40271fc18a1ec7d8e45f630a12fdafe571ace746c3426fb003'
            '9bcd4c6eac491d1c9bbade5b35182a778fc7e08021de30edc387ac2adce75035'
            '2194819fd417174351172d94e3ccff050479401ca883b57d325a349072200bee'
            'b3fa6257dad10fb39851e87563269b80b2473623126595d9c279bbd90e97f052')

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}.jar"

  ln -s "/usr/share/java/${pkgname}.jar" \
    "${pkgdir}/usr/share/java/${pkgname}-${pkgver}.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"
}