summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorbartus2021-06-19 08:25:23 +0200
committerbartus2021-06-19 08:25:23 +0200
commit2f9dfa4a334283ab2c6d5edd7658776af17d6fe2 (patch)
tree69bd7c10cb960189266309625a505b88c25a9e70
parent9680b9359eae0ea65c8b7711ad5469f029874b12 (diff)
downloadaur-2f9dfa4a334283ab2c6d5edd7658776af17d6fe2.tar.gz
Add optional python2 module.
-rw-r--r--.SRCINFO1
-rw-r--r--PKGBUILD9
2 files changed, 9 insertions, 1 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 194b0c3e6276..88b76b3668a6 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -15,6 +15,7 @@ pkgbase = openexr2
depends = zlib
optdepends = boost-libs: python support
optdepends = python: python support
+ optdepends = python2: python2 support
provides = openexr=2.5.5
conflicts = openexr
source = openexr2-2.5.5.tar.gz::https://github.com/openexr/openexr/archive/v2.5.5.tar.gz
diff --git a/PKGBUILD b/PKGBUILD
index 9f92922f7f5b..44150a64c2b5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -9,7 +9,7 @@ arch=('x86_64')
license=('BSD')
depends=('zlib')
makedepends=('cmake' 'patchelf' 'python' 'boost' 'freeglut' 'python-numpy' 'chrpath')
-optdepends=('boost-libs: python support' 'python: python support')
+optdepends=('boost-libs: python support' 'python: python support' 'python2: python2 support')
conflicts=('openexr')
provides=("openexr=${pkgver}")
source=("$pkgname-$pkgver.tar.gz::https://github.com/openexr/openexr/archive/v$pkgver.tar.gz")
@@ -29,4 +29,11 @@ package() {
_pythonpath=$(python -c "from sysconfig import get_path; print(get_path('platlib'))")
install -Dm755 build/python3*/imathnumpy.so -t "$pkgdir/$_pythonpath"
patchelf --set-rpath "" "${pkgdir}/$_pythonpath"/imathnumpy.so
+
+# Install optional python2 module
+ compgen -G "build/python2*/imathnumpy.so" && {
+ _python2path=$(python2 -c "from sysconfig import get_path; print(get_path('platlib'))")
+ install -Dm755 build/python2*/imathnumpy.so -t "$pkgdir/$_python2path"
+ patchelf --set-rpath "" "${pkgdir}/$_python2path"/imathnumpy.so
+ }
}