From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id EEipF/Nqtl/7CAAA0tVLHw (envelope-from ) for ; Thu, 19 Nov 2020 12:54:11 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id UG+WE/Nqtl9eRAAAbx9fmQ (envelope-from ) for ; Thu, 19 Nov 2020 12:54:11 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7A709940222 for ; Thu, 19 Nov 2020 12:54:10 +0000 (UTC) Received: from localhost ([::1]:52048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kfjRv-0004VR-Rd for larch@yhetil.org; Thu, 19 Nov 2020 07:54:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53332) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfjRq-0004VL-0r for guix-patches@gnu.org; Thu, 19 Nov 2020 07:54:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:55143) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kfjRp-0006J1-Nu for guix-patches@gnu.org; Thu, 19 Nov 2020 07:54:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kfjRp-0008Or-MJ for guix-patches@gnu.org; Thu, 19 Nov 2020 07:54:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#44736] [Shepherd PATCH] build: Add guix.scm helper file. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 19 Nov 2020 12:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44736 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 44736@debbugs.gnu.org Cc: Efraim Flashner X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.160579043732275 (code B ref -1); Thu, 19 Nov 2020 12:54:01 +0000 Received: (at submit) by debbugs.gnu.org; 19 Nov 2020 12:53:57 +0000 Received: from localhost ([127.0.0.1]:38456 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kfjRl-0008OU-0T for submit@debbugs.gnu.org; Thu, 19 Nov 2020 07:53:57 -0500 Received: from lists.gnu.org ([209.51.188.17]:40818) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kfjRj-0008ON-TV for submit@debbugs.gnu.org; Thu, 19 Nov 2020 07:53:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53312) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfjRj-0004VG-L1 for guix-patches@gnu.org; Thu, 19 Nov 2020 07:53:55 -0500 Received: from flashner.co.il ([178.62.234.194]:33266) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kfjRh-00066T-0a for guix-patches@gnu.org; Thu, 19 Nov 2020 07:53:55 -0500 Received: from localhost (unknown [141.226.15.169]) by flashner.co.il (Postfix) with ESMTPSA id 1968840304; Thu, 19 Nov 2020 12:53:20 +0000 (UTC) From: Efraim Flashner Date: Thu, 19 Nov 2020 14:52:44 +0200 Message-Id: <20201119125244.3674-1-efraim@flashner.co.il> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=178.62.234.194; envelope-from=efraim@flashner.co.il; helo=flashner.co.il X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/19 07:53:20 X-ACL-Warn: Detected OS = ??? X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -2.3 (--) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 3.99 X-TUID: gLqeDeG6pt6X * 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