summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 93655988d8baf7f15e24ec246a8e55155c5858ec (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
# Maintainer: b00rt00s <b00rt00s.aur@gmail.com>
# Maintainer: taotieren <admin@taotieren.com>
# Contributor: Markus Theil <aur@thillux.de>
# Contributor: Oleg Smirnov <oleg.smirnov@gmail.com>
# Contributor: Jason Taylor <jftaylor21@gmail.com>
# Contributor: Christophe Gueret <tolgam@homegnu.net>

pkgname=blt-git
pkgver=r1904.0857004
pkgrel=2
pkgdesc="Adds new commands and widgets to the Tcl interpreter."
url="http://blt.sourceforge.net"
license=("custom")
depends=('glibc' 'expat' 'tcl' 'tk' 'libnsl' 'libx11' 'libxau' 'libxcomposite' 'libxcursor' 'libxdmcp' 'libxext' 'libxft' 'libxpm' 'libxrandr' 'libxrender' 'libtiff' 'libjpeg-turbo' 'libpng' 'libssh2' 'freetype2' 'fontconfig' 'sqlite' 'zlib')
# 'postgresql-libs'
# 'libmariadbclient'
makedepends=('git' 'pkgconf')
provides=(${pkgname%-git})
conflicts=('blt_tcl85' ${pkgname%-git})
arch=($CARCH)
source=("${pkgname}::git+git://git.code.sf.net/p/blt/src"
  "fix-build.patch")
sha256sums=('SKIP'
  '4c274da7a995c31fbbc99bca2804b9fda58c8ce02470eaf853cff836a7d48ae4')

pkgver() {
  cd "${srcdir}/${pkgname}"
  (
    set -o pipefail
    git describe --long --tag --abbrev=7 2>/dev/null | sed 's/^v//g;s/\([^-]*-g\)/r\1/;s/-/./g' ||
      printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
  )
}

prepare() {
  git -C "${srcdir}/${pkgname}" clean -dfx
}

build() {
  # configure
  cd ${srcdir}/${pkgname}
  patch configure <${srcdir}/fix-build.patch
  #   autoreconf -i
  ./configure \
    --prefix=/usr \
    --with-tcl=/usr/lib \
    --with-tk=/usr/lib \
    --with-x --x-includes=/usr/include \
    --x-libraries=/usr/lib \
    --mandir=/usr/share/man

  # Compile
  make CFLAGS="$CFLAGS" CXXFLAGS="$XXCFLAGS"
}

package() {
  # Fix for the man directory
  mkdir -p ${pkgdir}/usr/share/man

  # Add license
  #   mkdir -p ${pkgdir}/usr/share/licenses/blt
  #   cp ${srcdir}/COPYING ${pkgdir}/usr/share/licenses/blt

  cd ${srcdir}/${pkgname}

  #some Makefile's are broken, fixing

  sed -i 's/bltConfig.sh \$(libdir)/bltConfig.sh \$(DESTDIR)\$(libdir)/' Makefile

  for file in library/dd_protocols/Makefile library/palettes/Makefile; do
    sed -i 's/\$\$i \$(destdir)/\$\$i \$(DESTDIR)\$(destdir)/' "${file}"
  done

  #installing
  make DESTDIR=${pkgdir} install

  # Delete man file, it is still owned by extra/tk
  rm ${pkgdir}/usr/share/man/mann/bitmap.n
  rm ${pkgdir}/usr/share/man/mann/busy.n
}