unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#67755] [PATCH v4 2/8] gnu: Add jthread.
       [not found] <01e5d15a71a605dd55df3cac5b7d30e15520f8ea.1724709670.git.sergio.pastorperez@outlook.es>
@ 2024-08-26 22:01 ` Sergio Pastor Pérez
  2024-08-26 22:01 ` [bug#67755] [PATCH v4 3/8] gnu: Add lunasvg Sergio Pastor Pérez
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: Sergio Pastor Pérez @ 2024-08-26 22:01 UTC (permalink / raw)
  To: 67755; +Cc: Sergio Pastor Pérez

* gnu/packages/cpp.scm (jthread): New variable.

Change-Id: I163ab0f8dbd9bc5ed0250612938f82926b07bc92
---
 gnu/packages/cpp.scm | 93 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 93 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 708487ca97..49520d1ece 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -111,6 +111,7 @@ (define-module (gnu packages cpp)
   #:use-module (gnu packages pretty-print)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages tls)
+  #:use-module (gnu packages tex)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
@@ -913,6 +914,98 @@ (define-public nlohmann-json
 (define-public json-modern-cxx
   (deprecated-package "json-modern-cxx" nlohmann-json))
 
+(define-public jthread
+  (let ((commit "0fa8d394254886c555d6faccd0a3de819b7d47f8")
+        (revision "0"))
+    (package
+      (name "jthread")
+      (version (git-version "0.0.0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/josuttis/jthread")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "11cq4zh7pv86c62ah5im00gxr4cw6d396dp9117z8s271j4lrp6f"))
+         (snippet
+          ;; NOTE: remove precompiled PDFs.
+          #~(begin
+              (use-modules (guix build utils))
+              (for-each (lambda (file)
+                          (delete-file file))
+                        (find-files "." ".pdf"))
+              (delete-file-recursively "doc")))))
+      (outputs '("out" "doc"))
+      (build-system cmake-build-system)
+      (arguments
+       (list
+        #:phases #~(modify-phases %standard-phases
+                     (delete 'configure)
+                     (delete 'build)
+                     (add-after 'unpack 'cd-and-generate-makefile
+                       (lambda _
+                         (call-with-output-file "source/Makefile.h"
+                           (lambda (port)
+                             ;; GCC 2.95 fails to deal with anonymous unions in glibc's
+                             ;; 'struct_rusage.h', so skip that.
+                             (display "CXX17 := c++ -std=c++17 -pthread\n"
+                                      port)))))
+                     (replace 'check
+                       (lambda* (#:key tests? #:allow-other-keys)
+                         (when tests?
+                           (invoke "make" "-C" "source"))))
+                     (add-after 'check 'build-docs
+                       (lambda _
+                         (with-directory-excursion "tex"
+                           ;; NOTE: remove strict versioning.
+                           (substitute* "styles.tex"
+                             (("lst@CheckVersion\\{1.6\\}")
+                              "lst@CheckVersion{1.9}"))
+                           (invoke "pdflatex" "std")
+                           (invoke "pdflatex" "std")))) ;Rerun to update references.
+                     (replace 'install
+                       (lambda _
+                         (for-each (lambda (file)
+                                     (install-file file
+                                                   (string-append #$output
+                                                                  "/include")))
+                                   '("source/condition_variable_any2.hpp"
+                                     "source/stop_token.hpp"
+                                     "source/jthread.hpp"))))
+                     (add-after 'install 'install-doc
+                       (lambda _
+                         (let ((out (string-append #$output:doc "/share/doc/")))
+                           (mkdir-p out)
+                           (copy-file "tex/std.pdf"
+                                      (string-append out
+                                                     #$name "-"
+                                                     #$version ".pdf"))))))))
+      (native-inputs (list perl
+                           (texlive-updmap.cfg (list texlive-ulem
+                                                     texlive-rsfs
+                                                     texlive-memoir
+                                                     texlive-substr
+                                                     texlive-xcolor
+                                                     texlive-isodate
+                                                     texlive-caption
+                                                     texlive-relsize
+                                                     texlive-extract
+                                                     texlive-xkeyval
+                                                     texlive-jknapltx
+                                                     texlive-enumitem
+                                                     texlive-etoolbox
+                                                     texlive-listings
+                                                     texlive-microtype
+                                                     texlive-underscore))))
+      (home-page "https://github.com/josuttis/jthread")
+      (synopsis "C++ class for a joining and cooperative interruptible thread")
+      (description
+       "C++ class for a joining and cooperative interruptible thread
+(std::jthread) with stop_token helper.")
+      (license license:cc-by4.0))))
+
 (define-public tomlplusplus
   (package
    (name "tomlplusplus")
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#67755] [PATCH v4 3/8] gnu: Add lunasvg.
       [not found] <01e5d15a71a605dd55df3cac5b7d30e15520f8ea.1724709670.git.sergio.pastorperez@outlook.es>
  2024-08-26 22:01 ` [bug#67755] [PATCH v4 2/8] gnu: Add jthread Sergio Pastor Pérez
@ 2024-08-26 22:01 ` Sergio Pastor Pérez
  2024-08-26 22:01 ` [bug#67755] [PATCH v4 4/8] gnu: Add miniaudio Sergio Pastor Pérez
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: Sergio Pastor Pérez @ 2024-08-26 22:01 UTC (permalink / raw)
  To: 67755; +Cc: Sergio Pastor Pérez

* gnu/packages/cpp.scm (lunasvg): New variable.

Change-Id: I77b7943e26e4e676a1575e3e33305f6f4476b401
---
 gnu/packages/cpp.scm | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 49520d1ece..ec5156b1fa 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -467,6 +467,27 @@ (define-public libzen
 operating system functions.")
     (license license:zlib)))
 
+(define-public lunasvg
+  (package
+    (name "lunasvg")
+    (version "2.4.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/sammycage/lunasvg")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0s81phhi0q1mkzhx9fxgvv71s21yv50r01gi3bdwxzb3xrhj3yjk"))))
+    (build-system cmake-build-system)
+    (arguments
+     '(#:tests? #f)) ; No tests.
+    (home-page "https://github.com/sammycage/lunasvg")
+    (synopsis "Standalone SVG rendering library in C++")
+    (description "Standalone SVG rendering library in C++.")
+    (license license:expat)))
+
 (define-public rttr
   (package
     (name "rttr")
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#67755] [PATCH v4 4/8] gnu: Add miniaudio.
       [not found] <01e5d15a71a605dd55df3cac5b7d30e15520f8ea.1724709670.git.sergio.pastorperez@outlook.es>
  2024-08-26 22:01 ` [bug#67755] [PATCH v4 2/8] gnu: Add jthread Sergio Pastor Pérez
  2024-08-26 22:01 ` [bug#67755] [PATCH v4 3/8] gnu: Add lunasvg Sergio Pastor Pérez
@ 2024-08-26 22:01 ` Sergio Pastor Pérez
  2024-08-26 22:01 ` [bug#67755] [PATCH v4 5/8] gnu: Add nativefiledialog-extended Sergio Pastor Pérez
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: Sergio Pastor Pérez @ 2024-08-26 22:01 UTC (permalink / raw)
  To: 67755; +Cc: Sergio Pastor Pérez

* gnu/packages/cpp.scm (miniaudio): New variable.

Change-Id: I27b74793dd7b80af4437e0a1b997cc87fe8822e5
---
 gnu/packages/cpp.scm | 51 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index ec5156b1fa..dd6488ccd1 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -1685,6 +1685,57 @@ (define (make-static-abseil-cpp version)
            #~(cons* "-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
                     (delete "-DBUILD_SHARED_LIBS=ON" #$flags)))))))))
 
+(define-public miniaudio
+  (package
+    (name "miniaudio")
+    (version "0.11.21")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/mackron/miniaudio")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0hlqp44ifi3vswvfpqljj89321y6yz3zq6rng51wfq8p4n9k5qhh"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   (delete 'build)
+                   (delete 'configure)
+                   (replace 'check
+                     (lambda* (#:key tests? #:allow-other-keys)
+                       (when tests?
+                         (with-directory-excursion "tests/_build"
+                           (mkdir "bin")
+                           (invoke "gcc"
+                                   "../test_automated/ma_test_automated.c"
+                                   "-o"
+                                   "bin/test_automated"
+                                   "-ldl"
+                                   "-lm"
+                                   "-lpthread"
+                                   "-Wall"
+                                   "-Wextra"
+                                   "-Wpedantic"
+                                   "-std=c89")
+                           (invoke "./bin/test_automated")))))
+                   (replace 'install
+                     (lambda _
+                       (install-file "miniaudio.h"
+                                     (string-append #$output "/include"))
+                       (copy-recursively "extras"
+                                         (string-append #$output
+                                                        "/include/extras/")))))))
+    (home-page "https://miniaud.io")
+    (synopsis "Audio playback and capture library for C and C++")
+    (description
+     "@code{miniaudio} is an audio playback and capture library for C and C++.
+It's made up of a single source file, has no external dependencies and is
+released into the public domain.")
+    (license license:expat)))
+
 (define-public abseil-cpp-cxxstd17
   (abseil-cpp-for-c++-standard abseil-cpp 17))  ;XXX: the default with GCC 11?
 
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#67755] [PATCH v4 5/8] gnu: Add nativefiledialog-extended.
       [not found] <01e5d15a71a605dd55df3cac5b7d30e15520f8ea.1724709670.git.sergio.pastorperez@outlook.es>
                   ` (2 preceding siblings ...)
  2024-08-26 22:01 ` [bug#67755] [PATCH v4 4/8] gnu: Add miniaudio Sergio Pastor Pérez
@ 2024-08-26 22:01 ` Sergio Pastor Pérez
  2024-08-26 22:01 ` [bug#67755] [PATCH v4 6/8] gnu: Add xdgpp Sergio Pastor Pérez
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: Sergio Pastor Pérez @ 2024-08-26 22:01 UTC (permalink / raw)
  To: 67755; +Cc: Sergio Pastor Pérez

* gnu/packages/cpp.scm (nativefiledialog-extended): New variable.

Change-Id: I89ed4554db3ec8075bbb7d50bbfb4b99cae81a27
---
 gnu/packages/cpp.scm | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index dd6488ccd1..184d3a889c 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -3325,6 +3325,31 @@ (define-public mpark-variant
 based on the implementation of std::variant in libc++.")
     (license license:boost1.0)))
 
+(define-public nativefiledialog-extended
+  (package
+    (name "nativefiledialog-extended")
+    (version "1.2.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/btzy/nativefiledialog-extended")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "15l0jy3v4p6rgg9dk8zr80lqp51s32ii62cm4s90400ragdgh10v"))))
+    (build-system cmake-build-system)
+    (arguments
+     '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
+    (native-inputs (list pkg-config))
+    (inputs (list gtk+))
+    (home-page "https://github.com/btzy/nativefiledialog-extended")
+    (synopsis "Native file dialog library with C and C++ bindings")
+    (description
+     "Cross platform (Windows, Mac, Linux) native file dialog
+library with C and C++ bindings, based on mlabbe/nativefiledialog.")
+    (license license:zlib)))
+
 (define-public tsl-hopscotch-map
   (package
     (name "tsl-hopscotch-map")
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#67755] [PATCH v4 6/8] gnu: Add xdgpp.
       [not found] <01e5d15a71a605dd55df3cac5b7d30e15520f8ea.1724709670.git.sergio.pastorperez@outlook.es>
                   ` (3 preceding siblings ...)
  2024-08-26 22:01 ` [bug#67755] [PATCH v4 5/8] gnu: Add nativefiledialog-extended Sergio Pastor Pérez
@ 2024-08-26 22:01 ` Sergio Pastor Pérez
  2024-08-26 22:01 ` [bug#67755] [PATCH v4 7/8] gnu: Add imhex-pattern-language Sergio Pastor Pérez
  2024-08-26 22:01 ` [bug#67755] [PATCH v4 8/8] gnu: Add imhex Sergio Pastor Pérez
  6 siblings, 0 replies; 7+ messages in thread
From: Sergio Pastor Pérez @ 2024-08-26 22:01 UTC (permalink / raw)
  To: 67755; +Cc: Sergio Pastor Pérez

* gnu/packages/cpp.scm (xdgpp): New variable.

Change-Id: Ia11c0926e5b7f6e60c5dd48e8973cfd6391b1469
---
 gnu/packages/cpp.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 184d3a889c..6030963a3b 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -619,6 +619,39 @@ (define-public dashel
 combination of these streams.")
     (license license:bsd-3)))
 
+(define-public xdgpp
+  (let ((commit "f01f810714443d0f10c333d4d1d9c0383be41375")
+        (revision "0"))
+    (package
+      (name "xdgpp")
+      (version (git-version "0.0.0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://git.sr.ht/~danyspin97/xdgpp")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "1w8da10whrhc7j82jf90814m3blabkl9s0kg8hv8h2fj5y3ji7hw"))))
+      (build-system gnu-build-system)
+      (native-inputs (list catch2))
+      (arguments
+       (list
+        #:test-target "test"
+        #:phases #~(modify-phases %standard-phases
+                     (delete 'configure)
+                     (replace 'install
+                       (lambda _
+                         (install-file "xdg.hpp"
+                                       (string-append #$output "/include")))))))
+      (home-page "https://git.sr.ht/~danyspin97/xdgpp")
+      (synopsis
+       "C++17 header-only implementation of the XDG Base Directory Specification")
+      (description
+       "C++17 header-only implementation of the XDG Base Directory Specification.")
+      (license license:expat))))
+
 (define-public xsimd
   (package
     (name "xsimd")
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#67755] [PATCH v4 7/8] gnu: Add imhex-pattern-language.
       [not found] <01e5d15a71a605dd55df3cac5b7d30e15520f8ea.1724709670.git.sergio.pastorperez@outlook.es>
                   ` (4 preceding siblings ...)
  2024-08-26 22:01 ` [bug#67755] [PATCH v4 6/8] gnu: Add xdgpp Sergio Pastor Pérez
@ 2024-08-26 22:01 ` Sergio Pastor Pérez
  2024-08-26 22:01 ` [bug#67755] [PATCH v4 8/8] gnu: Add imhex Sergio Pastor Pérez
  6 siblings, 0 replies; 7+ messages in thread
From: Sergio Pastor Pérez @ 2024-08-26 22:01 UTC (permalink / raw)
  To: 67755; +Cc: Sergio Pastor Pérez

* gnu/packages/hexedit.scm (imhex-pattern-language): New variable.

Change-Id: I641bebed0bea9b2c8aca87f54d0fb457064a07d7
---
 gnu/packages/hexedit.scm | 74 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 73 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/hexedit.scm b/gnu/packages/hexedit.scm
index 668699a28c..e5f58fcce0 100644
--- a/gnu/packages/hexedit.scm
+++ b/gnu/packages/hexedit.scm
@@ -22,15 +22,20 @@
 
 (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 (guix download)
   #:use-module (guix git-download)
-  #:use-module (guix build-system gnu))
+  #:use-module (guix build-system gnu)
+  #:use-module (guix build-system cmake))
 
 (define-public hexedit
   (package
@@ -94,6 +99,73 @@ (define-public ht
     (home-page "https://hte.sourceforge.net/")
     (license license:gpl2)))
 
+;; NOTE: `imhex-pattern-language' should improve it's build system to be used
+;; easily outside of ImHex. It should update it's shared library install target
+;; to deploy the header files and it should create the pertinent
+;; 'libpl-config.cmake' and 'libpl-config-version.cmake' files.
+(define-public imhex-pattern-language
+  (package
+    (name "imhex-pattern-language")
+    (version "1.35.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
+                "0riphslp3rca6z6f5zfvsisdh94apijfi03s7yap1vjnf6i93pks"))
+              (snippet
+               #~(begin
+                   (use-modules (guix build utils))
+                   ;; 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 (path)
+                                 (delete-file-recursively path))
+                               '("nlohmann_json" "cli11")))))))
+    (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"
+         ;; NOTE: the `fmt' package is vendored since it needs
+         ;; a specific commit. Until there is a compatible
+         ;; release, there is no interest in creating a Guix
+         ;; package for it.
+         "-DUSE_SYSTEM_FMT=OFF")
+      #: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 nlohmann-json python))
+    (home-page "https://imhex.werwolv.net")
+    (synopsis "The Pattern Language used by the ImHex Hex Editor")
+    (description "The Pattern Language used by the ImHex Hex Editor.")
+    (license license:lgpl2.1)))
+
 (define-public bvi
   (package
     (name "bvi")
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#67755] [PATCH v4 8/8] gnu: Add imhex.
       [not found] <01e5d15a71a605dd55df3cac5b7d30e15520f8ea.1724709670.git.sergio.pastorperez@outlook.es>
                   ` (5 preceding siblings ...)
  2024-08-26 22:01 ` [bug#67755] [PATCH v4 7/8] gnu: Add imhex-pattern-language Sergio Pastor Pérez
@ 2024-08-26 22:01 ` Sergio Pastor Pérez
  6 siblings, 0 replies; 7+ messages in thread
From: Sergio Pastor Pérez @ 2024-08-26 22:01 UTC (permalink / raw)
  To: 67755; +Cc: Sergio Pastor Pérez

* gnu/packages/hexedit.scm (imhex): New variable.

Change-Id: I114d3a6c0dae32ea434a77a6bd88b8ff6870b70c
---
 gnu/packages/hexedit.scm | 151 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 151 insertions(+)

diff --git a/gnu/packages/hexedit.scm b/gnu/packages/hexedit.scm
index e5f58fcce0..0eb551b54e 100644
--- a/gnu/packages/hexedit.scm
+++ b/gnu/packages/hexedit.scm
@@ -27,11 +27,24 @@ (define-module (gnu packages hexedit)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages gl)
   #:use-module (gnu packages man)
   #:use-module (gnu packages cpp)
   #:use-module (gnu packages gcc)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages curl)
+  #:use-module (gnu packages llvm)
+  #:use-module (gnu packages ruby)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages boost)
+  #:use-module (gnu packages backup)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages libffi)
   #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages fontutils)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages engineering)
+  #:use-module (gnu packages pretty-print)
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
@@ -166,6 +179,144 @@ (define-public imhex-pattern-language
     (description "The Pattern Language used by the ImHex Hex Editor.")
     (license license:lgpl2.1)))
 
+(define-public imhex
+  (package
+    (name "imhex")
+    (version "1.35.4")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/WerWolv/ImHex")
+             (commit (string-append "v" version))
+             (recursive? #t)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0gi5772w0fzgr1w403ckq2mkwiyvcxv08frs2fjr2hlc8hb6c2p9"))
+       (snippet
+        #~(begin
+            (use-modules (guix build utils))
+            (define (delete-files-from-list-recursively . args)
+              (for-each (lambda (path)
+                          (delete-file-recursively path))
+                        args))
+
+            (define (replace-files-from-list-recursively lst)
+              (for-each
+               (lambda (elt)
+                 (delete-file-recursively (cdr elt))
+                 (copy-recursively (car elt) (cdr elt)))
+               lst))
+
+            ;; NOTE: `libwolf' does not have an install target. Until the
+            ;; maintainers create one, it will remain bundled.
+            ;; NOTE: `libromfs' it's meant to be bundled and cannot be compiled
+            ;; independently. Until the maintainers support building it
+            ;; independently, it will remain bundled.
+            ;; NOTE: `imhex-pattern-language' it's meant to be bundled and
+            ;; cannot be linked independently. Until the maintainers support
+            ;; linking it independently, it's source will be replaced in-tree.
+            (replace-files-from-list-recursively
+             `((#$(package-source imhex-pattern-language)
+                . "lib/external/pattern_language")))
+            ;; NOTE: `hashlibplus' has been left as a submodule since it's a fork
+            ;; which only makes sense within ImHex.
+            (with-directory-excursion "lib/third_party"
+              (delete-files-from-list-recursively
+               "nlohmann_json" "capstone" "llvm-demangle" "fmt" "nativefiledialog"
+               ;; NOTE: for versions above c++20 it is not required.
+               "jthread/jthread")
+              (replace-files-from-list-recursively
+               `((#$(package-source lunasvg) . "lunasvg")
+                 (#$(package-source xdgpp) . "xdgpp")
+                 (#$(file-append miniaudio "/include/miniaudio.h")
+                    . "miniaudio/include/miniaudio.h"))))))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      ;; NOTE: there is an issue with the way the test library is linked with
+      ;; the output binaries. Tests are intrusive and should not be shipped
+      ;; with the release, when the issue is fixed we could add a phase which
+      ;; builds the package with the tests and runs the testsuite and a second
+      ;; build phase which prepares the output binary.
+      #:configure-flags
+      ''("-DIMHEX_OFFLINE_BUILD=ON"
+         "-DIMHEX_ENABLE_UNIT_TESTS=ON"
+         ;; NOTE: required for the `validate-runpath' phase.
+         ;; If OFF, the pluggings won't be able to find `libimhex.so'.
+         "-DIMHEX_PLUGIN_ADD_INSTALL_PREFIX_TO_RPATH=ON"
+
+         "-DUSE_SYSTEM_NLOHMANN_JSON=ON"
+         "-DUSE_SYSTEM_CAPSTONE=ON"
+         "-DUSE_SYSTEM_CLI11=ON"
+         "-DUSE_SYSTEM_LLVM=ON"
+         "-DUSE_SYSTEM_FMT=ON"
+
+         "-DUSE_SYSTEM_BOOST=ON"
+         "-DUSE_SYSTEM_EDLIB=ON"
+         "-DUSE_SYSTEM_NFD=ON"
+
+         ;; NOTE: the build system doesn't correctly support
+         ;; locating these system libraries. Until fixed
+         ;; upstream, drop the sources where they are
+         ;; expected, this is done in the `<origin>' snippet.
+         "-DUSE_SYSTEM_MINIAUDIO=OFF"
+         "-DUSE_SYSTEM_LUNASVG=OFF"
+
+         ;; TODO: package them.
+         "-DUSE_SYSTEM_YARA=OFF")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'fix-paths
+            (lambda _
+              (substitute* "main/gui/source/window/linux_window.cpp"
+                (("dbus-send")
+                 #$(file-append dbus "/bin/dbus-send")))
+              (substitute* "cmake/build_helpers.cmake"
+                (("boost REQUIRED")
+                 "Boost COMPONENTS regex REQUIRED")
+                (("boost::regex")
+                 "Boost::regex"))
+              (substitute* "lib/libimhex/CMakeLists.txt"
+                (("boost")
+                 "Boost"))))
+          (add-before 'check 'build-tests
+            (lambda _
+              (invoke "make" "unit_tests"))))))
+    (native-inputs
+     (list cli11
+           nlohmann-json
+           pkg-config
+           python
+           python-wrapper
+           ruby
+           gcc-14))
+    (inputs
+     (list boost
+           capstone
+           curl
+           edlib
+           fmt
+           glfw
+           libarchive
+           libffi
+           llvm-17
+           mbedtls
+           mesa
+           nativefiledialog-extended
+           xz
+           zlib
+           freetype))
+    (home-page "https://imhex.werwolv.net")
+    (synopsis "Hex Editor to display, decode and analyze binary data")
+    (description "@command{imhex} is a hex editor with many advanced features
+that can often only be found in paid applications.  Such features are a
+completely custom binary template and pattern language to decode and highlight
+structures in the data, a graphical node-based data processor to pre-process
+values before they're displayed, a disassembler, diffing support, bookmarks
+and much much more.")
+    (license license:gpl2)))
+
 (define-public bvi
   (package
     (name "bvi")
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-08-26 22:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <01e5d15a71a605dd55df3cac5b7d30e15520f8ea.1724709670.git.sergio.pastorperez@outlook.es>
2024-08-26 22:01 ` [bug#67755] [PATCH v4 2/8] gnu: Add jthread Sergio Pastor Pérez
2024-08-26 22:01 ` [bug#67755] [PATCH v4 3/8] gnu: Add lunasvg Sergio Pastor Pérez
2024-08-26 22:01 ` [bug#67755] [PATCH v4 4/8] gnu: Add miniaudio Sergio Pastor Pérez
2024-08-26 22:01 ` [bug#67755] [PATCH v4 5/8] gnu: Add nativefiledialog-extended Sergio Pastor Pérez
2024-08-26 22:01 ` [bug#67755] [PATCH v4 6/8] gnu: Add xdgpp Sergio Pastor Pérez
2024-08-26 22:01 ` [bug#67755] [PATCH v4 7/8] gnu: Add imhex-pattern-language Sergio Pastor Pérez
2024-08-26 22:01 ` [bug#67755] [PATCH v4 8/8] gnu: Add imhex Sergio Pastor Pérez

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).