summaryrefslogtreecommitdiff
path: root/multilib/lib32-libjpeg-turbo/PKGBUILD
blob: cd8b3bd19586cc664f188138a38a8bd4ce9909b8 (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
# $Id: PKGBUILD 73348 2012-07-06 15:36:04Z bluewind $
# Maintainer: Allan McRae <allan@archlinux.org>
# Contributor: Simone Sclavi 'Ito' <darkhado@gmail.com>

_pkgbasename=libjpeg-turbo
pkgname=lib32-$_pkgbasename
pkgver=1.2.1
pkgrel=1
pkgdesc="libjpeg derivative with accelerated baseline JPEG compression and decompression (32-bit)"
arch=('x86_64')
url="http://libjpeg-turbo.virtualgl.org/"
license=('GPL' 'custom')
depends=('lib32-glibc' $_pkgbasename)
makedepends=('nasm' gcc-multilib)
provides=('lib32-libjpeg=8.0.2')
conflicts=('lib32-libjpeg')
replaces=('lib32-libjpeg')
options=('!libtool')
source=(http://sourceforge.net/projects/$_pkgbasename/files/$pkgver/$_pkgbasename-$pkgver.tar.gz)
sha1sums=('a4992e102c6d88146709e8e6ce5896d5d0b5a361')

build() {
  cd "$srcdir/$_pkgbasename-$pkgver"

  export CC="gcc -m32"
  export CXX="g++ -m32"
  export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"

  sed -i "s|NAFLAGS='-felf64 -DELF -D__x86_64__'|NAFLAGS='-felf32 -DELF -D__x86_64__'|" configure
  ./configure --prefix=/usr --with-jpeg8 --mandir=/usr/share/man --libdir=/usr/lib32 --without-simd
  make
}

package() {
  cd "$srcdir/$_pkgbasename-$pkgver"

  make DESTDIR="$pkgdir/" install

  # do not distributre libturbojpeg as it is unversioned
  rm "$pkgdir"/usr/lib32/libturbojpeg.{so,a}

  rm -rf "${pkgdir}"/usr/{include,share,bin,sbin}
  mkdir -p "$pkgdir/usr/share/licenses"
  ln -s $_pkgbasename "$pkgdir/usr/share/licenses/$pkgname"
}