unicorn-bindings: fix python bindings

This commit is contained in:
blshkv 2019-02-17 10:30:54 +08:00
parent b79f860569
commit 4dde4e0e86
No known key found for this signature in database
GPG key ID: 273E3E90D1A6294F
3 changed files with 60 additions and 33 deletions

View file

@ -1 +1 @@
DIST unicorn-1.0.1.tar.gz 3241225 SHA256 3a6a4f2b8c405ab009040ca43af8e4aa10ebe44d9c8b336aa36dc35df955017c SHA512 edfe1f7bfbc1d20f5b62232057e194a937bc09db686ef2efadb33a54605029a53426432cdb2a29511385aacdb9343b3b3091af50a1909098d7cf6db3429eb966 WHIRLPOOL 3edb3cfcabef38936d052afc5b6a224b2e3d2ffefda4b602be5f9136cde21d6707b7081b1806b42e0f02ba33987c808002034305965ab549ace2efc597e88f14
DIST unicorn-1.0.1.tar.gz 3241225 BLAKE2B 977349ee9f98d63a93d67ed9f1e8c4fd7fc6a5bf43285baf011624ddb4b801bdaf61879ddaec1310d84a23151e16af95af0eb3396e22895d4067396f1426ea1e SHA512 edfe1f7bfbc1d20f5b62232057e194a937bc09db686ef2efadb33a54605029a53426432cdb2a29511385aacdb9343b3b3091af50a1909098d7cf6db3429eb966

View file

@ -1,32 +0,0 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI="5"
PYTHON_COMPAT=( python2_7 )
inherit git-r3 python-single-r1
DESCRIPTION="Unicorn bindings"
HOMEPAGE="http://www.unicorn-engine.org"
EGIT_REPO_URI="https://github.com/unicorn-engine/unicorn.git"
EGIT_COMMIT="7b47ab6b667f8959cbfe149fc67de7cfcd0bcf54"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE="go java python ruby"
RDEPEND="
go? ( dev-lang/go )
ruby? ( dev-lang/ruby:* )"
DEPEND="${RDEPEND}
~dev-util/unicorn-${PV}
virtual/pkgconfig"
S="${WORKDIR}/${P}"/bindings
src_prepare(){
use go || sed -i -e '/cd go/d' Makefile
use java || sed -i -e '/cd java/d' Makefile
}

View file

@ -0,0 +1,59 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python{2_7,3_{4,5,6}} )
inherit multilib distutils-r1 eutils
DESCRIPTION="Unicorn bindings"
HOMEPAGE="http://www.unicorn-engine.org"
SRC_URI="https://github.com/unicorn-engine/unicorn/archive/${PV}.tar.gz -> unicorn-${PV}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="python"
RDEPEND="~dev-util/unicorn-${PV}"
DEPEND="${RDEPEND}
virtual/pkgconfig
python? ( dev-python/setuptools[${PYTHON_USEDEP}] )
"
# go? ( dev-lang/go )
# ruby? ( dev-lang/ruby:* )
S="${WORKDIR}/unicorn-${PV}"/bindings
src_prepare(){
epatch "${FILESDIR}"/prebuilt.patch
# use go || sed -i -e '/go gen_const/d' Makefile
# use java || sed -i -e '/java gen_const/d' Makefile
# use python || sed -i -e '/python gen_const/d' Makefile
# use ruby || sed -i -e '/ruby gen_const/d' Makefile
sed -i -e '/const_generator.py dotnet/d' Makefile
#fix python2 install
sed -i "s|python setup.py install|python2 setup.py install|" python/Makefile || die
eapply_user
}
src_compile(){
einfo "Nothing to compile"
# emake -C python DESTDIR="${D}" check
}
src_install(){
if use python; then
myinstall_python() {
if python_is_python3; then
emake -C python DESTDIR="${D}" install3
else
emake -C python DESTDIR="${D}" install
fi
}
python_foreach_impl myinstall_python
fi
}