summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6be847ae53d61cb0cccd3b82b2af42e67b144ba0 (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
# -*- sh -*-

# Maintainer: Klaus Alexander Seistrup <klaus@seistrup.dk>

pkgname='slxfig-snapshot'
_pkgname="${pkgname%-snapshot}"
_pkgver=0.2.0-138
_prever="pre$_pkgver"
pkgver="${_pkgver/-/.}"
pkgrel=2
pkgdesc='Xfig-based publication quality plotting package for the S-Lang interpreter (development snapshot)'
arch=('aarch64' 'x86_64')
url='https://jedsoft.org/snapshots/'
license=('GPL-2.0-or-later')  # SPDX-License-Identifier: GPL-2.0-or-later
depends=('glibc' 'slang')
makedepends=('slsh')
provides=('slxfig')
conflicts=('slxfig')
options=('lto' '!makeflags')
source=("${url}${_pkgname}-$_prever.tar.gz")
md5sums=('254b43911f88cd2c02d81c7eb982f085')               # Taken from $url
validpgpkeys=('AE962A02D29BFE4A4BB2805FDE401E0D5873000A')  # John E. Davis
changelog="$pkgname.changelog"

build() {
  cd "$_pkgname-$_prever"

  # 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

  ./configure --prefix=/usr

  make
}

package() {
  cd "$_pkgname-$_prever"

  make DESTDIR="$pkgdir" install

  # Change permissions of the gcontour module: 0644 → 0755
  chmod 0755 "$pkgdir/usr/lib/slang/v2/modules/gcontour-module.so"

  # Install extra documentation
  install -vDm0644 -t "$pkgdir/usr/share/doc/$pkgname/${_doc##*/}" \
    changes.txt INSTALL README TODO doc/text/slxfig.txt

  cp -fax examples "$pkgdir/usr/share/doc/$pkgname/"

  # Byte-compile S-Lang files
  cd "$pkgdir/usr/share/slsh/local-packages/"
  slsh -e '
    for ($1=0; $1<__argc; $1++) {
      $2 = __argv[$1];
      () = printf("Byte-compiling %s …", $2);
      byte_compile_file($2, 0);
      () = printf("\n");
    }
  ' *.sl */*.sl
}

b2sums=(
  '8819329e3ec2da03e690a0b3c85369b33210b2a95e5a4480a536148593790b83a0e0f0c301ee962ddd55ec9bb01034fb757c8aefc6dd048a7051702d05200c89'
)

# eof