From e3c69f09ccb7c5203b683b9a878aa4a90959f745 Mon Sep 17 00:00:00 2001 From: Mario Haustein Date: Sat, 15 Jan 2022 13:39:10 +0100 Subject: dev-util/unicorn: new ebuild Package-Manager: Portage-3.0.28, Repoman-3.0.3 Signed-off-by: Mario Haustein Signed-off-by: Sam James --- dev-util/unicorn/Manifest | 1 + dev-util/unicorn/metadata.xml | 15 ++++++ dev-util/unicorn/unicorn-2.0.0_rc5.ebuild | 77 +++++++++++++++++++++++++++++++ dev-util/unicorn/unicorn-9999.ebuild | 77 +++++++++++++++++++++++++++++++ 4 files changed, 170 insertions(+) create mode 100644 dev-util/unicorn/Manifest create mode 100644 dev-util/unicorn/metadata.xml create mode 100644 dev-util/unicorn/unicorn-2.0.0_rc5.ebuild create mode 100644 dev-util/unicorn/unicorn-9999.ebuild (limited to 'dev-util/unicorn') diff --git a/dev-util/unicorn/Manifest b/dev-util/unicorn/Manifest new file mode 100644 index 000000000000..2566a0abfced --- /dev/null +++ b/dev-util/unicorn/Manifest @@ -0,0 +1 @@ +DIST unicorn-2.0.0_rc5.tar.gz 3808762 BLAKE2B 02a77c46e075f67df04a9fe0b5474df9f6a6c154778de3223c6ed3c475bd4658abd7b57d351a63cfa7ef5ecbadbee12a6151957b7b47b4f6741b5e4581d13c4b SHA512 3b5118e378872a50d3aa0dca01cda69b0e7b3875da7b03c1708963848c71818dd1e120df8796acace661c6b4d63813b9acc8106ce3a94c0d40c3b50677fbaacd diff --git a/dev-util/unicorn/metadata.xml b/dev-util/unicorn/metadata.xml new file mode 100644 index 000000000000..0c34d21d4fdd --- /dev/null +++ b/dev-util/unicorn/metadata.xml @@ -0,0 +1,15 @@ + + + + + mario.haustein@hrz.tu-chemnitz.de + Mario Haustein + + + sam@gentoo.org + Sam James + + + unicorn-engine/unicorn + + diff --git a/dev-util/unicorn/unicorn-2.0.0_rc5.ebuild b/dev-util/unicorn/unicorn-2.0.0_rc5.ebuild new file mode 100644 index 000000000000..c0be1c278b68 --- /dev/null +++ b/dev-util/unicorn/unicorn-2.0.0_rc5.ebuild @@ -0,0 +1,77 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MY_PV=${PV/_/-} + +DISTUTILS_OPTIONAL=1 +PYTHON_COMPAT=( python3_{9..10} ) +inherit cmake distutils-r1 + +DESCRIPTION="A lightweight multi-platform, multi-architecture CPU emulator framework" +HOMEPAGE="http://www.unicorn-engine.org" + +if [[ ${PV} == *9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/unicorn-engine/unicorn" +else + SRC_URI="https://github.com/unicorn-engine/unicorn/archive/${MY_PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~x86" +fi + +LICENSE="GPL-2" +SLOT="0" + +UNICORN_TARGETS="x86 arm aarch64 riscv mips sparc m68k ppc" + +IUSE="python static-libs" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +DEPEND="dev-libs/glib:2 + virtual/pkgconfig + ${PYTHON_DEPS}" +RDEPEND="python? ( ${PYTHON_DEPS} )" + +S="${WORKDIR}/${PN}-${MY_PV}" + +wrap_python() { + if use python; then + # src_prepare + # do not compile C extensions + export LIBUNICORN_PATH=1 + + pushd bindings/python >/dev/null || die + distutils-r1_${1} "$@" + popd >/dev/null + fi +} + +src_prepare() { + # build from sources + rm -r bindings/python/prebuilt || die "failed to remove prebuild" + cmake_src_prepare + wrap_python ${FUNCNAME} +} + +src_configure(){ + local mycmakeargs=( + -DBUILD_SHARED_LIBS=OFF + -DUNICORN_BUILD_SHARED="$(usex static-libs OFF ON)" + -DUNICORN_ARCH="${UNICORN_TARGETS}" + ) + cmake_src_configure + wrap_python ${FUNCNAME} +} + +src_compile() { + cmake_src_compile + wrap_python ${FUNCNAME} +} + +src_install() { + cmake_src_install + + wrap_python ${FUNCNAME} +} diff --git a/dev-util/unicorn/unicorn-9999.ebuild b/dev-util/unicorn/unicorn-9999.ebuild new file mode 100644 index 000000000000..c0be1c278b68 --- /dev/null +++ b/dev-util/unicorn/unicorn-9999.ebuild @@ -0,0 +1,77 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MY_PV=${PV/_/-} + +DISTUTILS_OPTIONAL=1 +PYTHON_COMPAT=( python3_{9..10} ) +inherit cmake distutils-r1 + +DESCRIPTION="A lightweight multi-platform, multi-architecture CPU emulator framework" +HOMEPAGE="http://www.unicorn-engine.org" + +if [[ ${PV} == *9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/unicorn-engine/unicorn" +else + SRC_URI="https://github.com/unicorn-engine/unicorn/archive/${MY_PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~x86" +fi + +LICENSE="GPL-2" +SLOT="0" + +UNICORN_TARGETS="x86 arm aarch64 riscv mips sparc m68k ppc" + +IUSE="python static-libs" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +DEPEND="dev-libs/glib:2 + virtual/pkgconfig + ${PYTHON_DEPS}" +RDEPEND="python? ( ${PYTHON_DEPS} )" + +S="${WORKDIR}/${PN}-${MY_PV}" + +wrap_python() { + if use python; then + # src_prepare + # do not compile C extensions + export LIBUNICORN_PATH=1 + + pushd bindings/python >/dev/null || die + distutils-r1_${1} "$@" + popd >/dev/null + fi +} + +src_prepare() { + # build from sources + rm -r bindings/python/prebuilt || die "failed to remove prebuild" + cmake_src_prepare + wrap_python ${FUNCNAME} +} + +src_configure(){ + local mycmakeargs=( + -DBUILD_SHARED_LIBS=OFF + -DUNICORN_BUILD_SHARED="$(usex static-libs OFF ON)" + -DUNICORN_ARCH="${UNICORN_TARGETS}" + ) + cmake_src_configure + wrap_python ${FUNCNAME} +} + +src_compile() { + cmake_src_compile + wrap_python ${FUNCNAME} +} + +src_install() { + cmake_src_install + + wrap_python ${FUNCNAME} +} -- cgit v1.2.3-65-gdbad