diff options
author | 2023-10-08 14:07:29 +0200 | |
---|---|---|
committer | 2024-01-08 15:50:35 +0200 | |
commit | 578daf3796eefa3981d9e97374cf0c529b4c7fcc (patch) | |
tree | c8107c634e2972242aa25b2ae490931eca8dfbb6 /dev-libs/keystone/keystone-0.9.2-r3.ebuild | |
parent | dev-libs/keystone: remove unused USE flag (diff) | |
download | gentoo-578daf3796eefa3981d9e97374cf0c529b4c7fcc.tar.gz gentoo-578daf3796eefa3981d9e97374cf0c529b4c7fcc.tar.bz2 gentoo-578daf3796eefa3981d9e97374cf0c529b4c7fcc.zip |
dev-libs/keystone: fix modern C issue
Closes: https://bugs.gentoo.org/879665
Signed-off-by: Mario Haustein <mario.haustein@hrz.tu-chemnitz.de>
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'dev-libs/keystone/keystone-0.9.2-r3.ebuild')
-rw-r--r-- | dev-libs/keystone/keystone-0.9.2-r3.ebuild | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/dev-libs/keystone/keystone-0.9.2-r3.ebuild b/dev-libs/keystone/keystone-0.9.2-r3.ebuild new file mode 100644 index 000000000000..70454b0a3b8e --- /dev/null +++ b/dev-libs/keystone/keystone-0.9.2-r3.ebuild @@ -0,0 +1,100 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_EXT=1 +DISTUTILS_OPTIONAL=1 +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{10..12} ) + +inherit cmake distutils-r1 + +DESCRIPTION="assembly/assembler framework + bindings" +HOMEPAGE="https://www.keystone-engine.org/" + +if [[ ${PV} == 9999* ]]; then + EGIT_REPO_URI="https://github.com/keystone-engine/keystone.git" + inherit git-r3 +else + SRC_URI="https://github.com/keystone-engine/keystone/archive/${PV/_rc/-rc}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86" +fi +S="${WORKDIR}"/${P/_rc/-rc} + +LICENSE="GPL-2" +SLOT="0" + +# Keep in sync with llvm/CMakeLists.txt +KEYSTONE_TARGETS="AArch64 ARM Hexagon Mips PowerPC Sparc SystemZ X86" + +IUSE="python" + +RDEPEND=" + python? ( ${PYTHON_DEPS} ) +" +DEPEND="${RDEPEND}" +BDEPEND=" + python? + ( + ${DISTUTILS_DEPS} + ${PYTHON_DEPS} + ) +" + +RESTRICT=test # only regression tests + +REQUIRED_USE=" + python? ( ${PYTHON_REQUIRED_USE} ) +" + +PATCHES=( + "${FILESDIR}/${P}-strict-prototypes.patch" +) + +# Upstream doesn't flag patch releases (bug 858395) +QA_PKGCONFIG_VERSION="$(ver_cut 1-2)" + +wrap_python() { + if use python; then + pushd bindings/python >/dev/null || die + distutils-r1_${1} "$@" + popd >/dev/null || die + fi +} + +pkg_setup() { + python_setup +} + +src_prepare() { + sed -i '/NOT uppercase_CMAKE_BUILD_TYPE MATCHES/ s/DEBUG/GENTOO|DEBUG/' \ + llvm/CMakeLists.txt || die + cmake_src_prepare + wrap_python ${FUNCNAME} +} + +src_configure() { + local libdir="$(get_libdir)" + local mycmakeargs=( + -DCMAKE_CONFIGURATION_TYPES="Gentoo" + -DLLVM_LIBDIR_SUFFIX=${libdir#lib} + -DBUILD_SHARED_LIBS=ON + -DLLVM_TARGETS_TO_BUILD="${KEYSTONE_TARGETS// /;}" + -DLLVM_HOST_TRIPLE="${CHOST}" + -DPYTHON_EXECUTABLE="${PYTHON}" + ) + + cmake_src_configure + wrap_python ${FUNCNAME} +} + +src_compile() { + cmake_src_compile + wrap_python ${FUNCNAME} +} + +src_install() { + cmake_src_install + wrap_python ${FUNCNAME} +} |