summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Iooss2017-02-18 11:29:32 +0100
committerNicolas Iooss2017-02-18 11:29:32 +0100
commit63f075022edb3cffe4af271f1842731ffec63f5f (patch)
tree9e76d1f19c9836f1ecba95c7bf77c61ed961326e
downloadaur-63f075022edb3cffe4af271f1842731ffec63f5f.tar.gz
gcc-python-plugin 0.15-1
-rw-r--r--.SRCINFO36
-rw-r--r--PKGBUILD82
2 files changed, 118 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..b1a9876ad04
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,36 @@
+pkgbase = gcc-python-plugin
+ pkgdesc = GCC plugin that embeds CPython inside the compiler
+ pkgver = 0.15
+ pkgrel = 1
+ url = https://gcc-python-plugin.readthedocs.io/en/latest/
+ arch = i686
+ arch = x86_64
+ license = GPL3
+ makedepends = python-lxml
+ makedepends = python-pygments
+ makedepends = python-six
+ makedepends = python-sphinx
+ makedepends = python2-lxml
+ makedepends = python2-pygments
+ makedepends = python2-six
+ source = gcc-python-plugin-0.15.tar.gz::https://github.com/davidmalcolm/gcc-python-plugin/archive/v0.15.tar.gz
+ sha256sums = fcb7596616fcb07f611b992f7603ca80f85181b23692693d1097977913419e74
+
+pkgname = gcc-python-plugin
+ depends = python-lxml
+ depends = python-pygments
+ depends = python-six
+ depends = gcc-python-plugin-c-api
+ optdepends = graphviz: for examples
+
+pkgname = gcc-python2-plugin
+ depends = python2-lxml
+ depends = python2-pygments
+ depends = python2-six
+ depends = gcc-python-plugin-c-api
+ optdepends = graphviz: for examples
+
+pkgname = gcc-python-plugin-c-api
+
+pkgname = gcc-python-plugin-doc
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..578ab26116d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,82 @@
+# Maintainer: Nicolas Iooss (nicolas <dot> iooss <at> m4x <dot> org)
+
+pkgbase=gcc-python-plugin
+pkgname=('gcc-python-plugin' 'gcc-python2-plugin' 'gcc-python-plugin-c-api' 'gcc-python-plugin-doc')
+pkgver=0.15
+pkgrel=1
+pkgdesc="GCC plugin that embeds CPython inside the compiler"
+arch=('i686' 'x86_64')
+url='https://gcc-python-plugin.readthedocs.io/en/latest/'
+license=('GPL3')
+makedepends=('python-lxml' 'python-pygments' 'python-six' 'python-sphinx'
+ 'python2-lxml' 'python2-pygments' 'python2-six')
+source=("${pkgname}-${pkgver}.tar.gz::https://github.com/davidmalcolm/gcc-python-plugin/archive/v${pkgver}.tar.gz")
+sha256sums=('fcb7596616fcb07f611b992f7603ca80f85181b23692693d1097977913419e74')
+
+prepare() {
+ cp -a "gcc-python-plugin-$pkgver" "gcc-python2-plugin-$pkgver"
+}
+
+build() {
+ GCCPLUGINS_DIR="$(${CC:-gcc} --print-file-name=plugin)"
+ make -C "gcc-python-plugin-$pkgver" plugin man html \
+ PLUGIN_NAME=python PYTHON=python PYTHON_CONFIG=python-config \
+ PLUGIN_PYTHONPATH="$GCCPLUGINS_DIR/python"
+ make -C "gcc-python2-plugin-$pkgver" plugin man \
+ PLUGIN_NAME=python2 PYTHON=python2 PYTHON_CONFIG=python2-config \
+ PLUGIN_PYTHONPATH="$GCCPLUGINS_DIR/python2"
+}
+
+check() {
+ pushd "gcc-python-plugin-$pkgver"
+ # This test fails with Python 3. Ignore it.
+ LD_LIBRARY_PATH=gcc-c-api PLUGIN_NAME=python python run-test-suite.py || :
+ LD_LIBRARY_PATH=gcc-c-api PLUGIN_NAME=python python testcpychecker.py -v
+ popd
+
+ pushd "gcc-python2-plugin-$pkgver"
+ LD_LIBRARY_PATH=gcc-c-api PLUGIN_NAME=python2 python2 run-test-suite.py
+ LD_LIBRARY_PATH=gcc-c-api PLUGIN_NAME=python2 python2 testcpychecker.py -v
+ popd
+}
+
+package_gcc-python-plugin() {
+ depends=('python-lxml' 'python-pygments' 'python-six' 'gcc-python-plugin-c-api')
+ optdepends=('graphviz: for examples')
+
+ cd "$pkgname-$pkgver"
+ GCCPLUGINS_DIR="$(${CC:-gcc} --print-file-name=plugin)"
+ make DESTDIR="$pkgdir" install \
+ PLUGIN_NAME=python PYTHON=python PYTHON_CONFIG=python-config \
+ PLUGIN_PYTHONPATH="$GCCPLUGINS_DIR/python"
+
+ rm "$pkgdir$(${CC:-gcc} --print-file-name=plugin)/libgcc-c-api.so"
+}
+
+package_gcc-python2-plugin() {
+ depends=('python2-lxml' 'python2-pygments' 'python2-six' 'gcc-python-plugin-c-api')
+ optdepends=('graphviz: for examples')
+
+ cd "$pkgname-$pkgver"
+ GCCPLUGINS_DIR="$(${CC:-gcc} --print-file-name=plugin)"
+ make DESTDIR="$pkgdir" install \
+ PLUGIN_NAME=python2 PYTHON=python2 PYTHON_CONFIG=python2-config \
+ PLUGIN_PYTHONPATH="$GCCPLUGINS_DIR/python2"
+
+ rm "$pkgdir$(${CC:-gcc} --print-file-name=plugin)/libgcc-c-api.so"
+}
+
+package_gcc-python-plugin-c-api() {
+ cd "$pkgbase-$pkgver"
+
+ # Install only once the library which is provided by both versions
+ GCCPLUGINS_DIR="$(${CC:-gcc} --print-file-name=plugin)"
+ install -Dm755 gcc-c-api/libgcc-c-api.so "$pkgdir$GCCPLUGINS_DIR/libgcc-c-api.so"
+}
+
+package_gcc-python-plugin-doc() {
+ cd "$pkgbase-$pkgver"
+
+ mkdir -p "$pkgdir/usr/share/doc/$pkgbase"
+ cp -r docs/_build/html examples "$pkgdir/usr/share/doc/$pkgbase/"
+}