summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1af220970adcfcc032a8e501880fb7bb0fa0d68b (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
# -*- mode: sh -*-

# Maintainer: Klaus Alexander Seistrup <$(echo 0x1fd+d59decfa=40 | tr 0-9+a-f=x ka-i@p-u.l)>
# Contributor: spider-mario <spidermario@free.fr>
# Contributor: Baptiste Jonglez <baptiste--aur at jonglez dot org>

pkgname=jbofihe-git
epoch=2
pkgver=0.43.19.gcc6fe66
pkgrel=3
pkgdesc='Tools to operate on Lojban text (main feature: approximate translation to English)'
arch=('aarch64' 'i686' 'x86_64')
url="https://github.com/lojban/jbofihe"
license=('GPL-2.0-or-later')
depends=('glibc')
makedepends=('git' 'perl')
options=('lto' '!makeflags')
source=("git+$url.git")
sha256sums=(SKIP)

pkgver() {
  cd jbofihe

  git describe --tags | sed -e 's/^[^0-9\-]*//' -e 'y/-/./'
}

build() {
  cd jbofihe

  echo "Running config.pl…"
  perl config.pl --prefix=/usr

  # RFC-0023
  # 🔗 https://rfc.archlinux.page/0023-pack-relative-relocs/
  #
  # ld(1) says: “Supported for i386 and x86-64.”
  case "Z${CARCH:-unknown}" in
    'Zx86_64' | 'Zi386' )
      export LDFLAGS="$LDFLAGS -Wl,-z,pack-relative-relocs"
    ;;
    * ) : pass ;;
  esac

  for _makefile in {.,dfasyn}/Makefile; do
    sed -i 's/^CFLAGS=/CFLAGS+=-Wno-implicit-int -Wno-implicit-function-declaration $(LDFLAGS)/g' "$_makefile"
  done

  echo "Running make…"
  # There is a Perl script that expects the locale to be an English one.
  env LANG=C LC_ALL=C make all
}

package() {
  cd jbofihe

  make DESTDIR="$pkgdir" install

  chmod -v 0644 "$pkgdir"/usr/share/man/man1/*.1

  install -vDm0644 -t "$pkgdir/usr/share/doc/$pkgname" \
    NEWS README README.*

  cp -vfa contrib "$pkgdir/usr/share/doc/$pkgname/"
}

# vim:set ts=2 sw=2 et: