From patchwork Sat Sep 14 21:20:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Giacomo Leidi X-Patchwork-Id: 67954 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 273E227BBE2; Sat, 14 Sep 2024 22:22:09 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id AC3D927BBEB for ; Sat, 14 Sep 2024 22:22:07 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1spaDI-0004RQ-Nf; Sat, 14 Sep 2024 17:21:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1spaDH-0004Qz-H4 for guix-patches@gnu.org; Sat, 14 Sep 2024 17:21:51 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1spaDH-0006gb-7u for guix-patches@gnu.org; Sat, 14 Sep 2024 17:21:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:In-Reply-To:References:Subject; bh=y+ZIbmwrWeRMd4YNqwXUPm04mrC1n8dh+PEfpR2ArUw=; b=nW8PhoAlytZjvZqm0x3XOEUkuLUvtPuYGf2q53if2xWUnRUyAfxqAqMd5QNhCt2dULP2Ck+xs6zWxMFDHx8fYCQ1td/jC6msWH5xH1xBhgwpDuWm/rCPBaF/66gnoFKTV8+M8GijGYmOu/jQTiVNN7Mw7SlLWr60cV/9262S1QHbtuOdTFCD/QeOSuSuxoyVTOk7ZV6z43J4ZbLg5zme+b6QCCdleE9BA+apehSmiEDMwnlvmaPPIUbovClFHHFoJsB2A0aterMONsqEjjBZNa5P6hZdMSyZkpysHGpaoSEhSrx8cmBJ2TrzKTftTQH1d9biVDAuA9VmEIrWa/7+GA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1spaDS-0000FG-6l for guix-patches@gnu.org; Sat, 14 Sep 2024 17:22:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73260] [PATCH 1/3] gnu: Add hivex. References: <0e7f7cc7-b6b8-0c97-f175-edd6d85a2eb1@autistici.org> In-Reply-To: <0e7f7cc7-b6b8-0c97-f175-edd6d85a2eb1@autistici.org> Resent-From: Giacomo Leidi Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 14 Sep 2024 21:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73260 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 73260@debbugs.gnu.org Cc: Giacomo Leidi Received: via spool by 73260-submit@debbugs.gnu.org id=B73260.1726348912903 (code B ref 73260); Sat, 14 Sep 2024 21:22:02 +0000 Received: (at 73260) by debbugs.gnu.org; 14 Sep 2024 21:21:52 +0000 Received: from localhost ([127.0.0.1]:47874 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spaDH-0000EU-KM for submit@debbugs.gnu.org; Sat, 14 Sep 2024 17:21:52 -0400 Received: from confino.investici.org ([93.190.126.19]:39941) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spaDF-0000EB-51 for 73260@debbugs.gnu.org; Sat, 14 Sep 2024 17:21:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1726348890; bh=y+ZIbmwrWeRMd4YNqwXUPm04mrC1n8dh+PEfpR2ArUw=; h=From:To:Cc:Subject:Date:From; b=Wj5CBkk0NIEodS+yPV+PrjM1hGWQQPBALESJpTDXTflNjVaMKW23QdOZveKz+Cjae NFtkIs0QnrJItbX/Zlik0A8ZSstp1rrcadUbxNkZmkcYKFUcu8rojXt7hGZtrSmHaW mwBZijTWSYghmAH+QWFvSl42V/xVFNHGS0I+KLTE= Received: from mx1.investici.org (unknown [127.0.0.1]) by confino.investici.org (Postfix) with ESMTP id 4X5kd62zyGz119y; Sat, 14 Sep 2024 21:21:30 +0000 (UTC) Received: from [93.190.126.19] (mx1.investici.org [93.190.126.19]) (Authenticated sender: goodoldpaul@autistici.org) by localhost (Postfix) with ESMTPSA id 4X5kd629KZz119H; Sat, 14 Sep 2024 21:21:30 +0000 (UTC) Date: Sat, 14 Sep 2024 23:20:56 +0200 Message-ID: <247263a340d7dedbf4671ebaf75da540e7e62734.1726348858.git.goodoldpaul@autistici.org> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Giacomo Leidi X-ACL-Warn: , Giacomo Leidi via Guix-patches X-Patchwork-Original-From: Giacomo Leidi via Guix-patches via From: Giacomo Leidi Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/virtualization.scm (hivex): New variable. Change-Id: I9828d267d5c6f24dc5039ea3b1849248cd9d23fb --- gnu/packages/virtualization.scm | 118 ++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) base-commit: c572cf81f4b322af4280ac2133889c997e39d247 diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index b076d49985..60f17ea630 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -36,6 +36,7 @@ ;;; Copyright © 2024 Raven Hallsby ;;; Copyright © 2024 jgart ;;; Copyright © 2024 Ashish SHUKLA +;;; Copyright © 2024 Giacomo Leidi ;;; ;;; This file is part of GNU Guix. ;;; @@ -80,6 +81,7 @@ (define-module (gnu packages virtualization) #:use-module (gnu packages dns) #:use-module (gnu packages docbook) #:use-module (gnu packages documentation) + #:use-module (gnu packages elf) #:use-module (gnu packages figlet) #:use-module (gnu packages firmware) #:use-module (gnu packages flex) @@ -112,6 +114,7 @@ (define-module (gnu packages virtualization) #:use-module (gnu packages nettle) #:use-module (gnu packages networking) #:use-module (gnu packages ninja) + #:use-module (gnu packages ocaml) #:use-module (gnu packages onc-rpc) #:use-module (gnu packages package-management) #:use-module (gnu packages pciutils) @@ -2902,3 +2905,118 @@ (define-public riscv-pk supervisor execution environment for tethered RISC-V systems. It is designed to host the RISC-V Linux port.") (license license:bsd-3))) + +(define-public hivex + (package + (name "hivex") + (version "1.3.24") + (source (origin + (method url-fetch) + (uri (string-append "https://libguestfs.org/download/" + name "/" name "-" version ".tar.gz")) + (sha256 + (base32 + "0g0rib62qg81fda8lxsaa7a1ykqy4rl5sq185pdqm9y9xifa8bx5")))) + (build-system gnu-build-system) + (native-inputs (list automake + autoconf + gettext-minimal + libtool + ocaml + patchelf + pkg-config + perl-io-stringy + python-wrapper + ruby + ruby-rake + ruby-rdoc)) + (inputs + (list bash-minimal + libxml2 + perl + readline)) + (arguments + (list + #:configure-flags + #~(list + "--disable-static" + "--with-readline" + "--disable-rpath") + #:phases + #~(modify-phases %standard-phases + (replace 'bootstrap + (lambda _ + (invoke "autoreconf" "-vif"))) + (add-after 'unpack 'patch-makefiles + (lambda _ + (let* ((current-system (or #$(%current-target-system) + #$(%current-system))) + (ocamllib + (string-append #$output "/lib/ocaml/" + #$(package-version + (this-package-native-input "ocaml")) "/site-lib")) + (python-installdir + (string-append #$output "/lib/python" + #$(version-major+minor + (package-version + (this-package-native-input + "python-wrapper"))) + "/site-packages")) + (ruby-version + #$(package-version + (this-package-native-input "ruby"))) + (ruby-libdir + (string-append #$output + "/lib/ruby/site_ruby/" + ruby-version)) + (ruby-archdir + (string-append ruby-libdir "/" current-system))) + (substitute* "lib/Makefile.am" + (((string-append "\\$\\(VERSION_SCRIPT_FLAGS\\)" + "\\$\\(srcdir\\)/hivex\\.syms")) + "")) + (substitute* "python/Makefile.am" + (("\\$\\(PYTHON_INSTALLDIR\\)") + python-installdir)) + (substitute* "ocaml/Makefile.am" + (("\\$\\(DESTDIR\\)\\$\\(OCAMLLIB\\)") + ocamllib)) + (substitute* "ruby/Makefile.am" + (("\\$\\(DESTDIR\\)\\$\\(RUBY_ARCHDIR\\)") + ruby-archdir) + (("\\$\\(DESTDIR\\)\\$\\(RUBY_LIBDIR\\)") + ruby-libdir))))) + (add-before 'install 'set-rpath + (lambda _ + (for-each + (lambda (sofile) + ;; The ‘validate-runpath’ phase fails to find libhivex.so.0. + (invoke (string-append #$(this-package-native-input "patchelf") + "/bin/patchelf") + "--add-rpath" (string-append #$output "/lib") sofile)) + '("perl/blib/arch/auto/Win/Hivex/Hivex.so" + "ruby/ext/hivex/_hivex.so")))) + (add-after 'install 'wrap-binaries + (lambda _ + (let ((hivexregedit + (string-append #$output "/bin/hivexregedit")) + (hivexml + (string-append #$output "/bin/hivexml"))) + (wrap-program hivexregedit + `("PERL5LIB" ":" prefix + (,(string-append #$output "/lib/perl5/site_perl"))) + `("PATH" ":" prefix + (,(string-append #$output "/bin")))) + (wrap-program hivexml + `("PATH" ":" prefix + (,(string-append #$output "/bin")))))))))) + (home-page "https://github.com/libguestfs/hivex") + (synopsis "Windows registry hive extraction library") + (description + "This package provides a self-contained library for reading and writing +Windows Registry \"hive\" binary files. Unlike many other tools in this area, +it doesn't use the textual @code{.REG} format for output, because parsing that +is as much trouble as parsing the original binary format. Instead it makes the +file available through a C API, or through a separate program to export the +hive as XML.") + (license license:lgpl2.1)))