PKGBUILD-pfstmo

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
#Maintainer: Jochen Keil <jochen dot keil at gmail dot com>
#Contributor: Brandon Andrews <bsa at bsa dot isa-geek dot com>
pkgname=pfstmo
pkgver=1.4
pkgrel=2
pkgdesc='The implementation of state-of-the-art tone mapping operators'
arch=('i686' 'x86_64')
url='http://pfstools.sourceforge.net/pfstmo.html'
license=('GPL2')
depends=('pfstools' 'fftw' 'gsl')
source=("http://downloads.sourceforge.net/pfstools/$pkgname-$pkgver.tar.gz"
        "display_adaptive_tmo.h.patch")
md5sums=('90409a9adda70f59001c04cafcdab8d6'
         '2399b09ac8df7587b3a79882e9427dfa')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  patch -i "${srcdir}/display_adaptive_tmo.h.patch" -p0
  # by default gcc will generate only code that can run on i386, therefore
  # unless -march (not -mtune, but -march implies -mtune anyway), -msse or
  # -msse2 is specified, pfstmo will build without sse support. If -march is
  # specified, the architecture must be capable of sse. Note that not all i686
  # architectures support sse, therefore -march=i686 does not enable sse, and
  # to meet Arch standards, neither can this PKGBUILD.
  # pfstmo wants to use the experimental -mfpmath="sse+387" option, effectively
  # doubling the amount of available registers. However, this option is known
  # to be unstable, so to disable it (only if sse is enabled), run
  #   sed -i 's/-mfpmath=sse,387/-mfpmath=sse/g' "${srcdir}/${pkgname}-${pkgver}/configure"
  # to enable sse, use either
  #   edit /etc/makepkg.conf
  #   CXXFLAGS="-msse ${CXXFLAGS}" ./configure --prefix=/usr
  #   sed -i 's/-mfpmath=sse,387/-msse -mfpmath=sse,387/g' "${srcdir}/${pkgname}-${pkgver}/configure"
  ./configure --prefix=/usr
  make
}

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

# vim:set ts=2 sw=2 et: