summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6d48c3186c768a3c058681039b4a3cf0a66d3b66 (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
gitname=fbpanel
pkgname="$gitname-git"
pkgver=44.478754b
pkgrel=3
pkgdesc="NetWM compliant desktop panel (git)"
license=(GPL)
arch=(i686 x86_64)
provides=('fbpanel' 'fbpanel-svn')
conflicts=('fbpanel' 'fbpanel-svn')
depends=('gtk2' 'python2')
makedepends=('automake' 'autoconf')
url="https://github.com/aanatoly/$gitname"
source=("git+$url.git")
sha512sums=('SKIP')

pkgver() {
    cd "${srcdir}/${gitname}"

    local ver="$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
    printf "%s" "${ver//-/.}"
}

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

    # Arch Linux packages python as python3 but these scripts are written in python2
    sed -i 's|/usr/bin/python$|/usr/bin/python2|' configure .config/repl.py

    # Make compilation pass despite GTK deprecation warnings
    sed -i 's/\-Werror//' .config/rules.mk

    # Remove unused definition that confuses the linker
    sed -i 's/struct\ \_plugin_instance \*stam\;//' panel/plugin.h
}

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

    ./configure --prefix=/usr --libexecdir=/usr/lib --mandir=/usr/share/man/man1
    make
}

package(){
    cd "${srcdir}/${gitname}"

    make DESTDIR="$pkgdir/" install

    # Add forgotten localization files
    cd po
    for mofile in *.mo;do
        install -Dm755 "$mofile" "$pkgdir/usr/share/fbpanel/locale/${mofile%%_*}/LC_MESSAGES/fbpanel.mo"
    done
}