summaryrefslogtreecommitdiff
path: root/community/lib32-turbojpeg/PKGBUILD
blob: 7da03783c7978b0d1454f5cffe587aed1e1e6de6 (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
# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
pkgname=lib32-turbojpeg
pkgver=1.2.1
pkgrel=1
pkgdesc="turbojpeg library from libjpeg-turbo (32-bit)"
arch=('x86_64')
url="http://www.libjpeg-turbo.org/About/TurboJPEG"
license=('GPL' 'custom')
depends=('lib32-glibc')
makedepends=('nasm' 'gcc-multilib')
options=('!libtool')
source=(http://sourceforge.net/projects/libjpeg-turbo/files/$pkgver/libjpeg-turbo-$pkgver.tar.gz)
sha1sums=('a4992e102c6d88146709e8e6ce5896d5d0b5a361')

build() {
  cd "$srcdir/libjpeg-turbo-$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/libjpeg-turbo-$pkgver"

  make DESTDIR="$pkgdir/" install

  # only distribute libturbojpeg
  rm "$pkgdir"/usr/lib32/libj*

  rm -rf "${pkgdir}"/usr/{include,share,bin,sbin}

  install -Dm644 README "$pkgdir/usr/share/licenses/$pkgname/README"
  install -Dm644 README-turbo.txt "$pkgdir/usr/share/licenses/$pkgname/README-turbo.txt"
}