public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-util/radare2/, dev-util/radare2/files/
@ 2021-04-12 23:06 Sergei Trofimovich
  0 siblings, 0 replies; 6+ messages in thread
From: Sergei Trofimovich @ 2021-04-12 23:06 UTC (permalink / raw
  To: gentoo-commits

commit:     e0bdceebac52482046dc9291ecc1bbdbbdb55f48
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 12 23:04:21 2021 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Mon Apr 12 23:05:17 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e0bdceeb

dev-util/radare2: bump up to 5.2.0

Package-Manager: Portage-3.0.18, Repoman-3.0.3
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 dev-util/radare2/Manifest                          |  1 +
 .../radare2/files/radare2-5.2.0-ssl-build.patch    | 54 +++++++++++++++
 dev-util/radare2/radare2-5.2.0.ebuild              | 80 ++++++++++++++++++++++
 3 files changed, 135 insertions(+)

diff --git a/dev-util/radare2/Manifest b/dev-util/radare2/Manifest
index ad15617c38f..f17fb782b4a 100644
--- a/dev-util/radare2/Manifest
+++ b/dev-util/radare2/Manifest
@@ -1,2 +1,3 @@
 DIST radare2-4.5.1.tar.gz 8266567 BLAKE2B 0d23c1d47dd79ffd9398ca7b2c8b383ba6a7e3ec662046d1111ab34cabcdaaf1fdd449686433b3229e3c22c31c705530b0a85bbd22b5fc79891a5ad292ba0ff1 SHA512 f08a4cd1e0d65643463d9f9dbb1aacfe793c7b411ec820a18b75a5975d265cfc2cf91e593522c8823aa369098ded21415939acb07c84d8acd102889bf5aed899
 DIST radare2-5.1.1.tar.gz 7920840 BLAKE2B c6109453d3da6a08f8169bfdc610614f2aee2d6ef13a975ed89e5337c79ad1a8340a08df1ba9d08cbb0db7b61db8c0357a4878e7b948a988c08b895c24ec366b SHA512 b6728bb59788804f5442d5eec8141f62c3b51f589955589b310733b3aeb28beedb969af540649f454dad96710231df384e389d8b4a1d55627d8370e4d3da454f
+DIST radare2-5.2.0.tar.gz 8254980 BLAKE2B 51335b5560ea9085a7cb6ae998657d62353ad65e10f715ca25ec34cde75d48cd06d8312a898de71096138365d3ea13de45e6e48b2c0f06cea7d593cca43a0ef9 SHA512 664ea6df65c1ea8d13a80d281c3dbbcae16fb308826b9276e68d63f26f239f4a5c0d59abcf9325c299894ad4ebf1098b964aa3cad0bbe58b6c96cbd6e7b25952

diff --git a/dev-util/radare2/files/radare2-5.2.0-ssl-build.patch b/dev-util/radare2/files/radare2-5.2.0-ssl-build.patch
new file mode 100644
index 00000000000..8701adb6266
--- /dev/null
+++ b/dev-util/radare2/files/radare2-5.2.0-ssl-build.patch
@@ -0,0 +1,54 @@
+From 7273429e4ba85318f0da2ae03ecc154834aaa73b Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Mon, 12 Apr 2021 23:48:09 +0100
+Subject: [PATCH] state.c: fix --with-openssl build
+
+Build failure happens at:
+
+```
+$ ./configure --with-openssl && make
+....
+state.c: In function 'r_hash_do_hmac_sha256':
+state.c:155:19: error: 'r_SHA256_BLOCK_LENGTH' undeclared (first use in this function); did you mean 'SHA256_BLOCK_LENGTH'?
+  155 |         ut8 bskey[r_SHA256_BLOCK_LENGTH]; // block-sized key
+      |                   ^~~~~~~~~~~~~~~~~~~~~
+      |                   SHA256_BLOCK_LENGTH
+```
+
+The change defines r2_.* aliases for openssl implementation.
+---
+ libr/hash/state.c | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+diff --git a/libr/hash/state.c b/libr/hash/state.c
+index 6f3ae6b4c..93adafc81 100644
+--- a/libr/hash/state.c
++++ b/libr/hash/state.c
+@@ -7,6 +7,24 @@
+ #include <openssl/md4.h>
+ #include <openssl/md5.h>
+ #include <openssl/sha.h>
++
++#  define r_SHA256_BLOCK_LENGTH SHA256_BLOCK_LENGTH
++
++#  define r_SHA1_Init           SHA1_Init
++#  define r_SHA1_Update         SHA1_Update
++#  define r_SHA1_Final          SHA1_Final
++
++#  define r_SHA256_Init         SHA256_Init
++#  define r_SHA256_Update       SHA256_Update
++#  define r_SHA256_Final        SHA256_Final
++
++#  define r_SHA384_Init         SHA384_Init
++#  define r_SHA384_Update       SHA384_Update
++#  define r_SHA384_Final        SHA384_Final
++
++#  define r_SHA512_Init         SHA512_Init
++#  define r_SHA512_Update       SHA512_Update
++#  define r_SHA512_Final        SHA512_Final
+ #else
+ #include "md4.h"
+ #include "md5.h"
+-- 
+2.31.1
+

diff --git a/dev-util/radare2/radare2-5.2.0.ebuild b/dev-util/radare2/radare2-5.2.0.ebuild
new file mode 100644
index 00000000000..21ead643e77
--- /dev/null
+++ b/dev-util/radare2/radare2-5.2.0.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit bash-completion-r1 toolchain-funcs
+
+DESCRIPTION="unix-like reverse engineering framework and commandline tools"
+HOMEPAGE="http://www.radare.org"
+
+if [[ ${PV} == *9999 ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/radareorg/radare2"
+else
+	SRC_URI="https://github.com/radareorg/radare2/archive/${PV}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="ssl libressl"
+
+RDEPEND="
+	dev-libs/libzip
+	dev-libs/xxhash
+	sys-apps/file
+	sys-libs/zlib
+	dev-libs/capstone:0=
+	ssl? (
+		!libressl? ( dev-libs/openssl:0= )
+		libressl? ( dev-libs/libressl:0= )
+	)
+"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=("${FILESDIR}"/${P}-ssl-build.patch)
+
+src_prepare() {
+	# Fix hardcoded docdir for fortunes
+	sed -i -e "/^#define R2_FORTUNES/s/radare2/$PF/" \
+		libr/include/r_userconf.h.acr
+	default
+}
+
+src_configure() {
+	# Ideally these should be set by ./configure
+	tc-export CC AR LD OBJCOPY RANLIB
+	export HOST_CC=${CC}
+
+	econf \
+		--without-libuv \
+		--with-syscapstone \
+		--with-sysmagic \
+		--with-sysxxhash \
+		--with-syszip \
+		$(use_with ssl openssl)
+}
+
+src_install() {
+	default
+
+	insinto /usr/share/zsh/site-functions
+	doins doc/zsh/_*
+
+	newbashcomp doc/bash_autocompletion.sh "${PN}"
+	bashcomp_alias "${PN}" rafind2 r2 rabin2 rasm2 radiff2
+
+	# a workaround for unstable $(INSTALL) call, bug #574866
+	local d
+	for d in doc/*; do
+		if [[ -d ${d} ]]; then
+			rm -rfv "${d}" || die "failed to delete '${d}'"
+		fi
+	done
+
+	# These are not really docs. radare assumes
+	# uncompressed files: bug #761250
+	docompress -x /usr/share/doc/${PF}/fortunes.{creepy,fun,nsfw,tips}
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/radare2/, dev-util/radare2/files/
@ 2024-09-14  7:14 Joonas Niilola
  0 siblings, 0 replies; 6+ messages in thread
From: Joonas Niilola @ 2024-09-14  7:14 UTC (permalink / raw
  To: gentoo-commits

commit:     65759acac1083516c8f0a84297cff3bb8fcb03be
Author:     David Roman <davidroman96 <AT> gmail <DOT> com>
AuthorDate: Sun Sep  1 01:36:02 2024 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Sat Sep 14 07:13:46 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65759aca

dev-util/radare2: add 5.9.4

Signed-off-by: David Roman <davidroman96 <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/38363
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 dev-util/radare2/Manifest                       |   4 +
 dev-util/radare2/files/radare2-5.8.4-test.patch |  13 +++
 dev-util/radare2/radare2-5.9.4.ebuild           | 123 ++++++++++++++++++++++++
 3 files changed, 140 insertions(+)

diff --git a/dev-util/radare2/Manifest b/dev-util/radare2/Manifest
index dbf6f474fc92..054e0519f2c8 100644
--- a/dev-util/radare2/Manifest
+++ b/dev-util/radare2/Manifest
@@ -4,5 +4,9 @@ DIST radare2-5.9.0.tar.gz 11425359 BLAKE2B 4e345eb93f50dd57f65d659e82918a3e83c29
 DIST radare2-5.9.2-vector35-arm64.tar.gz 1050988 BLAKE2B 889c5a98b6efb45026349ca25b73d39e8a8049fce052d49b5e37d974bff038de85f99f1d7651db6c621b036be2948e29a62e6b8261cab6a9bdfd72442858d7e9 SHA512 433a9e972ee13269a495e94aba335b97892eb2614de1460e055e30d60976989f986ef253b352ba918786d4056e3a4d948a66ea90d25aa5ddf52a276152279c92
 DIST radare2-5.9.2-vector35-armv7.tar.gz 255278 BLAKE2B 8b5191c48fad2e7602dc2f7053f9c9ea8cca8e9bc5d68a0cdb7ccff9ecc65c5d1ff6a434e28488dbd6fb71fc7482fce08a0a69c358e5c3d6c017ac1e4cee3b21 SHA512 40c048b29856f48300d4539bc7bda38e6ceae1e8d4d9d131c4a7546b6e26b2fb96309c483b67e2c2290b06cea5fc52a7beb30557d54e89296e7734cc1ab06d10
 DIST radare2-5.9.2.tar.gz 11461281 BLAKE2B ac849ec4bc0e2a1b8447256362d8db2518d72e2a4af3d29f9c8931ac815c1b0c339a072312658bbd725097b3401f28beee31c6f99a5eb5a62ff3eb0cf7ed122f SHA512 e190ec124c6d48e512939782148b23fb0ef50aeb66763c198fdf7a6329d6882bb49a10641902313045b6802fca233c56fbc0142155b52f915dab4099481923c9
+DIST radare2-5.9.4-vector35-arm64.tar.gz 1050988 BLAKE2B 889c5a98b6efb45026349ca25b73d39e8a8049fce052d49b5e37d974bff038de85f99f1d7651db6c621b036be2948e29a62e6b8261cab6a9bdfd72442858d7e9 SHA512 433a9e972ee13269a495e94aba335b97892eb2614de1460e055e30d60976989f986ef253b352ba918786d4056e3a4d948a66ea90d25aa5ddf52a276152279c92
+DIST radare2-5.9.4-vector35-armv7.tar.gz 255278 BLAKE2B 8b5191c48fad2e7602dc2f7053f9c9ea8cca8e9bc5d68a0cdb7ccff9ecc65c5d1ff6a434e28488dbd6fb71fc7482fce08a0a69c358e5c3d6c017ac1e4cee3b21 SHA512 40c048b29856f48300d4539bc7bda38e6ceae1e8d4d9d131c4a7546b6e26b2fb96309c483b67e2c2290b06cea5fc52a7beb30557d54e89296e7734cc1ab06d10
+DIST radare2-5.9.4.tar.gz 11561430 BLAKE2B 14903c087fbb140a8b4b6056adcb236b76ebcad0c7821150599c0732b0bb832b26a4fee5edda914ecd1be4dcdbe28087fadb48e623c593cf949cbc421acc5080 SHA512 51d42b6d98027d3f3d85570e79ea18a8f220c145e3451fd10d82eea1a0542648f83447bb6cb6f5bbf76241677a2412bf064ffbade75e69b486c6148543aa4b0f
 DIST radare2-testbins-32e2480e3b7b6959cd1ba483a200c792b4cb9236.tar.gz 156265712 BLAKE2B 4729c30f56ab9c318f8de83e2a0de820539351cb44aa64c500fa02ed94e4bf6494c60a928b64980767ec3003d72619c98769cfd229d8381524f5175027c03c2e SHA512 d8de16e7aacd2ea4e5ecc85ddc1d38c4b8c47b37964c680084bfcb49144e2da783bccd859cb0a84de6080c7ce893af08f27d170725dcdc5f87ee4f830c5dc6da
+DIST radare2-testbins-bca0e277a234cc71b43d919f88bda03cd4a518fd.tar.gz 159785408 BLAKE2B 325b13af8f965f9fa35995c409955a681b0cc0d6fc8d6d7547d7e70547b3d3ba7647c8c3ff6ede8878e1c3a7d394f3be444ce2f418ee6beb60c5047b5f310e63 SHA512 06fb363ec2959f605035aa0041f48985a98839a39616ac13838994e28b69a0c34240bc4365755f65743c7b72b59b73d11dba7be83848adc4fee0e8d13689d199
 DIST radare2-testbins-ff7a8fb14610c87f7b2d3b185eb267f2aff381ca.tar.gz 159774410 BLAKE2B 65b7712ab444f79f18b3568c790e0cbd250e44cea8fbff5f2ed9caeb0898779928f5018a49fdbd5c2dfba57f01c8b4ceb9c0aa9248612a5c545a147b4f876d90 SHA512 666ea966d94c661ed22c400f5cb7e5c5ca6f914d2436007b5510a57e43609ebc2637606e17d49d9c67d880d5229c295e57cef2295c4d093b856ead1f3d0a7f0a

diff --git a/dev-util/radare2/files/radare2-5.8.4-test.patch b/dev-util/radare2/files/radare2-5.8.4-test.patch
new file mode 100644
index 000000000000..ea8451a17859
--- /dev/null
+++ b/dev-util/radare2/files/radare2-5.8.4-test.patch
@@ -0,0 +1,13 @@
+diff --git a/test/Makefile b/test/Makefile
+index 399d7168ff..80ab108a96 100644
+--- a/test/Makefile
++++ b/test/Makefile
+@@ -76,7 +76,7 @@ uninstall:
+ unit unit-tests: bins
+ 	PATH="$(BINDIR):$(PATH)" $(MAKE) rc
+ 	PKG_CONFIG_PATH=$(PREFIX)/lib/pkgconfig \
+-	LD_LIBRARY_PATH=$(PREFIX)/lib \
++	LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(PREFIX)/lib \
+ 	PATH="$(BINDIR):$(PATH)" \
+ 		$(MAKE) -C unit run
+ 

diff --git a/dev-util/radare2/radare2-5.9.4.ebuild b/dev-util/radare2/radare2-5.9.4.ebuild
new file mode 100644
index 000000000000..458415d07af5
--- /dev/null
+++ b/dev-util/radare2/radare2-5.9.4.ebuild
@@ -0,0 +1,123 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 toolchain-funcs
+
+DESCRIPTION="unix-like reverse engineering framework and commandline tools"
+HOMEPAGE="https://www.radare.org"
+
+ARM64_COMMIT=55d73c6bbb94448a5c615933179e73ac618cf876
+ARMV7_COMMIT=f270a6cc99644cb8e76055b6fa632b25abd26024
+BINS_COMMIT=bca0e277a234cc71b43d919f88bda03cd4a518fd
+
+if [[ ${PV} == *9999 ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/radareorg/radare2"
+else
+	SRC_URI="mirror+https://github.com/radareorg/radare2/archive/${PV}.tar.gz -> ${P}.tar.gz
+		mirror+https://github.com/radareorg/vector35-arch-arm64/archive/${ARM64_COMMIT}.tar.gz -> ${P}-vector35-arm64.tar.gz
+		mirror+https://github.com/radareorg/vector35-arch-armv7/archive/${ARMV7_COMMIT}.tar.gz -> ${P}-vector35-armv7.tar.gz
+		test? ( https://github.com/radareorg/radare2-testbins/archive/${BINS_COMMIT}.tar.gz -> radare2-testbins-${BINS_COMMIT}.tar.gz )
+	"
+
+	KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="ssl test"
+
+# Need to audit licenses of the binaries used for testing
+RESTRICT="fetch !test? ( test )"
+
+RDEPEND="
+	app-arch/lz4
+	>=dev-libs/capstone-5.0_rc4:=
+	dev-libs/libzip:=
+	dev-libs/xxhash
+	sys-apps/file
+	sys-libs/zlib
+	ssl? ( dev-libs/openssl:0= )
+"
+DEPEND="
+	${RDEPEND}
+	dev-util/gperf
+"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-5.8.2-vector35.patch"
+	"${FILESDIR}/${PN}-5.8.4-test.patch"
+)
+
+src_prepare() {
+	default
+
+	# Hack for vector35 arm plugins
+	mv "${WORKDIR}/vector35-arch-arm64-${ARM64_COMMIT}" libr/arch/p/arm/v35/arch-arm64 || die
+	mv "${WORKDIR}/vector35-arch-armv7-${ARMV7_COMMIT}" libr/arch/p/arm/v35/arch-armv7 || die
+
+	if use test; then
+		cp -r "${WORKDIR}/radare2-testbins-${BINS_COMMIT}" "${S}/test/bins" || die
+		cp -r "${WORKDIR}/radare2-testbins-${BINS_COMMIT}" "${S}" || die
+	fi
+
+	# Fix hardcoded docdir for fortunes
+	sed -i -e "/^#define R2_FORTUNES/s/radare2/$PF/" \
+		libr/include/r_userconf.h.acr || die
+}
+
+src_configure() {
+	# Ideally these should be set by ./configure
+	tc-export CC AR LD OBJCOPY RANLIB
+	export HOST_CC=${CC}
+
+	econf \
+		--with-syscapstone \
+		--with-syslz4
+		--with-sysmagic \
+		--with-sysxxhash \
+		--with-syszip \
+		$(use_with ssl)
+}
+
+src_test() {
+	ln -fs "${S}/binr/radare2/radare2" "${S}/binr/radare2/r2" || die
+	LDFLAGS=""
+	for i in "${S}"/libr/*; do
+		if [[ -d ${i} ]]; then
+			LDFLAGS+="-Wl,-rpath=${i} -L${i} "
+			LD_LIBRARY_PATH+=":${i}"
+		fi
+	done
+	export LDFLAGS LD_LIBRARY_PATH
+	export PKG_CONFIG_PATH="${S}/pkgcfg"
+	PATH="${S}/binr/radare2:${PATH}" emake -C test -k unit-tests || die
+}
+
+src_install() {
+	default
+
+	insinto /usr/share/zsh/site-functions
+	doins doc/zsh/_*
+
+	newbashcomp doc/bash_autocompletion.sh "${PN}"
+	bashcomp_alias "${PN}" rafind2 r2 rabin2 rasm2 radiff2
+
+	# a workaround for unstable $(INSTALL) call, bug #574866
+	local d
+	for d in doc/*; do
+		if [[ -d ${d} ]]; then
+			rm -rfv "${d}" || die "failed to delete '${d}'"
+		fi
+	done
+
+	# These are not really docs. radare assumes
+	# uncompressed files: bug #761250
+	docompress -x /usr/share/doc/${PF}/fortunes.{creepy,fun,nsfw,tips}
+
+	# Create plugins directory although it's currently unsupported by radare2
+	keepdir "/usr/$(get_libdir)/radare2/${PV}" || die
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/radare2/, dev-util/radare2/files/
@ 2023-01-23  4:32 John Helmert III
  0 siblings, 0 replies; 6+ messages in thread
From: John Helmert III @ 2023-01-23  4:32 UTC (permalink / raw
  To: gentoo-commits

commit:     309640e8da12494bdc227e238bdbd7435cb415f9
Author:     John Helmert III <ajak <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 23 03:38:19 2023 +0000
Commit:     John Helmert III <ajak <AT> gentoo <DOT> org>
CommitDate: Mon Jan 23 04:32:34 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=309640e8

dev-util/radare2: add 5.8.2

Unbundle capstone to avoid upstream requirement of capstone-5 patches
which are not shipped in Gentoo's capstone package.

Bug: https://bugs.gentoo.org/885395
Bug: https://bugs.gentoo.org/889026
Bug: https://bugs.gentoo.org/891805
Closes: https://github.com/gentoo/gentoo/pull/29223
Signed-off-by: John Helmert III <ajak <AT> gentoo.org>

 dev-util/radare2/Manifest                          |   5 +
 .../files/radare2-5.8.2-bundled-capstone.patch     |  21 ++++
 .../radare2/files/radare2-5.8.2-vector35.patch     |  24 ++++
 dev-util/radare2/radare2-5.8.2.ebuild              | 125 +++++++++++++++++++++
 4 files changed, 175 insertions(+)

diff --git a/dev-util/radare2/Manifest b/dev-util/radare2/Manifest
index 8929834b2409..942e4cb4793e 100644
--- a/dev-util/radare2/Manifest
+++ b/dev-util/radare2/Manifest
@@ -7,5 +7,10 @@ DIST radare2-5.7.6.tar.gz 10071795 BLAKE2B e0bd54fcf4a56b34ec6f3b87ab6a20a8be235
 DIST radare2-5.7.8-vector35-arm64.tar.gz 1050960 BLAKE2B 12faa86a4cdfd9cdc8e307c16d8f797ae3ee800b72e76c6ace84cb7cb5108198dbfbc9a00df6b70448628dc869c94bf8cf9794460d05be99e5a08ee5a3ed40de SHA512 478f06c3fe09232152bbb63e500a440ca8546cc11fe59f9d489a25d327469b1869fe80b4e2e2cfad8a2b96261857cf74b6708628ac30ec8dabc5da05d04c1cfd
 DIST radare2-5.7.8-vector35-armv7.tar.gz 255288 BLAKE2B ca96b3f68381a0987c4efa10dcb798194486019762e89d1eb19a3fd24f6983535eea792099c60e4c1a9d2bdb5baab119fe2e9a7a889fad5a14023e5f984959b8 SHA512 e9eb6cee02bbbb265914b1f9118c7a143ed76a201c085af5516855475bf7f3ad5f9c82d1548e85a0339fbc33e029ef0e4be9d8cef68d212ae16ce1a7f18453ff
 DIST radare2-5.7.8.tar.gz 10324020 BLAKE2B 628b0c146a8e797f34f43f8d76166fb8c5e945a45232c2e4d63b2c2ce89aef96a20349c519ceb62921bad75ce5faaa8ea51ab1dac79156e00eef8f9ef06f5a45 SHA512 7c819a052f5e4b3da72b945915fca92a747c52dc2e2fa8483a8c2d8e71479ce374efbbe2bc02b1b4af26db6a891b6e44cdbb9e062de2f13b22a258cceab561f6
+DIST radare2-5.8.2-capstone-4.0.2.tar.gz 3439542 BLAKE2B 435729a8fef2dce6495635352101b3befe563c8404efdbb0dccabecbe2bded332221665bacdbcd9043dda72b652b6f29c0e1a548cefb8c64d5b6b9dc174ed3d9 SHA512 7f93534517307b737422a8825b66b2a1f3e1cca2049465d60ab12595940154aaf843ba40ed348fce58de58b990c19a0caef289060eb72898cb008a88c470970e
+DIST radare2-5.8.2-vector35-arm64.tar.gz 1021315 BLAKE2B 8741de83cddda878536627c0ff6be1f7d4842cf0fefeae2895fe751e39768134f6048167d5aa265169bc22b229a8b66ce37f4ef4df3abc2b3e304dc1f1fe17d1 SHA512 9b0fcf9119304e90b3fbed5e0509a819a0a561953681f5e5f408b55db3b0c962dca59c48553cffef21a56772db7871a3987f0f7c07b5538fd4b7d1af005ccdb0
+DIST radare2-5.8.2-vector35-armv7.tar.gz 255278 BLAKE2B 8b5191c48fad2e7602dc2f7053f9c9ea8cca8e9bc5d68a0cdb7ccff9ecc65c5d1ff6a434e28488dbd6fb71fc7482fce08a0a69c358e5c3d6c017ac1e4cee3b21 SHA512 40c048b29856f48300d4539bc7bda38e6ceae1e8d4d9d131c4a7546b6e26b2fb96309c483b67e2c2290b06cea5fc52a7beb30557d54e89296e7734cc1ab06d10
+DIST radare2-5.8.2.tar.gz 11017554 BLAKE2B 712941ac5871f2201ba806dc7b68ae1825c8dbe896b11aaa6b086651ff28a6d3b7e54b55621e7cc143748d7760ea7007f4dc70232ef16dfe5523a0ab87f0f266 SHA512 3c09d89172ac9a5cee6e52294f10b144237acb31b3d470521a7c8650511a58d1732c73004f2dbb1e6e3c43829e3e310b89d6a8abd5f1fb4fdfd3fea8779a72ec
+DIST radare2-testbins-1f0ea409f2af83fc4d0b685855de9d3b0f9eee41.tar.gz 125596301 BLAKE2B 55b876b09150e780359e753d26143640d410c1c15ace2e29bc06d2163657af2089c5044847f107e20256875c7ea5e7cc72460010df0c662c9da933a0388a3f0e SHA512 44662f0217871a51b856f66e876eb57b2006f6350e6bcfae6629b800197b6f30196caf2474d52881a398fd1d65c68364d870b7de692c9e9a2bd1fab493afe3d0
 DIST radare2-testbins-2fdb78f7f754b3aea90377588d45b774ccb41086.tar.gz 120580683 BLAKE2B ba16206f3c44f43c36fbc3079e43d29cd5b6266f8bd31602d7ec218a2b14601173c9022be9329975bd28de948933deeecc052f56c2acd9d6dfeb5576049ec32f SHA512 2c66c8f68df7c51a52a73b33e854b095a4f5435c60eab2a1456f366376aac0f7c39836699e09eae2918f31e75b7c6562994f0916f45de53ae6a480506da95dcb
 DIST radare2-testbins-602471f72caa60d6ece43c3fa483c43decf7052c.tar.gz 124090448 BLAKE2B 446f4b730095dc263f31bbd886b350fbf3cbde0cd3bc6f5ed0c5d65a90a66b4d97a7397798c0f6fb7596722d827a3805c6d4d810d06837cf46e8798cedb1fea4 SHA512 b490ec951813827bed940ca4fc772691f8e446ce14cf2f0cc7fe2027a481c91939e6212ce94237f71091c18ac8428c9a4a4f35fc58f41ba076c1da75835d0ff4

diff --git a/dev-util/radare2/files/radare2-5.8.2-bundled-capstone.patch b/dev-util/radare2/files/radare2-5.8.2-bundled-capstone.patch
new file mode 100644
index 000000000000..31de9b72bb37
--- /dev/null
+++ b/dev-util/radare2/files/radare2-5.8.2-bundled-capstone.patch
@@ -0,0 +1,21 @@
+Need to unbundle capstone due to broken capstone-5 compatibility:
+
+https://github.com/radareorg/radare2/issues/21204
+https://bugs.gentoo.org/891805
+
+diff --git a/shlr/Makefile b/shlr/Makefile
+index 5626a061ff..5e8af3b99b 100644
+--- a/shlr/Makefile
++++ b/shlr/Makefile
+@@ -225,10 +225,7 @@ capstone-sync: capstone
+ capstone-clean:
+ 	-$(MAKE) -C capstone clean
+ 
+-capstone: capstone-$(CS_VER).tar.gz
+-	tar xzvf capstone-$(CS_VER).tar.gz
+-	rm -rf capstone
+-	mv capstone-$(CS_VER) capstone
++capstone:
+ 	$(MAKE) patch-capstone
+ 
+ # already implemented in capstone.sh

diff --git a/dev-util/radare2/files/radare2-5.8.2-vector35.patch b/dev-util/radare2/files/radare2-5.8.2-vector35.patch
new file mode 100644
index 000000000000..6b67f39b40c4
--- /dev/null
+++ b/dev-util/radare2/files/radare2-5.8.2-vector35.patch
@@ -0,0 +1,24 @@
+diff --git a/libr/arch/p/arm/v35/Makefile b/libr/arch/p/arm/v35/Makefile
+index a7a40ddb97..1ef40746ac 100644
+--- a/libr/arch/p/arm/v35/Makefile
++++ b/libr/arch/p/arm/v35/Makefile
+@@ -30,8 +30,7 @@ $(ALIBS): arch-arm64 arch-armv7
+ 
+ ## ARM64
+ arch-arm64:
+-	git clone -q https://github.com/radareorg/vector35-arch-arm64 arch-arm64
+-	cd arch-arm64 && git checkout -q radare2-wip > /dev/null && git reset --hard $(ARCH_ARM64_COMMIT)
++	cd arch-arm64
+ 
+ $(V35ARM64_HOME)/arm64dis.a arm64dis.a: $(ALIBS)
+ 	rm -f arm64dis.$(EXT_AR)
+@@ -40,8 +39,7 @@ $(V35ARM64_HOME)/arm64dis.a arm64dis.a: $(ALIBS)
+ 
+ ## ARMV7
+ arch-armv7:
+-	git clone -q https://github.com/radareorg/vector35-arch-armv7 arch-armv7
+-	cd arch-armv7 && git checkout -q radare2 > /dev/null && git reset --hard $(ARCH_ARMV7_COMMIT)
++	cd arch-armv7
+ 
+ $(V35ARMV7_HOME)/armv7dis.a armv7dis.a: $(ALIBS)
+ 	rm -f armv7dis.$(EXT_AR)

diff --git a/dev-util/radare2/radare2-5.8.2.ebuild b/dev-util/radare2/radare2-5.8.2.ebuild
new file mode 100644
index 000000000000..e54517f249a2
--- /dev/null
+++ b/dev-util/radare2/radare2-5.8.2.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 toolchain-funcs
+
+DESCRIPTION="unix-like reverse engineering framework and commandline tools"
+HOMEPAGE="https://www.radare.org"
+
+ARM64_COMMIT=c9e7242972837ac11fc94db05fabcb801a8269c9
+ARMV7_COMMIT=f270a6cc99644cb8e76055b6fa632b25abd26024
+BINS_COMMIT=1f0ea409f2af83fc4d0b685855de9d3b0f9eee41
+CAPSTONE_VER=4.0.2
+
+if [[ ${PV} == *9999 ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/radareorg/radare2"
+else
+	SRC_URI="mirror+https://github.com/radareorg/radare2/archive/${PV}.tar.gz -> ${P}.tar.gz
+		mirror+https://github.com/radareorg/vector35-arch-arm64/archive/${ARM64_COMMIT}.tar.gz -> ${P}-vector35-arm64.tar.gz
+		mirror+https://github.com/radareorg/vector35-arch-armv7/archive/${ARMV7_COMMIT}.tar.gz -> ${P}-vector35-armv7.tar.gz
+		mirror+https://codeload.github.com/capstone-engine/capstone/tar.gz/${CAPSTONE_VER} -> ${P}-capstone-${CAPSTONE_VER}.tar.gz
+		test? ( https://github.com/radareorg/radare2-testbins/archive/${BINS_COMMIT}.tar.gz -> radare2-testbins-${BINS_COMMIT}.tar.gz )
+	"
+
+	KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="ssl test"
+
+# Need to audit licenses of the binaries used for testing
+RESTRICT="fetch !test? ( test )"
+
+RDEPEND="
+	dev-libs/libzip:=
+	dev-libs/xxhash
+	sys-apps/file
+	sys-libs/zlib
+	ssl? ( dev-libs/openssl:0= )
+"
+DEPEND="
+	${RDEPEND}
+	dev-util/gperf
+"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-5.8.2-vector35.patch"
+	# Maybe temporary, https://bugs.gentoo.org/891805
+	"${FILESDIR}/${PN}-5.8.2-bundled-capstone.patch"
+)
+
+src_prepare() {
+	default
+
+	mv "${WORKDIR}/capstone-${CAPSTONE_VER}" shlr/capstone || die
+
+	# Hack for vector35 arm plugins
+	mv "${WORKDIR}/vector35-arch-arm64-${ARM64_COMMIT}" libr/arch/p/arm/v35/arch-arm64 || die
+	mv "${WORKDIR}/vector35-arch-armv7-${ARMV7_COMMIT}" libr/arch/p/arm/v35/arch-armv7 || die
+
+	if use test; then
+		cp -r "${WORKDIR}/radare2-testbins-${BINS_COMMIT}" "${S}/test/bins" || die
+		cp -r "${WORKDIR}/radare2-testbins-${BINS_COMMIT}" "${S}" || die
+	fi
+
+	# Fix hardcoded docdir for fortunes
+	sed -i -e "/^#define R2_FORTUNES/s/radare2/$PF/" \
+		libr/include/r_userconf.h.acr || die
+}
+
+src_configure() {
+	# Ideally these should be set by ./configure
+	tc-export CC AR LD OBJCOPY RANLIB
+	export HOST_CC=${CC}
+
+	econf \
+		--without-libuv \
+		--with-sysmagic \
+		--with-sysxxhash \
+		--with-syszip \
+		$(use_with ssl openssl)
+}
+
+src_test() {
+	ln -fs "${S}/binr/radare2/radare2" "${S}/binr/radare2/r2" || die
+	LDFLAGS=""
+	for i in "${S}"/libr/*; do
+		if [[ -d ${i} ]]; then
+			LDFLAGS+="-R${i} -L${i} "
+			LD_LIBRARY_PATH+=":${i}"
+		fi
+	done
+	export LDFLAGS LD_LIBRARY_PATH
+	export PKG_CONFIG_PATH="${S}/pkgcfg"
+	PATH="${S}/binr/radare2:${PATH}" emake -C test -k unit-tests || die
+}
+
+src_install() {
+	default
+
+	insinto /usr/share/zsh/site-functions
+	doins doc/zsh/_*
+
+	newbashcomp doc/bash_autocompletion.sh "${PN}"
+	bashcomp_alias "${PN}" rafind2 r2 rabin2 rasm2 radiff2
+
+	# a workaround for unstable $(INSTALL) call, bug #574866
+	local d
+	for d in doc/*; do
+		if [[ -d ${d} ]]; then
+			rm -rfv "${d}" || die "failed to delete '${d}'"
+		fi
+	done
+
+	# These are not really docs. radare assumes
+	# uncompressed files: bug #761250
+	docompress -x /usr/share/doc/${PF}/fortunes.{creepy,fun,nsfw,tips}
+
+	# Create plugins directory although it's currently unsupported by radare2
+	keepdir "/usr/$(get_libdir)/radare2/${PV}" || die
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/radare2/, dev-util/radare2/files/
@ 2022-04-25  6:57 Joonas Niilola
  0 siblings, 0 replies; 6+ messages in thread
From: Joonas Niilola @ 2022-04-25  6:57 UTC (permalink / raw
  To: gentoo-commits

commit:     48627ba2203445afedb3eb0e99c24cf931896f1e
Author:     David Roman <davidroman96 <AT> gmail <DOT> com>
AuthorDate: Fri Apr 22 10:45:36 2022 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Mon Apr 25 06:56:56 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=48627ba2

dev-util/radare2: verbump to 5.6.8

Bug: https://bugs.gentoo.org/831057
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: David Roman <davidroman96 <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/25155
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 dev-util/radare2/Manifest                  |   3 +
 dev-util/radare2/files/CVE-2022-1437.patch |  72 +++++++++++++++++++
 dev-util/radare2/radare2-5.6.8.ebuild      | 109 +++++++++++++++++++++++++++++
 3 files changed, 184 insertions(+)

diff --git a/dev-util/radare2/Manifest b/dev-util/radare2/Manifest
index 38f5a0afce87..37816a87aff6 100644
--- a/dev-util/radare2/Manifest
+++ b/dev-util/radare2/Manifest
@@ -1,4 +1,7 @@
 DIST radare2-5.5.4-vector35-arm64.tar.gz 1021299 BLAKE2B 389bdc43e90ba71961e5d8afca495bd63b25d4c0dc9513c5e9cc0770f091199197dc1e4b8a9d4c57206acfd892a6b4ff9ba8b0f925e493f540956c64edfcd809 SHA512 7762cee60acc7605c2c127acab646c5c58c5736e6801058eec69c2da52901d0ecab85b0496d798be6403bedf27ffd4fe4e3a8d47c8802af1fe3805a4ac32ae26
 DIST radare2-5.5.4-vector35-armv7.tar.gz 255288 BLAKE2B ca96b3f68381a0987c4efa10dcb798194486019762e89d1eb19a3fd24f6983535eea792099c60e4c1a9d2bdb5baab119fe2e9a7a889fad5a14023e5f984959b8 SHA512 e9eb6cee02bbbb265914b1f9118c7a143ed76a201c085af5516855475bf7f3ad5f9c82d1548e85a0339fbc33e029ef0e4be9d8cef68d212ae16ce1a7f18453ff
 DIST radare2-5.5.4.tar.gz 9610424 BLAKE2B 4e113d854a55597270663f9c18f1d71da21fa8e539a997773f30178e93de54d397f56103813ec2c60cfabdf2d811151ad7285fc479e1ee681687831030e18da2 SHA512 b64268a8fcfbd89455b991557c82bb24d5f42471f4424cd971c1143ff604720fb4c00216a7054d72df6bbbdace1b814a6c3538708926c229dd2f8476b7d325da
+DIST radare2-5.6.8-vector35-arm64.tar.gz 1021299 BLAKE2B 389bdc43e90ba71961e5d8afca495bd63b25d4c0dc9513c5e9cc0770f091199197dc1e4b8a9d4c57206acfd892a6b4ff9ba8b0f925e493f540956c64edfcd809 SHA512 7762cee60acc7605c2c127acab646c5c58c5736e6801058eec69c2da52901d0ecab85b0496d798be6403bedf27ffd4fe4e3a8d47c8802af1fe3805a4ac32ae26
+DIST radare2-5.6.8-vector35-armv7.tar.gz 255288 BLAKE2B ca96b3f68381a0987c4efa10dcb798194486019762e89d1eb19a3fd24f6983535eea792099c60e4c1a9d2bdb5baab119fe2e9a7a889fad5a14023e5f984959b8 SHA512 e9eb6cee02bbbb265914b1f9118c7a143ed76a201c085af5516855475bf7f3ad5f9c82d1548e85a0339fbc33e029ef0e4be9d8cef68d212ae16ce1a7f18453ff
+DIST radare2-5.6.8.tar.gz 9627480 BLAKE2B 4de904ee779b72f0a0e305170cdf62b3a4c3fdad768bb2c9a96a90b429c94c2bae1523439d5b869d2fefed89849fde1d996dd1de400fe47ea657bee3dd258fe1 SHA512 e29a3ff235f37bcde4ec6c1c97d1b9c521b57e93512ca40d71be9e88ac1c002f41af905865fdf4685ee94287425cff32500b5a111eec5594bdd7f32f05631910
 DIST radare2-testbins-a6d1a0331605b4a5db9aa9260386c850d484dc70.tar.gz 118148516 BLAKE2B 9b1a1861b4aea7db1cc364d16577a2b7afe082b0838178d307ed24704710edfa572533bab9b194d38c1b294e5a4fb522d1a93e92a1c577ca6622a16d94209bd5 SHA512 8888fab0d2295e92c4bd0ab4c2ba646951e41cc4c1f9915d501a27fbff21e82d5340d1a9255d998dcf0e209a57bb35fc714adcb31ed7adb58aa412f6202e69c6

diff --git a/dev-util/radare2/files/CVE-2022-1437.patch b/dev-util/radare2/files/CVE-2022-1437.patch
new file mode 100644
index 000000000000..16e67c5d3193
--- /dev/null
+++ b/dev-util/radare2/files/CVE-2022-1437.patch
@@ -0,0 +1,72 @@
+--- a/libr/bin/format/mach0/coresymbolication.c
++++ b/libr/bin/format/mach0/coresymbolication.c
+@@ -269,6 +269,9 @@ RCoreSymCacheElement *r_coresym_cache_element_new(RBinFile *bf, RBuffer *buf, ut
+ 		for (i = 0; i < hdr->n_sections && cursor < end; i++) {
+ 			ut8 *sect_start = cursor;
+ 			RCoreSymCacheElementSection *sect = &result->sections[i];
++			if (cursor + (word_size * 4) > end) {
++				goto beach;
++			}
+ 			sect->vaddr = sect->paddr = r_read_ble (cursor, false, bits);
+ 			if (sect->vaddr < page_zero_size) {
+ 				sect->vaddr += page_zero_size;
+@@ -359,6 +362,10 @@ RCoreSymCacheElement *r_coresym_cache_element_new(RBinFile *bf, RBuffer *buf, ut
+ 				continue;
+ 			}
+ 			string_origin = relative_to_strings? b + start_of_strings : cursor;
++			if (!string_origin) {
++				cursor += R_CS_EL_SIZE_LSYM;
++				continue;
++			}
+ 			lsym->flc.file = str_dup_safe (b, string_origin + file_name_off, end);
+ 			if (!lsym->flc.file) {
+ 				cursor += R_CS_EL_SIZE_LSYM;
+--- a/libr/bin/p/bin_symbols.c
++++ b/libr/bin/p/bin_symbols.c
+@@ -353,28 +353,30 @@ static bool check_buffer(RBinFile *bf, RBuffer *b) {
+ }
+ 
+ static RList *symbols(RBinFile *bf) {
+-	RList *res = r_list_newf ((RListFree)r_bin_symbol_free);
+-	r_return_val_if_fail (res && bf->o && bf->o->bin_obj, res);
++	r_return_val_if_fail (bf && bf->o && bf->o->bin_obj, NULL);
+ 	RCoreSymCacheElement *element = bf->o->bin_obj;
+ 	size_t i;
+ 	HtUU *hash = ht_uu_new0 ();
+ 	if (!hash) {
+-		return res;
++		return NULL;
+ 	}
++	RList *res = r_list_newf ((RListFree)r_bin_symbol_free);
+ 	bool found = false;
+-	for (i = 0; i < element->hdr->n_lined_symbols; i++) {
+-		RCoreSymCacheElementSymbol *sym = (RCoreSymCacheElementSymbol *)&element->lined_symbols[i];
+-		if (!sym) {
+-			break;
+-		}
+-		ht_uu_find (hash, sym->paddr, &found);
+-		if (found) {
+-			continue;
+-		}
+-		RBinSymbol *s = bin_symbol_from_symbol (element, sym);
+-		if (s) {
+-			r_list_append (res, s);
+-			ht_uu_insert (hash, sym->paddr, 1);
++	if (element->lined_symbols) {
++		for (i = 0; i < element->hdr->n_lined_symbols; i++) {
++			RCoreSymCacheElementSymbol *sym = (RCoreSymCacheElementSymbol *)&element->lined_symbols[i];
++			if (!sym) {
++				break;
++			}
++			ht_uu_find (hash, sym->paddr, &found);
++			if (found) {
++				continue;
++			}
++			RBinSymbol *s = bin_symbol_from_symbol (element, sym);
++			if (s) {
++				r_list_append (res, s);
++				ht_uu_insert (hash, sym->paddr, 1);
++			}
+ 		}
+ 	}
+ 	if (element->symbols) {

diff --git a/dev-util/radare2/radare2-5.6.8.ebuild b/dev-util/radare2/radare2-5.6.8.ebuild
new file mode 100644
index 000000000000..f767f59da719
--- /dev/null
+++ b/dev-util/radare2/radare2-5.6.8.ebuild
@@ -0,0 +1,109 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 toolchain-funcs
+
+DESCRIPTION="unix-like reverse engineering framework and commandline tools"
+HOMEPAGE="https://www.radare.org"
+
+ARM64_COMMIT=3c5eaba46dab72ecb7d5f5b865a13fdeee95b464
+ARMV7_COMMIT=dde39f69ffea19fc37e681874b12cb4707bc4f30
+BINS_COMMIT=a6d1a0331605b4a5db9aa9260386c850d484dc70
+
+if [[ ${PV} == *9999 ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/radareorg/radare2"
+else
+	SRC_URI="mirror+https://github.com/radareorg/radare2/archive/${PV}.tar.gz -> ${P}.tar.gz
+		mirror+https://github.com/radareorg/vector35-arch-arm64/archive/${ARM64_COMMIT}.tar.gz -> ${P}-vector35-arm64.tar.gz
+		mirror+https://github.com/radareorg/vector35-arch-armv7/archive/${ARMV7_COMMIT}.tar.gz -> ${P}-vector35-armv7.tar.gz
+		test? ( https://github.com/radareorg/radare2-testbins/archive/${BINS_COMMIT}.tar.gz -> radare2-testbins-${BINS_COMMIT}.tar.gz )
+	"
+
+	KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="ssl test"
+
+# Need to audit licenses of the binaries used for testing
+RESTRICT="fetch test"
+
+RDEPEND="
+	dev-libs/libzip:=
+	dev-libs/xxhash
+	sys-apps/file
+	sys-libs/zlib
+	dev-libs/capstone:0=
+	ssl? ( dev-libs/openssl:0= )
+"
+DEPEND="
+	${RDEPEND}
+	dev-util/gperf
+"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=( "${FILESDIR}/CVE-2022-1437.patch" "${FILESDIR}/${PN}-5.5.0-vector35.patch" )
+
+src_prepare() {
+	default
+
+	# Hack for vector35 arm plugins
+	mv "${WORKDIR}/vector35-arch-arm64-${ARM64_COMMIT}" libr/asm/arch/arm/v35arm64/arch-arm64 || die
+	mv "${WORKDIR}/vector35-arch-armv7-${ARMV7_COMMIT}" libr/asm/arch/arm/v35arm64/arch-armv7 || die
+
+	if use test; then
+		cp -r "${WORKDIR}/radare2-testbins-${BINS_COMMIT}" "${S}/test/bins" || die
+		cp -r "${WORKDIR}/radare2-testbins-${BINS_COMMIT}" "${S}" || die
+	fi
+
+	# Fix hardcoded docdir for fortunes
+	sed -i -e "/^#define R2_FORTUNES/s/radare2/$PF/" \
+		libr/include/r_userconf.h.acr
+}
+
+src_configure() {
+	# Ideally these should be set by ./configure
+	tc-export CC AR LD OBJCOPY RANLIB
+	export HOST_CC=${CC}
+
+	econf \
+		--without-libuv \
+		--with-syscapstone \
+		--with-sysmagic \
+		--with-sysxxhash \
+		--with-syszip \
+		$(use_with ssl openssl)
+}
+
+src_install() {
+	default
+
+	insinto /usr/share/zsh/site-functions
+	doins doc/zsh/_*
+
+	newbashcomp doc/bash_autocompletion.sh "${PN}"
+	bashcomp_alias "${PN}" rafind2 r2 rabin2 rasm2 radiff2
+
+	# a workaround for unstable $(INSTALL) call, bug #574866
+	local d
+	for d in doc/*; do
+		if [[ -d ${d} ]]; then
+			rm -rfv "${d}" || die "failed to delete '${d}'"
+		fi
+	done
+
+	# These are not really docs. radare assumes
+	# uncompressed files: bug #761250
+	docompress -x /usr/share/doc/${PF}/fortunes.{creepy,fun,nsfw,tips}
+
+	# Create plugins directory although it's currently unsupported by radare2
+	keepdir "/usr/$(get_libdir)/radare2/${PV}" || die
+}
+
+src_test() {
+	emake -C test -k unit_tests || die
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/radare2/, dev-util/radare2/files/
@ 2019-06-22  8:21 Sergei Trofimovich
  0 siblings, 0 replies; 6+ messages in thread
From: Sergei Trofimovich @ 2019-06-22  8:21 UTC (permalink / raw
  To: gentoo-commits

commit:     677a68abfac2720af13042540adbb5f43b6475c3
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 22 08:21:01 2019 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sat Jun 22 08:21:44 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=677a68ab

dev-util/radare2: fix double-free in cmd_mount.c, bug #688336

Reported-by: D'juan McDonald (domhnall)
Bug: https://bugs.gentoo.org/688336
Package-Manager: Portage-2.3.67, Repoman-2.3.15
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 .../radare2/files/radare2-3.5.1-mount-free.patch   | 22 ++++++++
 dev-util/radare2/radare2-3.5.1-r1.ebuild           | 60 ++++++++++++++++++++++
 2 files changed, 82 insertions(+)

diff --git a/dev-util/radare2/files/radare2-3.5.1-mount-free.patch b/dev-util/radare2/files/radare2-3.5.1-mount-free.patch
new file mode 100644
index 00000000000..ad27596fc12
--- /dev/null
+++ b/dev-util/radare2/files/radare2-3.5.1-mount-free.patch
@@ -0,0 +1,22 @@
+https://bugs.gentoo.org/688336
+
+From 40453029179d230cf02ffed205f2d63e33981b8f Mon Sep 17 00:00:00 2001
+From: pancake <pancake@nopcode.org>
+Date: Mon, 17 Jun 2019 11:34:49 +0200
+Subject: [PATCH] Fix #14334 - Double-free in ms command
+
+---
+ libr/core/cmd_mount.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/libr/core/cmd_mount.c
++++ b/libr/core/cmd_mount.c
+@@ -471,7 +471,7 @@ static int cmd_mount(void *data, const char *_input) {
+ 			rli->completion.run_user = rli->user;
+ 			r_line_completion_set (&rli->completion, ms_argc, ms_argv);
+ 			r_fs_shell_prompt (&shell, core->fs, input);
+-			free (cwd);
++			R_FREE (cwd);
+ 			r_pvector_clear (&rli->completion.args);
+ 			memcpy (&rli->completion, &c, sizeof (c));
+ 		}

diff --git a/dev-util/radare2/radare2-3.5.1-r1.ebuild b/dev-util/radare2/radare2-3.5.1-r1.ebuild
new file mode 100644
index 00000000000..781c3273fe4
--- /dev/null
+++ b/dev-util/radare2/radare2-3.5.1-r1.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit bash-completion-r1 eutils
+
+DESCRIPTION="unix-like reverse engineering framework and commandline tools"
+HOMEPAGE="http://www.radare.org"
+
+if [[ ${PV} == *9999 ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/radare/radare2"
+else
+	SRC_URI="https://github.com/radare/radare2/archive/${PV}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="ssl libressl"
+
+RDEPEND="
+	dev-libs/capstone:0=
+	ssl? (
+		!libressl? ( dev-libs/openssl:0= )
+		libressl? ( dev-libs/libressl:0= )
+	)
+"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-3.5.1-mount-free.patch
+)
+
+src_configure() {
+	econf \
+		--without-libuv \
+		--with-syscapstone \
+		$(use_with ssl openssl)
+}
+
+src_install() {
+	default
+
+	insinto /usr/share/zsh/site-functions
+	doins doc/zsh/_*
+
+	newbashcomp doc/bash_autocompletion.sh "${PN}"
+	bashcomp_alias "${PN}" rafind2 r2 rabin2 rasm2 radiff2
+
+	# a workaround for unstable $(INSTALL) call, bug #574866
+	local d
+	for d in doc/*; do
+		if [[ -d $d ]]; then
+			rm -rfv "$d" || die "failed to delete '$d'"
+		fi
+	done
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/radare2/, dev-util/radare2/files/
@ 2017-01-11 11:06 Sergei Trofimovich
  0 siblings, 0 replies; 6+ messages in thread
From: Sergei Trofimovich @ 2017-01-11 11:06 UTC (permalink / raw
  To: gentoo-commits

commit:     7eaff6c31b22e5345e03702148ef52866c8ba283
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 11 11:05:41 2017 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Wed Jan 11 11:05:55 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7eaff6c3

dev-util/radare2: backport eroen's openssl-1.1.0c fix

Bug: https://bugs.gentoo.org/604576

Package-Manager: Portage-2.3.3_p18, Repoman-2.3.1_p11

 .../files/radare2-1.1.0-openssl-1.1.0c.patch       | 31 ++++++++++++++++++++++
 dev-util/radare2/radare2-1.1.0.ebuild              |  3 ++-
 2 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/dev-util/radare2/files/radare2-1.1.0-openssl-1.1.0c.patch b/dev-util/radare2/files/radare2-1.1.0-openssl-1.1.0c.patch
new file mode 100644
index 00000000..28e2f55
--- /dev/null
+++ b/dev-util/radare2/files/radare2-1.1.0-openssl-1.1.0c.patch
@@ -0,0 +1,31 @@
+commit ecd8cf26c2647a1f455595209fcf2d6bfb72240f
+Author: eroen <eroen@users.noreply.github.com>
+Date:   Tue Jan 3 23:45:07 2017 +0100
+
+    Disable deprecated initialization for openssl 1.1.0 (#6423)
+    
+    Openssl 1.1.0 handles this initialization internally. Leaving the calls in
+    place causes "undefined reference" errors if openssl was built with
+    `--api=1.1.0`.
+    
+    X-Gentoo-Bug: 604576
+    X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=604576
+
+diff --git a/libr/socket/socket.c b/libr/socket/socket.c
+index 1e30120fb..1ba87e77e 100755
+--- a/libr/socket/socket.c
++++ b/libr/socket/socket.c
+@@ -116,11 +116,13 @@ R_API RSocket *r_socket_new (int is_ssl) {
+ 		s->sfd = NULL;
+ 		s->ctx = NULL;
+ 		s->bio = NULL;
++#if OPENSSL_VERSION_NUMBER < 0x1010000fL
+ 		if (!SSL_library_init ()) {
+ 			r_socket_free (s);
+ 			return NULL;
+ 		}
+ 		SSL_load_error_strings ();
++#endif
+ 	}
+ #endif
+ 	return s;

diff --git a/dev-util/radare2/radare2-1.1.0.ebuild b/dev-util/radare2/radare2-1.1.0.ebuild
index ed05b06..a7480ac 100644
--- a/dev-util/radare2/radare2-1.1.0.ebuild
+++ b/dev-util/radare2/radare2-1.1.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -22,6 +22,7 @@ DEPEND="${RDEPEND}
 "
 src_prepare() {
 	epatch "${FILESDIR}"/${PN}-0.9.9-nogit.patch
+	epatch "${FILESDIR}"/${P}-openssl-1.1.0c.patch
 }
 
 src_configure() {


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-09-14  7:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-12 23:06 [gentoo-commits] repo/gentoo:master commit in: dev-util/radare2/, dev-util/radare2/files/ Sergei Trofimovich
  -- strict thread matches above, loose matches on Subject: below --
2024-09-14  7:14 Joonas Niilola
2023-01-23  4:32 John Helmert III
2022-04-25  6:57 Joonas Niilola
2019-06-22  8:21 Sergei Trofimovich
2017-01-11 11:06 Sergei Trofimovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox