Skip to content

Commit

Permalink
guix: Add manifest to build relevant variants.
Browse files Browse the repository at this point in the history
* .guix/manifest.scm: New file.
* Makefile.am (EXTRA_DIST): Add it.
  • Loading branch information
civodul committed Nov 17, 2024
1 parent c0b55fa commit d18e054
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .guix/manifest.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
;; Fibers: cooperative, event-driven user-space threads.

;;;; Copyright (C) 2024 Ludovic Courtès <[email protected]>
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 3 of the License, or (at your option) any later version.
;;;;
;;;; This library 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
;;;; Lesser General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU Lesser General Public License
;;;; along with this program. If not, see <http://www.gnu.org/licenses/>.

(use-modules (guix)
(guix profiles)
(fibers-package)
(srfi srfi-1))

;;; Commentary:
;;;
;;; This file defines a manifest containing a configuration matrix for
;;; different native and cross-compilation targets and different variants.
;;; To build them, run:
;;;
;;; guix build -L .guix/modules -m manifest.scm
;;;
;;; Code:

(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 guile-fibers
guile2.2-fibers
guile-fibers/libevent)))
'("x86_64-linux"
"i686-linux"))))

(define cross-builds
(manifest
(map (lambda (target)
(package->manifest-entry* (if (string-contains target "linux")
guile-fibers
guile-fibers/libevent)
"x86_64-linux"
#:target target))
'("i586-pc-gnu"
"aarch64-linux-gnu"))))

(concatenate-manifests (list native-builds cross-builds))
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ EXTRA_DIST += \
$(TESTS) \
env.in \
guix.scm \
.guix/manifest.scm \
.guix/modules/fibers-package.scm \
HACKING \
COPYING.LESSER \
Expand Down

0 comments on commit d18e054

Please sign in to comment.