summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a6f3df0e9f3fa4743aa4bec16a0a371de2fc1974 (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Maintainer:
# Contributor: xiretza
# Contributor: getzze
# Contributor: Ke Liu

_module='ffmpeg-python'
_pkgname="python-$_module"
pkgname="$_pkgname"
pkgver=0.2.0
pkgrel=5
pkgdesc="(old) Python bindings for FFmpeg with complex filtering support"
arch=(any)
url="https://github.com/kkroening/ffmpeg-python"
license=('Apache')
options=(!emptydirs)
depends=(
  'ffmpeg'
  'python-future'
  'python-graphviz'
)
makedepends=(
  'python-build'
  'python-installer'
  'python-pytest-runner'
  'python-setuptools'
  'python-wheel'
)
checkdepends=(
  'python-pytest'
  'python-pytest-mock'
)

provides=(
  'python-ffmpeg'
)
conflicts=(
  'python-ffmpeg'
  'python-python-ffmpeg'
)

if [ x"$_pkgname" == x"$pkgname" ] ; then
  # normal package
  _pkgsrc="$_module-$pkgver"

  source+=(
    "$_module-$pkgver.tar.gz"::"https://github.com/kkroening/ffmpeg-python/archive/$pkgver.tar.gz"
  )
  sha256sums+=(
    '01b6b7640f00585a404194a358358bdf7f4050cedcd99f41416ac8b27222c9f1'
  )
else
  # x-git package
  _pkgsrc="$_module"

  makedepends+=('git')

  provides+=("$_pkgname")
  conflicts+=("$_pkgname")

  source+=(
    "$_module"::"git+https://github.com/kkroening/ffmpeg-python"
  )
  sha256sums+=(
    'SKIP'
  )

  pkgver() {
    cd "$srcdir/$_pkgsrc"
    git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
  }
fi

prepare() {
  cd "$srcdir/$_pkgsrc"
  sed -i -e 's/collections.Iterable/collections.abc.Iterable/g' ffmpeg/_run.py
}

build() {
  cd "$srcdir/$_pkgsrc"
  python -m build --no-isolation --wheel
}

check(){
  cd "$srcdir/$_pkgsrc"
  pytest || true
}

package() {
  cd "$srcdir/$_pkgsrc"
  python -m installer --destdir="$pkgdir" dist/*.whl

  install -vDm0644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
}