[PATCH] gnu: Add imhex.

  • Open
  • quality assurance status badge
Details
4 participants
  • Divya Ranjan
  • jgart
  • Sergio Pastor Pérez
  • Sergio Pastor Pérez
Owner
unassigned
Submitted by
Sergio Pastor Pérez
Severity
normal

Debbugs page

Sergio Pastor Pérez wrote 1 years ago
(address . guix-patches@gnu.org)(name . Sergio Pastor Pérez)(address . sergio.pastorperez@outlook.es)
DU2P193MB2132C35D79D699156A2DB730F388A@DU2P193MB2132.EURP193.PROD.OUTLOOK.COM
* gnu/packages/hexedit.scm (imhex): New variable.

Change-Id: Iac50937ceecf617ebadf4b81d3321a262e28090b
---
Hello.

This package adds ImHex using specifically commit
`ef7898ea8d83d0e3f4897c221f8595112aad9f2d`. This is done since from commit
`eae3cd99eef6202d772e3d2d43298449b7a36233` [1], the offline build enabled with
`-DIMHEX_OFFLINE_BUILD=ON` avoids running networking tests during the check
phase.

Thanks,
Sergio.


gnu/packages/hexedit.scm | 65 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 65 insertions(+)

Toggle diff (95 lines)
diff --git a/gnu/packages/hexedit.scm b/gnu/packages/hexedit.scm
index 79c14a2996..b1cb006de3 100644
--- a/gnu/packages/hexedit.scm
+++ b/gnu/packages/hexedit.scm
@@ -21,14 +21,26 @@
(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 ncurses)
+ #:use-module (gnu packages gl)
+ #:use-module (gnu packages tls)
+ #:use-module (gnu packages gcc)
+ #:use-module (gnu packages glib)
+ #:use-module (gnu packages curl)
+ #:use-module (gnu packages ruby)
+ #:use-module (gnu packages python)
+ #:use-module (gnu packages fontutils)
+ #:use-module (gnu packages pkg-config)
+ #:use-module (gnu packages engineering)
#:use-module (guix download)
#:use-module (guix git-download)
+ #:use-module (guix build-system cmake)
#:use-module (guix build-system gnu))
(define-public hexedit
@@ -93,6 +105,59 @@ (define-public ht
(home-page "https://hte.sourceforge.net/")
(license license:gpl2)))
+(define-public imhex
+ (let ((revision "0")
+ (commit "ef7898ea8d83d0e3f4897c221f8595112aad9f2d"))
+ (package
+ (name "imhex")
+ (version (git-version "1.31.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/WerWolv/ImHex")
+ (commit commit)
+ (recursive? #t)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0mqx9g3hzap1grav0n2fi54ph63kb9b0hx70zxkknq5rqp6mpy5m"))))
+ (build-system cmake-build-system)
+ (arguments
+ (list
+ #:configure-flags ''("-DIMHEX_OFFLINE_BUILD=ON"
+ "-DCMAKE_BUILD_TYPE=Release"
+ "-DCMAKE_BUILD_TYPE=Release")
+ #:phases #~(modify-phases %standard-phases
+ (add-after 'unpack 'fix-gsettings
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "main/gui/source/window/linux_window.cpp"
+ (("dbus-send")
+ (search-input-file inputs "/bin/dbus-send")))))
+ (add-before 'check 'build-tests
+ (lambda _
+ (invoke "make" "unit_tests"))))))
+ (native-inputs (list gcc-13
+ pkg-config
+ python
+ python-wrapper
+ ruby
+ mbedtls-apache))
+ (inputs (list freetype
+ libglvnd
+ dbus
+ curl
+ glfw
+ dbus))
+ (home-page "https://github.com/WerWolv/ImHex")
+ (synopsis "Hex Editor to display, decode and analyze binary data")
+ (description
+ "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")

base-commit: 63e06f30ce20fa846a7e2e814976fefcd9eda7d3
--
2.41.0
Sergio Pastor Pérez wrote 8 months ago
[PATCH v2] gnu: Add imhex.
(address . 67755@debbugs.gnu.org)(name . Sergio Pastor Pérez)(address . sergio.pastorperez@outlook.es)
PAXP251MB0348D5D300F7971E167A2DD0F3D12@PAXP251MB0348.EURP251.PROD.OUTLOOK.COM
* gnu/packages/hexedit.scm (imhex): New variable.

Change-Id: Iac50937ceecf617ebadf4b81d3321a262e28090b
---
Hello!

I'm updating this patch since ImHex has been updated a few times since.

You will notice that the ImHex repository contains a few submodules, many of the
submodules are libraries which do not include a cmake 'Findxxx.cmake'. For some
libraries, the build system provides the appropriate file, but not for all. We
decided not to un-bundle the libraries for now, the maintainers will consider
adding the appropriate files in the future. Once that's done, we can update the
package and un-bundle the libraries.


gnu/packages/hexedit.scm | 98 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 98 insertions(+)

Toggle diff (128 lines)
diff --git a/gnu/packages/hexedit.scm b/gnu/packages/hexedit.scm
index 668699a28c..e730d160a6 100644
--- a/gnu/packages/hexedit.scm
+++ b/gnu/packages/hexedit.scm
@@ -22,14 +22,30 @@
(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 ncurses)
+ #:use-module (gnu packages gl)
+ #:use-module (gnu packages tls)
+ #:use-module (gnu packages gcc)
+ #:use-module (gnu packages cpp)
+ #:use-module (gnu packages llvm)
+ #:use-module (gnu packages glib)
+ #:use-module (gnu packages curl)
+ #:use-module (gnu packages ruby)
+ #:use-module (gnu packages python)
+ #:use-module (gnu packages backup)
+ #: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 cmake)
#:use-module (guix build-system gnu))
(define-public hexedit
@@ -94,6 +110,88 @@ (define-public ht
(home-page "https://hte.sourceforge.net/")
(license license:gpl2)))
+(define-public imhex
+ (package
+ (name "imhex")
+ (version "1.35.1")
+ (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 "1789hkqh78sg4cic09yq46bsy2vpk5y56b8g4q0r60si5y2vc9lh"))))
+ (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"
+
+ ;; TODO: remove unneeded submodules.
+ "-DUSE_SYSTEM_NLOHMANN_JSON=ON"
+ "-DUSE_SYSTEM_CAPSTONE=ON"
+ "-DUSE_SYSTEM_CLI11=ON"
+ "-DUSE_SYSTEM_LLVM=ON"
+ "-DUSE_SYSTEM_FMT=ON"
+
+ ;; TODO: package them.
+ "-DUSE_SYSTEM_MINIAUDIO=OFF"
+ "-DUSE_SYSTEM_LUNASVG=OFF"
+ "-DUSE_SYSTEM_JTHREAD=OFF"
+ "-DUSE_SYSTEM_BOOST=OFF"
+ "-DUSE_SYSTEM_EDLIB=OFF"
+ "-DUSE_SYSTEM_YARA=OFF"
+ "-DUSE_SYSTEM_NFD=OFF")
+ #:phases #~(modify-phases %standard-phases
+ (add-after 'unpack 'fix-gsettings
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "main/gui/source/window/linux_window.cpp"
+ (("dbus-send")
+ (search-input-file inputs "/bin/dbus-send")))))
+ (add-before 'check 'build-tests
+ (lambda _
+ (invoke "make" "unit_tests"))))))
+ (native-inputs (list gcc-13
+ pkg-config
+ python
+ python-wrapper
+ ruby
+ mbedtls-apache
+
+ ;; Third party submodules
+ nlohmann-json
+ capstone
+ llvm-17
+ cli11
+ fmt))
+ (inputs (list freetype
+ libarchive
+ mesa
+ dbus
+ curl
+ glfw
+ dbus))
+ (home-page "https://github.com/WerWolv/ImHex")
+ (synopsis "Hex Editor to display, decode and analyze binary data")
+ (description "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")

