summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6dff1c9936bc50da57a6a09ece3654075c14912d (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
# Maintainer: Eli Schwartz <eschwartz@archlinux.org>

pkgname=xapps-git
pkgver=1.8.0.r3.g5b59768
pkgrel=1
pkgdesc="Common library for X-Apps project"
arch=('i686' 'x86_64')
url="https://github.com/linuxmint/${pkgname%-git}"
license=('GPL')
depends=('libdbusmenu-gtk3' 'libgnomekbd')
makedepends=('git' 'meson' 'samurai' 'gobject-introspection' 'python-gobject' 'vala')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("git+${url}.git")
sha256sums=('SKIP')

pkgver() {
    cd "${srcdir}"/${pkgname%-git}

    git describe --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
    mkdir -p "${srcdir}"/${pkgname%-git}/build
    cd "${srcdir}"/${pkgname%-git}/build

    meson --prefix=/usr \
          --libexecdir=lib \
          --buildtype=plain \
          ..
    samu
}

package(){
    cd "${srcdir}"/${pkgname%-git}/build

    DESTDIR="${pkgdir}" samu install
    # rm useless scripts
    rm -r "${pkgdir}"/usr/bin

    # byte-compile python modules since meson does not implement autotools'
    # py-compile.
    # This is kind of ugly but removes traces of the build root.
    while read -rd '' _file; do
        _destdir="$(dirname "${_file#${pkgdir}}")"
        python -m compileall -d "${_destdir}" "${_file}"
        python -O -m compileall -d "${_destdir}" "${_file}"
    done < <(find "${pkgdir}"/usr/lib/python3* -name '*.py' -print0)
}