summaryrefslogtreecommitdiff
path: root/community/freeimage/PKGBUILD
blob: 1a3a5837ef54a0e582c8337cb98036ce06e1343c (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
# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: Thomas Dziedzic < gostrc at gmail >
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>
# Contributor: Mihai Militaru <mihai.militaru@gmx.com>
# Contributor: scippio <scippio@berounet.cz>

pkgname=freeimage
pkgver=3.15.4
pkgrel=1
pkgdesc="Library project for developers who would like to support popular graphics image formats"
arch=('i686' 'x86_64' 'mips64el')
license=('GPL' 'custom:FIPL')
url="http://freeimage.sourceforge.net/"
depends=('gcc-libs')
makedepends=('dos2unix')
source=("http://downloads.sourceforge.net/project/freeimage/Source%20Distribution/${pkgver}/FreeImage${pkgver//./}.zip")
md5sums=('9f9a3b2c3c1b4fd24fe479e8aaee86b1')

build() {
  if [ "$CARCH" != "i686" ] ; then
    # The Makefile incorrectly assumes that only x86_64 shared
    # libraries need PIC.
    export CFLAGS="$CFLAGS -fPIC"
    export CXXFLAGS="$CXXFLAGS -fPIC"
  fi

  cp -r FreeImage FreeImagefip

  export CFLAGS="$CFLAGS -fPIC -fexceptions -fvisibility=hidden -DNO_LCMS"
  export CXXFLAGS="$CXXFLAGS -fPIC -fexceptions -fvisibility=hidden -DNO_LCMS"

  cd FreeImage
  sed -i "1 i #include <cstring>" Source/OpenEXR/IlmImf/ImfAutoArray.h
  make

  cd ${srcdir}/FreeImagefip
  sed -i "1 i #include <cstring>" Source/OpenEXR/IlmImf/ImfAutoArray.h
  make -f Makefile.fip 
}

package() {
  cd FreeImage
  make DESTDIR=${pkgdir} install

  cd ${srcdir}/FreeImagefip
  make -f Makefile.fip DESTDIR=${pkgdir} install

  install -D -m644 ${srcdir}/FreeImage/license-fi.txt ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
}