summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 10d9df0fc91e82df62330fbc30c4aaa4ad38d1d9 (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
pkgname=mingw-w64-lcms2
pkgver=2.8
pkgrel=3
pkgdesc="Small-footprint color management engine, version 2 (mingw-w64)"
arch=(any)
url="http://www.littlecms.com"
license=("MIT")
makedepends=(mingw-w64-configure)
depends=(mingw-w64-crt mingw-w64-libtiff)
options=(staticlibs !strip !buildflags)
source=("http://downloads.sourceforge.net/sourceforge/lcms/lcms2-${pkgver}.tar.gz"
"0002-need-jconfig-before-jmoreconfig.mingw.patch"
"commit-5ca71a7.patch")
md5sums=('87a5913f1a52464190bb655ad230539c'
         '4017f8307298d6f65e1cb5bce9684fa5'
         'ebbfae97a511fea5387a705cea472e0e')

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

prepare() {
	cd lcms2-$pkgver
	patch -p1 -i ${srcdir}/0002-need-jconfig-before-jmoreconfig.mingw.patch
	patch -p1 -i ${srcdir}/commit-5ca71a7.patch
	autoreconf -fi
}

build() {
  cd "${srcdir}"/${pkgname#mingw-w64-}-${pkgver}
  for _arch in ${_architectures}; do
    mkdir -p build-${_arch} && pushd build-${_arch}
    ${_arch}-configure ..
    make
    popd
  done
}

package() {
  for _arch in ${_architectures}; do
    cd "${srcdir}/${pkgname#mingw-w64-}-${pkgver}/build-${_arch}"
    make DESTDIR="$pkgdir" install
    find "$pkgdir/usr/${_arch}" -name '*.exe' -exec ${_arch}-strip {} \;
    find "$pkgdir/usr/${_arch}" -name '*.dll' -exec ${_arch}-strip --strip-unneeded {} \;
    find "$pkgdir/usr/${_arch}" -name '*.a' -o -name '*.dll' | xargs ${_arch}-strip -g
  done
}