summaryrefslogtreecommitdiff
path: root/dev-util/unicorn
diff options
context:
space:
mode:
authorroot <root@alpha.trunkmasters.com>2026-06-12 19:09:37 -0500
committerroot <root@alpha.trunkmasters.com>2026-06-12 19:09:37 -0500
commitb590c8d7572b727d565cc0b8ff660d43569845de (patch)
tree06f7a4102ea4e845df8b66660f252920d52952f9 /dev-util/unicorn
parent24f9cbfc4c34fdb6a6e03311674414e881ceab47 (diff)
downloadbaldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.gz
baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.xz
baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.zip
Adding metadata
Diffstat (limited to 'dev-util/unicorn')
-rw-r--r--dev-util/unicorn/Manifest2
-rw-r--r--dev-util/unicorn/files/unicorn-2.1.3-delay_slot_flag.patch17
-rw-r--r--dev-util/unicorn/files/unicorn-2.1.3-strings.patch40
-rw-r--r--dev-util/unicorn/metadata.xml19
-rw-r--r--dev-util/unicorn/unicorn-2.1.3-r1.ebuild116
-rw-r--r--dev-util/unicorn/unicorn-2.1.4.ebuild111
-rw-r--r--dev-util/unicorn/unicorn-9999.ebuild111
7 files changed, 416 insertions, 0 deletions
diff --git a/dev-util/unicorn/Manifest b/dev-util/unicorn/Manifest
new file mode 100644
index 000000000000..13aced56ae99
--- /dev/null
+++ b/dev-util/unicorn/Manifest
@@ -0,0 +1,2 @@
+DIST unicorn-2.1.3.gh.tar.gz 4197694 BLAKE2B 97f3954a33e7eed4264c4fdd33f011da39a3f4cca96c5e3bcdc88d10bb3a2392ced00a8c79470100c9f0b3f48c118a4c99e6a632dedccf5a20e3a4f7fd4e0fa7 SHA512 49aa53cd981e88857cf579010e3e86a6808fbfc9723fbf73c3d5bcebf945c5d78ffcdf426a4bbcd06b13337a3a0ce76bce8815497e3521023ae432a053d3e4bb
+DIST unicorn-2.1.4.gh.tar.gz 4252854 BLAKE2B 2dd4daa39f4f7365d47e33dfb47541ee9cc0fdfe31cd84c4a81bc36351cdf69e26696f2f496d562e748f9212c29e211258ccf5aedce486c721f679cd7ef5b3ea SHA512 c9ae4230a20b77e0187cde33dbf4827b3504b6c24debd61fc79ec9c13fa2051335c834c101433cebbbc8e3baadae56212b79c5922bf37ea1f777d66d8e67b495
diff --git a/dev-util/unicorn/files/unicorn-2.1.3-delay_slot_flag.patch b/dev-util/unicorn/files/unicorn-2.1.3-delay_slot_flag.patch
new file mode 100644
index 000000000000..e9fe96482b16
--- /dev/null
+++ b/dev-util/unicorn/files/unicorn-2.1.3-delay_slot_flag.patch
@@ -0,0 +1,17 @@
+From 0bb1bbd93c9e821154845ba81b81e8a05c49c3b7 Mon Sep 17 00:00:00 2001
+From: mio <mio@lazym.io>
+Date: Tue, 18 Mar 2025 21:20:37 +0800
+Subject: [PATCH] Initialize delay_slot_flag correctly
+Upstream: https://github.com/unicorn-engine/unicorn/issues/2134
+
+--- a/qemu/include/exec/gen-icount.h
++++ b/qemu/include/exec/gen-icount.h
+@@ -45,6 +45,8 @@ static inline void gen_tb_start(TCGContext *tcg_ctx, TranslationBlock *tb)
+ // We CANT'T use brcondi_i32 here or we will fail liveness analysis
+ // because it marks the end of BB
+ if (tcg_ctx->delay_slot_flag != NULL) {
++ // Initialize delay_slot_flag here
++ tcg_gen_movi_i32(tcg_ctx, tcg_ctx->delay_slot_flag, 0);
+ TCGv_i32 tmp = tcg_const_i32(tcg_ctx, 0);
+ // dest = (c1 cond c2 ? v1 : v2)
+ tcg_gen_movcond_i32(tcg_ctx, TCG_COND_GT, count, tcg_ctx->delay_slot_flag, tmp, tcg_ctx->delay_slot_flag, count);
diff --git a/dev-util/unicorn/files/unicorn-2.1.3-strings.patch b/dev-util/unicorn/files/unicorn-2.1.3-strings.patch
new file mode 100644
index 000000000000..00cf498d15e7
--- /dev/null
+++ b/dev-util/unicorn/files/unicorn-2.1.3-strings.patch
@@ -0,0 +1,40 @@
+https://github.com/unicorn-engine/unicorn/pull/2186
+
+From e57d319971005235cc6946f0ba9e832a339aecb1 Mon Sep 17 00:00:00 2001
+From: "Z. Liu" <zhixu.liu@gmail.com>
+Date: Thu, 15 May 2025 21:50:55 +0800
+Subject: [PATCH] qemu/configure: make strings command can be redefined by
+ ${STRINGS}
+
+Signed-off-by: Z. Liu <zhixu.liu@gmail.com>
+---
+ qemu/configure | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/qemu/configure b/qemu/configure
+index e8eb427c..af3781c3 100755
+--- a/qemu/configure
++++ b/qemu/configure
+@@ -339,6 +339,7 @@ ld="${LD-${cross_prefix}ld}"
+ ranlib="${RANLIB-${cross_prefix}ranlib}"
+ nm="${NM-${cross_prefix}nm}"
+ strip="${STRIP-${cross_prefix}strip}"
++strings="${STRINGS-${cross_prefix}strings}"
+ pkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}"
+ query_pkg_config() {
+ "${pkg_config_exe}" ${QEMU_PKG_CONFIG_FLAGS} "$@"
+@@ -1233,9 +1234,9 @@ int main(int argc, char *argv[]) {
+ EOF
+
+ if compile_object ; then
+- if strings -a $TMPO | grep -q BiGeNdIaN ; then
++ if ${strings} -a $TMPO | grep -q BiGeNdIaN ; then
+ bigendian="yes"
+- elif strings -a $TMPO | grep -q LiTtLeEnDiAn ; then
++ elif ${strings} -a $TMPO | grep -q LiTtLeEnDiAn ; then
+ bigendian="no"
+ else
+ echo big/little test failed
+--
+2.45.2
+
diff --git a/dev-util/unicorn/metadata.xml b/dev-util/unicorn/metadata.xml
new file mode 100644
index 000000000000..c9ab31d6789b
--- /dev/null
+++ b/dev-util/unicorn/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>mario.haustein@hrz.tu-chemnitz.de</email>
+ <name>Mario Haustein</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>sam@gentoo.org</email>
+ <name>Sam James</name>
+ </maintainer>
+ <use>
+ <flag name="logging">Enable logging</flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:unicorn-engine:unicorn_engine</remote-id>
+ </upstream>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/dev-util/unicorn/unicorn-2.1.3-r1.ebuild b/dev-util/unicorn/unicorn-2.1.3-r1.ebuild
new file mode 100644
index 000000000000..b00f9a10807a
--- /dev/null
+++ b/dev-util/unicorn/unicorn-2.1.3-r1.ebuild
@@ -0,0 +1,116 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MY_PV=${PV/_/-}
+
+DISTUTILS_USE_PEP517=setuptools
+DISTUTILS_OPTIONAL=1
+PYTHON_COMPAT=( python3_{13..14} )
+
+inherit cmake distutils-r1 toolchain-funcs
+
+DESCRIPTION="A lightweight multi-platform, multi-architecture CPU emulator framework"
+HOMEPAGE="https://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}.gh.tar.gz"
+ KEYWORDS="amd64 ~arm arm64 ~ppc ~ppc64 ~riscv x86"
+fi
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+LICENSE="BSD-2 GPL-2 LGPL-2.1"
+SLOT="0/2"
+IUSE="logging python static-libs test"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+DEPEND="${PYTHON_DEPS}
+ dev-libs/glib:2"
+RDEPEND="python? ( ${PYTHON_DEPS} )"
+BDEPEND="virtual/pkgconfig
+ python? (
+ ${DISTUTILS_DEPS}
+ >=dev-python/setuptools-scm-8[${PYTHON_USEDEP}]
+ )"
+
+RESTRICT="!test? ( test )"
+
+UNICORN_TARGETS="x86 arm aarch64 riscv mips sparc m68k ppc s390x tricore"
+
+export SETUPTOOLS_SCM_PRETEND_VERSION=${PV}
+
+PATCHES=(
+ "${FILESDIR}/${P}-strings.patch"
+ "${FILESDIR}/${P}-delay_slot_flag.patch"
+)
+
+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 || die
+ fi
+}
+
+src_prepare() {
+ # Build from sources
+ rm -r bindings/python/prebuilt || die "failed to remove prebuilt files"
+
+ cmake_src_prepare
+ wrap_python ${FUNCNAME}
+
+ if use elibc_musl ; then
+ QA_CONFIG_IMPL_DECL_SKIP=( malloc_trim )
+ fi
+}
+
+src_configure(){
+ tc-export STRINGS
+
+ local mycmakeargs=(
+ -DUNICORN_ARCH="${UNICORN_TARGETS// /;}"
+ -DUNICORN_LOGGING=$(usex logging)
+ -DUNICORN_LEGACY_STATIC_ARCHIVE=$(usex static-libs)
+ -DZIG_BUILD=OFF
+ )
+
+ cmake_src_configure
+
+ wrap_python ${FUNCNAME}
+}
+
+src_compile() {
+ cmake_src_compile
+
+ wrap_python ${FUNCNAME}
+}
+
+src_test() {
+ cmake_src_test
+
+ wrap_python ${FUNCNAME}
+}
+
+python_test() {
+# export LD_LIBRARY_PATH="${ED}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
+ for f in tests/test_*.py; do
+ if test -x ${f}; then
+ LD_LIBRARY_PATH="${ED}/usr/$(get_libdir)" ${EPYHTON} ${f} || die
+ fi
+ done
+}
+
+src_install() {
+ cmake_src_install
+
+ wrap_python ${FUNCNAME}
+}
diff --git a/dev-util/unicorn/unicorn-2.1.4.ebuild b/dev-util/unicorn/unicorn-2.1.4.ebuild
new file mode 100644
index 000000000000..e640ac89f552
--- /dev/null
+++ b/dev-util/unicorn/unicorn-2.1.4.ebuild
@@ -0,0 +1,111 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MY_PV=${PV/_/-}
+
+DISTUTILS_USE_PEP517=setuptools
+DISTUTILS_OPTIONAL=1
+PYTHON_COMPAT=( python3_{13..14} )
+
+inherit cmake distutils-r1 toolchain-funcs
+
+DESCRIPTION="A lightweight multi-platform, multi-architecture CPU emulator framework"
+HOMEPAGE="https://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}.gh.tar.gz"
+ KEYWORDS="amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv x86"
+fi
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+LICENSE="BSD-2 GPL-2 LGPL-2.1"
+SLOT="0/2"
+IUSE="logging python static-libs test"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+DEPEND="${PYTHON_DEPS}
+ dev-libs/glib:2"
+RDEPEND="python? ( ${PYTHON_DEPS} )"
+BDEPEND="virtual/pkgconfig
+ python? (
+ ${DISTUTILS_DEPS}
+ >=dev-python/setuptools-scm-8[${PYTHON_USEDEP}]
+ )"
+
+RESTRICT="!test? ( test )"
+
+UNICORN_TARGETS="x86 arm aarch64 riscv mips sparc m68k ppc s390x tricore"
+
+export SETUPTOOLS_SCM_PRETEND_VERSION=${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 || die
+ fi
+}
+
+src_prepare() {
+ # Build from sources
+ rm -r bindings/python/prebuilt || die "failed to remove prebuilt files"
+
+ cmake_src_prepare
+ wrap_python ${FUNCNAME}
+
+ if use elibc_musl ; then
+ QA_CONFIG_IMPL_DECL_SKIP=( malloc_trim )
+ fi
+}
+
+src_configure(){
+ tc-export STRINGS
+
+ local mycmakeargs=(
+ -DUNICORN_ARCH="${UNICORN_TARGETS// /;}"
+ -DUNICORN_LOGGING=$(usex logging)
+ -DUNICORN_LEGACY_STATIC_ARCHIVE=$(usex static-libs)
+ -DZIG_BUILD=OFF
+ )
+
+ cmake_src_configure
+
+ wrap_python ${FUNCNAME}
+}
+
+src_compile() {
+ cmake_src_compile
+
+ wrap_python ${FUNCNAME}
+}
+
+src_test() {
+ cmake_src_test
+
+ wrap_python ${FUNCNAME}
+}
+
+python_test() {
+# export LD_LIBRARY_PATH="${ED}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
+ for f in tests/test_*.py; do
+ if test -x ${f}; then
+ LD_LIBRARY_PATH="${ED}/usr/$(get_libdir)" ${EPYHTON} ${f} || die
+ fi
+ done
+}
+
+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..2744cb9b8fa8
--- /dev/null
+++ b/dev-util/unicorn/unicorn-9999.ebuild
@@ -0,0 +1,111 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MY_PV=${PV/_/-}
+
+DISTUTILS_USE_PEP517=setuptools
+DISTUTILS_OPTIONAL=1
+PYTHON_COMPAT=( python3_{13..14} )
+
+inherit cmake distutils-r1 toolchain-funcs
+
+DESCRIPTION="A lightweight multi-platform, multi-architecture CPU emulator framework"
+HOMEPAGE="https://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}.gh.tar.gz"
+ KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~x86"
+fi
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+LICENSE="BSD-2 GPL-2 LGPL-2.1"
+SLOT="0/2"
+IUSE="logging python static-libs test"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+DEPEND="${PYTHON_DEPS}
+ dev-libs/glib:2"
+RDEPEND="python? ( ${PYTHON_DEPS} )"
+BDEPEND="virtual/pkgconfig
+ python? (
+ ${DISTUTILS_DEPS}
+ >=dev-python/setuptools-scm-8[${PYTHON_USEDEP}]
+ )"
+
+RESTRICT="!test? ( test )"
+
+UNICORN_TARGETS="x86 arm aarch64 riscv mips sparc m68k ppc s390x tricore"
+
+export SETUPTOOLS_SCM_PRETEND_VERSION=${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 || die
+ fi
+}
+
+src_prepare() {
+ # Build from sources
+ rm -r bindings/python/prebuilt || die "failed to remove prebuilt files"
+
+ cmake_src_prepare
+ wrap_python ${FUNCNAME}
+
+ if use elibc_musl ; then
+ QA_CONFIG_IMPL_DECL_SKIP=( malloc_trim )
+ fi
+}
+
+src_configure(){
+ tc-export STRINGS
+
+ local mycmakeargs=(
+ -DUNICORN_ARCH="${UNICORN_TARGETS// /;}"
+ -DUNICORN_LOGGING=$(usex logging)
+ -DUNICORN_LEGACY_STATIC_ARCHIVE=$(usex static-libs)
+ -DZIG_BUILD=OFF
+ )
+
+ cmake_src_configure
+
+ wrap_python ${FUNCNAME}
+}
+
+src_compile() {
+ cmake_src_compile
+
+ wrap_python ${FUNCNAME}
+}
+
+src_test() {
+ cmake_src_test
+
+ wrap_python ${FUNCNAME}
+}
+
+python_test() {
+# export LD_LIBRARY_PATH="${ED}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
+ for f in tests/test_*.py; do
+ if test -x ${f}; then
+ LD_LIBRARY_PATH="${ED}/usr/$(get_libdir)" ${EPYHTON} ${f} || die
+ fi
+ done
+}
+
+src_install() {
+ cmake_src_install
+
+ wrap_python ${FUNCNAME}
+}