base-commit: d601e953a463669a775ce17138e2b0f0c2e73ad9
--
2.45.1
jgart wrote 8 months ago
Re: [PATCH] gnu: Add imhex.
(address . 67755@debbugs.gnu.org)(name . Sergio Pastor Pérez)(address . sergio.pastorperez@outlook.es)
87r0ceqign.fsf@dismail.de
Hi Sergio,

It looks like this patch still needs some work from the TODO comments.

Are you planning on resolving those TODO items soonish?

If you'd like to make this package easily available to others before its
ready for upstream I would recommend creating a channel for it.

all the best,

jgart
Sergio Pastor Pérez wrote 8 months ago
(name . jgart)(address . jgart@dismail.de)(address . 67755@debbugs.gnu.org)
PAXP251MB0348CDC3D06F4EC738251BF0F3D32@PAXP251MB0348.EURP251.PROD.OUTLOOK.COM
Hi! Thanks for taking a look.

jgart <jgart@dismail.de> writes:

Toggle quote (2 lines)
> Are you planning on resolving those TODO items soonish?

This is what I was explaining on the version 2 of the patch. It's not
something that should be fixed at the package level. I've discussed it
with the maintainers, until they don't implement a proper way of
externalizing the handling of libraries we should be using the
submodules.

Having said that, I think the package is ready, is there any reason why
you don't find it adequate, aside from the bundled libraries? We can
remove the comments if that's what worries you.

