summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9339a060938eb1886a1437708356c57b1dd0d15c (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
# Maintainer: √Čric Gillet <e+aur@linuxw.info>

_py_pkgname=pymp4
_github_url=https://github.com/beardypig/$_py_pkgname
pkgbase=python-${_py_pkgname}
pkgname=(python-${_py_pkgname} python2-${_py_pkgname})
pkgver=1.2.0
pkgrel=1
pkgdesc="A Python MP4 Parser and toolkit"
arch=(any)
url="https://github.com/beardypig/pymp4"
license=('Apache') #2.0
makedepends=(python-setuptools python2-setuptools)
#python2-coverage has file conflitcs with python-coverage, so we can't do coverage analysis
#checkdepends=(python-pytest python2-pytest python-codecov python2-codecov python-pytest-cov python2-pytest-cov)
checkdepends=(python-pytest python2-pytest python-wheel python2-wheel)
source=(${_py_pkgname}::git+${_github_url}.git#tag=$pkgver)
md5sums=('SKIP')

prepare() {
    cp -af "${srcdir}/${_py_pkgname}" "${srcdir}/python2-${_py_pkgname}"
}

build() {
    cd "${srcdir}/${_py_pkgname}"
    python setup.py build

    cd "${srcdir}/python2-${_py_pkgname}"
    python2 setup.py build
}

check() {
    cd "${srcdir}/${_py_pkgname}"
    python setup.py test

    #python2-coverage has file conflitcs with python-coverage, so we can't do coverage analysis
    #coverage3 run setup.py test

    cd "${srcdir}/python2-${_py_pkgname}"
    python2 setup.py test

    #python2-coverage has file conflitcs with python-coverage, so we can't do coverage analysis
    #coverage2 run setup.py test
}

package_python-pymp4() {
    depends=(python "python-construct<2.9")

    cd "${srcdir}/${_py_pkgname}"
    python setup.py install --skip-build --root="${pkgdir}" --optimize=1
}

package_python2-pymp4() {
    depends=(python2 "python2-construct<2.9")

    cd "${srcdir}/python2-${_py_pkgname}"
    python2 setup.py install --skip-build --root="${pkgdir}" --optimize=1
    mv "${pkgdir}/usr/bin/mp4dump" "${pkgdir}/usr/bin/mp4dump-2"
    find "${pkgdir}" -name \*.py -exec sed -i 's/^\(#!.*\)python$/\1python2/' {} \;
}