summaryrefslogtreecommitdiff
path: root/libre/openexr/PKGBUILD
blob: ac5bf73777fb9acadb5654ae99863b850bc88839 (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
# Maintainer (Arch): Tobias Powalowski <tpowa@archlinux.org>
# Maintainer (Hyperbola): André Silva <emulatorman@hyperbola.info>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
# Contributor: grizzlyuser <grizzlyuser@protonmail.com>

pkgname=openexr
pkgver=2.4.1
pkgrel=2
pkgrel+=.parabola2
pkgdesc="An high dynamic-range image file format library"
pkgdesc+=", without embedded nonfree fonts in the documentation"
url="https://www.openexr.com/"
arch=('x86_64')
arch+=('i686' 'armv7h')
license=('BSD3')
depends=('zlib')
makedepends=('cmake' 'fltk' 'python' 'boost' 'freeglut' 'python-numpy' 'chrpath')
makedepends+=('unoconv' 'libepoxy' 'ttf-croscore' 'ttf-caladea' 'ttf-carlito' 'gsfonts' 'ttf-bitstream-vera')
optdepends=('fltk: for exrdisplay' 'boost-libs: python support' 'python: python support')
conflicts=('ilmbase')
replaces=('ilmbase')
source=($pkgname-$pkgver.tar.gz::"https://github.com/AcademySoftwareFoundation/openexr/archive/v$pkgver.tar.gz"
        openexr-pc-prefix.patch::"https://github.com/AcademySoftwareFoundation/openexr/commit/0b26a9de.patch")
sha256sums=('3ebbe9a8e67edb4a25890b98c598e9fe23b10f96d1416d6a3ff0732e99d001c1'
            'f20d7588badb679828816e0ada201705b7d1cc5a4d82df3d586707a792b10950')

prepare() {
  cd $pkgname-$pkgver
  patch -p1 -i ../openexr-pc-prefix.patch # Fix prefix in pc file

  # remove documentation with embedded nonfree fonts
  rm -v OpenEXR/doc/{InterpretingDeepPixels,MultiViewOpenEXR,OpenEXRFileLayout,ReadingAndWritingImageFiles,TechnicalIntroduction,TheoryDeepPixels}.pdf
  rm -v OpenEXR_Viewers/doc/OpenEXRViewers.pdf

  # convert source documentation to pdf format and clean source code
  pushd OpenEXR/doc
  unoconv -v -f pdf {InterpretingDeepPixels.docx,{MultiViewOpenEXR,OpenEXRFileLayout,ReadingAndWritingImageFiles,TechnicalIntroduction}.odt}
  popd
  pushd OpenEXR_Viewers/doc
  unoconv -v -f pdf OpenEXRViewers.odt
  popd

  # remove TheoryDeepPixels.pdf reference
  sed -i '\|TheoryDeepPixels[.]pdf|d
         ' "OpenEXR/doc/CMakeLists.txt"
}

build() {
  mkdir -p build

  cd build
  cmake ../$pkgname-$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr
  make
}

package() {
  cd build
  make DESTDIR="${pkgdir}" install
  install -D -m644 "$srcdir"/$pkgname-$pkgver/LICENSE.md -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -m644 "$srcdir/$pkgname-$pkgver/OpenEXR/doc/"{InterpretingDeepPixels.docx,{MultiViewOpenEXR,OpenEXRFileLayout,ReadingAndWritingImageFiles,TechnicalIntroduction}.odt} "${pkgdir}/usr/share/doc/OpenEXR"

# Install missing python module
  _pythonpath=`python -c "from sysconfig import get_path; print(get_path('platlib'))"`
  install -Dm755 python3*/imathnumpy.so -t "$pkgdir"/$_pythonpath 
}