Hey,
Here's an update to radare2.
Notes:
- switch back to GH distfile.
- No longer needs treesitter.
- Now needs an extra distfile for some aarch64 support.
- Tests mostly work, but some fail due to our old capstone (upstream tends to
embed a newer version, we tell the build to use the system one)
I'm not sure if we'd need to update cutter at the same time? I've not had time
to look into that yet.
Index: main/Makefile
===================================================================
RCS file: /cvs/ports/devel/radare2/main/Makefile,v
retrieving revision 1.25
diff -u -p -r1.25 Makefile
--- main/Makefile 15 Jan 2021 19:01:31 -0000 1.25
+++ main/Makefile 20 Oct 2021 09:16:16 -0000
@@ -1,25 +1,24 @@
# $OpenBSD: Makefile,v 1.25 2021/01/15 19:01:31 jasper Exp $
+# Note that the build may fail if an older radare2 is installed.
+
COMMENT = libre and portable reverse engineering framework
-V = 4.5.1
+V = 5.4.2
SUBST_VARS += V
GH_PROJECT = radare2
GH_TAGNAME = ${V}
-# When updating, use the output from the command below to set
-# the extra distfiles so as not to invoke clone_3rd_repo.sh during build:
-# grep -E '^TS_TIP' ${WRKSRC}/shlr/Makefile
-TREESITTER_COMMIT = 86a5dabb
-MASTER_SITES0 =
https://github.com/tree-sitter/tree-sitter/archive/
+# When updating, grep the sources for `ARCH_ARM64_COMMIT`.
+VECTOR35_ARM64_COMMIT = 58379159
+MASTER_SITES0 =
https://github.com/radareorg/vector35-arch-arm64/archive/
-MASTER_SITES = https://distfiles.sigtrap.nl/
DISTFILES = ${DISTNAME}${EXTRACT_SUFX} \
- treesitter-{}${TREESITTER_COMMIT}.tar.gz:0
+ vector35-arch-arm64-{}${VECTOR35_ARM64_COMMIT}.tar.gz:0
# In radare, all libs have the same version
-LIBV = 8.0 # 4.4.0
+LIBV = 9.0 # 5.4.2
.for _lib in r_anal r_asm r_bin r_bp r_config r_cons r_core \
r_crypto r_debug r_egg r_flag r_fs r_hash r_io r_lang \
r_main r_magic r_parse r_reg r_search r_socket \
@@ -28,7 +27,7 @@ SHARED_LIBS+= ${_lib} ${LIBV}
.endfor
# uses pledge()
-WANTLIB = c capstone crypto kvm m pthread ssl util uv z zip
+WANTLIB = c capstone crypto kvm m pthread ssl uv z zip
DEBUG_PACKAGES = ${BUILD_PACKAGES}
@@ -47,19 +46,18 @@ CONFIGURE_ENV += LDFLAGS="-L${LOCALBASE}
MAKE_ENV = HOST_CC="${CC}"
# Requires downloading a number of test binaries
+# Expect test failures, as we use an older capstone than r2 embeds by default.
TEST_DEPENDS = devel/git \
- textproc/jq
+ textproc/jq \
+ ${BASE_PKGPATH}=${V}
TEST_IS_INTERACTIVE = Yes
TEST_TARGET = tests
post-extract:
- mv ${WRKDIR}/tree-sitter-${TREESITTER_COMMIT}*
${WRKSRC}/shlr/tree-sitter
+ mv ${WRKDIR}/vector35-arch-arm64-${VECTOR35_ARM64_COMMIT}* \
+ ${WRKSRC}/libr/asm/arch/arm/v35arm64/arch-arm64
post-patch:
sed -i 's/>mips/>mipsen/' ${WRKSRC}/libr/anal/p/anal_mips_cs.c
-
-# https://github.com/radare/radare2/blob/master/doc/capstone.md
-post-configure:
- sed -i 's|include/capstone|include|' ${WRKSRC}/config-user.mk
.include <bsd.port.mk>
Index: main/distinfo
===================================================================
RCS file: /cvs/ports/devel/radare2/main/distinfo,v
retrieving revision 1.14
diff -u -p -r1.14 distinfo
--- main/distinfo 12 Sep 2020 08:47:37 -0000 1.14
+++ main/distinfo 16 Oct 2021 16:30:18 -0000
@@ -1,4 +1,4 @@
-SHA256 (radare2-4.5.1.tar.gz) = ToWzWYe9LKWIGtlYWXC5cP5zdIFL04O9HNYulhoMIos=
-SHA256 (treesitter-86a5dabb.tar.gz) =
Mowg7lh22eiae2r+omKusi+7SIpLWG95CRVD1gbo+Pc=
-SIZE (radare2-4.5.1.tar.gz) = 8266567
-SIZE (treesitter-86a5dabb.tar.gz) = 495011
+SHA256 (radare2-5.4.2.tar.gz) = 08M36JPX0efVr4tSevPURpySiY8CSfG2Jj6jMlyUVbk=
+SHA256 (vector35-arch-arm64-58379159.tar.gz) =
QSv7HKFm9eqDPwhj6PtMaEaYs3ewcEz73jTVxtsdkrU=
+SIZE (radare2-5.4.2.tar.gz) = 9523813
+SIZE (vector35-arch-arm64-58379159.tar.gz) = 1021232
Index: main/patches/patch-binr_rules_mk
===================================================================
RCS file: /cvs/ports/devel/radare2/main/patches/patch-binr_rules_mk,v
retrieving revision 1.3
diff -u -p -r1.3 patch-binr_rules_mk
--- main/patches/patch-binr_rules_mk 1 Nov 2019 15:54:58 -0000 1.3
+++ main/patches/patch-binr_rules_mk 18 Oct 2021 16:24:04 -0000
@@ -6,12 +6,12 @@ and this interferes badly with lld
Index: binr/rules.mk
--- binr/rules.mk.orig
+++ binr/rules.mk
-@@ -3,7 +3,7 @@ include ../../libr/config.mk
- include ../../shlr/zip/deps.mk
+@@ -13,7 +13,7 @@ endif
+ endif
- ifeq (,$(findstring tcc,${CC}))
+ ifeq ($(USE_PIE),1)
-CFLAGS+=-pie
+#CFLAGS+=-pie
endif
- CFLAGS+=-I$(LTOP)/include
+ CFLAGS:=-I$(LTOP)/include -I$(LTOP)/include/sdb $(CFLAGS)
Index: main/patches/patch-libr_Makefile
===================================================================
RCS file: /cvs/ports/devel/radare2/main/patches/patch-libr_Makefile,v
retrieving revision 1.10
diff -u -p -r1.10 patch-libr_Makefile
--- main/patches/patch-libr_Makefile 12 Sep 2020 08:47:37 -0000 1.10
+++ main/patches/patch-libr_Makefile 16 Oct 2021 16:15:09 -0000
@@ -5,7 +5,7 @@ Remove library symlinks
Index: libr/Makefile
--- libr/Makefile.orig
+++ libr/Makefile
-@@ -228,7 +228,6 @@ install: install-includes install-pkgconfig
+@@ -230,7 +230,6 @@ install: install-includes install-pkgconfig
echo " ${DESTDIR}${LIBDIR}/$(call
libpath-to-name-version,$(lib),${LIBVERSION})"; \
rm -f "${DESTDIR}${LIBDIR}/$(call
libpath-to-name-version,$(lib),${LIBVERSION})"; \
${INSTALL_LIB} "$(lib)" "${DESTDIR}${LIBDIR}/$(call
libpath-to-name-version,$(lib),${LIBVERSION})"; \
Index: main/pkg/PLIST
===================================================================
RCS file: /cvs/ports/devel/radare2/main/pkg/PLIST,v
retrieving revision 1.16
diff -u -p -r1.16 PLIST
--- main/pkg/PLIST 21 Jul 2020 07:41:51 -0000 1.16
+++ main/pkg/PLIST 18 Oct 2021 13:44:14 -0000
@@ -13,8 +13,10 @@ bin/r2pm
@bin bin/rarun2
@bin bin/rasign2
@bin bin/rasm2
+@bin bin/ravc2
@bin bin/rax2
include/libr/
+include/libr/ptrace_wrap.h
include/libr/r2naked.h
include/libr/r_agraph.h
include/libr/r_anal.h
@@ -25,6 +27,7 @@ include/libr/r_bind.h
include/libr/r_binheap.h
include/libr/r_bp.h
include/libr/r_cmd.h
+include/libr/r_codemeta.h
include/libr/r_config.h
include/libr/r_cons.h
include/libr/r_core.h
@@ -58,20 +61,22 @@ include/libr/r_regex.h
include/libr/r_search.h
include/libr/r_sign.h
include/libr/r_skiplist.h
+include/libr/r_skyline.h
include/libr/r_socket.h
include/libr/r_syscall.h
include/libr/r_th.h
include/libr/r_types.h
include/libr/r_types_base.h
+include/libr/r_types_overflow.h
include/libr/r_userconf.h
include/libr/r_util/
include/libr/r_util.h
include/libr/r_util/pj.h
include/libr/r_util/r_alloc.h
-include/libr/r_util/r_annotated_code.h
include/libr/r_util/r_ascii_table.h
include/libr/r_util/r_asn1.h
include/libr/r_util/r_assert.h
+include/libr/r_util/r_axml.h
include/libr/r_util/r_base64.h
include/libr/r_util/r_base91.h
include/libr/r_util/r_big.h
@@ -79,15 +84,16 @@ include/libr/r_util/r_bitmap.h
include/libr/r_util/r_buf.h
include/libr/r_util/r_cache.h
include/libr/r_util/r_ctypes.h
-include/libr/r_util/r_date.h
include/libr/r_util/r_debruijn.h
include/libr/r_util/r_event.h
include/libr/r_util/r_file.h
include/libr/r_util/r_graph.h
+include/libr/r_util/r_graph_drawable.h
include/libr/r_util/r_hex.h
include/libr/r_util/r_idpool.h
include/libr/r_util/r_intervaltree.h
include/libr/r_util/r_itv.h
+include/libr/r_util/r_json.h
include/libr/r_util/r_log.h
include/libr/r_util/r_mem.h
include/libr/r_util/r_name.h
@@ -118,11 +124,12 @@ include/libr/r_util/r_uleb128.h
include/libr/r_util/r_utf16.h
include/libr/r_util/r_utf32.h
include/libr/r_util/r_utf8.h
+include/libr/r_util/r_w32.h
include/libr/r_util/r_x509.h
include/libr/r_vector.h
include/libr/r_version.h
+include/libr/rvc.h
include/libr/sdb/
-include/libr/sdb.h
include/libr/sdb/buffer.h
include/libr/sdb/cdb.h
include/libr/sdb/cdb_make.h
@@ -130,6 +137,7 @@ include/libr/sdb/config.h
include/libr/sdb/dict.h
include/libr/sdb/ht_inc.h
include/libr/sdb/ht_pp.h
+include/libr/sdb/ht_pu.h
include/libr/sdb/ht_up.h
include/libr/sdb/ht_uu.h
include/libr/sdb/ls.h
@@ -154,6 +162,10 @@ include/libr/sflib/darwin-x86-64/
include/libr/sflib/darwin-x86-64/sflib.h
include/libr/sflib/darwin-x86-64/sfsyscall.h
include/libr/sflib/darwin-x86-64/sfsysnr.h
+include/libr/sflib/freebsd-x86-32/
+include/libr/sflib/freebsd-x86-32/sflib.h
+include/libr/sflib/freebsd-x86-32/sfsyscall.h
+include/libr/sflib/freebsd-x86-32/sfsysnr.h
include/libr/sflib/linux-arm-32/
include/libr/sflib/linux-arm-32/sflib.h
include/libr/sflib/linux-arm-32/sfsyscall.h
@@ -170,6 +182,7 @@ include/libr/sflib/linux-x86-64/
include/libr/sflib/linux-x86-64/sflib.h
include/libr/sflib/linux-x86-64/sfsyscall.h
include/libr/sflib/linux-x86-64/sfsysnr.h
+lib/arm64dis.a
@lib lib/libr_anal.so.${LIBr_anal_VERSION}
@lib lib/libr_asm.so.${LIBr_asm_VERSION}
@lib lib/libr_bin.so.${LIBr_bin_VERSION}
@@ -190,7 +203,6 @@ include/libr/sflib/linux-x86-64/sfsysnr.
@lib lib/libr_parse.so.${LIBr_parse_VERSION}
@lib lib/libr_reg.so.${LIBr_reg_VERSION}
@lib lib/libr_search.so.${LIBr_search_VERSION}
-@static-lib lib/libr_shlr.a
@lib lib/libr_socket.so.${LIBr_socket_VERSION}
@lib lib/libr_syscall.so.${LIBr_syscall_VERSION}
@lib lib/libr_util.so.${LIBr_util_VERSION}
@@ -231,7 +243,9 @@ lib/radare2/last
@man man/man1/ragg2.1
@man man/man1/rahash2.1
@man man/man1/rarun2.1
+@man man/man1/rasign2.1
@man man/man1/rasm2.1
+@man man/man1/ravc2.1
@man man/man1/rax2.1
@man man/man7/esil.7
share/doc/pkg-readmes/${PKGSTEM}
@@ -243,7 +257,6 @@ share/doc/radare2/bash_autocompletion.sh
share/doc/radare2/brainfuck.md
share/doc/radare2/calling-conventions.md
share/doc/radare2/capstone.md
-share/doc/radare2/cows128.data
share/doc/radare2/crosscompile
share/doc/radare2/debug-internals.md
share/doc/radare2/debug.md
@@ -253,9 +266,7 @@ share/doc/radare2/dwarf-line.rsc
share/doc/radare2/emscripten.md
share/doc/radare2/esil.md
share/doc/radare2/flirt.md
-share/doc/radare2/fortunes.creepy
share/doc/radare2/fortunes.fun
-share/doc/radare2/fortunes.nsfw
share/doc/radare2/fortunes.tips
share/doc/radare2/freebsd.md
share/doc/radare2/gdb.md
@@ -291,6 +302,7 @@ share/doc/radare2/repo
share/doc/radare2/rgraph.md
share/doc/radare2/sdb_ordinal.md
share/doc/radare2/siol.md
+share/doc/radare2/snap.md
share/doc/radare2/solaris.md
share/doc/radare2/static-plugins
share/doc/radare2/statis.md
@@ -305,10 +317,16 @@ share/doc/radare2/windows.md
share/doc/radare2/yara.md
share/radare2/
share/radare2/${V}/
+share/radare2/${V}/charsets/
+share/radare2/${V}/charsets/ascii.sdb
+share/radare2/${V}/charsets/ebcdic37.sdb
+share/radare2/${V}/charsets/pokered.sdb
share/radare2/${V}/cons/
share/radare2/${V}/cons/ayu
share/radare2/${V}/cons/basic
share/radare2/${V}/cons/behelit
+share/radare2/${V}/cons/bluy
+share/radare2/${V}/cons/bobcrawl
share/radare2/${V}/cons/bold
share/radare2/${V}/cons/bright
share/radare2/${V}/cons/cga
@@ -316,7 +334,6 @@ share/radare2/${V}/cons/consonance
share/radare2/${V}/cons/cutter
share/radare2/${V}/cons/dark
share/radare2/${V}/cons/darkda
-share/radare2/${V}/cons/defragger
share/radare2/${V}/cons/focus
share/radare2/${V}/cons/gb
share/radare2/${V}/cons/gentoo
@@ -334,7 +351,6 @@ share/radare2/${V}/cons/tango
share/radare2/${V}/cons/twilight
share/radare2/${V}/cons/white
share/radare2/${V}/cons/white2
-share/radare2/${V}/cons/xvilka
share/radare2/${V}/cons/zenburn
share/radare2/${V}/fcnsign/
share/radare2/${V}/fcnsign/cc-arm-16.sdb
@@ -348,7 +364,9 @@ share/radare2/${V}/fcnsign/cc-mips-64.sd
share/radare2/${V}/fcnsign/cc-ppc-32.sdb
share/radare2/${V}/fcnsign/cc-ppc-64.sdb
share/radare2/${V}/fcnsign/cc-riscv-64.sdb
+share/radare2/${V}/fcnsign/cc-s390-64.sdb
share/radare2/${V}/fcnsign/cc-sparc-32.sdb
+share/radare2/${V}/fcnsign/cc-v850-32.sdb
share/radare2/${V}/fcnsign/cc-x86-16.sdb
share/radare2/${V}/fcnsign/cc-x86-32.sdb
share/radare2/${V}/fcnsign/cc-x86-64.sdb
@@ -418,7 +436,6 @@ share/radare2/${V}/format/dll/MSACM.sdb
share/radare2/${V}/format/dll/MSACMMAP.sdb
share/radare2/${V}/format/dll/MSDOS.sdb
share/radare2/${V}/format/dll/MSDOSD.sdb
-share/radare2/${V}/format/dll/MSGSRV32.sdb
share/radare2/${V}/format/dll/MSJSTICK.sdb
share/radare2/${V}/format/dll/MSMIXMGR.sdb
share/radare2/${V}/format/dll/MSPCIC.sdb
@@ -460,8 +477,6 @@ share/radare2/${V}/format/dll/SYSTEM.sdb
share/radare2/${V}/format/dll/SYSTHUNK.sdb
share/radare2/${V}/format/dll/TAPI.sdb
share/radare2/${V}/format/dll/TAPIADDR.sdb
-share/radare2/${V}/format/dll/TAPIEXE.sdb
-share/radare2/${V}/format/dll/TAPIINI.sdb
share/radare2/${V}/format/dll/TOOLHELP.sdb
share/radare2/${V}/format/dll/TYPELIB.sdb
share/radare2/${V}/format/dll/UMDM16.sdb
@@ -595,10 +610,11 @@ share/radare2/${V}/opcodes/pic18c.sdb
share/radare2/${V}/opcodes/ppc.sdb
share/radare2/${V}/opcodes/propeller.sdb
share/radare2/${V}/opcodes/riscv.sdb
+share/radare2/${V}/opcodes/s390.sdb
share/radare2/${V}/opcodes/sh.sdb
share/radare2/${V}/opcodes/sparc.sdb
-share/radare2/${V}/opcodes/sysz.sdb
share/radare2/${V}/opcodes/tms320.sdb
+share/radare2/${V}/opcodes/tricore.sdb
share/radare2/${V}/opcodes/v810.sdb
share/radare2/${V}/opcodes/v850.sdb
share/radare2/${V}/opcodes/x86.sdb
@@ -634,35 +650,6 @@ share/radare2/${V}/www/d3/d3.layout.js
share/radare2/${V}/www/d3/index.html
share/radare2/${V}/www/d3/packages.js
share/radare2/${V}/www/d3/style.css
-share/radare2/${V}/www/enyo/
-share/radare2/${V}/www/enyo/disassembler_old.js
-share/radare2/${V}/www/enyo/enyo/
-share/radare2/${V}/www/enyo/enyo.css
-share/radare2/${V}/www/enyo/enyo/lib/
-share/radare2/${V}/www/enyo/enyo/lib/onyx/
-share/radare2/${V}/www/enyo/enyo/lib/onyx/images/
-share/radare2/${V}/www/enyo/enyo/lib/onyx/images/gradient-invert.png
-share/radare2/${V}/www/enyo/enyo/lib/onyx/images/gradient.png
-share/radare2/${V}/www/enyo/enyo_app.js
-share/radare2/${V}/www/enyo/gradient-invert.png
-share/radare2/${V}/www/enyo/gradient.png
-share/radare2/${V}/www/enyo/icon.png
-share/radare2/${V}/www/enyo/index.html
-share/radare2/${V}/www/enyo/r2app.js
-share/radare2/${V}/www/enyo/r2core.css
-share/radare2/${V}/www/enyo/r2core.js
-share/radare2/${V}/www/enyo/rlogo-tr.png
-share/radare2/${V}/www/enyo/stylesheet.css
-share/radare2/${V}/www/enyo/vendors/
-share/radare2/${V}/www/enyo/vendors/backbone-min.js
-share/radare2/${V}/www/enyo/vendors/joint.layout.DirectedGraph.js
-share/radare2/${V}/www/enyo/vendors/joint.min.css
-share/radare2/${V}/www/enyo/vendors/joint.min.js
-share/radare2/${V}/www/enyo/vendors/jquery-ui.min.js
-share/radare2/${V}/www/enyo/vendors/jquery.layout-latest.min.js
-share/radare2/${V}/www/enyo/vendors/jquery.min.js
-share/radare2/${V}/www/enyo/vendors/jquery.scrollTo.min.js
-share/radare2/${V}/www/enyo/vendors/lodash.min.js
share/radare2/${V}/www/f/
share/radare2/${V}/www/f/index.html
share/radare2/${V}/www/f/r2.js
@@ -689,8 +676,11 @@ share/radare2/${V}/www/m/disasmNavProvid
share/radare2/${V}/www/m/disasmProvider.js
share/radare2/${V}/www/m/hexchunkProvider.js
share/radare2/${V}/www/m/images/
+share/radare2/${V}/www/m/images/apple-touch-icon.png
share/radare2/${V}/www/m/images/icon.png
share/radare2/${V}/www/m/images/rlogo256.png
+share/radare2/${V}/www/m/images/touch/
+share/radare2/${V}/www/m/images/touch/chrome-touch-icon-192x192.png
share/radare2/${V}/www/m/images/user.jpg
share/radare2/${V}/www/m/index.html
share/radare2/${V}/www/m/legacy.js
@@ -730,32 +720,6 @@ share/radare2/${V}/www/old/index.html
share/radare2/${V}/www/old/rlogo2.png
share/radare2/${V}/www/old/script.js
share/radare2/${V}/www/old/style.css
-share/radare2/${V}/www/p/
-share/radare2/${V}/www/p/dependencies.css
-share/radare2/${V}/www/p/dependencies.js
-share/radare2/${V}/www/p/index.html
-share/radare2/${V}/www/p/main.js
-share/radare2/${V}/www/p/panels.js
-share/radare2/${V}/www/p/r2core.css
-share/radare2/${V}/www/p/r2core.js
-share/radare2/${V}/www/p/rlogo-inv.png
-share/radare2/${V}/www/p/vendors/
-share/radare2/${V}/www/p/vendors/backbone-min.js
-share/radare2/${V}/www/p/vendors/dagre.core.js
-share/radare2/${V}/www/p/vendors/graphlib.core.js
-share/radare2/${V}/www/p/vendors/joint.layout.DirectedGraph.js
-share/radare2/${V}/www/p/vendors/joint.layout.DirectedGraph.min.js
-share/radare2/${V}/www/p/vendors/joint.min.css
-share/radare2/${V}/www/p/vendors/joint.min.js
-share/radare2/${V}/www/p/vendors/jquery-ui.min.js
-share/radare2/${V}/www/p/vendors/jquery.layout-latest.min.js
-share/radare2/${V}/www/p/vendors/jquery.min.js
-share/radare2/${V}/www/p/vendors/jquery.onoff.css
-share/radare2/${V}/www/p/vendors/jquery.onoff.min.js
-share/radare2/${V}/www/p/vendors/jquery.scrollTo.min.js
-share/radare2/${V}/www/p/vendors/jquery.ui-contextmenu.min.js
-share/radare2/${V}/www/p/vendors/layout-default-latest.css
-share/radare2/${V}/www/p/vendors/lodash.min.js
share/radare2/${V}/www/r2.svg
share/radare2/${V}/www/rlogo.png
share/radare2/${V}/www/t/
--
Best Regards
Edd Barrett
https://www.theunixzoo.co.uk