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

pkgname=xapps-git
pkgver=1.2.2.r0.gd957699
pkgrel=2
pkgdesc="Common library for X-Apps project"
arch=('i686' 'x86_64')
url="https://github.com/linuxmint/${pkgname%-git}"
license=('GPL')
depends=('libgnomekbd')
makedepends=('git' 'meson' 'gobject-introspection' 'python-gobject' 'python2-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 --buildtype=plain ..
    ninja
}

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

    DESTDIR="${pkgdir}" ninja 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.
    for _python in python3 python2; do
        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/${_python}* -name '*.py' -print0)
    done
}