summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntony Lee2016-09-16 15:27:13 -0700
committerAntony Lee2016-09-16 15:28:45 -0700
commitfebd39ef7979bcf921cacae6b7d3b2d80879dd3b (patch)
treeeb419f2250cf88983532ba615f90273a11aff4e2
downloadaur-febd39ef7979bcf921cacae6b7d3b2d80879dd3b.tar.gz
Initial commit.
-rw-r--r--.SRCINFO11
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD42
3 files changed, 57 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..8a07c1ce6e5a
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,11 @@
+pkgbase = matlab-engine-for-python
+ pkgdesc = MATLAB Engine API for Python
+ pkgver = 9.1
+ pkgrel = 1
+ url = http://www.mathworks.com/help/matlab/matlab-engine-for-python.html
+ arch = any
+ license = custom
+ depends = python
+
+pkgname = matlab-engine-for-python
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..05c6d4d4c97b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+*
+!.gitignore
+!.SRCINFO
+!PKGBUILD
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..ee958c2541f3
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,42 @@
+# Maintainer: Antony Lee <anntzer dot lee at gmail dot com>
+
+pkgname=matlab-engine-for-python
+pkgver=9.1
+pkgrel=1
+pkgdesc='MATLAB Engine API for Python'
+arch=('any')
+url='http://www.mathworks.com/help/matlab/matlab-engine-for-python.html'
+license=('custom')
+depends=('python') # and MATLAB >= 2016b.
+makedepends=()
+checkdepends=()
+source=()
+sha256sums=()
+
+# Run MATLAB only once, as its startup is slow.
+_pkgver_and_root=$(\
+ matlab -nosplash -nodesktop \
+ -r "v = ver('MATLAB'); fprintf([v.Version, '\n', matlabroot, '\n']); quit" \
+ | tail -3 | head -2)
+
+pkgver() {
+ readarray -t pkgver_and_root <<<"$_pkgver_and_root"
+ echo "${pkgver_and_root[0]}"
+}
+
+# We need to run `setup.py` in `build()` as it can only be run from its original folder.
+
+build() {
+ readarray -t pkgver_and_root <<<"$_pkgver_and_root"
+ matlabroot="${pkgver_and_root[1]}"
+ cd "$matlabroot/extern/engines/python"
+ python setup.py build --build-base="$srcdir" install --root="$srcdir" --optimize=1
+}
+
+package() {
+ readarray -t pkgver_and_root <<<"$_pkgver_and_root"
+ matlabroot="${pkgver_and_root[1]}"
+ cp -r "$srcdir/usr" "$pkgdir"
+ mkdir -p "$pkgdir/usr/share/licenses/$pkgname"
+ ln -s "$matlabroot/license_agreement.txt" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}