As a side note, I tried to un-bundle the libraries and the amount of
patching that it requires is unreasonable, every library requires it's
own CMAKE find file, which is responsibility of the software
developers. This is why I say that this should be done upstream.

I suggest to merge it as it is and I will update the package definition
once ImHex properly supports using system libraries. I don't think the
maintainers have this on their priority list so I don't know how long it
could take.

I will send a v3 of this patch without the comments and without the
redundant flags.

Toggle quote (3 lines)
> If you'd like to make this package easily available to others before its
> ready for upstream I would recommend creating a channel for it.

I have it already available on my channel.

Thanks for your time!
Have a good evening,
Sergio.
Sergio Pastor Pérez wrote 8 months ago
[PATCH v3] gnu: Add imhex.
(address . 67755@debbugs.gnu.org)(name . Sergio Pastor Pérez)(address . sergio.pastorperez@outlook.es)
PAXP251MB0348851E558B33233E7BBEFFF3D32@PAXP251MB0348.EURP251.PROD.OUTLOOK.COM
* gnu/packages/hexedit.scm (imhex): New variable.

Change-Id: Iac50937ceecf617ebadf4b81d3321a262e28090b
---
Updated patch without the TODO comments and the redundant flags.

gnu/packages/hexedit.scm | 87 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 87 insertions(+)

Toggle diff (117 lines)
diff --git a/gnu/packages/hexedit.scm b/gnu/packages/hexedit.scm
index 668699a28c..f5689fd1df 100644
--- a/gnu/packages/hexedit.scm
+++ b/gnu/packages/hexedit.scm
@@ -22,14 +22,30 @@
(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 ncurses)
+ #:use-module (gnu packages gl)
+ #:use-module (gnu packages tls)
+ #:use-module (gnu packages gcc)
+ #:use-module (gnu packages cpp)
+ #:use-module (gnu packages llvm)
+ #:use-module (gnu packages glib)
+ #:use-module (gnu packages curl)
+ #:use-module (gnu packages ruby)
+ #:use-module (gnu packages python)
+ #:use-module (gnu packages backup)
+ #: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 cmake)
#:use-module (guix build-system gnu))
(define-public hexedit
@@ -94,6 +110,77 @@ (define-public ht
(home-page "https://hte.sourceforge.net/")
(license license:gpl2)))
+(define-public imhex
+ (package
+ (name "imhex")
+ (version "1.35.1")
+ (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 "1789hkqh78sg4cic09yq46bsy2vpk5y56b8g4q0r60si5y2vc9lh"))))
+ (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")
+ #:phases #~(modify-phases %standard-phases
+ (add-after 'unpack 'fix-gsettings
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "main/gui/source/window/linux_window.cpp"
+ (("dbus-send")
+ (search-input-file inputs "/bin/dbus-send")))))
+ (add-before 'check 'build-tests
+ (lambda _
+ (invoke "make" "unit_tests"))))))
+ (native-inputs (list gcc-13
+ pkg-config
+ python
+ python-wrapper
+ ruby
+ mbedtls-apache
+
+ ;; Third party submodules
+ nlohmann-json
+ capstone
+ llvm-17
+ cli11
+ fmt))
+ (inputs (list freetype
+ libarchive
+ mesa
+ dbus
+ curl
+ glfw
+ dbus))
+ (home-page "https://github.com/WerWolv/ImHex")
+ (synopsis "Hex Editor to display, decode and analyze binary data")
+ (description "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")

base-commit: d601e953a463669a775ce17138e2b0f0c2e73ad9
--
2.45.1
Sergio Pastor Pérez wrote 7 months ago
Re: [PATCH] gnu: Add imhex.
(name . jgart)(address . jgart@dismail.de)(address . 67755@debbugs.gnu.org)
PAXP251MB0348778D33DA5D0855B4EC0DF38B2@PAXP251MB0348.EURP251.PROD.OUTLOOK.COM
jgart <jgart@dismail.de> writes:

