rehex: add recipe

This commit is contained in:
PulkoMandy
2024-05-01 10:42:28 +02:00
parent b009fa7a48
commit 9a6199aa67
2 changed files with 192 additions and 0 deletions

View File

@@ -0,0 +1,105 @@
From 48a62d0ff83371b9ab049ef2f0facd8901c1d4b0 Mon Sep 17 00:00:00 2001
From: PulkoMandy <pulkomandy@pulkomandy.tk>
Date: Wed, 1 May 2024 10:07:56 +0200
Subject: Add endianness conversion for Haiku
diff --git a/include/portable_endian.h b/include/portable_endian.h
index c878794..e3d471f 100644
--- a/include/portable_endian.h
+++ b/include/portable_endian.h
@@ -106,6 +106,25 @@
# define __LITTLE_ENDIAN LITTLE_ENDIAN
# define __PDP_ENDIAN PDP_ENDIAN
+#elif defined(__HAIKU__)
+
+# include <ByteOrder.h>
+
+# define htobe16(x) B_HOST_TO_BENDIAN_INT16(x)
+# define htole16(x) B_HOST_TO_LENDIAN_INT16(x)
+# define be16toh(x) B_BENDIAN_TO_HOST_INT16(x)
+# define le16toh(x) B_LENDIAN_TO_HOST_INT16(x)
+
+# define htobe32(x) B_HOST_TO_BENDIAN_INT32(x)
+# define htole32(x) B_HOST_TO_LENDIAN_INT32(x)
+# define be32toh(x) B_BENDIAN_TO_HOST_INT32(x)
+# define le32toh(x) B_LENDIAN_TO_HOST_INT32(x)
+
+# define htobe64(x) B_HOST_TO_BENDIAN_INT64(x)
+# define htole64(x) B_HOST_TO_LENDIAN_INT64(x)
+# define be64toh(x) B_BENDIAN_TO_HOST_INT64(x)
+# define le64toh(x) B_LENDIAN_TO_HOST_INT64(x)
+
#else
# error platform not supported
--
2.43.2
From a060113669455dd766c802898a225bdfffd6b652 Mon Sep 17 00:00:00 2001
From: PulkoMandy <pulkomandy@pulkomandy.tk>
Date: Wed, 1 May 2024 10:41:41 +0200
Subject: Link with libiconv on Haiku
diff --git a/Makefile b/Makefile
index 3656da1..0e12968 100644
--- a/Makefile
+++ b/Makefile
@@ -115,6 +115,9 @@ endif
ifeq ($(uname_S),OpenBSD)
LDLIBS += -liconv
endif
+ifeq ($(uname_S),Haiku)
+ LDLIBS += -liconv
+endif
LDLIBS := -lunistring $(WX_LIBS) $(GTK_LIBS) $(BOTAN_LIBS) $(CAPSTONE_LIBS) $(JANSSON_LIBS) $(LUA_LIBS) $(LDLIBS)
--
2.43.2
From 098d494f9d596479cc3a49076a33fbc98f919937 Mon Sep 17 00:00:00 2001
From: PulkoMandy <pulkomandy@pulkomandy.tk>
Date: Wed, 1 May 2024 10:41:56 +0200
Subject: disable tests using Busted
We don't have busted available currently on Haiku
diff --git a/plugins/binary-template/Makefile b/plugins/binary-template/Makefile
index fe13880..7403eee 100644
--- a/plugins/binary-template/Makefile
+++ b/plugins/binary-template/Makefile
@@ -43,26 +43,11 @@ LUA ?= lua
PLUGIN_NAME := binary-template
PLUGINS_INST_DIR ?= $(DESTDIR)$(libdir)/rehex
-ifeq ($(BUSTED),)
- # LuaRocks under MinGW doesn't install busted under a bin/ directory - it sticks it
- # elsewhere and puts a .bat that runs it under the right Lua environment for Reasons.
-
- BUSTED := $(shell busted --version > /dev/null 2>&1 && echo busted --lua=$(LUA))
- ifeq ($(BUSTED),)
- BUSTED := $(shell busted.bat --version > /dev/null 2>&1 && echo busted.bat --lua=$(LUA))
- endif
-
- ifeq ($(BUSTED),)
- X := $(error Neither busted or busted.bat found in PATH)
- endif
-endif
-
.PHONY: all
all:
.PHONY: check
check:
- $(BUSTED) .
.PHONY: install
install:
--
2.43.2

View File

@@ -0,0 +1,87 @@
SUMMARY="Reverse Engineers' Hex Editor"
DESCRIPTION="Hex editor for reverse engineering, and everything else.
- Large (1TB+) file support
- Decoding of integer/floating point value types
- Inline disassembly of machine code
- Highlighting and annotation of ranges of bytes
- Side by side comparision of whole files or selections
- Lua scripting support
- Virtual address mapping support
- Support for common text encodings (ASCII, Unicode, ISO-8859-X, etc)
- Import and export of Intel HEX files.
- Bitmap data visualisation.
- Binary Templates for automatically annotating data (similar to 010 Editor).
- Bit editing/manipulation.
- Checksumming of files/selections.
"
HOMEPAGE="https://solemnwarning.net/rehex/"
COPYRIGHT="2019-2024 Daniel Collins"
LICENSE="GNU GPL v2"
SOURCE_URI="https://github.com/solemnwarning/rehex/archive/refs/tags/0.61.1.tar.gz"
SOURCE_DIR="$portVersionedName"
CHECKSUM_SHA256="1526b18b2dcf357fd49d41d3c37306e2fec1fccfee07a41e6a017b60e6416bed"
REVISION="1"
PATCHES="rehex-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
rehex$secondaryArchSuffix = $portVersion
cmd:rehex$secondaryArchSuffix = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libatk_1.0$secondaryArchSuffix
lib:libbotan_2$secondaryArchSuffix
lib:libcairo$secondaryArchSuffix
lib:libcairo_gobject$secondaryArchSuffix
lib:libcapstone$secondaryArchSuffix
lib:libharfbuzz$secondaryArchSuffix
lib:libgdk_3$secondaryArchSuffix
lib:libgdk_pixbuf_2.0$secondaryArchSuffix
lib:libgio_2.0$secondaryArchSuffix
lib:libglib_2.0$secondaryArchSuffix
lib:libgtk_3$secondaryArchSuffix
lib:libiconv$secondaryArchSuffix
lib:libintl$secondaryArchSuffix
lib:libjansson$secondaryArchSuffix
lib:liblua$secondaryArchSuffix
lib:libpango_1.0$secondaryArchSuffix
lib:libunistring$secondaryArchSuffix
lib:libwx_baseu_3.2$secondaryArchSuffix
lib:libwx_baseu_net_3.2$secondaryArchSuffix
lib:libwx_gtk3u_aui_3.2$secondaryArchSuffix
lib:libwx_gtk3u_core_3.2$secondaryArchSuffix
lib:libwx_gtk3u_html_3.2$secondaryArchSuffix
lib:libwx_gtk3u_propgrid_3.2$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
cmd:wx_config$secondaryArchSuffix
devel:libbotan_2$secondaryArchSuffix
devel:libcapstone$secondaryArchSuffix
devel:libjansson$secondaryArchSuffix
devel:liblua$secondaryArchSuffix
devel:libunistring$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:find
cmd:lua$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
make $jobArgs BOTAN_CFLAGS=-I/system/develop/headers/botan-2/ BUILD_HELP=0
}
INSTALL()
{
make install BUILD_HELP=0 prefix=$prefix datarootdir=$dataRootDir
}