summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f630680ed4a70c25f4a3279d0dee8b801a056281 (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
# Maintainer: Calimero <calimeroteknik@free.fr>

pkgname=fbpanel-svn
pkgver=515
pkgrel=5
pkgdesc='NetWM compliant desktop panel'
arch=('i686' 'x86_64')
url='http://fbpanel.sourceforge.net/'
depends=('gtk2')
makedepends=('subversion')
conflicts=('fbpanel')
provides=('fbpanel')
license=('GPL')
source=("$pkgname"::"svn+https://fbpanel.svn.sourceforge.net/svnroot/fbpanel/trunk#revision=$pkgver"
        'https://sourceforge.net/p/fbpanel/patches/_discuss/thread/b77d09e7/4927/attachment/fbpanel_sys_battery.patch')
md5sums=('SKIP'
         'd0e40eeb3b32e941e2e656bda1da2428')

pkgver() {
  cd "${srcdir}/${pkgname}"
  local ver="$(svnversion)"
  printf "%s" "${ver//[[:alpha:]]}"
}

prepare() {
  cd "${srcdir}/${pkgname}"

  # Why is the menu icon highlighted in red?
  # Fix this to a white highlight.
  sed -i 's/0x702020/0x282828/' plugins/menu/menu.c

  # Fix battery plugin
  patch -d plugins/battery -Np0 -i "${srcdir}/fbpanel_sys_battery.patch"
}

build() {
  cd "${srcdir}/${pkgname}"

  # Fix missing linker flags
  export LDFLAGS="${LDFLAGS} -lX11 -lm"

  # Python2 fix
  sed -i 's|/usr/bin/python$|/usr/bin/python2|' configure

  ./configure --prefix=/usr \
              --mandir=/usr/share/man/man1 \
              --libexecdir="/usr/lib$([[ "$pkgver" > 515 ]] && echo '/fbpanel')"

  # Additional python2 fix for the new build system introduced in r516
  [[ "$pkgver" > 515 ]] && sed -i 's|/usr/bin/python$|/usr/bin/python2|' repl.py

  make
}

package() {
  cd "${srcdir}/${pkgname}"
  make DESTDIR="${pkgdir}" install

  # Man page was forgotten before r516
  [[ "$pkgver" > 515 ]] || install -Dm 644 data/man/fbpanel.1 "${pkgdir}/usr/share/man/man1/fbpanel.1"
}