Toggle quote (5 lines)
> Hi Sergio,
>
> It looks like this patch still needs some work from the TODO comments.
>
> Are you planning on resolving those TODO items soonish?
Hi!

I went ahead and unbundled all I could from the package. There are still
some vendored libraries that I think it's unreasonable to pacakge in
Guix, since they won't be useful for other packages. I added multiple
comments explaining why certain libraries remain bundled in the
package. You will see that, although I made Guix packages for most
libraries so they can be used by other users, for others I had to deploy
their source code in-tree. This is due to ImHex not supporting
unbundling them. After some discussions with the maintainers, the effort
required to refactor the build system to support a more modular
compilation, is out of the scope of the protect; the changes you see in
the following patches is the best I could do with a reasonable amount of
effort.

I hope this brings the package up to Guix's standards and
allows us to merge it.

Good night,
Sergio.
Sergio Pastor Pérez wrote 7 months ago
[PATCH v4 2/8] gnu: Add jthread.
(address . 67755@debbugs.gnu.org)(name . Sergio Pastor Pérez)(address . sergio.pastorperez@outlook.es)
PAXP251MB03486D519E57336C94543D13F38B2@PAXP251MB0348.EURP251.PROD.OUTLOOK.COM
* gnu/packages/cpp.scm (jthread): New variable.

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

Toggle diff (113 lines)
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
Sergio Pastor Pérez wrote 7 months ago
[PATCH v4 3/8] gnu: Add lunasvg.
(address . 67755@debbugs.gnu.org)(name . Sergio Pastor Pérez)(address . sergio.pastorperez@outlook.es)
PAXP251MB034896EA6C139CFFAA233F01F38B2@PAXP251MB0348.EURP251.PROD.OUTLOOK.COM
* gnu/packages/cpp.scm (lunasvg): New variable.

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

Toggle diff (34 lines)
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
Sergio Pastor Pérez wrote 7 months ago
[PATCH v4 4/8] gnu: Add miniaudio.
(address . 67755@debbugs.gnu.org)(name . Sergio Pastor Pérez)(address . sergio.pastorperez@outlook.es)
PAXP251MB034887FDAA1735B5E2C8A85EF38B2@PAXP251MB0348.EURP251.PROD.OUTLOOK.COM
* gnu/packages/cpp.scm (miniaudio): New variable.

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

Toggle diff (64 lines)
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
Sergio Pastor Pérez wrote 7 months ago
[PATCH v4 5/8] gnu: Add nativefiledialog-extended.
(address . 67755@debbugs.gnu.org)(name . Sergio Pastor Pérez)(address . sergio.pastorperez@outlook.es)
PAXP251MB034859C62EEBDA2E8D5FA7F6F38B2@PAXP251MB0348.EURP251.PROD.OUTLOOK.COM
* gnu/packages/cpp.scm (nativefiledialog-extended): New variable.

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

Toggle diff (38 lines)
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
Sergio Pastor Pérez wrote 7 months ago
[PATCH v4 6/8] gnu: Add xdgpp.
(address . 67755@debbugs.gnu.org)(name . Sergio Pastor Pérez)(address . sergio.pastorperez@outlook.es)
PAXP251MB034864C8399A2D5FB07609A4F38B2@PAXP251MB0348.EURP251.PROD.OUTLOOK.COM
* gnu/packages/cpp.scm (xdgpp): New variable.

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

Toggle diff (46 lines)
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
Sergio Pastor Pérez wrote 7 months ago
[PATCH v4 7/8] gnu: Add imhex-pattern-language.
(address . 67755@debbugs.gnu.org)(name . Sergio Pastor Pérez)(address . sergio.pastorperez@outlook.es)
PAXP251MB0348D60BFD86D877691395F7F38B2@PAXP251MB0348.EURP251.PROD.OUTLOOK.COM
* gnu/packages/hexedit.scm (imhex-pattern-language): New variable.

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

