diff mbox series

[bug#57560,2/4] hashcat: Unbundle everything but LZMA-SDK.

Message ID 20220903120827.25648-2-maximedevos@telenet.be
State Accepted
Headers show
Series Fix multiple hashcat issue. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

M Sept. 3, 2022, 12:08 p.m. UTC
There does not appear to be a convenient Guix package for LZMA-SDK yet.
I currently have a bit of a dirty working tree (fiddling with imports), so the
use-modules is in the wrong place. Also, a small rebase conflict, the version
and source hash of hashcat has been updated.

* gnu/packages/password-utils.scm (hashcat)[source]{snippet}: Delete
everything from deps except for deps/LZMA-SDK.
(hashcat)[inputs]: Add minizip, xxhash and zlib.
(hashcat)[arguments]<#:make-flags>: Add USE_SYSTEM_ZLIB, USE_SYSTEM_OPENCL and
USE_SYSTEM_XXHASH.
---
 gnu/packages/password-utils.scm | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index f64a205610..ec4aff048a 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -1110,6 +1110,8 @@  (define-public pass-rotate
 your online accounts makes it necessary.")
     (license license:expat)))
 
+;; XXX: move this import upwards before merging this patch
+(use-modules (gnu packages digest))
 (define-public hashcat
   (package
     (name "hashcat")
@@ -1121,13 +1123,25 @@  (define-public hashcat
                            version ".tar.gz"))
        (sha256
         (base32
-         "104z63m7lqbb0sdrxhf9yi15l4a9zwf9m6zs9dbb3gf0nfxl1h9r"))))
+         "104z63m7lqbb0sdrxhf9yi15l4a9zwf9m6zs9dbb3gf0nfxl1h9r"))
+       (modules '((guix build utils)))
+       ;; Delete bundled libraries.
+       (snippet
+        ;; TODO: Unbundle LZMA-SDK as well
+        #~(for-each delete-file-recursively
+                    '("deps/zlib" "deps/xxHash" "deps/OpenCL-Headers")))))
     (native-inputs
      (list opencl-headers))
+    (inputs (list minizip xxhash zlib))
     (build-system gnu-build-system)
     (arguments
      '(#:tests? #f                      ;no tests
-       #:make-flags (list (string-append "PREFIX=" %output))
+       #:make-flags (list (string-append "PREFIX=" %output)
+                          ;; TODO: unbundle
+                          ;; (string-append "USE_SYSTEM_LZMA=1")
+                          (string-append "USE_SYSTEM_ZLIB=1")
+                          (string-append "USE_SYSTEM_OPENCL=1")
+                          (string-append "USE_SYSTEM_XXHASH=1"))
        #:phases
        (modify-phases %standard-phases
          ;; Don't embed timestamps, for bit-for-bit reproducibility.