summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: db6b966b8827eb130f58ba35db3b130601ce8efe (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
# Maintainer: Paulo Matias <matias@ufscar.br>

## links
# https://sourceforge.net/projects/incrtcl/
# https://core.tcl-lang.org/itcl/
# https://github.com/tcltk/itk

_pkgname="tk-itk"
pkgname="$_pkgname"
pkgver=4.2.3
pkgrel=1
pkgdesc="OOP extension for Tk"
url="https://github.com/tcltk/itk"
license=('TCL')
arch=('x86_64')

depends=('tcl' 'tk')
makedepends=('git')
checkdepends=(
  'xorg-server-xvfb'
  'noto-fonts'
)

options=('!emptydirs')

_pkgsrc="itk-itk-${pkgver//./-}"
_pkgext="tar.gz"
source=(
  "$_pkgname-$pkgver.$_pkgext"::"$url/archive/refs/tags/itk-${pkgver//./-}.$_pkgext"
  "git+https://github.com/tcltk/tclconfig.git"
)
sha256sums=(
  'bc5ed347212fce403e04d3161cd429319af98da47effd3e32e20d2f04293b036'
  'SKIP'
)

prepare() {
  cp -r tclconfig "$_pkgsrc/"
}

build() {
  cd "$_pkgsrc"
  ./configure \
    --prefix=/usr \
    --mandir=/usr/share/man \
    --enable-64bit \
    --with-itcl=/$(pacman -Ql tcl | grep -Pom1 'usr/lib/itcl[\d.]+')
  make
}

check() {
  local _headless_run=(
    xvfb-run
    -s "-screen 0 1920x1080x24 -nolisten local"
  )

  cd "$_pkgsrc"
  env "${_headless_run[@]}" -- make test
}

package() {
  cd "$_pkgsrc"
  make DESTDIR="${pkgdir}" install
  install -Dm644 license.terms "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  # unwanted
  find "$pkgdir/usr/lib" -name '*.a' -delete
}