unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Efraim Flashner <efraim@flashner.co.il>
To: 44736@debbugs.gnu.org
Cc: Efraim Flashner <efraim@flashner.co.il>
Subject: [bug#44736] [Shepherd PATCH] build: Add guix.scm helper file.
Date: Thu, 19 Nov 2020 14:52:44 +0200	[thread overview]
Message-ID: <20201119125244.3674-1-efraim@flashner.co.il> (raw)

* build-aux/guix.scm: New file.
---
 build-aux/guix.scm | 52 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 build-aux/guix.scm

diff --git a/build-aux/guix.scm b/build-aux/guix.scm
new file mode 100644
index 0000000..ea9c63f
--- /dev/null
+++ b/build-aux/guix.scm
@@ -0,0 +1,52 @@
+;;; guix.scm -- Guix package definition
+
+(use-modules
+  (guix packages)
+  ((guix git-download) #:select (git-version))
+  ((guix build utils) #:select (find-files))
+  ((guix gexp) #:select (local-file))
+  ((gnu packages) #:select (specification->package))
+  ((ice-9 popen) #:select (open-pipe))
+  ((ice-9 rdelim) #:select (read-string))
+  ((srfi srfi-1) #:select (any)))
+
+(define %source-dir (dirname (dirname (current-filename))))
+
+(define %git-commit
+  (read-string (open-pipe "git show HEAD | head -1 | cut -d ' ' -f 2" OPEN_READ)))
+
+(define (keep-file? file stat)
+  (not (any (lambda (my-string)
+              (string-contains file my-string))
+            (list ".git" ".dir-locals.el" "build-aux"))))
+
+(define (build-from-git base)
+  (package
+    (inherit base)
+    (version (git-version (package-version base) "HEAD" %git-commit))
+    (source (local-file %source-dir
+                        #:recursive? #t
+                        #:select? keep-file?))
+    (native-inputs
+     `(("autoconf" ,(specification->package "autoconf"))
+       ("automake" ,(specification->package "automake"))
+       ("gettext" ,(specification->package "gettext"))
+       ("help2man" ,(specification->package "help2man"))
+       ("texinfo" ,(specification->package "texinfo"))
+       ,@(package-native-inputs base)))
+    (arguments
+     `(#:configure-flags '("--localstatedir=/var")
+       #:make-flags (list "GUILE_AUTO_COMPILE=0")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'make-po-directory-writable
+           (lambda _
+             (for-each make-file-writable
+               (find-files "po" "."))
+               #t)))))))
+
+(list (build-from-git (specification->package "shepherd"))
+      (build-from-git (specification->package "guile2.2-shepherd"))
+      ;; This version FTBFS due to an import of '(ice-9 threads)' in modules/shepherd.scm
+      ;(build-from-git (specification->package "guile2.0-shepherd"))
+      )
-- 
2.29.2





             reply	other threads:[~2020-11-19 12:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-19 12:52 Efraim Flashner [this message]
2021-01-11 12:36 ` [bug#44736] [Shepherd PATCH] build: Add guix.scm helper file Ludovic Courtès
2021-01-21 10:13   ` Efraim Flashner
2023-06-02 13:54 ` bug#44736: " Ludovic Courtès

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=20201119125244.3674-1-efraim@flashner.co.il \
    --to=efraim@flashner.co.il \
    --cc=44736@debbugs.gnu.org \
    /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).