summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 62a1cadc23e96e54523dbc799d922cec43e0b03c (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
# Maintainer: MGislv <nocentinigabriele91@gmail.com>

pkgname=lib32-mozjpeg-git
pkgver=4.1.1.r67.gaf265e75
pkgrel=1
pkgdesc='Improved JPEG encoder (32-bit)'
url='https://github.com/mozilla/mozjpeg'
arch=('x86_64')
license=('BSD')
depends=('lib32-glibc')
makedepends=('git' 'cmake' 'nasm' 'lib32-gcc-libs' 'lib32-libpng')
provides=('lib32-libjpeg' 'libjpeg.so' 'libturbojpeg.so' 'lib32-libjpeg-turbo' 'lib32-mozjpeg')
conflicts=('lib32-libjpeg' 'lib32-mozjpeg' 'lib32-libjpeg-turbo')
source=("git+${url}")
sha512sums=('SKIP')

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

build() {
	cd mozjpeg

	export CFLAGS+=" -m32"
	export CXXFLAGS+=" -m32"
	export LDFLAGS+=" -m32"
	export PKG_CONFIG_PATH='/usr/lib32/pkgconfig'

	cmake -DCMAKE_INSTALL_PREFIX=/usr \
	      -DCMAKE_INSTALL_LIBDIR=/usr/lib32 \
	      -DCMAKE_BUILD_TYPE=None \
	      -DWITH_JPEG8=ON \
	      -DENABLE_SHARED=1 \
	      -DENABLE_STATIC=0 \
	      -W no-dev \
	      -B build \
	      -S .
	make -C build
}

package() {
	cd mozjpeg
	make DESTDIR="${pkgdir}" \
	     docdir='/usr/share/doc/mozjpeg' \
	     exampledir='/usr/share/doc/mozjpeg' \
	     install -C build
	
	# remove everything that is provided by libjpeg-turbo
	rm -rf "${pkgdir}"/usr/{include,share,bin}
	# license
	install -vDm 644 LICENSE.md -t "${pkgdir}/usr/share/licenses/${pkgname}"
}