Toggle diff (102 lines)
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
Sergio Pastor Pérez wrote 7 months ago
[PATCH v4 8/8] gnu: Add imhex.
(address . 67755@debbugs.gnu.org)(name . Sergio Pastor Pérez)(address . sergio.pastorperez@outlook.es)
PAXP251MB034892752BCA35913841773EF38B2@PAXP251MB0348.EURP251.PROD.OUTLOOK.COM
* gnu/packages/hexedit.scm (imhex): New variable.

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

Toggle diff (176 lines)
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
Sergio Pastor Pérez wrote 7 months ago
[PATCH v4 1/8] gnu: Add edlib.
(address . 67755@debbugs.gnu.org)(name . Sergio Pastor Pérez)(address . sergio.pastorperez@outlook.es)
PAXP251MB0348018F87795B05E3F79F2EF38B2@PAXP251MB0348.EURP251.PROD.OUTLOOK.COM
* gnu/packages/cpp.scm (edlib): New variable.

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

Toggle diff (37 lines)
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 7dca7a2d02..708487ca97 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -390,6 +390,28 @@ (define-public c2ffi
various formats, including @code{json}.")
(license license:gpl2+)))
+(define-public edlib
+ (package
+ (name "edlib")
+ (version "1.2.7")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/Martinsos/edlib")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0ibpxs3r8ii2s3g7kdbyr8brg6ha5l0fb21idw8531gx9v2qzh4v"))))
+ (build-system cmake-build-system)
+ (arguments
+ '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
+ (home-page "https://github.com/Martinsos/edlib")
+ (synopsis "Lightweight C/C++ library for sequence alignment")
+ (description "Lightweight, C/C++ (& Python) library for sequence alignment
+using edit (Levenshtein) distance with a focus on speed.")
+ (license license:expat)))
+
(define-public expected-lite
(package
(name "expected-lite")

base-commit: 732dac4ce0de75ba0ffd79558e876815b273c925
--
2.45.2
Sergio Pastor Pérez wrote 7 months ago
Re: [PATCH] gnu: Add imhex.
(name . jgart)(address . jgart@dismail.de)(address . 67755@debbugs.gnu.org)
PAXP251MB0348F1434560988CCA7F93B6F38B2@PAXP251MB0348.EURP251.PROD.OUTLOOK.COM
Hello, again.

I forgot to add the Copyright line in the files where I added new
packages. If this patch series gets merged and maintainers find it
appropriate, please add it for me in the pertinent commit:
Toggle snippet (3 lines)
Copyright © 2024 Sergio Pastor Pérez <sergio.pastorperez@outlook.es>

Thanks!
Sergio.
Sergio Pastor Pérez wrote 47 hours ago
[PATCH v5 1/9] gnu: Add edlib.
(address . 67755@debbugs.gnu.org)(name . Sergio Pastor Pérez)(address . sergio.pastorperez@outlook.es)
5af801299bc13936ebbd6d1cbc5076dc5f11b463.1741720525.git.sergio.pastorperez@gmail.com
From: Sergio Pastor Pérez <sergio.pastorperez@outlook.es>

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

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

Toggle diff (47 lines)
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 8d482d1fbd..338455b9fb 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -43,7 +43,8 @@
;;; Copyright © 2024 Peepo Froggings <peepofroggings@tutanota.de>
;;; Copyright © 2024 Jakob Kirsch <jakob.kirsch@web.de>
;;; Copyright © 2025 Sharlatan Hellseher <sharlatanus@gmail.com>
-
+;;; Copyright © 2025 Sergio Pastor Pérez <sergio.pastorperez@gmail.com>
+;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
@@ -468,6 +469,28 @@ (define-public c2ffi
various formats, including @code{json}.")
(license license:gpl2+)))
+(define-public edlib
+ (package
+ (name "edlib")
+ (version "1.2.7")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/Martinsos/edlib")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0ibpxs3r8ii2s3g7kdbyr8brg6ha5l0fb21idw8531gx9v2qzh4v"))))
+ (build-system cmake-build-system)
+ (arguments
+ '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
+ (home-page "https://github.com/Martinsos/edlib")
+ (synopsis "Lightweight C/C++ library for sequence alignment")
+ (description "Lightweight, C/C++ (& Python) library for sequence alignment
+using edit (Levenshtein) distance with a focus on speed.")
+ (license license:expat)))
+
(define-public expected-lite
(package
(name "expected-lite")

base-commit: 3bf7a0e8c431abfcba51806ee2a3eea9e0865472
--
2.48.1
Sergio Pastor Pérez wrote 47 hours ago
[PATCH v5 2/9] gnu: Add jthread.
(address . 67755@debbugs.gnu.org)(name . Sergio Pastor Pérez)(address . sergio.pastorperez@outlook.es)
9fa60d241a95a1f991c3e69950571f9840ed2ef8.1741720525.git.sergio.pastorperez@gmail.com
From: Sergio Pastor Pérez <sergio.pastorperez@outlook.es>

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

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

Toggle diff (115 lines)
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 338455b9fb..e0c6be7905 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -118,6 +118,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 webkit)
#:use-module (gnu packages xdisorg)
@@ -1145,6 +1146,100 @@ (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.10}"))
+ (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-xpatch
+ texlive-xkeyval
+ texlive-jknapltx
+ texlive-booktabs
+ 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.48.1
Sergio Pastor Pérez wrote 47 hours ago
[PATCH v5 3/9] gnu: Add plutovg.
(address . 67755@debbugs.gnu.org)(name . Sergio Pastor Pérez)(address . sergio.pastorperez@gmail.com)
08a793533840279c0e0df0885738d43077b6b7f3.1741720525.git.sergio.pastorperez@gmail.com
* gnu/packages/cpp.scm (plutovg): New variable.

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

Toggle diff (35 lines)
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index e0c6be7905..530111da4d 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -614,6 +614,28 @@ (define-public rct
(license (list license:expat ; cJSON
license:bsd-4))))) ; everything else (LICENSE.txt)
+(define-public plutovg
+ (package
+ (name "plutovg")
+ (version "0.0.13")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/sammycage/plutovg")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0y2w0qhs89bnh440z1xj65vg4c71rlwinxgs3p8bvh2fmbi7lqff"))))
+ (build-system cmake-build-system)
+ (arguments
+ '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")
+ #:tests? #f)) ;No tests.
+ (home-page "https://github.com/sammycage/plutovg")
+ (synopsis "Tiny 2D vector graphics library in C")
+ (description "PlutoVG is a standalone 2D vector graphics library in C.")
+ (license license:expat)))
+
(define-public pystring
(package
(name "pystring")
--
2.48.1
Sergio Pastor Pérez wrote 47 hours ago
[PATCH v5 4/9] gnu: Add lunasvg.
(address . 67755@debbugs.gnu.org)(name . Sergio Pastor Pérez)(address . sergio.pastorperez@outlook.es)
d6a39eb0cf8c58918d0cba90ec2ff5cd1414b392.1741720525.git.sergio.pastorperez@gmail.com
From: Sergio Pastor Pérez <sergio.pastorperez@outlook.es>

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

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

Toggle diff (39 lines)
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 530111da4d..252e809a10 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -546,6 +546,32 @@ (define-public libzen
operating system functions.")
(license license:zlib)))
+(define-public lunasvg
+ (package
+ (name "lunasvg")
+ (version "3.2.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 "14ppk3k6sdbf3lwhv2gjqy32vwa7ck9jcj9xfk0fxwfqbvbp6608"))))
+ (build-system cmake-build-system)
+ (inputs (list plutovg))
+ (arguments
+ '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")
+ #:tests? #f)) ;No tests.
+ (home-page "https://github.com/sammycage/lunasvg")
+ (synopsis "SVG rendering and manipulation library in C++")
+ (description
+ "LunaSVG is an SVG rendering library in C++, designed to be
+lightweight and portable, offering efficient rendering and manipulation of
+Scalable Vector Graphics (SVG) files.")
+ (license license:expat)))
+
(define-public rttr
(package
(name "rttr")
--
2.48.1
Sergio Pastor Pérez wrote 47 hours ago
[PATCH v5 5/9] gnu: Add miniaudio.
(address . 67755@debbugs.gnu.org)(name . Sergio Pastor Pérez)(address . sergio.pastorperez@outlook.es)
77018049d6d7979267a08e2c758433fe53ac7bd4.1741720525.git.sergio.pastorperez@gmail.com
From: Sergio Pastor Pérez <sergio.pastorperez@outlook.es>

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

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

Toggle diff (73 lines)
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 252e809a10..a4083604c1 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -1957,6 +1957,66 @@ (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.22")
+ (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 "1pjaiq71x24n9983vkhjxrsbraa24053h727db22b1rb2xyfrzm3"))))
+ (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"
+ (let ((tests '("conversion" "filtering" "generation")))
+ (mkdir "bin")
+ ;; Compile tests
+ (for-each (lambda (test)
+ (invoke "gcc"
+ (string-append "../" test "/" test
+ ".c")
+ "-o"
+ (string-append "bin/" test)
+ "-ldl"
+ "-lm"
+ "-lpthread"
+ "-Wall"
+ "-Wextra"
+ "-Wpedantic")
+ (let ((bin (string-append "./bin/" test)))
+ (if (string= test "filtering")
+ ;; NOTE: the 'filtering' test
+ ;; requires an input file.
+ (invoke bin bin)
+ (invoke bin))))
+ tests))))))
+ (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
+ "Miniaudio is an audio playback and capture library for C and C++. It is
+made up of a single source file and has no external dependencies.")
+ (license license:expat)))
+
(define-public abseil-cpp-cxxstd17
(abseil-cpp-for-c++-standard abseil-cpp 17)) ;XXX: the default with GCC 11?
--
2.48.1
Sergio Pastor Pérez wrote 47 hours ago
[PATCH v5 6/9] gnu: Add nativefiledialog-extended.
(address . 67755@debbugs.gnu.org)(name . Sergio Pastor Pérez)(address . sergio.pastorperez@outlook.es)
bd316fa740bf4b64d2244dfc66c1a8371c7d508f.1741720525.git.sergio.pastorperez@gmail.com
From: Sergio Pastor Pérez <sergio.pastorperez@outlook.es>

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

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

Toggle diff (38 lines)
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index a4083604c1..ff4f7f3f9d 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -3691,6 +3691,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.48.1
Sergio Pastor Pérez wrote 47 hours ago
[PATCH v5 7/9] gnu: Add xdgpp.
(address . 67755@debbugs.gnu.org)(name . Sergio Pastor Pérez)(address . sergio.pastorperez@outlook.es)
a655628cf869ab5f46f04c7953724b63df3da231.1741720525.git.sergio.pastorperez@gmail.com
From: Sergio Pastor Pérez <sergio.pastorperez@outlook.es>

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

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

Toggle diff (47 lines)
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index ff4f7f3f9d..3c1097ae74 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -748,6 +748,40 @@ (define-public debug-assert
enabled in different parts of your code.")
(license license:zlib)))
+(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.48.1
Sergio Pastor Pérez wrote 47 hours ago
[PATCH v5 8/9] gnu: Add imhex-pattern-language.
(address . 67755@debbugs.gnu.org)(name . Sergio Pastor Pérez)(address . sergio.pastorperez@outlook.es)
5ed489950e0cfd7f368ebf073f01da8b1d8c8c3c.1741720525.git.sergio.pastorperez@gmail.com
From: Sergio Pastor Pérez <sergio.pastorperez@outlook.es>

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

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

Toggle diff (111 lines)
diff --git a/gnu/packages/hexedit.scm b/gnu/packages/hexedit.scm
index 15bf7db877..2eab13e239 100644
--- a/gnu/packages/hexedit.scm
+++ b/gnu/packages/hexedit.scm
@@ -4,6 +4,7 @@
;;; Copyright © 2018, 2020, 2022 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
;;; Copyright © 2024 Artyom V. Poptsov <poptsov.artyom@gmail.com>
+;;; Copyright © 2025 Sergio Pastor Pérez <sergio.pastorperez@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -22,17 +23,22 @@
(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 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 +143,72 @@ (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.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"))
+ (snippet #~(begin
+ (use-modules (guix build utils))
+ (define (delete-files-from-list-recursively . args)
+ (for-each (lambda (path)
+ (delete-file-recursively path)) args))
+ ;; 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"
+ (delete-files-from-list-recursively "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.48.1
Sergio Pastor Pérez wrote 47 hours ago
[PATCH v5 9/9] gnu: Add imhex.
(address . 67755@debbugs.gnu.org)(name . Sergio Pastor Pérez)(address . sergio.pastorperez@outlook.es)
bb3e92e932c691ab0be00f28cd61611fcf1edff3.1741720525.git.sergio.pastorperez@gmail.com
From: Sergio Pastor Pérez <sergio.pastorperez@outlook.es>

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

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

Toggle diff (194 lines)
diff --git a/gnu/packages/hexedit.scm b/gnu/packages/hexedit.scm
index 2eab13e239..e9b9698c22 100644
--- a/gnu/packages/hexedit.scm
+++ b/gnu/packages/hexedit.scm
@@ -28,11 +28,25 @@ (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 antivirus)
+ #: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 gexp)
@@ -209,6 +223,161 @@ (define-public imhex-pattern-language
(description "The Pattern Language used by the ImHex Hex Editor.")
(license license:lgpl2.1)))
+(define-public imhex
+ ;; NOTE: imhex-patterns does not support using `imhex-pattern-language'
+ ;; system package. Until it does, there is no point in making it a package.
+ (let ((version "1.37.4"))
+ (define-public imhex-patterns
+ (let ((name "imhex-patterns"))
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/WerWolv/ImHex-Patterns")
+ (commit (string-append "ImHex-v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0m9g93fzmj2rsgaq25y4mmfigjh1xxyh41zjs6lp5ydsl5hhrn6q")))))
+ (package
+ (name "imhex")
+ (version version)
+ (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 "0l3fpizkz2ykdirbn9alddnnsg75w6kwpp92nvmird13l80z1sdr"))
+ (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 xdgpp) . "xdgpp")
+ (#$(file-append miniaudio "/include/miniaudio.h")
+ . "miniaudio/include/miniaudio.h"))))
+
+ ;; Drop `imhex-patters' in the source tree.
+ (copy-recursively #$imhex-patterns "ImHex-Patterns")))))
+ (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_ENABLE_UNIT_TESTS=ON"
+ "-DIMHEX_OFFLINE_BUILD=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_LUNASVG=ON"
+ "-DUSE_SYSTEM_CLI11=ON"
+ "-DUSE_SYSTEM_BOOST=ON"
+ "-DUSE_SYSTEM_EDLIB=ON"
+ "-DUSE_SYSTEM_YARA=ON"
+ "-DUSE_SYSTEM_LLVM=ON"
+ "-DUSE_SYSTEM_FMT=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")
+ #: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"))))
+ (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 yara
+ boost
+ capstone
+ curl
+ edlib
+ fmt
+ glfw
+ libarchive
+ libffi
+ llvm-17
+ lunasvg
+ plutovg
+ mbedtls
+ mesa
+ nativefiledialog-extended
+ xz
+ fontconfig
+ lz4
+ `(,zstd "lib")
+ zlib
+ freetype))
+ (home-page "https://imhex.werwolv.net")
+ (synopsis "Hex Editor to display, decode and analyze binary data")
+ (description "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.48.1
Divya Ranjan wrote 14 hours ago
(name . Sergio Pastor Pérez)(address . sergio.pastorperez@gmail.com)(name . Sergio Pastor Pérez)(address . sergio.pastorperez@outlook.es)(name . Cayetano Santos)(address . cstanosb@inventati.org)(name . jgart)(address . jgart@dismail.de)(address . 67755@debbugs.gnu.org)(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
87senha984.fsf@subvertising.org
Hello Sergio, thank you for tenaciously working on this series and revising it. v5 seems to build fine, and =guix lint= doesn’t complain either. I do see that for each package =guix style= tries to reindent the package definitions. But since this series has already been long enough, what I recommend is that the committers do a round of =guix style= before applying each patch. I’ll CC members of the electronics-team.

Reviewed-by: Divya Ranjan Pattanaik <divya@subvertising.org>
(for the whole series)
--
Divya Ranjan,
Philosophy, Mathematics, Libre Software.

PGP Fingerprint: F0B3 1A69 8006 8FB8 096A 2F12 B245 10C6 108C 8D4A
Sergio Pastor Pérez wrote 2 hours ago
(name . Divya Ranjan)(address . divya@subvertising.org)(name . Sergio Pastor Pérez)(address . sergio.pastorperez@outlook.es)(name . jgart)(address . jgart@dismail.de)(address . 67755@debbugs.gnu.org)(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)(name . Cayetano Santos)(address . csantosb@inventati.org)
841pv1x7u6.fsf@gmail.com
Hello, Divyá.

Divya Ranjan <divya@subvertising.org> writes:
Toggle quote (2 lines)
> [...] I do see that for each package =guix style= tries to reindent the package definitions. [...]

I'm aware of those, I decided not to follow the `guix style' for some of them because
it hindered readability. The commiter can decide if it is appropriate to
style all the packages but I think they will prefer to leve them as they
are, anyways `guix style' is not applied on every definition in Guix.


Thanks for the review!
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 67755@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 67755
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help