[PATCH] gnu: Add imhex.

  • Open
  • quality assurance status badge
Details
2 participants
  • jgart
  • Sergio Pastor Pérez
Owner
unassigned
Submitted by
Sergio Pastor Pérez
Severity
normal
S
S
Sergio Pastor Pérez wrote on 10 Dec 2023 21:06
(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
S
S
Sergio Pastor Pérez wrote on 29 Jun 14:15 +0200
[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
J
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
S
S
Sergio Pastor Pérez wrote on 1 Jul 19:02 +0200
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.
S
S
Sergio Pastor Pérez wrote on 1 Jul 18:55 +0200
[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
S
S
Sergio Pastor Pérez wrote on 26 Aug 23:51 +0200
Re: [PATCH] gnu: Add imhex.
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.
S
S
Sergio Pastor Pérez wrote on 27 Aug 00:01 +0200
[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
S
S
Sergio Pastor Pérez wrote on 27 Aug 00:01 +0200
[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
S
S
Sergio Pastor Pérez wrote on 27 Aug 00:01 +0200
[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
S
S
Sergio Pastor Pérez wrote on 27 Aug 00:01 +0200
[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
S
S
Sergio Pastor Pérez wrote on 27 Aug 00:01 +0200
[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
S
S
Sergio Pastor Pérez wrote on 27 Aug 00:01 +0200
[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
S
S
Sergio Pastor Pérez wrote on 27 Aug 00:01 +0200
[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
S
S
Sergio Pastor Pérez wrote on 27 Aug 00:01 +0200
[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
S
S
Sergio Pastor Pérez wrote on 27 Aug 00:32 +0200
Re: [PATCH] gnu: Add imhex.
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.
?
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