summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a41ff34c0bd433cff4f995e0ac63d8603bc37603 (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
# Maintainer: Karl-Felix Glatzer <karl.glatzer@gmx.de>
pkgname=mingw-w64-rtmpdump
pkgver=2.4.r105.6f6bb13
pkgrel=1
pkgdesc='A toolkit for RTMP streams (mingw-w64)'
arch=(any)
url=https://rtmpdump.mplayerhq.hu/
license=(
  GPL2
  LGPL2.1
)
depends=(
  mingw-w64-crt
  mingw-w64-gnutls
  mingw-w64-zlib
)
options=(!strip !buildflags !makeflags staticlibs)
makedepends=(
  mingw-w64-gcc git
)
_commit=6f6bb1353fc84f4cc37138baa99f586750028a01
source=(git+https://git.ffmpeg.org/rtmpdump#commit=${_commit})
sha256sums=(SKIP)
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"

pkgver() {
  cd rtmpdump

  echo "2.4.r$(git rev-list --count c28f1bab7822de97353849e7787b59e50bbb1428..HEAD).$(git rev-parse --short HEAD)"
}

build() {
  for _arch in ${_architectures}; do
    cp -r ${srcdir}/rtmpdump ${srcdir}/build-${_arch} && cd ${srcdir}/build-${_arch}

    sed -e 's/^CRYPTO=OPENSSL/#CRYPTO=OPENSSL/' -e 's/#CRYPTO=GNUTLS/CRYPTO=GNUTLS/' -i Makefile -i librtmp/Makefile

    unset LDFLAGS CPPFLAGS
    make \
      CC=${_arch}-gcc \
      LD=${_arch}-ld \
      AR=${_arch}-ar \
      SYS=mingw
  done
}

package() {
  for _arch in ${_architectures}; do
    cd ${srcdir}/build-${_arch}
    unset LDFLAGS CPPFLAGS
    make \
      CC=${_arch}-gcc \
      LD=${_arch}-ld \
      AR=${_arch}-ar \
      SYS=mingw \
      prefix=/usr/${_arch} \
      sbindir=/usr/${_arch}/bin \
      mandir=/usr/${_arch}/share/man \
      DESTDIR="$pkgdir" \
      install

    ${_arch}-strip -s ${pkgdir}/usr/${_arch}/bin/*.exe
    ${_arch}-strip --strip-unneeded ${pkgdir}/usr/${_arch}/bin/*.dll
    ${_arch}-strip -g ${pkgdir}/usr/${_arch}/lib/*.a

    rm -r ${pkgdir}/usr/${_arch}/share
  done
}
# vim: ts=2 sw=2 et: