Skip to content

Instantly share code, notes, and snippets.

@nonakap
Created November 2, 2023 10:38
Show Gist options
  • Save nonakap/aca72e01298412dbbacd73f74a97a41b to your computer and use it in GitHub Desktop.
Save nonakap/aca72e01298412dbbacd73f74a97a41b to your computer and use it in GitHub Desktop.
new pkgsrc: editors/imhex
# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
# editors/imhex/DESCR
# editors/imhex/Makefile
# editors/imhex/PLIST
# editors/imhex/distinfo
# editors/imhex/patches
# editors/imhex/patches/patch-lib_external_libwolv_libs_io_CMakeLists.txt
# editors/imhex/patches/patch-lib_external_libwolv_libs_io_source_io_file.cpp
# editors/imhex/patches/patch-lib_external_libwolv_libs_io_source_io_fs.cpp
# editors/imhex/patches/patch-lib_libimhex_CMakeLists.txt
# editors/imhex/patches/patch-lib_libimhex_source_api_task.cpp
# editors/imhex/patches/patch-lib_libimhex_source_helpers_fs.cpp
# editors/imhex/patches/patch-main_source_window_linux_window.cpp
# editors/imhex/patches/patch-plugins_builtin_CMakeLists.txt
# editors/imhex/patches/patch-plugins_builtin_source_content_providers_disk_provider.cpp
#
echo x - editors/imhex/DESCR
sed 's/^X//' >editors/imhex/DESCR << 'END-of-editors/imhex/DESCR'
XImHex is a hex editor for reverse engineers, programmers and people that value
Xtheir eye sight when working at 3 AM.
X
XImHex has many features including the following:
X- Byte patching
X- String and hex search
X- Colorful highlighting
X- Custom C++-like pattern language for parsing highlighting a file's content
X- Data inspector allowing interpretation of data as many different types
X (little and big endian)
X- File hashing support
X- Disassembler supporting many different architectures
X- Bookmarks
X- Data Analyzer
END-of-editors/imhex/DESCR
echo x - editors/imhex/Makefile
sed 's/^X//' >editors/imhex/Makefile << 'END-of-editors/imhex/Makefile'
X# $NetBSD$
X
XDISTNAME= imhex-1.31.0
XCATEGORIES= editors
XMASTER_SITES= ${MASTER_SITE_GITHUB:=WerWolv/}
XGITHUB_PROJECT= ImHex
XGITHUB_TAG= v${PKGVERSION_NOREV}
XDIST_SUBDIR= ${PKGBASE}
XDISTFILES= ${DISTNAME}${EXTRACT_SUFX}
X
XMAINTAINER= nonakap@gmail.com
XHOMEPAGE= https://github.com/WerWolv/ImHex
XCOMMENT= Hex editor for reverse engineers and programmers
XLICENSE= gnu-gpl-v2
X
X# no getrandom(2).
XNOT_FOR_PLATFORM+= NetBSD-[0-8].*-*
X
XCAPSTONE_TAG= 5.0
XFMT_TAG= 10.1.1
XLIBROMFS_TAG= 31b331c
XLIBWOLV_TAG= 094d87c
XNATIVEFILEDIALOG_TAG= v1.1.0
XPATTERNLANGUAGE_TAG= ImHex-v${PKGVERSION_NOREV}
XXDGPP_TAG= f01f810
XYARA_TAG= v4.3.2
X
XGITHUB_SUBMODULES+= btzy nativefiledialog-extended ${NATIVEFILEDIALOG_TAG} \
X lib/external/nativefiledialog
XGITHUB_SUBMODULES+= capstone-engine capstone ${CAPSTONE_TAG} \
X lib/external/capstone
XGITHUB_SUBMODULES+= fmtlib fmt ${FMT_TAG} lib/external/fmt
XGITHUB_SUBMODULES+= WerWolv libromfs ${LIBROMFS_TAG} lib/external/libromfs
XGITHUB_SUBMODULES+= WerWolv libwolv ${LIBWOLV_TAG} lib/external/libwolv
XGITHUB_SUBMODULES+= WerWolv PatternLanguage ${PATTERNLANGUAGE_TAG} \
X lib/external/pattern_language
XGITHUB_SUBMODULES+= VirusTotal yara ${YARA_TAG} lib/external/yara/yara
X
XDISTFILES+= ${XDGPP_TAG}.tar.gz
XSITES.${XDGPP_TAG}.tar.gz= https://git.sr.ht/~danyspin97/xdgpp/archive/
X
X# for PatternLanguage
XPL_CLI11_TAG= v2.3.2
XPL_FMT_TAG= f5e5435 # = 10.1.1 XXX
XPL_LIBWOLV_TAG= 123e815
XGITHUB_SUBMODULES+= CLIUtils CLI11 ${PL_CLI11_TAG} lib/external/pattern_language/external/cli11
XGITHUB_SUBMODULES+= fmtlib fmt ${PL_FMT_TAG} lib/external/pattern_language/external/fmt
XGITHUB_SUBMODULES+= WerWolv libwolv ${PL_LIBWOLV_TAG} lib/external/pattern_language/external/libwolv
X
XCONFIGURE_DIRS= ${WRKDIR}/build
XCMAKE_ARG_PATH= ${WRKSRC}
X
XUSE_TOOLS+= pkg-config
XUSE_LANGUAGES= c c++20
XUSE_CMAKE= yes
X
XGCC_REQD+= 12
X
XCMAKE_ARGS+= -DCMAKE_BUILD_TYPE=Release
XCMAKE_ARGS+= -DCMAKE_C_COMPILER=${CC:Q}
XCMAKE_ARGS+= -DCMAKE_CXX_COMPILER=${CXX:Q}
XCMAKE_ARGS+= -DCMAKE_CXX_LINK_FLAGS=${LDFLAGS:Q}
X
XPLIST_SRC+= PLIST
X
XPRINT_PLIST_AWK+= { gsub(/${PKGVERSION_NOREV}/, "$${PKGVERSION}"); \
X print; next; }
X
XPYTHON_VERSIONS_INCOMPATIBLE= 27 37
X
Xpost-extract:
X ${MKDIR} ${WRKDIR}/build
X ${CP} ${WRKDIR}/xdgpp-${XDGPP_TAG}/* ${WRKSRC}/lib/external/xdgpp/
X
X.include "../../lang/python/application.mk"
X.include "../../lang/python/tool.mk"
X.include "../../sysutils/file/buildlink3.mk"
X.include "../../www/curl/buildlink3.mk"
X.include "../../graphics/glfw/buildlink3.mk"
X.include "../../security/mbedtls/buildlink3.mk"
X.include "../../graphics/freetype2/buildlink3.mk"
X.include "../../x11/gtk3/buildlink3.mk"
X.include "../../mk/bsd.pkg.mk"
END-of-editors/imhex/Makefile
echo x - editors/imhex/PLIST
sed 's/^X//' >editors/imhex/PLIST << 'END-of-editors/imhex/PLIST'
X@comment $NetBSD$
Xbin/imhex
Xlib/imhex/plugins/builtin.hexplug
Xlib/imhex/plugins/script_loader.hexplug
Xlib/libimhex.so.${PKGVERSION}
Xshare/applications/imhex.desktop
Xshare/imhex/constants/crc16.json
Xshare/imhex/constants/crc32.json
Xshare/imhex/constants/http_status.json
Xshare/imhex/constants/linux_errors.json
Xshare/imhex/encodings/arabic_iso.tbl
Xshare/imhex/encodings/arabic_windows.tbl
Xshare/imhex/encodings/ascii.tbl
Xshare/imhex/encodings/ascii_ansi.tbl
Xshare/imhex/encodings/ascii_oem.tbl
Xshare/imhex/encodings/baltic_iso.tbl
Xshare/imhex/encodings/baltic_windows.tbl
Xshare/imhex/encodings/cyrillic_cp866.tbl
Xshare/imhex/encodings/cyrillic_iso.tbl
Xshare/imhex/encodings/cyrillic_koi8_r.tbl
Xshare/imhex/encodings/cyrillic_koi8_u.tbl
Xshare/imhex/encodings/cyrillic_windows.tbl
Xshare/imhex/encodings/eastern_europe_iso.tbl
Xshare/imhex/encodings/eastern_europe_windows.tbl
Xshare/imhex/encodings/ebcdic.tbl
Xshare/imhex/encodings/euc_jp.tbl
Xshare/imhex/encodings/euc_kr.tbl
Xshare/imhex/encodings/greek_iso.tbl
Xshare/imhex/encodings/greek_windows.tbl
Xshare/imhex/encodings/hebrew_iso.tbl
Xshare/imhex/encodings/hebrew_windows.tbl
Xshare/imhex/encodings/iso_646.tbl
Xshare/imhex/encodings/iso_6937.tbl
Xshare/imhex/encodings/jis_x_0201.tbl
Xshare/imhex/encodings/jis_x_0211.tbl
Xshare/imhex/encodings/jis_x_0213.tbl
Xshare/imhex/encodings/macintosh.tbl
Xshare/imhex/encodings/ms932.tbl
Xshare/imhex/encodings/pokegen1_en.tbl
Xshare/imhex/encodings/pokegen3_en.tbl
Xshare/imhex/encodings/shiftjis.tbl
Xshare/imhex/encodings/thai.tbl
Xshare/imhex/encodings/turkish_iso.tbl
Xshare/imhex/encodings/turkish_windows.tbl
Xshare/imhex/encodings/utf8.tbl
Xshare/imhex/encodings/vietnamese.tbl
Xshare/imhex/includes/hex/core.pat
Xshare/imhex/includes/hex/dec.pat
Xshare/imhex/includes/hex/http.pat
Xshare/imhex/includes/hex/impl/imhex_check.pat
Xshare/imhex/includes/hex/provider.pat
Xshare/imhex/includes/hex/type/mangled.pat
Xshare/imhex/includes/std/array.pat
Xshare/imhex/includes/std/bit.pat
Xshare/imhex/includes/std/core.pat
Xshare/imhex/includes/std/ctype.pat
Xshare/imhex/includes/std/file.pat
Xshare/imhex/includes/std/fxpt.pat
Xshare/imhex/includes/std/hash.pat
Xshare/imhex/includes/std/io.pat
Xshare/imhex/includes/std/limits.pat
Xshare/imhex/includes/std/math.pat
Xshare/imhex/includes/std/mem.pat
Xshare/imhex/includes/std/ptr.pat
Xshare/imhex/includes/std/random.pat
Xshare/imhex/includes/std/string.pat
Xshare/imhex/includes/std/sys.pat
Xshare/imhex/includes/std/time.pat
Xshare/imhex/includes/type/base.pat
Xshare/imhex/includes/type/base64.pat
Xshare/imhex/includes/type/bcd.pat
Xshare/imhex/includes/type/byte.pat
Xshare/imhex/includes/type/color.pat
Xshare/imhex/includes/type/float16.pat
Xshare/imhex/includes/type/guid.pat
Xshare/imhex/includes/type/ip.pat
Xshare/imhex/includes/type/leb128.pat
Xshare/imhex/includes/type/mac.pat
Xshare/imhex/includes/type/magic.pat
Xshare/imhex/includes/type/path.pat
Xshare/imhex/includes/type/size.pat
Xshare/imhex/includes/type/time.pat
Xshare/imhex/includes/type/types/010.pat
Xshare/imhex/includes/type/types/c.pat
Xshare/imhex/includes/type/types/linux.pat
Xshare/imhex/includes/type/types/rust.pat
Xshare/imhex/includes/type/types/win32.pat
Xshare/imhex/magic/nintendo_switch_magic
Xshare/imhex/magic/portable_executable_magic
Xshare/imhex/patterns/3ds.hexpat
Xshare/imhex/patterns/7z.hexpat
Xshare/imhex/patterns/Crashlvl.hexpat
Xshare/imhex/patterns/afe2.hexpat
Xshare/imhex/patterns/ar.hexpat
Xshare/imhex/patterns/aria2.hexpat
Xshare/imhex/patterns/arm_cm_vtor.hexpat
Xshare/imhex/patterns/bencode.hexpat
Xshare/imhex/patterns/bmp.hexpat
Xshare/imhex/patterns/bson.hexpat
Xshare/imhex/patterns/bsp_goldsrc.hexpat
Xshare/imhex/patterns/cchva.hexpat
Xshare/imhex/patterns/ccpal.hexpat
Xshare/imhex/patterns/ccvxl.hexpat
Xshare/imhex/patterns/cda.hexpat
Xshare/imhex/patterns/chm.hexpat
Xshare/imhex/patterns/coff.hexpat
Xshare/imhex/patterns/cpio.hexpat
Xshare/imhex/patterns/dds.hexpat
Xshare/imhex/patterns/dex.hexpat
Xshare/imhex/patterns/dicom.hexpat
Xshare/imhex/patterns/dmg.hexpat
Xshare/imhex/patterns/dsstore.hexpat
Xshare/imhex/patterns/elf.hexpat
Xshare/imhex/patterns/evtx.hexpat
Xshare/imhex/patterns/fas_oskasoftware.hexpat
Xshare/imhex/patterns/fas_oskasoftware_old.hexpat
Xshare/imhex/patterns/fdt.hexpat
Xshare/imhex/patterns/flac.hexpat
Xshare/imhex/patterns/fs.hexpat
Xshare/imhex/patterns/gb.hexpat
Xshare/imhex/patterns/gif.hexpat
Xshare/imhex/patterns/gzip.hexpat
Xshare/imhex/patterns/ico.hexpat
Xshare/imhex/patterns/id3.hexpat
Xshare/imhex/patterns/intel_hex.hexpat
Xshare/imhex/patterns/ip.hexpat
Xshare/imhex/patterns/ips.hexpat
Xshare/imhex/patterns/iso.hexpat
Xshare/imhex/patterns/java_class.hexpat
Xshare/imhex/patterns/jpeg.hexpat
Xshare/imhex/patterns/lnk.hexpat
Xshare/imhex/patterns/lua54.hexpat
Xshare/imhex/patterns/macho.hexpat
Xshare/imhex/patterns/max_v104.hexpat
Xshare/imhex/patterns/midi.hexpat
Xshare/imhex/patterns/minidump.hexpat
Xshare/imhex/patterns/mp4.hexpat
Xshare/imhex/patterns/msgpack.hexpat
Xshare/imhex/patterns/nacp.hexpat
Xshare/imhex/patterns/nbt.hexpat
Xshare/imhex/patterns/ne.hexpat
Xshare/imhex/patterns/nes.hexpat
Xshare/imhex/patterns/nro.hexpat
Xshare/imhex/patterns/ntag.hexpat
Xshare/imhex/patterns/ogg.hexpat
Xshare/imhex/patterns/pbz.hexpat
Xshare/imhex/patterns/pcap.hexpat
Xshare/imhex/patterns/pcx.hexpat
Xshare/imhex/patterns/pe.hexpat
Xshare/imhex/patterns/pfs0.hexpat
Xshare/imhex/patterns/pif.hexpat
Xshare/imhex/patterns/png.hexpat
Xshare/imhex/patterns/prodinfo.hexpat
Xshare/imhex/patterns/protobuf.hexpat
Xshare/imhex/patterns/pyc.hexpat
Xshare/imhex/patterns/pyinstaller.hexpat
Xshare/imhex/patterns/qbcl.hexpat
Xshare/imhex/patterns/qoi.hexpat
Xshare/imhex/patterns/selinux.hexpat
Xshare/imhex/patterns/selinuxpp.hexpat
Xshare/imhex/patterns/shp.hexpat
Xshare/imhex/patterns/shx.hexpat
Xshare/imhex/patterns/sit5.hexpat
Xshare/imhex/patterns/spirv.hexpat
Xshare/imhex/patterns/stl.hexpat
Xshare/imhex/patterns/tar.hexpat
Xshare/imhex/patterns/tga.hexpat
Xshare/imhex/patterns/tiff.hexpat
Xshare/imhex/patterns/ubiquiti.hexpat
Xshare/imhex/patterns/uefi.hexpat
Xshare/imhex/patterns/uefi_boot_entry.hexpat
Xshare/imhex/patterns/uf2.hexpat
Xshare/imhex/patterns/usb.hexpat
Xshare/imhex/patterns/vbmeta.hexpat
Xshare/imhex/patterns/vdf.hexpat
Xshare/imhex/patterns/vhdx.hexpat
Xshare/imhex/patterns/wad.hexpat
Xshare/imhex/patterns/was_oskasoftware.hexpat
Xshare/imhex/patterns/wav.hexpat
Xshare/imhex/patterns/xbeh.hexpat
Xshare/imhex/patterns/xci.hexpat
Xshare/imhex/patterns/xilinx_bit.hexpat
Xshare/imhex/patterns/zip.hexpat
Xshare/imhex/patterns/zlib.hexpat
Xshare/imhex/patterns/zstd.hexpat
Xshare/licenses/imhex/LICENSE
Xshare/metainfo/net.werwolv.imhex.appdata.xml
Xshare/metainfo/net.werwolv.imhex.metainfo.xml
Xshare/pixmaps/imhex.png
END-of-editors/imhex/PLIST
echo x - editors/imhex/distinfo
sed 's/^X//' >editors/imhex/distinfo << 'END-of-editors/imhex/distinfo'
X$NetBSD$
X
XBLAKE2s (imhex/CLIUtils-CLI11-v2.3.2.tar.gz) = e46da4ec92b3f20d1be81d2c5fca031623fb5f933552b8f9ac6639dbf73267d9
XSHA512 (imhex/CLIUtils-CLI11-v2.3.2.tar.gz) = f48b289d52034c47b90db58c035a123b464bed488cf31bcdbe10a692214a5c05e62b99d6fb7c4b065f42df862ecf3813f11dd533b3697939d761e99d2b89c2ec
XSize (imhex/CLIUtils-CLI11-v2.3.2.tar.gz) = 303507 bytes
XBLAKE2s (imhex/VirusTotal-yara-v4.3.2.tar.gz) = b53875e318aae8211da805ba2bc52af19f805e146c9f4005afc687580347994d
XSHA512 (imhex/VirusTotal-yara-v4.3.2.tar.gz) = dc77ec46a30ca2fff33b639166fc554c9c6d9e955642774e23da3ea7dbb25fe154cfd4ef83c9808920193028b9099258a63b3f1b9a66864a1f3905f0a8e8053f
XSize (imhex/VirusTotal-yara-v4.3.2.tar.gz) = 2179265 bytes
XBLAKE2s (imhex/WerWolv-PatternLanguage-ImHex-v1.31.0.tar.gz) = 62a0e648eb0727d22f16ba0413806c07406cc43105c761867698eecbf5a8aaa5
XSHA512 (imhex/WerWolv-PatternLanguage-ImHex-v1.31.0.tar.gz) = fd6e00375ce3da32196f9f77138aab1fccd27bd6d88fe06bde39e910391d46633d00bf75a1ed7f3ba22e45c3e7ac84ba2fd9e790f7f2e10b0ed9386ffc01df16
XSize (imhex/WerWolv-PatternLanguage-ImHex-v1.31.0.tar.gz) = 230510 bytes
XBLAKE2s (imhex/WerWolv-libromfs-31b331c.tar.gz) = 1d4805eac7a58b5baf24793d8e69e8ae7b037c5a73aa6a936f8f6becffaea1dd
XSHA512 (imhex/WerWolv-libromfs-31b331c.tar.gz) = 71626787eefa414fb67b32b62262e7eca1ca379c1dbad65ada29a942040e7553be93b88b12df212c09cb1b05344af0c22a605591634cfa8336a946957c69f3a8
XSize (imhex/WerWolv-libromfs-31b331c.tar.gz) = 4617 bytes
XBLAKE2s (imhex/WerWolv-libwolv-094d87c.tar.gz) = bbaf552e812b28c58bcbc74bb72134d3760a7976ecdd774c1ba43dd0e0ddf88a
XSHA512 (imhex/WerWolv-libwolv-094d87c.tar.gz) = 5be7fc61fdeb930194ece86b1b78921468ef39741f49eead18e28aac8e6fd6bb796b6f1f6ec869ad7677a7e6a93492a8c6881dfa2ae34296323ef01a668a472e
XSize (imhex/WerWolv-libwolv-094d87c.tar.gz) = 32677 bytes
XBLAKE2s (imhex/WerWolv-libwolv-123e815.tar.gz) = e3c4d5070b955e18a94245f7ebf3b9b199442335d45ad0ad9fdeb9a208239c44
XSHA512 (imhex/WerWolv-libwolv-123e815.tar.gz) = 0826390bf02db321222e3d26d3911376514df5125e77a50f86558086c9beb2f52e5ae5d875cb119c405b22f73df49ef23ea2ad58e3147bd93dba2f72c36dabc0
XSize (imhex/WerWolv-libwolv-123e815.tar.gz) = 29932 bytes
XBLAKE2s (imhex/btzy-nativefiledialog-extended-v1.1.0.tar.gz) = 64018589ec5e7f8ddf73a34b45e96ccca32c2518614e6e39395ebe59e0b5e68d
XSHA512 (imhex/btzy-nativefiledialog-extended-v1.1.0.tar.gz) = 0fbbe942111e99d069a3d42a21757a46ed7ce09c239df86714ab26f07a45bfe55b64f1ad8779cef3ee2a8de3136d96e0a308a1d2471aaa81211cfb18eff35124
XSize (imhex/btzy-nativefiledialog-extended-v1.1.0.tar.gz) = 413535 bytes
XBLAKE2s (imhex/capstone-engine-capstone-5.0.tar.gz) = 70c23c4f3fe308332ce3bf64202bfa387f00483908aaf7dd4118ad9815cace6c
XSHA512 (imhex/capstone-engine-capstone-5.0.tar.gz) = e6794a9a06ed93edff9ae0b2c085d34010dd415e128ce4018b584fe35fa81182431f8fd6549d6a3c7a8a3bcca0691157c7a1c96971b7f51774960fd9afef9b8f
XSize (imhex/capstone-engine-capstone-5.0.tar.gz) = 7633758 bytes
XBLAKE2s (imhex/f01f810.tar.gz) = d774aa58f3527fa8a7a3a9a0ab3d92f79a9e555b1e0f94db0b2549b41c8fa2d6
XSHA512 (imhex/f01f810.tar.gz) = 8fc3c9b060c3a5bf27f9c179917476a53f734de941cd9cb229d238aa89d14784f3e68437a14d958dbd6399ab68ae77af8acfadcc5472026b865fd80f2b99bcb3
XSize (imhex/f01f810.tar.gz) = 5004 bytes
XBLAKE2s (imhex/fmtlib-fmt-10.1.1.tar.gz) = 0e5d93144689e4b56a664fbcc25107900b1b490e7bcdadf6197e4ecb3cc8e998
XSHA512 (imhex/fmtlib-fmt-10.1.1.tar.gz) = 288c349baac5f96f527d5b1bed0fa5f031aa509b4526560c684281388e91909a280c3262a2474d963b5d1bf7064b1c9930c6677fe54a0d8f86982d063296a54c
XSize (imhex/fmtlib-fmt-10.1.1.tar.gz) = 851454 bytes
XBLAKE2s (imhex/fmtlib-fmt-f5e5435.tar.gz) = 0368a5d0e8b3d4cb892dbc1686ace2c8261f2c8411975b673ee755b9ab67e2a2
XSHA512 (imhex/fmtlib-fmt-f5e5435.tar.gz) = 0810d7d96d96aea0d02648eb5d201f8bed22d0b0ddc0ed22e7d4f4dd11ea05bf90fc23e067c274f16e1ff566d0326942ccd55696cdab1a4a9ba01e6553280999
XSize (imhex/fmtlib-fmt-f5e5435.tar.gz) = 851890 bytes
XBLAKE2s (imhex/imhex-1.31.0.tar.gz) = f1757da5d093cfdc106600bc09cc182feaa01936dbee872da98d4a282a39e755
XSHA512 (imhex/imhex-1.31.0.tar.gz) = 8eaa1cbae384afcdd55a71a1a43a83137b687464f31af5a344c163f76ddcf4034d242a23c83c9125fa9172a14da8ea018014c7601c7ba8b15a46c0848ea6ea66
XSize (imhex/imhex-1.31.0.tar.gz) = 12402162 bytes
XSHA1 (patch-lib_external_libwolv_libs_io_CMakeLists.txt) = 86140b711d6ce93ce8f00a7271c4396a658be355
XSHA1 (patch-lib_external_libwolv_libs_io_source_io_file.cpp) = 114fb6bc331830e30a7046205ef7745fcc3c23f1
XSHA1 (patch-lib_external_libwolv_libs_io_source_io_fs.cpp) = 8d7ce1c195eb22d8131d917642f272e86b45cdb6
XSHA1 (patch-lib_libimhex_CMakeLists.txt) = 67618f4212d0757b300b5682e227bc0335c5c028
XSHA1 (patch-lib_libimhex_source_api_task.cpp) = 6ac1260f7e7650ecd15c2f12866859f2795bd589
XSHA1 (patch-lib_libimhex_source_helpers_fs.cpp) = 1b21ab5014e24bb47c8594d415f5e5457aff3728
XSHA1 (patch-main_source_window_linux_window.cpp) = c7bc451fc5b79b0258f47d954276c804eee8b17d
XSHA1 (patch-plugins_builtin_CMakeLists.txt) = bf13160f7c824841591b4a4934e263fe7836feab
XSHA1 (patch-plugins_builtin_source_content_providers_disk_provider.cpp) = 9bbdb59cc2bd9c73f87b17d0e215763880413fb9
END-of-editors/imhex/distinfo
echo c - editors/imhex/patches
mkdir -p editors/imhex/patches > /dev/null 2>&1
echo x - editors/imhex/patches/patch-lib_external_libwolv_libs_io_CMakeLists.txt
sed 's/^X//' >editors/imhex/patches/patch-lib_external_libwolv_libs_io_CMakeLists.txt << 'END-of-editors/imhex/patches/patch-lib_external_libwolv_libs_io_CMakeLists.txt'
X$NetBSD$
X
X--- lib/external/libwolv/libs/io/CMakeLists.txt.orig 2023-08-13 12:11:32.000000000 +0000
X+++ lib/external/libwolv/libs/io/CMakeLists.txt 2023-11-02 07:56:24.511113762 +0000
X@@ -31,8 +31,44 @@ if (APPLE)
X target_link_libraries(${PROJECT_NAME} PUBLIC ${FOUNDATION})
X endif ()
X
X+if (UNIX)
X+ include(CheckIncludeFile)
X+ include(CheckSymbolExists)
X+ check_include_file("sys/event.h" HAVE_SYS_EVENT_H)
X+ if (HAVE_SYS_EVENT_H)
X+ add_definitions(-DHAVE_SYS_EVENT_H=1)
X+ check_symbol_exists(kqueue "sys/event.h" HAVE_KQUEUE)
X+ if (HAVE_KQUEUE)
X+ add_definitions(-DHAVE_KQUEUE=1)
X+ endif ()
X+ endif ()
X+ check_include_file("linux/limits.h" HAVE_LINUX_LIMITS_H)
X+ if (HAVE_LINUX_LIMITS_H)
X+ add_definitions(-DHAVE_LINUX_LIMITS_H=1)
X+ endif ()
X+ check_include_file("limits.h" HAVE_LIMITS_H)
X+ if (HAVE_LIMITS_H)
X+ add_definitions(-DHAVE_LIMITS_H=1)
X+ endif ()
X+ check_symbol_exists(fopen64 "stdio.h" HAVE_FOPEN64)
X+ if (HAVE_FOPEN64)
X+ add_definitions(-DHAVE_FOPEN64=1)
X+ endif ()
X+ check_symbol_exists(fseeko64 "stdio.h" HAVE_FSEEKO64)
X+ if (HAVE_FSEEKO64)
X+ add_definitions(-DHAVE_FSEEKO64=1)
X+ endif ()
X+ check_symbol_exists(ftello64 "stdio.h" HAVE_FTELLO64)
X+ if (HAVE_FTELLO64)
X+ add_definitions(-DHAVE_FTELLO64=1)
X+ endif ()
X+ check_symbol_exists(ftruncate64 "stdio.h" HAVE_FTRUNCATE64)
X+ if (HAVE_FTRUNCATE64)
X+ add_definitions(-DHAVE_FTRUNCATE64=1)
X+ endif ()
X+endif ()
X
X # Add example project
X add_executable(${PROJECT_NAME}-test EXCLUDE_FROM_ALL example/main.cpp)
X target_include_directories(${PROJECT_NAME}-test PRIVATE include)
X-target_link_libraries(${PROJECT_NAME}-test PRIVATE ${PROJECT_NAME})
X\ No newline at end of file
X+target_link_libraries(${PROJECT_NAME}-test PRIVATE ${PROJECT_NAME})
END-of-editors/imhex/patches/patch-lib_external_libwolv_libs_io_CMakeLists.txt
echo x - editors/imhex/patches/patch-lib_external_libwolv_libs_io_source_io_file.cpp
sed 's/^X//' >editors/imhex/patches/patch-lib_external_libwolv_libs_io_source_io_file.cpp << 'END-of-editors/imhex/patches/patch-lib_external_libwolv_libs_io_source_io_file.cpp'
X$NetBSD$
X
X--- lib/external/libwolv/libs/io/source/io/file.cpp.orig 2023-08-13 12:11:32.000000000 +0000
X+++ lib/external/libwolv/libs/io/source/io/file.cpp 2023-11-02 07:58:34.213622627 +0000
X@@ -16,12 +16,24 @@
X #elif defined(OS_WINDOWS)
X #include <Windows.h>
X #include <share.h>
X-#elif defined(OS_MACOS)
X+#elif defined(OS_MACOS) || defined(HAVE_KQUEUE)
X #include <unistd.h>
X #include <sys/types.h>
X #include <sys/event.h>
X #include <sys/mman.h>
X #include <fcntl.h>
X+ #if !defined(HAVE_FOPEN64)
X+ #define fopen64 fopen
X+ #endif
X+ #if !defined(HAVE_FSEEKO64)
X+ #define fseeko64 fseek
X+ #endif
X+ #if !defined(HAVE_FTELLO64)
X+ #define ftello64 ftell
X+ #endif
X+ #if !defined(HAVE_FTRUNCATE64)
X+ #define ftruncate64 ftruncate
X+ #endif
X #elif defined(OS_LINUX)
X #include <unistd.h>
X #include <sys/types.h>
X@@ -311,7 +323,7 @@ namespace wolv::io {
X }
X #endif
X
X- #if defined(OS_MACOS)
X+ #if defined(OS_MACOS) || defined(HAVE_KQUEUE)
X static void trackMacOS(const std::stop_token &stopToken, const std::fs::path &path, const std::function<void()> &callback) {
X int queue = kqueue();
X if (queue == -1)
X@@ -345,7 +357,7 @@ namespace wolv::io {
X }
X #endif
X
X- #if defined(OS_LINUX)
X+ #if defined(OS_LINUX) && !defined(HAVE_KQUEUE)
X static void trackLinux(const std::stop_token &stopToken, const std::fs::path &path, const std::function<void()> &callback) {
X int fileDescriptor = inotify_init();
X if (fileDescriptor == -1)
X@@ -390,9 +402,9 @@ namespace wolv::io {
X this->m_thread = std::jthread([this, callback](const std::stop_token &stopToken) {
X #if defined(OS_WINDOWS)
X trackWindows(stopToken, this->m_path, callback);
X- #elif defined(OS_MACOS)
X+ #elif defined(OS_MACOS) || defined(HAVE_KQUEUE)
X trackMacOS(stopToken, this->m_path, callback);
X- #elif defined(OS_LINUX)
X+ #elif defined(OS_LINUX) && !defined(HAVE_KQUEUE)
X trackLinux(stopToken, this->m_path, callback);
X #endif
X });
X@@ -405,4 +417,4 @@ namespace wolv::io {
X
X #endif
X
X-}
X\ No newline at end of file
X+}
END-of-editors/imhex/patches/patch-lib_external_libwolv_libs_io_source_io_file.cpp
echo x - editors/imhex/patches/patch-lib_external_libwolv_libs_io_source_io_fs.cpp
sed 's/^X//' >editors/imhex/patches/patch-lib_external_libwolv_libs_io_source_io_fs.cpp << 'END-of-editors/imhex/patches/patch-lib_external_libwolv_libs_io_source_io_fs.cpp'
X$NetBSD$
X
X--- lib/external/libwolv/libs/io/source/io/fs.cpp.orig 2023-08-13 12:11:32.000000000 +0000
X+++ lib/external/libwolv/libs/io/source/io/fs.cpp 2023-11-02 07:20:23.167129100 +0000
X@@ -15,7 +15,14 @@
X #elif defined(OS_LINUX)
X
X #include <unistd.h>
X- #include <linux/limits.h>
X+ #if defined(HAVE_LINUX_LIMITS_H)
X+ #include <linux/limits.h>
X+ #elif defined(HAVE_LINUX_LIMITS_H)
X+ #include <limits.h>
X+ #endif
X+ #if !defined(PATH_MAX)
X+ #define PATH_MAX 260
X+ #endif
X
X #endif
X
END-of-editors/imhex/patches/patch-lib_external_libwolv_libs_io_source_io_fs.cpp
echo x - editors/imhex/patches/patch-lib_libimhex_CMakeLists.txt
sed 's/^X//' >editors/imhex/patches/patch-lib_libimhex_CMakeLists.txt << 'END-of-editors/imhex/patches/patch-lib_libimhex_CMakeLists.txt'
X$NetBSD$
X
X--- lib/libimhex/CMakeLists.txt.orig 2023-09-24 18:05:03.000000000 +0000
X+++ lib/libimhex/CMakeLists.txt 2023-11-02 08:48:50.357095902 +0000
X@@ -77,7 +77,12 @@ elseif (APPLE)
X endif ()
X
X target_link_libraries(libimhex PRIVATE ${FMT_LIBRARIES})
X-target_link_libraries(libimhex PUBLIC dl imgui ${NFD_LIBRARIES} magic ${CAPSTONE_LIBRARIES} LLVMDemangle microtar ${NLOHMANN_JSON_LIBRARIES} ${YARA_LIBRARIES} ${LIBCURL_LIBRARIES} ${MBEDTLS_LIBRARIES} ${LIBBACKTRACE_LIBRARIES} plcli libpl libpl-gen ${MINIAUDIO_LIBRARIES} libwolv-utils libwolv-io libwolv-hash libwolv-net libwolv-containers)
X+include(CheckLibraryExists)
X+check_library_exists(dl dlopen "" HAVE_LIBDL)
X+if (HAVE_LIBDL)
X+ target_link_libraries(libimhex PUBLIC dl)
X+endif ()
X+target_link_libraries(libimhex PUBLIC imgui ${NFD_LIBRARIES} magic ${CAPSTONE_LIBRARIES} LLVMDemangle microtar ${NLOHMANN_JSON_LIBRARIES} ${YARA_LIBRARIES} ${LIBCURL_LIBRARIES} ${MBEDTLS_LIBRARIES} ${LIBBACKTRACE_LIBRARIES} plcli libpl libpl-gen ${MINIAUDIO_LIBRARIES} libwolv-utils libwolv-io libwolv-hash libwolv-net libwolv-containers)
X
X set_property(TARGET libimhex PROPERTY INTERPROCEDURAL_OPTIMIZATION FALSE)
X
X@@ -119,4 +124,4 @@ if ((NOT GIT_COMMIT_HASH_SHORT STREQUAL
X addDefineToSource(source/api/imhex_api.cpp "GIT_BRANCH=\"${GIT_BRANCH}\"")
X endif ()
X
X-addDefineToSource(source/api/imhex_api.cpp "IMHEX_VERSION=\"${IMHEX_VERSION_STRING}\"")
X\ No newline at end of file
X+addDefineToSource(source/api/imhex_api.cpp "IMHEX_VERSION=\"${IMHEX_VERSION_STRING}\"")
END-of-editors/imhex/patches/patch-lib_libimhex_CMakeLists.txt
echo x - editors/imhex/patches/patch-lib_libimhex_source_api_task.cpp
sed 's/^X//' >editors/imhex/patches/patch-lib_libimhex_source_api_task.cpp << 'END-of-editors/imhex/patches/patch-lib_libimhex_source_api_task.cpp'
X$NetBSD$
X
X--- lib/libimhex/source/api/task.cpp.orig 2023-09-24 18:05:03.000000000 +0000
X+++ lib/libimhex/source/api/task.cpp 2023-11-02 08:13:34.138865377 +0000
X@@ -47,6 +47,8 @@ namespace hex {
X
X const DWORD MS_VC_EXCEPTION = 0x406D1388;
X RaiseException(MS_VC_EXCEPTION, 0, sizeof(info) / sizeof(ULONG_PTR), (ULONG_PTR*)&info);
X+ #elif defined(__NetBSD__)
X+ pthread_setname_np(pthread_self(), name.c_str(), NULL);
X #elif defined(OS_LINUX)
X pthread_setname_np(pthread_self(), name.c_str());
X #elif defined(OS_MACOS)
END-of-editors/imhex/patches/patch-lib_libimhex_source_api_task.cpp
echo x - editors/imhex/patches/patch-lib_libimhex_source_helpers_fs.cpp
sed 's/^X//' >editors/imhex/patches/patch-lib_libimhex_source_helpers_fs.cpp << 'END-of-editors/imhex/patches/patch-lib_libimhex_source_helpers_fs.cpp'
X$NetBSD$
X
X--- lib/libimhex/source/helpers/fs.cpp.orig 2023-09-24 18:05:03.000000000 +0000
X+++ lib/libimhex/source/helpers/fs.cpp 2023-11-02 08:20:07.528289130 +0000
X@@ -13,7 +13,6 @@
X #include <shlobj.h>
X #elif defined(OS_LINUX)
X #include <xdg.hpp>
X- #include <linux/limits.h>
X #endif
X
X #include <algorithm>
END-of-editors/imhex/patches/patch-lib_libimhex_source_helpers_fs.cpp
echo x - editors/imhex/patches/patch-main_source_window_linux_window.cpp
sed 's/^X//' >editors/imhex/patches/patch-main_source_window_linux_window.cpp << 'END-of-editors/imhex/patches/patch-main_source_window_linux_window.cpp'
X$NetBSD$
X
X--- main/source/window/linux_window.cpp.orig 2023-09-24 18:05:03.000000000 +0000
X+++ main/source/window/linux_window.cpp 2023-11-02 08:57:54.987341924 +0000
X@@ -81,7 +81,8 @@ namespace hex {
X while (fgets(buffer.data(), buffer.size(), pipe) != nullptr)
X result += buffer.data();
X
X- auto exitCode = WEXITSTATUS(pclose(pipe));
X+ int statusCode = pclose(pipe);
X+ auto exitCode = WEXITSTATUS(statusCode);
X if (exitCode != 0) return;
X
X EventManager::post<RequestChangeTheme>(hex::containsIgnoreCase(result, "light") ? "Light" : "Dark");
X@@ -99,4 +100,4 @@ namespace hex {
X
X }
X
X-#endif
X\ No newline at end of file
X+#endif
END-of-editors/imhex/patches/patch-main_source_window_linux_window.cpp
echo x - editors/imhex/patches/patch-plugins_builtin_CMakeLists.txt
sed 's/^X//' >editors/imhex/patches/patch-plugins_builtin_CMakeLists.txt << 'END-of-editors/imhex/patches/patch-plugins_builtin_CMakeLists.txt'
X$NetBSD$
X
X--- plugins/builtin/CMakeLists.txt.orig 2023-09-24 18:05:03.000000000 +0000
X+++ plugins/builtin/CMakeLists.txt 2023-11-02 09:17:44.434482428 +0000
X@@ -1,5 +1,11 @@
X cmake_minimum_required(VERSION 3.16)
X
X+include(CheckSymbolExists)
X+check_symbol_exists(lseek64 "stdio.h" HAVE_LSEEK64)
X+if (HAVE_LSEEK64)
X+ add_definitions(-DHAVE_LSEEK64=1)
X+endif ()
X+
X include(ImHexPlugin)
X add_imhex_plugin(
X NAME
X@@ -75,4 +81,4 @@ add_imhex_plugin(
X
X INCLUDES
X include
X-)
X\ No newline at end of file
X+)
END-of-editors/imhex/patches/patch-plugins_builtin_CMakeLists.txt
echo x - editors/imhex/patches/patch-plugins_builtin_source_content_providers_disk_provider.cpp
sed 's/^X//' >editors/imhex/patches/patch-plugins_builtin_source_content_providers_disk_provider.cpp << 'END-of-editors/imhex/patches/patch-plugins_builtin_source_content_providers_disk_provider.cpp'
X$NetBSD$
X
X--- plugins/builtin/source/content/providers/disk_provider.cpp.orig 2023-09-24 18:05:03.000000000 +0000
X+++ plugins/builtin/source/content/providers/disk_provider.cpp 2023-11-02 09:11:17.465008378 +0000
X@@ -20,10 +20,17 @@
X #elif defined(OS_LINUX)
X #include <fcntl.h>
X #include <unistd.h>
X+#if defined(__NetBSD__)
X+#include <sys/statvfs.h>
X+#else
X #include <linux/fs.h>
X+#endif
X #include <sys/stat.h>
X #include <sys/ioctl.h>
X #include <sys/types.h>
X+#if defined(HAVE_LSEEK64)
X+#define lseek lseek64
X+#endif
X #elif defined(OS_MACOS)
X #include <fcntl.h>
X #include <unistd.h>
X@@ -33,10 +40,6 @@
X #include <sys/disk.h>
X #endif
X
X-#if defined(OS_LINUX)
X-#define lseek lseek64
X-#endif
X-
X namespace hex::plugin::builtin {
X
X DiskProvider::DiskProvider() : Provider() {
X@@ -76,7 +79,23 @@ namespace hex::plugin::builtin {
X this->m_path = path;
X }
X
X-#if defined (OS_LINUX)
X+#if defined(__NetBSD__) || defined(__OpenBSD__)
X+ int blkdev_get_sector_size(int fd, int *sector_size) {
X+ struct statvfs fs;
X+ if (fstatvfs(fd, &fs) < 0)
X+ return -1;
X+ *sector_size = (int)fs.f_bsize;
X+ return 0;
X+ }
X+
X+ int blkdev_get_size(int fd, u64 *bytes) {
X+ struct statvfs fs;
X+ if (fstatvfs(fd, &fs) < 0)
X+ return -1;
X+ *bytes = fs.f_bsize * fs.f_blocks;
X+ return 0;
X+ }
X+#elif defined (OS_LINUX)
X #ifdef BLKSSZGET
X int blkdev_get_sector_size(int fd, int *sector_size) {
X if (ioctl(fd, BLKSSZGET, sector_size) < 0)
X@@ -453,4 +472,4 @@ namespace hex::plugin::builtin {
X return Provider::queryInformation(category, argument);
X }
X
X-}
X\ No newline at end of file
X+}
END-of-editors/imhex/patches/patch-plugins_builtin_source_content_providers_disk_provider.cpp
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment