GNU bug report logs - #67755
[PATCH] gnu: Add imhex.

Previous Next

Package: guix-patches;

Reported by: Sergio Pastor Pérez <sergio.pastorperez <at> outlook.es>

Date: Sun, 10 Dec 2023 20:20:02 UTC

Severity: normal

Tags: patch

Done: Liliana Marie Prikler <liliana.prikler <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #107 received at 67755 <at> debbugs.gnu.org (full text, mbox):

From: "Sergio Pastor Pérez" <liliana.prikler <at> gmail.com>
To: 67755 <at> debbugs.gnu.org
Cc: Sergio Pastor Pérez <sergio.pastorperez <at> outlook.es>
Subject: [PATCH v6 7/8] gnu: Add imhex-pattern-language.
Date: Wed, 19 Mar 2025 18:00:08 +0100
* gnu/packages/hexedit.scm (imhex-pattern-language): New variable.

Change-Id: I641bebed0bea9b2c8aca87f54d0fb457064a07d7
---
Changes from v5:
* Use system fmt (fmt-11).
* Use a keep list rather than a delete list.

I think the header-only libraries should be provided as regular inputs,
but haven't done that yet.

 gnu/packages/hexedit.scm | 71 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 70 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/hexedit.scm b/gnu/packages/hexedit.scm
index 15bf7db8773..ed30e882847 100644
--- a/gnu/packages/hexedit.scm
+++ b/gnu/packages/hexedit.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2018, 2020, 2022 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba <at> kadziolka.net>
 ;;; Copyright © 2024 Artyom V. Poptsov <poptsov.artyom <at> gmail.com>
+;;; Copyright © 2025 Sergio Pastor Pérez <sergio.pastorperez <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -22,17 +23,23 @@
 
 (define-module (gnu packages hexedit)
   #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix gexp)
   #:use-module (guix packages)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages python)
   #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages pretty-print)
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix gexp)
   #:use-module (guix utils)
-  #:use-module (guix build-system gnu))
+  #:use-module (guix build-system gnu)
+  #:use-module (guix build-system cmake))
 
 (define-public hexedit
   (package
@@ -137,6 +144,68 @@ (define-public ht
     (home-page "https://hte.sourceforge.net/")
     (license license:gpl2)))
 
+;; NOTE: The install target of imhex-pattern-language falls short in a few areas
+;; that make this package difficult to use outside of ImHex.  Neither header
+;; files nor package information (using e.g. pkg-config or CMake files) are
+;; currently available.
+(define-public imhex-pattern-language
+  (package
+    (name "imhex-pattern-language")
+    (version "1.37.4")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/WerWolv/PatternLanguage")
+             (commit (string-append "ImHex-v" version))
+             (recursive? #t)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "13mlbclg2r3axv6vz4dsyry5azc6xavcbdkvwan6zyaq9ngk7r3r"))
+       (modules '((guix build utils) (ice-9 ftw)))
+       (snippet #~(begin
+                    ;; NOTE: the `throwing-ptr' hasn't been updated in 6 years
+                    ;; and the testsuite expects to use an outdated version of
+                    ;; Conan, since this library if not interesting to have it
+                    ;; in Guix it will remain bundled.
+                    ;; NOTE: `libwolf' does not have an install target. Until
+                    ;; the maintainers create one, it will be bundled.
+                    (with-directory-excursion "external"
+                      (for-each
+                       (lambda (dir)
+                         (unless (member dir '("." ".." "libwolv" "throwing_ptr"))
+                           (delete-file-recursively dir)))
+                       (scandir ".")))))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      #:configure-flags ''("-DLIBPL_SHARED_LIBRARY=ON"
+                           "-DLIBPL_ENABLE_TESTS=ON"
+                           "-DUSE_SYSTEM_NLOHMANN_JSON=ON"
+                           "-DUSE_SYSTEM_CLI11=ON"
+                           "-DUSE_SYSTEM_FMT=ON")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'fix-rel-paths
+            (lambda _
+              (substitute* "tests/include/test_patterns/test_pattern_format.hpp"
+                (("../tests/files/export/")
+                 "../source/tests/files/export/"))))
+          (add-after 'build 'build-tests
+            (lambda _
+              (invoke "make" "pattern_language_tests" "plcli")))
+          (add-before 'check 'plcli-integration-tests
+            (lambda _
+              (with-directory-excursion "../source"
+                (invoke "python3" "tests/integration/integration.py"
+                        "../build/cli/plcli")))))))
+    (native-inputs (list cli11 gcc-14 fmt-11 nlohmann-json python))
+    (home-page "https://imhex.werwolv.net")
+    (synopsis "Pattern language used by the ImHex Hex Editor")
+    (description "This package provides a C-like domain-specific language used
+for specifying patterns in the ImHex Hex Editor.")
+    (license license:lgpl2.1)))
+
 (define-public bvi
   (package
     (name "bvi")
-- 
2.48.1





This bug report was last modified 136 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.