From: Karl Hallsby via Guix-patches via <guix-patches@gnu.org>
To: 72249@debbugs.gnu.org
Cc: Karl Hallsby <karl@hallsby.com>,
Sharlatan Hellseher <sharlatanus@gmail.com>
Subject: [bug#72249] [PATCH 1/2] gnu: Add xe-guest-utilities.
Date: Wed, 8 Jan 2025 14:10:25 -0600 [thread overview]
Message-ID: <6920fcb2b7edd619b323c7f70d076a7a73ab0463.1736366732.git.karl@hallsby.com> (raw)
In-Reply-To: <cover.1721711392.git.karl@hallsby.com>
* gnu/packages/virtualization.scm (xe-guest-utilities): Init at 8.4.0
Change-Id: I4daf19dc1964be00554e1c598ef88897081f5d52
---
gnu/packages/virtualization.scm | 88 +++++++++++++++++++++++++++++++++
gnu/services/virtualization.scm | 1 +
2 files changed, 89 insertions(+)
diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 9dff421341..3b162474af 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -104,6 +104,7 @@ (define-module (gnu packages virtualization)
#:use-module (gnu packages gnome)
#:use-module (gnu packages gnupg)
#:use-module (gnu packages golang)
+ #:use-module (gnu packages golang-build)
#:use-module (gnu packages gperf)
#:use-module (gnu packages graphviz)
#:use-module (gnu packages gtk)
@@ -2772,6 +2773,93 @@ (define-public xen
(license license:gpl2)
(supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))))
+(define-public xe-guest-utilities
+ (package
+ (name "xe-guest-utilities")
+ (version "8.4.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/xenserver/xe-guest-utilities")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1yqspizhq3ii6cz2w75slaxy8838yyri9pmgc2q1radnm7w735if"))))
+ (build-system go-build-system)
+ (arguments
+ (list
+ #:import-path "github.com/xenserver/xe-guest-utilities"
+ #:install-source? #f
+ #:tests? #f ; There are no tests.
+ #:phases
+ #~(modify-phases %standard-phases
+ ;; Despite using go-build-system, this project does not use Go's build
+ ;; infrastructure to do anything, instead relying on a Makefile.
+ ;; NOTE: This target builds a tarball, but it is only filled with
+ ;; 2 binaries, 1 script, and a bunch of text files; it is tiny.
+ (add-after 'patch-source-shebangs 'fix-udev-rule
+ (lambda* (#:key inputs import-path #:allow-other-keys)
+ (substitute* (string-append "src/" import-path "/mk/xen-vcpu-hotplug.rules")
+ (("/bin/sh") (search-input-file inputs "/bin/sh")))))
+ (replace 'build
+ (lambda* (#:key import-path #:allow-other-keys)
+ (let* ((version #$version)
+ (version-split (string-split version #\.))
+ (major-version (list-ref version-split 0))
+ (minor-version (list-ref version-split 1))
+ (micro-version (list-ref version-split 2))
+ (build-number "0"))
+ (with-directory-excursion (string-append "src/" import-path)
+ ;; Perform a buggy substitution. In Guix, the Go's guestmetric
+ ;; import will resolve to the source version, NOT the version
+ ;; the Makefile and sed substituted into build/. So we perform
+ ;; the correct substitution.
+ ;; This file list is what make & sed substitute, but we do it
+ ;; in-place too.
+ (substitute* (list "xe-daemon/xe-daemon.go"
+ "syslog/syslog.go"
+ "system/system.go"
+ "guestmetric/guestmetric.go"
+ "guestmetric/guestmetric_linux.go"
+ "xenstoreclient/xenstore.go"
+ "xenstore/xenstore.go")
+ (("@PRODUCT_MAJOR_VERSION@") major-version)
+ (("@PRODUCT_MINOR_VERSION@") minor-version)
+ (("@PRODUCT_MICRO_VERSION@") micro-version)
+ (("@NUMERIC_BUILD_NUMBER@") build-number))
+ ;; Explicitly state version, removes git as native-input and
+ ;; removes using git commit hash as an ID.
+ ;; NOTE: The final step of the Makefile's build target is to "cd"
+ ;; to the final build directory.
+ (invoke "make" "build"
+ (string-append "RELEASE=" version)
+ (string-append "PRODUCT_MAJOR_VERSION=" major-version)
+ (string-append "PRODUCT_MINOR_VERSION=" minor-version)
+ (string-append "PRODUCT_MICRO_VERSION=" micro-version))))))
+ ;; The default "install" actions produce package-manager-specific
+ ;; outputs, .deb, .rpm, and .tgz. We just copy the final build
+ ;; products out.
+ (replace 'install
+ (lambda* (#:key outputs import-path #:allow-other-keys)
+ (let* ((stage (string-append "src/" import-path "/build/stage"))
+ (out (assoc-ref outputs "out")))
+ ;; Put udev rules in #$output/lib/udev/rules.d/
+ (copy-recursively (string-append stage "/etc/udev")
+ (string-append out "/lib/udev"))
+ ;; Copy produced binaries and scripts
+ (copy-recursively (string-append stage "/usr") out)))))))
+ (native-inputs (list go-golang-org-x-sys))
+ (inputs (list bash-minimal))
+ (home-page "https://github.com/xenserver/xe-guest-utilities")
+ (synopsis "XenServer guest utilities for unix-like operating systems")
+ (description "The XenServer guest utilities enable a Xen-based hypervisor,
+(Citrix XenServer, XCP-ng, etc.) to work with a Xen-enabled Unix-like guest VMs.
+This allows the guest to share information about its state back to the host,
+such IP address, memory usage, etc. and allows the host to inform the guest VM
+about events that change the virtualized hardware, such as hotplugging.")
+ (license license:bsd-2)))
+
(define-public osinfo-db-tools
(package
(name "osinfo-db-tools")
diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm
index 53f79e367b..c32c47484c 100644
--- a/gnu/services/virtualization.scm
+++ b/gnu/services/virtualization.scm
@@ -6,6 +6,7 @@
;;; Copyright © 2022 Oleg Pykhalov <go.wigust@gmail.com>
;;; Copyright © 2022 Leo Nikkilä <hello@lnikki.la>
;;; Copyright © 2023 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2024 Raven Hallsby <karl@hallsby.com>
;;;
;;; This file is part of GNU Guix.
;;;
base-commit: 4eaeff997907bc1b67884a6dc087756a50f175e2
--
2.46.0
next prev parent reply other threads:[~2025-01-08 20:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-23 5:14 [bug#72249] [PATCH 0/2] Add xe-guest-utilities and daemon Karl Hallsby via Guix-patches via
2024-07-23 5:22 ` [bug#72249] [PATCH 1/2] gnu: Add xe-guest-utilities Karl Hallsby via Guix-patches via
2024-07-23 5:22 ` [bug#72249] [PATCH 2/2] services: Add xe-guest-utilities-service-type Karl Hallsby via Guix-patches via
2025-01-08 20:10 ` Karl Hallsby via Guix-patches via [this message]
2025-01-08 20:10 ` Karl Hallsby via Guix-patches via
2025-01-09 13:45 ` Ludovic Courtès
2025-01-11 21:45 ` Karl G. Hallsby via Guix-patches via
2025-01-16 8:04 ` bug#72249: " Ludovic Courtès
2025-01-16 17:02 ` [bug#72249] " Karl G. Hallsby via Guix-patches via
2025-01-10 7:00 ` [bug#72249] [PATCH] " Karl Hallsby via Guix-patches via
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6920fcb2b7edd619b323c7f70d076a7a73ab0463.1736366732.git.karl@hallsby.com \
--to=guix-patches@gnu.org \
--cc=72249@debbugs.gnu.org \
--cc=karl@hallsby.com \
--cc=sharlatanus@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).