summaryrefslogtreecommitdiff
path: root/libre/openexr/PKGBUILD
blob: 3831c2d48bab5891e0dd71b072a6fc91b2bf2581 (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
83
84
85
86
87
# Maintainer (Arch): Tobias Powalowski <tpowa@archlinux.org>
# Maintainer (Hyperbola): André Silva <emulatorman@hyperbola.info>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

pkgname=openexr
pkgver=2.4.1
pkgrel=2
pkgrel+=.parabola1
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')
optdepends=('fltk: for exrdisplay' 'boost-libs: python support' 'python: python support') 
conflicts=('ilmbase')
replaces=('ilmbase')
source=($pkgname-$pkgver.tar.gz::"https://github.com/openexr/openexr/archive/v$pkgver.tar.gz"
        openexr-pc-prefix.patch::"https://github.com/AcademySoftwareFoundation/openexr/commit/0b26a9de.patch"
        "https://github.com/${pkgname}/${pkgname}/raw/master/OpenEXR/doc/InterpretingDeepPixels.docx"
        "https://github.com/${pkgname}/${pkgname}/raw/master/OpenEXR/doc/MultiViewOpenEXR.odt"
        "https://github.com/${pkgname}/${pkgname}/raw/master/OpenEXR/doc/OpenEXRFileLayout.odt"
        "https://github.com/${pkgname}/${pkgname}/raw/master/OpenEXR/doc/ReadingAndWritingImageFiles.odt"
        "https://github.com/${pkgname}/${pkgname}/raw/master/OpenEXR/doc/TechnicalIntroduction.odt"
        "https://github.com/${pkgname}/${pkgname}/raw/master/OpenEXR_Viewers/doc/OpenEXRViewers.odt")
sha256sums=('3ebbe9a8e67edb4a25890b98c598e9fe23b10f96d1416d6a3ff0732e99d001c1'
            'f20d7588badb679828816e0ada201705b7d1cc5a4d82df3d586707a792b10950'
            '6fc748b44fc4c52680db233143b53a199988f51682b206c623b05238a6fdbcbe'
            '38c46075f7efe02e231d32753966ffa463f2a3c4673dd8ea71dd47560c403db0'
            '854942160870b4c442dc249e10d8f540aa554bd793ce40576bda430f90b7f995'
            'a4fdf678244f6c37e5ae126a9385a2e154b824b67e1746ed10bc17907c6b45ba'
            'fab77bb2afb3d580387249807300fa26c70eaf46ca23a0036165bafee607dc4e'
            '27467ce4cad8a84cb63b2da2d58454834eac8830c2516cbe8846f32324517a92')
noextract=(InterpretingDeepPixels.docx
           MultiViewOpenEXR.odt
           OpenEXRFileLayout.odt
           ReadingAndWritingImageFiles.odt
           TechnicalIntroduction.odt
           OpenEXRViewers.odt)

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

  # add source documentation
  install -m644 -v "$srcdir/"{InterpretingDeepPixels.docx,{MultiViewOpenEXR,OpenEXRFileLayout,ReadingAndWritingImageFiles,TechnicalIntroduction}.odt} OpenEXR/doc
  install -m644 -v "$srcdir/"OpenEXRViewers.odt OpenEXR_Viewers/doc

  # 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 
}