summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaximilian Stahlberg2022-01-06 16:32:22 +0100
committerMaximilian Stahlberg2022-01-06 16:32:22 +0100
commit1b2e8750603ad08f0e654c73a812b87bbd004fad (patch)
tree0ed0c26ee6719260a939656e881ffe89660ae503
parent53b0201f3d1991fa1b1d070465e0a4d6af17d3c5 (diff)
downloadaur-cplex.tar.gz
Install Python bindings if Python 3.7 or 3.8 are installed.
-rw-r--r--.SRCINFO5
-rw-r--r--PKGBUILD27
2 files changed, 21 insertions, 11 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b883fc4c5351..019a1e9bf2f8 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,11 +1,13 @@
pkgbase = cplex
pkgdesc = A commercial solver for mathematical optimization problems.
pkgver = 20.10
- pkgrel = 1
+ pkgrel = 2
url = https://www.ibm.com/software/products/de/ibmilogcpleoptistud
arch = x86_64
license = custom
depends = gcc-libs
+ optdepends = python37: for Python 3.7 bindings
+ optdepends = python38: for Python 3.8 bindings
options = !strip
source = local://ILOG_COS_20.10_LINUX_X86_64.bin
source = installer.properties.template
@@ -13,4 +15,3 @@ pkgbase = cplex
md5sums = f295f6c4ecd0f3a6d2fdca21788efd0f
pkgname = cplex
-
diff --git a/PKGBUILD b/PKGBUILD
index ea62c4bb409e..cef575912644 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,20 +4,22 @@
# You need to manually download the IBM ILOG CPLEX Optimization Studio installer
# and place it into the same directory as this PKGBUILD, before you proceed.
-# Yes, CPLEX consistently refuses to run with latest Python. Remove the comment
-# characters at 'makedepends' and around the 'python3' line in package() to
-# install Python bindings given that you still run Python 3.7 or Python 3.8.
+# Note that CPLEX consistently refuses to run with recent Python versions and
+# currently supports only versions 3.7 and 3.8. If you have one of those
+# installed from the AUR, then the appropriate bindings will be installed.
pkgname='cplex'
pkgdesc="A commercial solver for mathematical optimization problems."
pkgver=20.10
-pkgrel=1
+pkgrel=2
arch=('x86_64')
url='https://www.ibm.com/software/products/de/ibmilogcpleoptistud'
license=('custom')
-#makedepends=('python>=3.7' 'python<3.9' 'python-setuptools')
depends=('gcc-libs')
-#optdepends=('python: for Python bindings')
+optdepends=(
+ 'python37: for Python 3.7 bindings'
+ 'python38: for Python 3.8 bindings'
+)
options=('!strip')
_arch_upper=${arch^}
@@ -83,9 +85,16 @@ package() {
install -m644 "./cpoptimizer/include/ilcp/"*.h "${pkgdir}/usr/include/ilcp"
# Install Python bindings.
- #cd "./cplex/python/${_pythonver}/${_archdir}/"
- #python3 setup.py install --root="${pkgdir}/" --optimize=1
- #cd "../../../../"
+ if pacman -Qq python37 >/dev/null 2>&1; then
+ cd "./cplex/python/3.7/${_archdir}/"
+ python3.7 setup.py install --root="${pkgdir}/" --optimize=1
+ cd "../../../../"
+ fi
+ if pacman -Qq python38 >/dev/null 2>&1; then
+ cd "./cplex/python/3.8/${_archdir}/"
+ python3.8 setup.py install --root="${pkgdir}/" --optimize=1
+ cd "../../../../"
+ fi
# Install license.
install -dm755 "${pkgdir}/usr/share/licenses/cplex"