From: classabbyamp <classabbyamp@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] New package: imhex-1.25.0
Date: Mon, 19 Dec 2022 07:28:24 +0100 [thread overview]
Message-ID: <20221219062824.byuHuAJZ6Zn6Da_Un92hNiBQhKTC0yZTTD82Dt-PzYE@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-36967@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 692 bytes --]
There is an updated pull request by classabbyamp against master on the void-packages repository
https://github.com/classabbyamp/void-packages new/imhex
https://github.com/void-linux/void-packages/pull/36967
New package: imhex-1.25.0
closes #36954
This template will be able to be cleaned up a bit once capstone v5 is released (currently at rc2).
#### Testing the changes
- I tested the changes in this PR: **YES**
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**
A patch file from https://github.com/void-linux/void-packages/pull/36967.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-new/imhex-36967.patch --]
[-- Type: text/x-diff, Size: 8932 bytes --]
From 30b5d5542eeb3f415354e6a8a59e48c66a753f4b Mon Sep 17 00:00:00 2001
From: classabbyamp <dev@placeviolette.net>
Date: Tue, 3 May 2022 02:27:08 -0400
Subject: [PATCH] New package: imhex-1.25.0
closes #36954
---
srcpkgs/imhex-patterns | 1 +
srcpkgs/imhex/patches/musl.patch | 29 +++++++
srcpkgs/imhex/patches/no-update-check.patch | 90 +++++++++++++++++++++
srcpkgs/imhex/template | 53 ++++++++++++
4 files changed, 173 insertions(+)
create mode 120000 srcpkgs/imhex-patterns
create mode 100644 srcpkgs/imhex/patches/musl.patch
create mode 100644 srcpkgs/imhex/patches/no-update-check.patch
create mode 100644 srcpkgs/imhex/template
diff --git a/srcpkgs/imhex-patterns b/srcpkgs/imhex-patterns
new file mode 120000
index 000000000000..9f335cad9f82
--- /dev/null
+++ b/srcpkgs/imhex-patterns
@@ -0,0 +1 @@
+imhex
\ No newline at end of file
diff --git a/srcpkgs/imhex/patches/musl.patch b/srcpkgs/imhex/patches/musl.patch
new file mode 100644
index 000000000000..b8e2ba476367
--- /dev/null
+++ b/srcpkgs/imhex/patches/musl.patch
@@ -0,0 +1,29 @@
+From a966cab1551e0e15e4261c55349b27f84d29cecc Mon Sep 17 00:00:00 2001
+From: WerWolv <werwolv98@gmail.com>
+Date: Mon, 19 Dec 2022 07:15:18 +0100
+Subject: [PATCH] build: Use correct fcntl.h include on Linux
+
+---
+ plugins/builtin/include/content/providers/file_provider.hpp | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/ImHex/plugins/builtin/include/content/providers/file_provider.hpp b/ImHex/plugins/builtin/include/content/providers/file_provider.hpp
+index 61da65cc8db2..ce8ee7084e0c 100644
+--- a/ImHex/plugins/builtin/include/content/providers/file_provider.hpp
++++ b/ImHex/plugins/builtin/include/content/providers/file_provider.hpp
+@@ -9,10 +9,14 @@
+ #if defined(OS_WINDOWS)
+ #define WIN32_LEAN_AND_MEAN
+ #include <windows.h>
++#elif defined(OS_MACOS)
++ #include <sys/mman.h>
++ #include <unistd.h>
++ #include <sys/fcntl.h>
+ #else
+ #include <sys/mman.h>
+ #include <unistd.h>
+- #include <sys/fcntl.h>
++ #include <fcntl.h>
+ #endif
+
+ namespace hex::plugin::builtin {
diff --git a/srcpkgs/imhex/patches/no-update-check.patch b/srcpkgs/imhex/patches/no-update-check.patch
new file mode 100644
index 000000000000..c600bceac07e
--- /dev/null
+++ b/srcpkgs/imhex/patches/no-update-check.patch
@@ -0,0 +1,90 @@
+running the internal update checker is pointless when updates are managed by xbps
+
+--- a/ImHex/plugins/builtin/source/content/welcome_screen.cpp
++++ b/ImHex/plugins/builtin/source/content/welcome_screen.cpp
+@@ -517,20 +517,6 @@
+ loadDefaultLayout();
+ });
+
+- EventManager::subscribe<EventWindowInitialized>([] {
+- // documentation of the value above the setting definition
+- int showCheckForUpdates = ContentRegistry::Settings::read("hex.builtin.setting.general", "hex.builtin.setting.general.check_for_updates", 2);
+- if (showCheckForUpdates == 2) {
+- ContentRegistry::Settings::write("hex.builtin.setting.general", "hex.builtin.setting.general.check_for_updates", 0);
+- View::showYesNoQuestionPopup("hex.builtin.welcome.check_for_updates_text"_lang,
+- [] { // yes
+- ContentRegistry::Settings::write("hex.builtin.setting.general", "hex.builtin.setting.general.check_for_updates", 1);
+- ImGui::CloseCurrentPopup();
+- }, [] { // no
+- ImGui::CloseCurrentPopup();
+- });
+- }
+- });
+
+ ContentRegistry::Interface::addMenuItem("hex.builtin.menu.file", 1075, [&] {
+ if (ImGui::BeginMenu("hex.builtin.menu.file.open_recent"_lang, !s_recentProvidersUpdating && !s_recentProviders.empty())) {
+--- a/ImHex/plugins/builtin/source/content/settings_entries.cpp
++++ b/ImHex/plugins/builtin/source/content/settings_entries.cpp
+@@ -35,21 +35,6 @@
+
+ /* General */
+
+- /* Values of this setting :
+- 0 - do not check for updates on startup
+- 1 - check for updates on startup
+- 2 - default value - ask the user if he wants to check for updates. This value should only be encountered on the first startup.
+- */
+- ContentRegistry::Settings::add("hex.builtin.setting.general", "hex.builtin.setting.general.check_for_updates", 2, [](auto name, nlohmann::json &setting) {
+- static bool enabled = static_cast<int>(setting) == 1;
+-
+- if (ImGui::Checkbox(name.data(), &enabled)) {
+- setting = static_cast<int>(enabled);
+- return true;
+- }
+-
+- return false;
+- });
+
+ ContentRegistry::Settings::add("hex.builtin.setting.general", "hex.builtin.setting.general.show_tips", 1, [](auto name, nlohmann::json &setting) {
+ static bool enabled = static_cast<int>(setting);
+--- a/ImHex/main/source/init/tasks.cpp
++++ b/ImHex/main/source/init/tasks.cpp
+@@ -24,30 +24,6 @@
+
+ using namespace std::literals::string_literals;
+
+- static bool checkForUpdates() {
+- // documentation of the value above the setting definition
+- int showCheckForUpdates = ContentRegistry::Settings::read("hex.builtin.setting.general", "hex.builtin.setting.general.check_for_updates", 2);
+- if (showCheckForUpdates == 1){
+- hex::Net net;
+-
+- auto releases = net.getJson(GitHubApiURL + "/releases/latest"s, 2000).get();
+- if (releases.code != 200)
+- return false;
+-
+- if (!releases.body.contains("tag_name") || !releases.body["tag_name"].is_string())
+- return false;
+-
+- auto versionString = std::string(IMHEX_VERSION);
+- size_t versionLength = std::min(versionString.find_first_of('-'), versionString.length());
+- auto currVersion = "v" + versionString.substr(0, versionLength);
+- auto latestVersion = releases.body["tag_name"].get<std::string_view>();
+-
+- if (latestVersion != currVersion)
+- ImHexApi::System::impl::addInitArgument("update-available", latestVersion.data());
+-
+- }
+- return true;
+- }
+
+ bool createDirectories() {
+ bool result = true;
+@@ -283,7 +283,6 @@
+ { "Creating directories", createDirectories, false },
+ { "Loading settings", loadSettings, false },
+ { "Loading plugins", loadPlugins, false },
+- { "Checking for updates", checkForUpdates, true },
+ { "Loading fonts", loadFonts, true },
+ };
+ }
diff --git a/srcpkgs/imhex/template b/srcpkgs/imhex/template
new file mode 100644
index 000000000000..29155de36532
--- /dev/null
+++ b/srcpkgs/imhex/template
@@ -0,0 +1,53 @@
+# Template file for 'imhex'
+pkgname=imhex
+version=1.25.0
+revision=1
+create_wrksrc=yes
+build_wrksrc="ImHex"
+build_style=cmake
+build_helper=qemu
+# XXX: when capstone v5 is out, -DUSE_SYSTEM_CAPSTONE=ON
+configure_args="-DIMHEX_OFFLINE_BUILD=ON -DIMHEX_STRIP_RELEASE=OFF
+ -DUSE_SYSTEM_CURL=ON -DUSE_SYSTEM_FMT=ON -DUSE_SYSTEM_LLVM=ON
+ -DUSE_SYSTEM_YARA=ON -DUSE_SYSTEM_NLOHMANN_JSON=ON"
+hostmakedepends="pkg-config clang-tools-extra qemu-user-static"
+makedepends="libcurl-devel fmt-devel llvm12 jansson-devel yara-devel json-c++
+ freetype-devel glfw-devel gtk+3-devel python3-devel file-devel mbedtls-devel
+ clang-tools-extra"
+short_desc="Hex editor for reverse engineers and programmers"
+maintainer="classabbyamp <dev@placeviolette.net>"
+license="GPL-2.0-or-later"
+homepage="https://imhex.werwolv.net/"
+changelog="https://github.com/WerWolv/ImHex/releases"
+distfiles="https://github.com/WerWolv/ImHex/releases/download/v${version}/Full.Sources.tar.gz>imhex-${version}.tar.gz
+ https://github.com/WerWolv/ImHex-Patterns/archive/refs/tags/ImHex-v${version}.tar.gz>imhex-patterns-${version}.tar.gz"
+checksum="59817990bb1ab2377143480d4a26171ea631bcecdbc6682b2f79bed2a30e7eed
+ aff9b14a67bea48a06365b1d702af3b6c9cee9161912dd4daadd3f34ae8ee204"
+
+if [ "$XBPS_TARGET_WORDSIZE" = 32 ]; then
+ broken="uses i128"
+fi
+
+nocross="/bin/sh: line 1: /builddir/imhex-1.25.0/ImHex/build/lib/libimhex/external/libromfs/generator/generator-imhex: cannot execute binary file: Exec format error"
+
+do_check() {
+ cd build
+ ninja ${makejobs} unit_tests
+ # StoreAPI, TipsAPI, ContentAPI tests are flaky
+ ctest ${makejobs} -E '^.*API$'
+}
+
+post_install() {
+ vmkdir usr/share/imhex
+ for d in constants encodings includes magic patterns yara; do
+ vcopy ../ImHex-Patterns-ImHex-v${version}/$d usr/share/imhex
+ done
+}
+
+imhex-patterns_package() {
+ short_desc+=" - patterns and magic files"
+ depends="imhex"
+ pkg_install() {
+ vmove usr/share/imhex
+ }
+}
next prev parent reply other threads:[~2022-12-19 6:28 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-03 6:28 [PR PATCH] New package: imhex-1.17.0 classabbyamp
2022-05-03 6:54 ` [PR PATCH] [Updated] " classabbyamp
2022-05-03 7:06 ` classabbyamp
2022-05-03 7:14 ` classabbyamp
2022-05-03 12:38 ` dmarto
2022-05-03 17:09 ` [PR PATCH] [Updated] " classabbyamp
2022-05-03 17:09 ` classabbyamp
2022-05-07 20:58 ` [PR PATCH] [Updated] " classabbyamp
2022-05-17 17:07 ` classabbyamp
2022-05-28 6:56 ` classabbyamp
2022-05-28 19:43 ` classabbyamp
2022-05-28 19:52 ` classabbyamp
2022-05-28 20:11 ` classabbyamp
2022-06-04 15:31 ` [PR PATCH] [Updated] New package: imhex-1.18.1 classabbyamp
2022-06-04 19:48 ` classabbyamp
2022-06-23 22:35 ` New package: imhex-1.18.2 iTrooz
2022-06-23 22:58 ` classabbyamp
2022-07-05 15:00 ` [PR PATCH] [Updated] " classabbyamp
2022-07-07 15:58 ` classabbyamp
2022-07-18 5:20 ` [PR PATCH] [Updated] New package: imhex-1.19.1 classabbyamp
2022-08-03 15:52 ` classabbyamp
2022-08-03 15:52 ` classabbyamp
2022-08-03 16:14 ` classabbyamp
2022-08-03 16:32 ` classabbyamp
2022-08-03 16:59 ` classabbyamp
2022-11-02 2:13 ` github-actions
2022-12-19 1:36 ` [PR PATCH] [Updated] New package: imhex-1.25.0 classabbyamp
2022-12-19 6:28 ` classabbyamp [this message]
2022-12-19 7:33 ` classabbyamp
2022-12-19 7:52 ` classabbyamp
2022-12-19 7:57 ` classabbyamp
2022-12-20 22:55 ` [PR PATCH] [Merged]: " classabbyamp
2022-12-22 0:16 ` iTrooz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221219062824.byuHuAJZ6Zn6Da_Un92hNiBQhKTC0yZTTD82Dt-PzYE@z \
--to=classabbyamp@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).