summaryrefslogtreecommitdiff
path: root/libre/openimageio/PKGBUILD
blob: 9e721725029ccb6bd05e66e1daf99993d1c501ff (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Maintainer: Márcio Silva <coadde@parabola.nu>
# based of Arch pkg

pkgname=openimageio
pkgver=1.3.12
pkgrel=2
pkgdesc='A library for reading and writing images, including classes, utilities, and applications (built for the blender-libre package)'
arch=(
  mips64el
  x86_64
  i686
)
url=http://www.openimageio.org/
license=custom
depends=(
  boost-libs
  freetype2
  giflib
  glew
  libjpeg-turbo
  libpng
  libtiff
  libwebp
  opencolorio
  openexr
  openjpeg
  openssl
  zlib
)
makedepends=(
  boost
  cmake
  python2
  qt4
)
optdepends=(
  'qt4: iv image viewer'
  'python2: bindings support'
)
source=https://github.com/OpenImageIO/oiio/archive/Release-$pkgver.tar.gz
sha512sums=SKIP

prepare() {
  cd oiio-Release-$pkgver

  msg 'renaming wrong OS name'
  _OS=$(uname -o)
  [[ $_OS == GNU ]] &&\
    sed -i 's|linux|GNU|i;
           ' src/{cmake/platform.cmake,make/detectplatform.mk}
  [[ $_OS == GNU/Linux ]] &&\
    sed -i 's|[{]uname[}][,]linux]|{uname -o},GNU/Linux|;\|platform| s|linux|GNU/Linux|i
           ' src/{cmake/platform.cmake,make/detectplatform.mk}
  [[ $_OS == GNU/kFreeBSD ]] &&\
    sed -i '\|STREQUAL| s|FreeBSD|kFreeBSD|;\|platform| s|freebsd|GNU/kFreeBSD|i
           ' src/cmake/platform.cmake
    sed -i 's|[{]uname[}][,]linux]|{uname -o},GNU/kFreeBSD|;\|platform| s|linux|GNU/kFreeBSD|i
           ' src/make/detectplatform.mk

  [[ -d build ]] && rm -r build
  mkdir build
}

build() {
  cd oiio-Release-$pkgver/build
  cmake .. \
      -DCMAKE_INSTALL_PREFIX=/usr\
      -DOIIO_BUILD_TESTS=OFF\
      -DPYLIB_INSTALL_DIR=lib/python2.7/site-packages\
      -DPYLIB_INCLUDE_SONAME=ON\
      -DPYLIB_LIB_PREFIX=OFF\
      -DUSE_EXTERNAL_TBB=OFF
  make
}

package() {
  cd oiio-Release-$pkgver/build
  make DESTDIR=$pkgdir install
  install -Dm644 ../LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

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