summaryrefslogtreecommitdiff
path: root/libre/jedit/PKGBUILD
blob: faef2aa72d8c27fe94476ce443fe5221593aa1c2 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

pkgname=jedit
pkgver=5.4.0
pkgrel=1.parabola1
pkgdesc='Editor for programmers'
arch=('any')
url='http://jedit.org/'
license=('GPL')
depends=('java-runtime=8' 'bash')
makedepends=('java-environment=8' 'apache-ant' 'apache-ant-contrib' 'apache-ivy' 'beanshell' 'docbook-xsl-saxon'
             'gendesk' 'java-hamcrest' 'jsr305' 'junit' 'xerces2-java')
optdepends=('noto-fonts: perfectly usable font')
options=('!emptydirs')
source=("http://sourceforge.net/projects/$pkgname/files/$pkgname/$pkgver/jedit${pkgver}source.tar.bz2"
        'jedit.sh'
        'jeditbg.sh'
        'jedit.props'
        'jedit-fix_build.patch')
sha256sums=('b42dec6c81936b8974308f03c8f356487586cec782d79659b8ae67953c8edf71'
            '91d9b4b0c4855c9624ceea8c6b40c90b53fb15a020b6d954f4bb6b4b934e0348'
            '5cf267b6ee1f908ee7e9a830dc98f03a3a4a53db2822fce6a2cb5ed02d444c69'
            'dc5fe0050321d4f34bce556895fbc39cc6f7df194e14eb4f6ea53166a4d82347'
            '2676e043f9cd7e9e51322f5173ddf05f4ff2b68dc97d984b0b678c80478d4cee')

prepare() {
  gendesk -f -n --pkgname "$pkgname" --pkgdesc "$pkgdesc" --exec 'jeditbg %U' \
    --name 'jEdit' --genericname 'Editor'

  cd jEdit
  mkdir -p lib/{ant-contrib,compile,docbook,ivy,default-plugins,scripting,test}
  ln -sf /usr/share/java/ant-contrib.jar lib/ant-contrib/ant-contrib.jar
  ln -sf /usr/share/java/apache-ivy/ivy.jar lib/ivy/ivy.jar
  ln -sf /usr/share/java/bsh.jar lib/ant-contrib/bsh.jar
  ln -sf /usr/share/java/docbook-xsl-saxon.jar lib/docbook/docbook-xsl-saxon.jar
  ln -sf /usr/share/java/saxon.jar lib/docbook/saxon.jar
  ln -sf /usr/share/java/xercesImpl.jar lib/docbook/xercesImpl.jar
  ln -sf /usr/share/java/hamcrest-core.jar lib/test/hamcrest-core.jar
  ln -sf /usr/share/java/hamcrest-library.jar lib/test/hamcrest-library.jar
  ln -sf /usr/share/java/jsr305.jar lib/compile/jsr305.jar
  ln -sf /usr/share/java/junit.jar lib/test/junit.jar
  patch -Np1 -i "${srcdir}/jedit-fix_build.patch"
}

build() {
  cd jEdit
  ant build docs-html \
    -Divy.done=true
}

package() {
  cd jEdit

  # Install documentation
  install -d "$pkgdir/usr/share/java/$pkgname"
  cp -r build/doc "$pkgdir/usr/share/java/$pkgname"

  # Install jars
  install -D -m644 build/$pkgname.jar "$pkgdir/usr/share/java/$pkgname/$pkgname.jar"

  # Install keymaps
  cp -r build/keymaps "${pkgdir}/usr/share/java/${pkgname}"

  # Install macros
  cp -r build/macros "${pkgdir}/usr/share/java/${pkgname}"

  # Install modes
  cp -r build/modes "${pkgdir}/usr/share/java/${pkgname}"

  # Install properties
  cp -r build/properties "${pkgdir}/usr/share/java/${pkgname}"

  # Install startup
  cp -r build/startup "${pkgdir}/usr/share/java/${pkgname}"

  # Man pages
  install -Dm644 package-files/linux/$pkgname.1 "$pkgdir/usr/share/man/man1/$pkgname.1"

  # Launchers, properties and desktop shortcuts
  install -d "$pkgdir/usr/bin"
  install -Dm755 "$srcdir/$pkgname.sh" "$pkgdir/usr/bin/$pkgname"
  install -Dm755 "$srcdir/${pkgname}bg.sh" "$pkgdir/usr/bin/${pkgname}bg"
  install -Dm644 "$srcdir/$pkgname.props" "$pkgdir/usr/share/$pkgname/default.props"
  install -Dm644 "$srcdir/$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"
  install -Dm644 doc/$pkgname.png "$pkgdir/usr/share/pixmaps/$pkgname.png"
}