summaryrefslogtreecommitdiff
path: root/extra/libpng/PKGBUILD
blob: ab48303fc3212e4e76d28c5b3cbd629cd190c7cf (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
# $Id: PKGBUILD 184406 2013-05-06 19:38:28Z foutrelis $
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Contributor: dorphell <dorphell@archlinux.org>
# Contributor: Travis Willard <travis@archlinux.org>
# Contributor: Douglas Soares de Andrade <douglas@archlinux.org>

pkgname=libpng
pkgver=1.6.2
_apngver=1.6.2
pkgrel=3
pkgdesc="A collection of routines used to create PNG format graphics files"
arch=('i686' 'x86_64')
url="http://www.libpng.org/pub/png/libpng.html"
license=('custom')
depends=('zlib' 'sh')
options=('!libtool')
source=("http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.xz"
        "http://downloads.sourceforge.net/sourceforge/libpng-apng/libpng-$_apngver-apng.patch.gz"
        0001-libpng16-Avoid-dereferencing-NULL-pointer-possibly-r.patch
        0002-libpng16-Calculate-our-own-zlib-windowBits-when-deco.patch
        adjust-apng-patch-for-libpng16-git-changes.patch)
md5sums=('9d838f6fca9948a9f360a0cc1b516d5f'
         '7d0c9f4b9a7f45dd5d1088e54b623c98'
         '59b83234f60a7d1d179d9b0b6a0ebc01'
         'b1f7922b6678305bdb7c23d5bd1763f3'
         'f87704c3fb6d29f09b52178e89a42e2e')

prepare() {
  cd $pkgname-$pkgver

  # Add fixes from libpng16 branch
  patch -Np1 -i ../0001-libpng16-Avoid-dereferencing-NULL-pointer-possibly-r.patch
  patch -Np1 -i ../0002-libpng16-Calculate-our-own-zlib-windowBits-when-deco.patch

  # Add animated PNG (apng) support
  # see http://sourceforge.net/projects/libpng-apng/
  patch -d .. -Np0 -i adjust-apng-patch-for-libpng16-git-changes.patch
  patch -Np1 -i ../libpng-$_apngver-apng.patch
}

build() {
  cd $pkgname-$pkgver

  ./configure --prefix=/usr
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install

  cd contrib/pngminus
  make PNGLIB="-L$pkgdir/usr/lib -lpng" -f makefile.std png2pnm pnm2png
  install -m755 png2pnm pnm2png "$pkgdir/usr/bin/"
  install -D -m644 ../../LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}