[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[shepherd] 02/02: maint: Add Guix manifest for continuous integration.
From: |
Ludovic Courtès |
Subject: |
[shepherd] 02/02: maint: Add Guix manifest for continuous integration. |
Date: |
Fri, 10 Mar 2023 16:00:39 -0500 (EST) |
civodul pushed a commit to branch master
in repository shepherd.
commit 50f888715ab14e397c57b1e993f1f3316ac9eda9
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Fri Mar 10 21:56:10 2023 +0100
maint: Add Guix manifest for continuous integration.
This commit turns the repository into a Guix channel, which in turn lets
tools such as Cuirass treat it as such and build what 'manifest.scm'
specifies.
* build-aux/manifest.scm, .guix-channel: New files.
* Makefile.am (EXTRA_DIST): Add 'build-aux/manifest.scm'.
---
.guix-channel | 5 +++++
Makefile.am | 3 ++-
build-aux/manifest.scm | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 67 insertions(+), 1 deletion(-)
diff --git a/.guix-channel b/.guix-channel
new file mode 100644
index 0000000..3a5a513
--- /dev/null
+++ b/.guix-channel
@@ -0,0 +1,5 @@
+;; This file lets us present this repo as a Guix channel.
+
+(channel
+ (version 0)
+ (directory "build-aux/guix"))
diff --git a/Makefile.am b/Makefile.am
index 05e69ed..7c57ff8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -74,7 +74,8 @@ CLEANFILES = \
EXTRA_DIST = \
etc/crash-handler.c \
guix.scm \
- build-aux/guix/shepherd-package.scm
+ build-aux/guix/shepherd-package.scm \
+ build-aux/manifest.scm
if BUILD_CRASH_HANDLER
diff --git a/build-aux/manifest.scm b/build-aux/manifest.scm
new file mode 100644
index 0000000..edb1077
--- /dev/null
+++ b/build-aux/manifest.scm
@@ -0,0 +1,60 @@
+;;; manifest.scm -- Guix manifest for continuous integration.
+;;; Copyright © 2023 Ludovic Courtès <ludo@gnu.org>
+;;;
+;;; This file is part of the GNU Shepherd.
+;;;
+;;; The GNU Shepherd is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; The GNU Shepherd is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with the GNU Shepherd. If not, see <http://www.gnu.org/licenses/>.
+
+(use-modules (guix)
+ (guix profiles)
+ (shepherd-package)
+ (srfi srfi-1))
+
+(define* (package->manifest-entry* package system
+ #:key target)
+ "Return a manifest entry for PACKAGE on SYSTEM, optionally cross-compiled to
+TARGET."
+ (manifest-entry
+ (inherit (package->manifest-entry package))
+ (name (string-append (package-name package) "." system
+ (if target
+ (string-append "." target)
+ "")))
+ (item (with-parameters ((%current-system system)
+ (%current-target-system target))
+ package))))
+
+(define native-builds
+ (manifest
+ (append-map (lambda (system)
+ (map (lambda (package)
+ (package->manifest-entry* package system))
+ (list shepherd
+ shepherd-from-tarball
+ guile2.2-shepherd)))
+ '("x86_64-linux"
+ "i686-linux"
+ "aarch64-linux" "armhf-linux"
+ "powerpc64le-linux"))))
+
+(define cross-builds
+ (manifest
+ (map (lambda (target)
+ (package->manifest-entry* shepherd-from-tarball "x86_64-linux"
+ #:target target))
+ '(;; "i586-pc-gnu" ;FIXME: requires Fibers 1.2.0+
+ "aarch64-linux-gnu"
+ "riscv64-linux-gnu"))))
+
+(concatenate-manifests (list native-builds cross-builds))