summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 26eb859b26985aa3c1568e9fb7616ec2e6c269de (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
# Maintainer: CloverGit <clovergit@hotmail.com>
# Contributor: drakkan <nicola.murino at gmail dot com>
pkgname=mingw-w64-openh264
pkgver=2.5.0
pkgrel=1
pkgdesc="OpenH264 is a codec library which supports H.264 encoding and decoding (mingw-w64)"
arch=(any)
url="http://www.openh264.org/"
license=("BSD")
depends=('mingw-w64-gcc')
makedepends=('nasm' 'mingw-w64-make')
options=(!strip !buildflags staticlibs)
source=("https://github.com/cisco/openh264/archive/v${pkgver}.tar.gz")
sha256sums=('94c8ca364db990047ec4ec3481b04ce0d791e62561ef5601443011bdc00825e3')

_architectures="i686-w64-mingw32 x86_64-w64-mingw32"

build() {
	for _arch in ${_architectures}; do
		[[ -d "build-${_arch}" ]] && rm -rf "build-${_arch}"
		cp -rf "$srcdir/openh264-${pkgver}" "${srcdir}/build-${_arch}"

		pushd build-${_arch}
		if [ ${_arch} = "i686-w64-mingw32" ]; then
			_targetarch="i686"
		else
			_targetarch="x86_64"
		fi
		${_arch}-make OS=mingw_nt ARCH=${_targetarch}
		popd
	done
}

package() {
	for _arch in ${_architectures}; do
		cd "${srcdir}/build-${_arch}"

		if [ ${_arch} = "i686-w64-mingw32" ]; then
			_targetarch="i686"
		else
			_targetarch="x86_64"
		fi

		${_arch}-make OS=mingw_nt ARCH=${_targetarch} DESTDIR="${pkgdir}" PREFIX="/usr/${_arch}" install

		install -Dm755 h264dec.exe "$pkgdir"/usr/${_arch}/bin/h264dec.exe
		install -Dm755 h264enc.exe "$pkgdir"/usr/${_arch}/bin/h264enc.exe

		${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
		${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a
		${_arch}-strip --strip-all "$pkgdir"/usr/${_arch}/bin/*.exe
		if [[ $NO_EXECUTABLES ]]; then
			find "${pkgdir}/usr/${_arch}" -name '*.exe' -delete
		fi
	done
}
# vim: set sw=2 ts=2 et: