[PATCH 1/2] gnu: shepherd: Build Shepherd from git.

  • Open
  • quality assurance status badge
Details
One participant
  • Attila Lendvai
Owner
unassigned
Submitted by
Attila Lendvai
Severity
normal
A
A
Attila Lendvai wrote on 24 Feb 15:02 +0100
(address . guix-patches@gnu.org)(name . Attila Lendvai)(address . attila@lendvai.name)
20230224140243.15315-1-attila@lendvai.name
The rationale for this is that it makes it simpler to start VM's with a
Shepherd that is compiled from a local checkout. This facilitates hacking on
Shepherd itself, and testing it in the Guix init environment, by speeding up
the edit-compile-test cycle.

* gnu/packages/admin.scm (shepherd-0.9): Source points to the git repo; adjust
native-inputs accordingly. Also delete the strip build phase.
---

the first commit works, except when cross-compiling: help2man wants
to run the foreign binary, and fails.

the second commit is a WIP attempt to get the compiled man pages
from the native package when cross compiling. it's not ready,
but i got stuck at needing to gunzip the man pages, and where
to put them to convince the makefile to not execute help2man, etc.

my suggestion is to simply get rid of the not-very-useful
auto generated man page to fix cross-compilation.

if that's not desirable, then the second commit needs to be
polished, or implemented some other way.

gnu/packages/admin.scm | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)

Toggle diff (49 lines)
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index d4cc8ca6ca..91f98bf48e 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -335,12 +335,13 @@ (define-public shepherd-0.9
(inherit shepherd)
(version "0.9.3")
(source (origin
- (method url-fetch)
- (uri (string-append "mirror://gnu/shepherd/shepherd-"
- version ".tar.gz"))
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://git.savannah.gnu.org/git/shepherd.git/")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name "shepherd" version))
(sha256
- (base32
- "0qy2yq13xhf05an5ilz7grighdxicx56211yaarqq5qigiiybc32"))))
+ (base32 "1pvdpx2mfki8wvhcac54p8fn5idqszicww60ikswszz2cv5d0s11"))))
(arguments
(list #:configure-flags #~'("--localstatedir=/var")
#:make-flags #~'("GUILE_AUTO_COMPILE=0")
@@ -360,12 +361,17 @@ (define-public shepherd-0.9
(this-package-input "guile-fibers")
"/lib/guile/3.0/site-ccache"))))))
#~%standard-phases)))
-
- ;; Note: Use 'guile-3.0-latest' to address the continuation-related memory
- ;; leak reported at <https://issues.guix.gnu.org/58631>.
- (native-inputs (list pkg-config guile-3.0-latest
- guile-fibers-1.1)) ;for cross-compilation
- (inputs (list guile-3.0-latest guile-fibers-1.1))))
+ (native-inputs
+ (list autoconf
+ automake
+ gettext-minimal
+ guile-3.0
+ guile-fibers-1.1 ; for cross-compilation
+ help2man
+ pkg-config
+ texinfo))
+ (inputs (list guile-3.0
+ guile-fibers-1.1))))
(define-public guile2.2-shepherd
(package
--
2.38.1
A
A
Attila Lendvai wrote on 24 Feb 15:07 +0100
[PATCH 2/2] WIP failing attempt to get the man page while cross-compiling
(address . 61750@debbugs.gnu.org)(name . Attila Lendvai)(address . attila@lendvai.name)
20230224140740.16494-2-attila@lendvai.name
---
gnu/packages/admin.scm | 48 +++++++++++++++++++++++++++++++++---------
1 file changed, 38 insertions(+), 10 deletions(-)

Toggle diff (70 lines)
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 91f98bf48e..6e5082e612 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -343,7 +343,7 @@ (define-public shepherd-0.9
(sha256
(base32 "1pvdpx2mfki8wvhcac54p8fn5idqszicww60ikswszz2cv5d0s11"))))
(arguments
- (list #:configure-flags #~'("--localstatedir=/var")
+ (list #:configure-flags #~'("HELP2MAN=true --localstatedir=/var")
#:make-flags #~'("GUILE_AUTO_COMPILE=0")
#:phases (if (%current-target-system)
#~(modify-phases %standard-phases
@@ -359,17 +359,45 @@ (define-public shepherd-0.9
(("%FIBERS_OBJECT_DIRECTORY%")
#$(file-append
(this-package-input "guile-fibers")
- "/lib/guile/3.0/site-ccache"))))))
+ "/lib/guile/3.0/site-ccache")))))
+ (add-after 'configure 'copy-man-pages
+ (lambda* (#:key outputs native-inputs #:allow-other-keys)
+ ;; Cannot run help2man when cross-compiling,
+ ;; so let's copy the man pages from the native
+ ;; build.
+ (let ((gzip (search-input-file native-inputs
+ "bin/gzip")))
+ ;; TODO
+ (pk #$(file-append
+ (this-package-input this-package)
+ "/man/shepherd.1.gz"))
+ (invoke gzip "--decompress" "--stdout"
+ #$(file-append
+ (this-package-input this-package)
+ "/man/shepherd.1.gz")
+ ">doc/shepherd.1"))
+ #;(copy-file #$(file-append
+ (this-package-input this-package)
+ "/man/shepherd.1")
+ (string-append
+ (assoc-ref outputs "out")
+ "/man/shepherd.1"))
+ #f)))
#~%standard-phases)))
(native-inputs
- (list autoconf
- automake
- gettext-minimal
- guile-3.0
- guile-fibers-1.1 ; for cross-compilation
- help2man
- pkg-config
- texinfo))
+ (cons* autoconf
+ automake
+ gettext-minimal
+ guile-3.0
+ guile-fibers-1.1 ; for cross-compilation
+ help2man
+ pkg-config
+ texinfo
+ ;; for the help2man man page when cross-compiling
+ (if (%current-target-system)
+ (list gzip
+ this-package)
+ '())))
(inputs (list guile-3.0
guile-fibers-1.1))))
--
2.38.1
?