diff options
author | David Seifert <soap@gentoo.org> | 2021-01-24 00:37:50 +0100 |
---|---|---|
committer | David Seifert <soap@gentoo.org> | 2021-01-24 00:37:50 +0100 |
commit | d8d68e4b7e09155d1a4569c365780fe48908c7c4 (patch) | |
tree | 6b0c9b6523957998100804618f01eb2a8157934e /dev-libs/udis86 | |
parent | dev-libs/liboil: Port to EAPI 7 (diff) | |
download | gentoo-d8d68e4b7e09155d1a4569c365780fe48908c7c4.tar.gz gentoo-d8d68e4b7e09155d1a4569c365780fe48908c7c4.tar.bz2 gentoo-d8d68e4b7e09155d1a4569c365780fe48908c7c4.zip |
dev-libs/udis86: Port to EAPI 7
* Fix python automagic
* Fix python tests scripts
Closes: https://bugs.gentoo.org/632251
Closes: https://bugs.gentoo.org/737214
Closes: https://bugs.gentoo.org/765862
Package-Manager: Portage-3.0.14, Repoman-3.0.2
Signed-off-by: David Seifert <soap@gentoo.org>
Diffstat (limited to 'dev-libs/udis86')
-rw-r--r-- | dev-libs/udis86/files/udis86-1.7.2-python3.patch | 42 | ||||
-rw-r--r-- | dev-libs/udis86/udis86-1.7.2-r1.ebuild | 54 | ||||
-rw-r--r-- | dev-libs/udis86/udis86-1.7.2.ebuild | 39 |
3 files changed, 96 insertions, 39 deletions
diff --git a/dev-libs/udis86/files/udis86-1.7.2-python3.patch b/dev-libs/udis86/files/udis86-1.7.2-python3.patch new file mode 100644 index 000000000000..b708072195c5 --- /dev/null +++ b/dev-libs/udis86/files/udis86-1.7.2-python3.patch @@ -0,0 +1,42 @@ +--- a/scripts/ud_opcode.py ++++ b/scripts/ud_opcode.py +@@ -130,8 +130,8 @@ + '/mod' : lambda v: '00' if v == '!11' else '01', + # Mode extensions: + # (16, 32, 64) => (00, 01, 02) +- '/o' : lambda v: "%02x" % (int(v) / 32), +- '/a' : lambda v: "%02x" % (int(v) / 32), ++ '/o' : lambda v: "%02x" % (int(v) // 32), ++ '/a' : lambda v: "%02x" % (int(v) // 32), + '/m' : lambda v: '00' if v == '!64' else '01', + # SSE + '/sse' : lambda v: UdOpcodeTables.OpcExtIndex['sse'][v], +@@ -227,7 +227,7 @@ + + def print_table( self, table, pfxs ): + print("%s |" % pfxs) +- keys = table[ 'entries' ].keys() ++ keys = list(table[ 'entries' ].keys()) + if ( len( keys ) ): + keys.sort() + for idx in keys: +--- a/tests/oprgen.py ++++ b/tests/oprgen.py +@@ -686,7 +686,7 @@ + def generate_yasm( self, mode, seed ): + opr_combos = {} + random.seed( seed ) +- print "[bits %s]" % mode ++ print("[bits %s]" % mode) + for insn in self.InsnTable: + if insn[ 'mnemonic' ] in self.ExcludeList: + continue +@@ -728,7 +728,7 @@ + else: + operands = None + if operands is not None: +- print "\t%s %s" % (insn['mnemonic'], operands) ++ print("\t%s %s" % (insn['mnemonic'], operands)) + opr_combos[fusedName]['covered'] = True + + # stats diff --git a/dev-libs/udis86/udis86-1.7.2-r1.ebuild b/dev-libs/udis86/udis86-1.7.2-r1.ebuild new file mode 100644 index 000000000000..5cc32041f20e --- /dev/null +++ b/dev-libs/udis86/udis86-1.7.2-r1.ebuild @@ -0,0 +1,54 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{7..9} ) + +inherit autotools multilib-minimal python-any-r1 + +DESCRIPTION="Disassembler library for the x86/-64 architecture sets" +HOMEPAGE="http://udis86.sourceforge.net/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86" +IUSE="test" +RESTRICT="!test? ( test )" + +BDEPEND=" + test? ( + ${PYTHON_DEPS} + amd64? ( dev-lang/yasm ) + x86? ( dev-lang/yasm ) + )" + +PATCHES=( + "${FILESDIR}"/${P}-docdir.patch + "${FILESDIR}"/${P}-python3.patch +) + +pkg_setup() { + use test && python-any-r1_pkg_setup +} + +src_prepare() { + default + eautoreconf +} + +multilib_src_configure() { + ECONF_SOURCE="${S}" econf \ + --disable-static \ + --enable-shared \ + --with-pic \ + PYTHON="${EPYTHON}" +} + +multilib_src_install_all() { + einstalldocs + + # no static archives + find "${ED}" -name '*.la' -delete || die +} diff --git a/dev-libs/udis86/udis86-1.7.2.ebuild b/dev-libs/udis86/udis86-1.7.2.ebuild deleted file mode 100644 index 7c7ecf4c0e99..000000000000 --- a/dev-libs/udis86/udis86-1.7.2.ebuild +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=5 - -AUTOTOOLS_AUTORECONF=1 -inherit autotools-multilib eutils - -DESCRIPTION="Disassembler library for the x86/-64 architecture sets" -HOMEPAGE="http://udis86.sourceforge.net/" -SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="~amd64 ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86" -IUSE="test" -RESTRICT="!test? ( test )" - -DEPEND="test? ( - amd64? ( dev-lang/yasm ) - x86? ( dev-lang/yasm ) - x86-fbsd? ( dev-lang/yasm ) - )" -RDEPEND="" - -PATCHES=( - "${FILESDIR}"/${P}-docdir.patch -) - -src_configure() { - local myeconfargs=( - --docdir="${EPREFIX}"/usr/share/doc/${PF} - --disable-static - --enable-shared - --with-pic - ) - - autotools-multilib_src_configure -} |