From a9a28b2926d5f7ad913e751ed5925ee718c019d2 Mon Sep 17 00:00:00 2001 From: Michael Gehring Date: Wed, 13 Apr 2016 20:07:13 +0200 Subject: [PATCH] unicorn: package python bindings --- srcpkgs/python-unicorn | 1 + srcpkgs/python3.4-unicorn | 1 + srcpkgs/unicorn/template | 35 +++++++++++++++++++++++++++++++++-- 3 files changed, 35 insertions(+), 2 deletions(-) create mode 120000 srcpkgs/python-unicorn create mode 120000 srcpkgs/python3.4-unicorn diff --git a/srcpkgs/python-unicorn b/srcpkgs/python-unicorn new file mode 120000 index 00000000000..20c8576391e --- /dev/null +++ b/srcpkgs/python-unicorn @@ -0,0 +1 @@ +unicorn \ No newline at end of file diff --git a/srcpkgs/python3.4-unicorn b/srcpkgs/python3.4-unicorn new file mode 120000 index 00000000000..20c8576391e --- /dev/null +++ b/srcpkgs/python3.4-unicorn @@ -0,0 +1 @@ +unicorn \ No newline at end of file diff --git a/srcpkgs/unicorn/template b/srcpkgs/unicorn/template index e03016ce599..d1cb62e9acd 100644 --- a/srcpkgs/unicorn/template +++ b/srcpkgs/unicorn/template @@ -1,9 +1,9 @@ # Template file for 'unicorn' pkgname=unicorn version=0.9 -revision=1 +revision=2 only_for_archs="x86_64 x86_64-musl i686 i686-musl" -hostmakedepends="pkg-config python" +hostmakedepends="pkg-config python-setuptools python3.4-setuptools" makedepends="glib-devel" short_desc="Lightweight multi-platform, multi-architecture CPU emulator framework" maintainer="Michael Gehring " @@ -22,10 +22,20 @@ post_extract() { do_build() { make + make -C bindings + cd bindings/python + for pyver in 2.7 3.4; do + python${pyver} setup.py build --build-base=build-${pyver} + done } do_install() { make DESTDIR=${PKGDESTDIR} install + cd bindings/python + for pyver in 2.7 3.4; do + python${pyver} setup.py build --build-base=build-${pyver} \ + install --prefix=/usr --root=${DESTDIR} + done } unicorn-devel_package() { @@ -38,3 +48,24 @@ unicorn-devel_package() { vmove usr/lib/pkgconfig } } + +python-unicorn_package() { + depends="${sourcepkg}-devel>=${version}_${revision}" + short_desc+=" - Python2 bindings" + pycompile_version="2.7" + pycompile_module="unicorn" + pkg_install() { + vmove usr/lib/python2.7 + } +} + +python3.4-unicorn_package() { + depends="${sourcepkg}-devel>=${version}_${revision}" + short_desc+=" - Python3.4 bindings" + pycompile_version="3.4" + pycompile_module="unicorn" + pkg_install() { + vmove usr/lib/python3.4 + } +} +