From 17e3b7d28fd030f88e1824a937179d80432fcc8a Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Mon, 23 May 2022 09:03:51 +0200 Subject: system: image: Fix indentation. * gnu/system/image.scm: Fix it. --- gnu/system/image.scm | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'gnu/system/image.scm') diff --git a/gnu/system/image.scm b/gnu/system/image.scm index 42e215f614..251615a757 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -295,11 +295,12 @@ used in the image." ;; the hdimage format (raw disk-image) is supported. (cond ((memq format '(disk-image compressed-qcow2)) "hdimage") - (else - (raise (condition - (&message - (message - (format #f (G_ "Unsupported image type ~a~%.") format)))))))) + (else + (raise (condition + (&message + (message + (format #f (G_ "Unsupported image type ~a~%.") + format)))))))) (define (partition->dos-type partition) ;; Return the MBR partition type corresponding to the given PARTITION. @@ -396,10 +397,10 @@ used in the image." (define (genimage-type-options image-type image) (cond - ((equal? image-type "hdimage") - (format #f "~%~/~/gpt = ~a~%~/" - (if (gpt-image? image) "true" "false"))) - (else ""))) + ((equal? image-type "hdimage") + (format #f "~%~/~/gpt = ~a~%~/" + (if (gpt-image? image) "true" "false"))) + (else ""))) (let* ((format (image-format image)) (image-type (format->image-type format)) -- cgit v1.2.3 From db3193f55b455440958c8ce0386a88cf8f75b1e5 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Mon, 23 May 2022 09:16:30 +0200 Subject: system: image: Tweak error message. * gnu/system/image.scm (system-disk-image): Tweak it. --- gnu/system/image.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/system/image.scm') diff --git a/gnu/system/image.scm b/gnu/system/image.scm index 251615a757..2cd035e4e7 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -299,7 +299,7 @@ used in the image." (raise (condition (&message (message - (format #f (G_ "Unsupported image type ~a~%.") + (format #f (G_ "unsupported image type: ~a") format)))))))) (define (partition->dos-type partition) -- cgit v1.2.3 From 76139eb2535b6b4ac53178c7066d92550f817d7e Mon Sep 17 00:00:00 2001 From: Pavel Shlyak Date: Sun, 22 May 2022 16:52:45 +0300 Subject: system: image: Support MBR vfat partitions. * gnu/system/image.scm (system-disk-image): Support them. Signed-off-by: Mathieu Othacehe --- gnu/system/image.scm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'gnu/system/image.scm') diff --git a/gnu/system/image.scm b/gnu/system/image.scm index 2cd035e4e7..cdb6c09633 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020, 2021 Mathieu Othacehe ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen +;;; Copyright © 2022 Pavel Shlyak ;;; ;;; This file is part of GNU Guix. ;;; @@ -305,10 +306,18 @@ used in the image." (define (partition->dos-type partition) ;; Return the MBR partition type corresponding to the given PARTITION. ;; See: https://en.wikipedia.org/wiki/Partition_type. - (let ((flags (partition-flags partition))) + (let ((flags (partition-flags partition)) + (file-system (partition-file-system partition))) (cond ((member 'esp flags) "0xEF") - (else "0x83")))) + ((string-prefix? "ext" file-system) "0x83") + ((string=? file-system "vfat") "0x0E") + (else + (raise (condition + (&message + (message + (format #f (G_ "unsupported partition type: ~a") + file-system))))))))) (define (partition->gpt-type partition) ;; Return the genimage GPT partition type code corresponding to PARTITION. -- cgit v1.2.3 From 6e99c020b8c19e140635d1a52815d5b3298ed1ec Mon Sep 17 00:00:00 2001 From: Pavel Shlyak Date: Sun, 22 May 2022 16:53:30 +0300 Subject: system: image: Support GPT vfat partitions. * gnu/system/image.scm (system-disk-image): Support them. Signed-off-by: Mathieu Othacehe --- gnu/system/image.scm | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'gnu/system/image.scm') diff --git a/gnu/system/image.scm b/gnu/system/image.scm index cdb6c09633..e86e8c0867 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -320,12 +320,21 @@ used in the image." file-system))))))))) (define (partition->gpt-type partition) - ;; Return the genimage GPT partition type code corresponding to PARTITION. - ;; See https://github.com/pengutronix/genimage/blob/master/README.rst - (let ((flags (partition-flags partition))) + ;; Return the genimage GPT partition type code corresponding to the + ;; given PARTITION. See: + ;; https://github.com/pengutronix/genimage/blob/master/README.rst + (let ((flags (partition-flags partition)) + (file-system (partition-file-system partition))) (cond - ((member 'esp flags) "U") - (else "L")))) + ((member 'esp flags) "U") + ((string-prefix? "ext" file-system) "L") + ((string=? file-system "vfat") "F") + (else + (raise (condition + (&message + (message + (format #f (G_ "unsupported partition type: ~a") + file-system))))))))) (define (partition-image partition) ;; Return as a file-like object, an image of the given PARTITION. A -- cgit v1.2.3 From bb662d71e6e3db69114645d690bc033c5ffa1ac5 Mon Sep 17 00:00:00 2001 From: Pavel Shlyak Date: Sun, 22 May 2022 16:53:49 +0300 Subject: image: Add bootable flag support. * gnu/build/image.scm (sexp->partition): Add flags support. * gnu/system/image.scm (partition->gexp): Ditto. (system-disk-image): Set the genimage bootable flag if it is part of the partition flags. Signed-off-by: Mathieu Othacehe --- gnu/build/image.scm | 7 +++++-- gnu/system/image.scm | 11 ++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'gnu/system/image.scm') diff --git a/gnu/build/image.scm b/gnu/build/image.scm index 81caa424f8..3e8b94e2d6 100644 --- a/gnu/build/image.scm +++ b/gnu/build/image.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2017 Marius Bakke ;;; Copyright © 2020, 2022 Tobias Geerinckx-Rice ;;; Copyright © 2020 Mathieu Othacehe +;;; Copyright © 2022 Pavel Shlyak ;;; ;;; This file is part of GNU Guix. ;;; @@ -48,12 +49,13 @@ "Take SEXP, a tuple as returned by 'partition->gexp', and turn it into a record." (match sexp - ((size file-system file-system-options label uuid) + ((size file-system file-system-options label uuid flags) (partition (size size) (file-system file-system) (file-system-options file-system-options) (label label) - (uuid uuid))))) + (uuid uuid) + (flags flags))))) (define (size-in-kib size) "Convert SIZE expressed in bytes, to kilobytes and return it as a string." @@ -78,6 +80,7 @@ turn doesn't take any constant overhead into account, force a 1-MiB minimum." (fs-options (partition-file-system-options partition)) (label (partition-label partition)) (uuid (partition-uuid partition)) + (flags (partition-flags partition)) (journal-options "lazy_itable_init=1,lazy_journal_init=1")) (apply invoke `("fakeroot" "mke2fs" "-t" ,fs "-d" ,root diff --git a/gnu/system/image.scm b/gnu/system/image.scm index e86e8c0867..74b81d02f6 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -219,7 +219,8 @@ set to the given OS." #$(partition-file-system-options partition) #$(partition-label partition) #$(and=> (partition-uuid partition) - uuid-bytevector))) + uuid-bytevector) + #$(partition-flags partition))) (define gcrypt-sqlite3&co ;; Guile-Gcrypt, Guile-SQLite3, and their propagated inputs. @@ -401,17 +402,21 @@ used in the image." (partition-type-values image partition))) (let ((label (partition-label partition)) (image (partition-image partition)) - (offset (partition-offset partition))) + (offset (partition-offset partition)) + (bootable (if (memq 'boot (partition-flags partition)) + "true" "false" ))) #~(format #f "~/partition ~a { ~/~/~a = ~a ~/~/image = \"~a\" ~/~/offset = \"~a\" + ~/~/bootable = \"~a\" ~/}" #$label #$partition-type-attribute #$partition-type-value #$image - #$offset)))) + #$offset + #$bootable)))) (define (genimage-type-options image-type image) (cond -- cgit v1.2.3 From dab819d5c4c55609efae098c8e3c2f2757c34e5b Mon Sep 17 00:00:00 2001 From: Josselin Poiret Date: Mon, 23 May 2022 22:37:26 +0200 Subject: Move (gnu platform) and (gnu platforms ...) to guix/. * gnu/platform.scm: * gnu/platforms/arm.scm: * gnu/platforms/hurd.scm: * gnu/platforms/mips.scm: * gnu/platforms/powerpc.scm: * gnu/platforms/riscv.scm: * gnu/platforms/s390.scm: * gnu/platforms/x86.scm: Move to guix/. * Makefile.am: * doc/guix.texi (Porting to a New Platform): * etc/release-manifest.scm: * gnu/ci.scm: * gnu/image.scm: * gnu/local.mk: * gnu/packages/bioinformatics.scm: * gnu/packages/bootstrap.scm: * gnu/packages/cross-base.scm: * gnu/packages/instrumentation.scm: * gnu/packages/linux.scm: * gnu/system/image.scm: * gnu/system/images/hurd.scm: * gnu/system/images/novena.scm: * gnu/system/images/pine64.scm: * gnu/system/images/pinebook-pro.scm: * gnu/system/images/rock64.scm: * guix/scripts/build.scm: * guix/scripts/system.scm: * guix/self.scm: Update (gnu platform...) to (guix platform...). Signed-off-by: Mathieu Othacehe --- Makefile.am | 8 +++ doc/guix.texi | 2 +- etc/release-manifest.scm | 2 +- gnu/ci.scm | 2 +- gnu/image.scm | 2 +- gnu/local.mk | 8 --- gnu/packages/bioinformatics.scm | 2 +- gnu/packages/bootstrap.scm | 2 +- gnu/packages/cross-base.scm | 2 +- gnu/packages/instrumentation.scm | 2 +- gnu/packages/linux.scm | 2 +- gnu/platform.scm | 139 ------------------------------------- gnu/platforms/arm.scm | 38 ---------- gnu/platforms/hurd.scm | 29 -------- gnu/platforms/mips.scm | 30 -------- gnu/platforms/powerpc.scm | 38 ---------- gnu/platforms/riscv.scm | 30 -------- gnu/platforms/s390.scm | 30 -------- gnu/platforms/x86.scm | 59 ---------------- gnu/system/image.scm | 2 +- gnu/system/images/hurd.scm | 2 +- gnu/system/images/novena.scm | 2 +- gnu/system/images/pine64.scm | 2 +- gnu/system/images/pinebook-pro.scm | 2 +- gnu/system/images/rock64.scm | 2 +- guix/platform.scm | 139 +++++++++++++++++++++++++++++++++++++ guix/platforms/arm.scm | 37 ++++++++++ guix/platforms/hurd.scm | 28 ++++++++ guix/platforms/mips.scm | 29 ++++++++ guix/platforms/powerpc.scm | 37 ++++++++++ guix/platforms/riscv.scm | 29 ++++++++ guix/platforms/s390.scm | 29 ++++++++ guix/platforms/x86.scm | 58 ++++++++++++++++ guix/scripts/build.scm | 2 +- guix/scripts/system.scm | 2 +- guix/self.scm | 2 +- 36 files changed, 412 insertions(+), 419 deletions(-) delete mode 100644 gnu/platform.scm delete mode 100644 gnu/platforms/arm.scm delete mode 100644 gnu/platforms/hurd.scm delete mode 100644 gnu/platforms/mips.scm delete mode 100644 gnu/platforms/powerpc.scm delete mode 100644 gnu/platforms/riscv.scm delete mode 100644 gnu/platforms/s390.scm delete mode 100644 gnu/platforms/x86.scm create mode 100644 guix/platform.scm create mode 100644 guix/platforms/arm.scm create mode 100644 guix/platforms/hurd.scm create mode 100644 guix/platforms/mips.scm create mode 100644 guix/platforms/powerpc.scm create mode 100644 guix/platforms/riscv.scm create mode 100644 guix/platforms/s390.scm create mode 100644 guix/platforms/x86.scm (limited to 'gnu/system/image.scm') diff --git a/Makefile.am b/Makefile.am index 5a42bb90b2..e993552fe9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -132,6 +132,14 @@ MODULES = \ guix/workers.scm \ guix/least-authority.scm \ guix/ipfs.scm \ + guix/platform.scm \ + guix/platforms/arm.scm \ + guix/platforms/hurd.scm \ + guix/platforms/mips.scm \ + guix/platforms/powerpc.scm \ + guix/platforms/riscv.scm \ + guix/platforms/s390.scm \ + guix/platforms/x86.scm \ guix/build-system.scm \ guix/build-system/android-ndk.scm \ guix/build-system/ant.scm \ diff --git a/doc/guix.texi b/doc/guix.texi index 184206bec8..d3a6966a4c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -40448,7 +40448,7 @@ guix build --target=armv5tel-linux-gnueabi bootstrap-tarballs @end example For this to work, it is first required to register a new platform as -defined in the @code{(gnu platform)} module. A platform is making the +defined in the @code{(guix platform)} module. A platform is making the connection between a GNU triplet (@pxref{Specifying Target Triplets, GNU configuration triplets,, autoconf, Autoconf}), the equivalent @var{system} in Nix notation, the name of the diff --git a/etc/release-manifest.scm b/etc/release-manifest.scm index 1098f491ba..dd70068490 100644 --- a/etc/release-manifest.scm +++ b/etc/release-manifest.scm @@ -23,7 +23,7 @@ (use-modules (gnu packages) (guix packages) (guix profiles) - ((gnu platform) #:select (targets)) + ((guix platform) #:select (targets)) ((gnu services xorg) #:select (%default-xorg-modules)) (guix utils) (srfi srfi-1) diff --git a/gnu/ci.scm b/gnu/ci.scm index 9de1b54fc8..f476e22731 100644 --- a/gnu/ci.scm +++ b/gnu/ci.scm @@ -55,7 +55,7 @@ #:use-module (gnu packages multiprecision) #:use-module (gnu packages make-bootstrap) #:use-module (gnu packages package-management) - #:use-module (gnu platform) + #:use-module (guix platform) #:use-module (gnu system) #:use-module (gnu system image) #:use-module (gnu system vm) diff --git a/gnu/image.scm b/gnu/image.scm index 0b3a5a096b..e10a495d3d 100644 --- a/gnu/image.scm +++ b/gnu/image.scm @@ -17,7 +17,7 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu image) - #:use-module (gnu platform) + #:use-module (guix platform) #:use-module (guix records) #:export (partition partition? diff --git a/gnu/local.mk b/gnu/local.mk index 06826ee0cc..a4250248ca 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -89,7 +89,6 @@ GNU_SYSTEM_MODULES = \ %D%/home/services/utils.scm \ %D%/home/services/xdg.scm \ %D%/image.scm \ - %D%/platform.scm \ %D%/packages.scm \ %D%/packages/abduco.scm \ %D%/packages/abiword.scm \ @@ -631,13 +630,6 @@ GNU_SYSTEM_MODULES = \ %D%/packages/zile.scm \ %D%/packages/zwave.scm \ \ - %D%/platforms/arm.scm \ - %D%/platforms/mips.scm \ - %D%/platforms/powerpc.scm \ - %D%/platforms/riscv.scm \ - %D%/platforms/s390.scm \ - %D%/platforms/x86.scm \ - \ %D%/services.scm \ %D%/services/admin.scm \ %D%/services/audio.scm \ diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 2a312b1989..474d85f320 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -161,7 +161,7 @@ #:use-module (gnu packages wget) #:use-module (gnu packages xml) #:use-module (gnu packages xorg) - #:use-module (gnu platform) + #:use-module (guix platform) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (ice-9 match)) diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm index 5337617a53..d2914fb5a7 100644 --- a/gnu/packages/bootstrap.scm +++ b/gnu/packages/bootstrap.scm @@ -26,7 +26,7 @@ (define-module (gnu packages bootstrap) #:use-module (guix licenses) #:use-module (gnu packages) - #:use-module (gnu platform) + #:use-module (guix platform) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system) diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 427fefbcd2..93e4f8a445 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -30,7 +30,7 @@ #:use-module (gnu packages linux) #:use-module (gnu packages hurd) #:use-module (gnu packages mingw) - #:use-module (gnu platform) + #:use-module (guix platform) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix utils) diff --git a/gnu/packages/instrumentation.scm b/gnu/packages/instrumentation.scm index c5062388f8..2db21aef1b 100644 --- a/gnu/packages/instrumentation.scm +++ b/gnu/packages/instrumentation.scm @@ -42,7 +42,7 @@ #:use-module (gnu packages swig) #:use-module (gnu packages tbb) #:use-module (gnu packages xml) - #:use-module (gnu platform) + #:use-module (guix platform) #:use-module (guix build-system cmake) #:use-module (guix build-system copy) #:use-module (guix build-system gnu) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 048fdcec98..bd24fce432 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -158,7 +158,7 @@ #:use-module (gnu packages groff) #:use-module (gnu packages selinux) #:use-module (gnu packages swig) - #:use-module (gnu platform) + #:use-module (guix platform) #:use-module (guix build-system cmake) #:use-module (guix build-system copy) #:use-module (guix build-system gnu) diff --git a/gnu/platform.scm b/gnu/platform.scm deleted file mode 100644 index fdc3685e7c..0000000000 --- a/gnu/platform.scm +++ /dev/null @@ -1,139 +0,0 @@ -;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2021 Mathieu Othacehe -;;; -;;; This file is part of GNU Guix. -;;; -;;; GNU Guix 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. -;;; -;;; GNU Guix 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 GNU Guix. If not, see . - -(define-module (gnu platform) - #:use-module (guix discovery) - #:use-module (guix memoization) - #:use-module (guix records) - #:use-module (guix ui) - #:use-module (srfi srfi-1) - #:export (platform - platform? - platform-target - platform-system - platform-linux-architecture - platform-glibc-dynamic-linker - - platform-modules - platforms - lookup-platform-by-system - lookup-platform-by-target - lookup-platform-by-target-or-system - platform-system->target - platform-target->system - - systems - targets)) - - -;;; -;;; Platform record. -;;; - -;; Description of a platform supported by GNU Guix. -;; -;; The 'target' field must be a valid GNU triplet as defined here: -;; https://www.gnu.org/software/autoconf/manual/autoconf-2.68/html_node/Specifying-Target-Triplets.html. -;; It is used for cross-compilation purposes. -;; -;; The 'system' field is the name of the corresponding system as defined in -;; the (gnu packages bootstrap) module. It can be for instance -;; "aarch64-linux" or "armhf-linux". It is used to emulate a different host -;; architecture, for instance i686-linux on x86_64-linux-gnu, or armhf-linux -;; on x86_64-linux, using the QEMU binfmt transparent emulation mechanism. -;; -;; The 'linux-architecture' is only relevant if the kernel is Linux. In that -;; case, it corresponds to the ARCH variable used when building Linux. -;; -;; The 'glibc-dynamic-linker' field is the name of Glibc's dynamic linker for -;; the corresponding system. -(define-record-type* platform make-platform - platform? - (target platform-target) - (system platform-system) - (linux-architecture platform-linux-architecture - (default #f)) - (glibc-dynamic-linker platform-glibc-dynamic-linker)) - - -;;; -;;; Platforms. -;;; - -(define (platform-modules) - "Return the list of platform modules." - (all-modules (map (lambda (entry) - `(,entry . "gnu/platforms")) - %load-path) - #:warn warn-about-load-error)) - -(define platforms - ;; The list of publically-known platforms. - (memoize - (lambda () - (fold-module-public-variables (lambda (obj result) - (if (platform? obj) - (cons obj result) - result)) - '() - (platform-modules))))) - -(define (lookup-platform-by-system system) - "Return the platform corresponding to the given SYSTEM." - (find (lambda (platform) - (let ((s (platform-system platform))) - (and (string? s) (string=? s system)))) - (platforms))) - -(define (lookup-platform-by-target target) - "Return the platform corresponding to the given TARGET." - (find (lambda (platform) - (let ((t (platform-target platform))) - (and (string? t) (string=? t target)))) - (platforms))) - -(define (lookup-platform-by-target-or-system target-or-system) - "Return the platform corresponding to the given TARGET or SYSTEM." - (or (lookup-platform-by-target target-or-system) - (lookup-platform-by-system target-or-system))) - -(define (platform-system->target system) - "Return the target matching the given SYSTEM if it exists or false -otherwise." - (let ((platform (lookup-platform-by-system system))) - (and=> platform platform-target))) - -(define (platform-target->system target) - "Return the system matching the given TARGET if it exists or false -otherwise." - (let ((platform (lookup-platform-by-target system))) - (and=> platform platform-system))) - - -;;; -;;; Systems & Targets. -;;; - -(define (systems) - "Return the list of supported systems." - (delete-duplicates - (filter-map platform-system (platforms)))) - -(define (targets) - "Return the list of supported targets." - (map platform-target (platforms))) diff --git a/gnu/platforms/arm.scm b/gnu/platforms/arm.scm deleted file mode 100644 index bf68b2d00f..0000000000 --- a/gnu/platforms/arm.scm +++ /dev/null @@ -1,38 +0,0 @@ -;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2021 Mathieu Othacehe -;;; -;;; This file is part of GNU Guix. -;;; -;;; GNU Guix 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. -;;; -;;; GNU Guix 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 GNU Guix. If not, see . - -(define-module (gnu platforms arm) - #:use-module (gnu platform) - #:use-module (gnu packages linux) - #:use-module (guix records) - #:export (armv7-linux - aarch64-linux)) - -(define armv7-linux - (platform - (target "arm-linux-gnueabihf") - (system "armhf-linux") - (linux-architecture "arm") - (glibc-dynamic-linker "/lib/ld-linux-armhf.so.3"))) - -(define aarch64-linux - (platform - (target "aarch64-linux-gnu") - (system "aarch64-linux") - (linux-architecture "arm64") - (glibc-dynamic-linker "/lib/ld-linux-aarch64.so.1"))) diff --git a/gnu/platforms/hurd.scm b/gnu/platforms/hurd.scm deleted file mode 100644 index 328e9818ad..0000000000 --- a/gnu/platforms/hurd.scm +++ /dev/null @@ -1,29 +0,0 @@ -;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2021 Mathieu Othacehe -;;; -;;; This file is part of GNU Guix. -;;; -;;; GNU Guix 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. -;;; -;;; GNU Guix 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 GNU Guix. If not, see . - -(define-module (gnu platforms hurd) - #:use-module (gnu platform) - #:use-module (gnu packages linux) - #:use-module (guix records) - #:export (hurd)) - -(define hurd - (platform - (target "i586-pc-gnu") - (system "i586-gnu") - (glibc-dynamic-linker "/lib/ld.so.1"))) diff --git a/gnu/platforms/mips.scm b/gnu/platforms/mips.scm deleted file mode 100644 index 174657da13..0000000000 --- a/gnu/platforms/mips.scm +++ /dev/null @@ -1,30 +0,0 @@ -;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2022 Mathieu Othacehe -;;; -;;; This file is part of GNU Guix. -;;; -;;; GNU Guix 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. -;;; -;;; GNU Guix 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 GNU Guix. If not, see . - -(define-module (gnu platforms mips) - #:use-module (gnu platform) - #:use-module (gnu packages linux) - #:use-module (guix records) - #:export (mips64-linux)) - -(define mips64-linux - (platform - (target "mips64el-linux-gnu") - (system "mips64el-linux") - (linux-architecture "mips") - (glibc-dynamic-linker "/lib/ld.so.1"))) diff --git a/gnu/platforms/powerpc.scm b/gnu/platforms/powerpc.scm deleted file mode 100644 index 1d0b5cb666..0000000000 --- a/gnu/platforms/powerpc.scm +++ /dev/null @@ -1,38 +0,0 @@ -;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2022 Mathieu Othacehe -;;; -;;; This file is part of GNU Guix. -;;; -;;; GNU Guix 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. -;;; -;;; GNU Guix 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 GNU Guix. If not, see . - -(define-module (gnu platforms powerpc) - #:use-module (gnu platform) - #:use-module (gnu packages linux) - #:use-module (guix records) - #:export (powerpc-linux - powerpc64le-linux)) - -(define powerpc-linux - (platform - (target "powerpc-linux-gnu") - (system "powerpc-linux") - (linux-architecture "powerpc") - (glibc-dynamic-linker "/lib/ld.so.1"))) - -(define powerpc64le-linux - (platform - (target "powerpc64le-linux-gnu") - (system "powerpc64le-linux") - (linux-architecture "powerpc") - (glibc-dynamic-linker "/lib/ld64.so.2"))) diff --git a/gnu/platforms/riscv.scm b/gnu/platforms/riscv.scm deleted file mode 100644 index c2b4850e55..0000000000 --- a/gnu/platforms/riscv.scm +++ /dev/null @@ -1,30 +0,0 @@ -;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2022 Mathieu Othacehe -;;; -;;; This file is part of GNU Guix. -;;; -;;; GNU Guix 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. -;;; -;;; GNU Guix 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 GNU Guix. If not, see . - -(define-module (gnu platforms riscv) - #:use-module (gnu platform) - #:use-module (gnu packages linux) - #:use-module (guix records) - #:export (riscv64-linux)) - -(define riscv64-linux - (platform - (target "riscv64-linux-gnu") - (system "riscv64-linux") - (linux-architecture "riscv") - (glibc-dynamic-linker "/lib/ld-linux-riscv64-lp64d.so.1"))) diff --git a/gnu/platforms/s390.scm b/gnu/platforms/s390.scm deleted file mode 100644 index d3b1133974..0000000000 --- a/gnu/platforms/s390.scm +++ /dev/null @@ -1,30 +0,0 @@ -;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2022 Mathieu Othacehe -;;; -;;; This file is part of GNU Guix. -;;; -;;; GNU Guix 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. -;;; -;;; GNU Guix 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 GNU Guix. If not, see . - -(define-module (gnu platforms s390) - #:use-module (gnu platform) - #:use-module (gnu packages linux) - #:use-module (guix records) - #:export (s390x-linux)) - -(define s390x-linux - (platform - (target "s390x-linux-gnu") - (system "s390x-linux") - (linux-architecture "s390") - (glibc-dynamic-linker "/lib/ld64.so.1"))) diff --git a/gnu/platforms/x86.scm b/gnu/platforms/x86.scm deleted file mode 100644 index fba7dd4fc0..0000000000 --- a/gnu/platforms/x86.scm +++ /dev/null @@ -1,59 +0,0 @@ -;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2022 Mathieu Othacehe -;;; -;;; This file is part of GNU Guix. -;;; -;;; GNU Guix 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. -;;; -;;; GNU Guix 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 GNU Guix. If not, see . - -(define-module (gnu platforms x86) - #:use-module (gnu platform) - #:use-module (gnu packages linux) - #:use-module (guix records) - #:export (i686-linux - x86_64-linux - i686-mingw - x86_64-mingw - hurd)) - -(define i686-linux - (platform - (target "i686-linux-gnu") - (system "i686-linux") - (linux-architecture "i386") - (glibc-dynamic-linker "/lib/ld-linux.so.2"))) - -(define x86_64-linux - (platform - (target "x86_64-linux-gnu") - (system "x86_64-linux") - (linux-architecture "x86_64") - (glibc-dynamic-linker "/lib/ld-linux-x86-64.so.2"))) - -(define i686-mingw - (platform - (target "i686-w64-mingw32") - (system #f) - (glibc-dynamic-linker #f))) - -(define x86_64-mingw - (platform - (target "x86_64-w64-mingw32") - (system #f) - (glibc-dynamic-linker #f))) - -(define hurd - (platform - (target "i586-pc-gnu") - (system "i586-gnu") - (glibc-dynamic-linker "/lib/ld.so.1"))) diff --git a/gnu/system/image.scm b/gnu/system/image.scm index 74b81d02f6..dd32e58c2d 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -32,7 +32,7 @@ #:use-module (gnu bootloader) #:use-module (gnu bootloader grub) #:use-module (gnu image) - #:use-module (gnu platform) + #:use-module (guix platform) #:use-module (gnu services) #:use-module (gnu services base) #:use-module (gnu system) diff --git a/gnu/system/images/hurd.scm b/gnu/system/images/hurd.scm index 4c38c46a89..36b6f3a200 100644 --- a/gnu/system/images/hurd.scm +++ b/gnu/system/images/hurd.scm @@ -23,7 +23,7 @@ #:use-module (gnu bootloader grub) #:use-module (gnu image) #:use-module (gnu packages ssh) - #:use-module (gnu platforms hurd) + #:use-module (guix platforms hurd) #:use-module (gnu services) #:use-module (gnu services ssh) #:use-module (gnu system) diff --git a/gnu/system/images/novena.scm b/gnu/system/images/novena.scm index 5b625e56c5..b9ff6dcfea 100644 --- a/gnu/system/images/novena.scm +++ b/gnu/system/images/novena.scm @@ -22,7 +22,7 @@ #:use-module (gnu bootloader u-boot) #:use-module (gnu image) #:use-module (gnu packages linux) - #:use-module (gnu platforms arm) + #:use-module (guix platforms arm) #:use-module (gnu services) #:use-module (gnu services base) #:use-module (gnu system) diff --git a/gnu/system/images/pine64.scm b/gnu/system/images/pine64.scm index aaec458766..99c4ed6ceb 100644 --- a/gnu/system/images/pine64.scm +++ b/gnu/system/images/pine64.scm @@ -21,7 +21,7 @@ #:use-module (gnu bootloader u-boot) #:use-module (gnu image) #:use-module (gnu packages linux) - #:use-module (gnu platforms arm) + #:use-module (guix platforms arm) #:use-module (gnu services) #:use-module (gnu services base) #:use-module (gnu system) diff --git a/gnu/system/images/pinebook-pro.scm b/gnu/system/images/pinebook-pro.scm index 1bfac7a8bb..7e8910427e 100644 --- a/gnu/system/images/pinebook-pro.scm +++ b/gnu/system/images/pinebook-pro.scm @@ -21,7 +21,7 @@ #:use-module (gnu bootloader u-boot) #:use-module (gnu image) #:use-module (gnu packages linux) - #:use-module (gnu platforms arm) + #:use-module (guix platforms arm) #:use-module (gnu services) #:use-module (gnu services base) #:use-module (gnu system) diff --git a/gnu/system/images/rock64.scm b/gnu/system/images/rock64.scm index d25d55e528..68cb65f115 100644 --- a/gnu/system/images/rock64.scm +++ b/gnu/system/images/rock64.scm @@ -21,7 +21,7 @@ #:use-module (gnu bootloader u-boot) #:use-module (gnu image) #:use-module (gnu packages linux) - #:use-module (gnu platforms arm) + #:use-module (guix platforms arm) #:use-module (gnu services) #:use-module (gnu services base) #:use-module (gnu services networking) diff --git a/guix/platform.scm b/guix/platform.scm new file mode 100644 index 0000000000..361241cb2e --- /dev/null +++ b/guix/platform.scm @@ -0,0 +1,139 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2021 Mathieu Othacehe +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix 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. +;;; +;;; GNU Guix 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 GNU Guix. If not, see . + +(define-module (guix platform) + #:use-module (guix discovery) + #:use-module (guix memoization) + #:use-module (guix records) + #:use-module (guix ui) + #:use-module (srfi srfi-1) + #:export (platform + platform? + platform-target + platform-system + platform-linux-architecture + platform-glibc-dynamic-linker + + platform-modules + platforms + lookup-platform-by-system + lookup-platform-by-target + lookup-platform-by-target-or-system + platform-system->target + platform-target->system + + systems + targets)) + + +;;; +;;; Platform record. +;;; + +;; Description of a platform supported by GNU Guix. +;; +;; The 'target' field must be a valid GNU triplet as defined here: +;; https://www.gnu.org/software/autoconf/manual/autoconf-2.68/html_node/Specifying-Target-Triplets.html. +;; It is used for cross-compilation purposes. +;; +;; The 'system' field is the name of the corresponding system as defined in +;; the (gnu packages bootstrap) module. It can be for instance +;; "aarch64-linux" or "armhf-linux". It is used to emulate a different host +;; architecture, for instance i686-linux on x86_64-linux-gnu, or armhf-linux +;; on x86_64-linux, using the QEMU binfmt transparent emulation mechanism. +;; +;; The 'linux-architecture' is only relevant if the kernel is Linux. In that +;; case, it corresponds to the ARCH variable used when building Linux. +;; +;; The 'glibc-dynamic-linker' field is the name of Glibc's dynamic linker for +;; the corresponding system. +(define-record-type* platform make-platform + platform? + (target platform-target) + (system platform-system) + (linux-architecture platform-linux-architecture + (default #f)) + (glibc-dynamic-linker platform-glibc-dynamic-linker)) + + +;;; +;;; Platforms. +;;; + +(define (platform-modules) + "Return the list of platform modules." + (all-modules (map (lambda (entry) + `(,entry . "guix/platforms")) + %load-path) + #:warn warn-about-load-error)) + +(define platforms + ;; The list of publically-known platforms. + (memoize + (lambda () + (fold-module-public-variables (lambda (obj result) + (if (platform? obj) + (cons obj result) + result)) + '() + (platform-modules))))) + +(define (lookup-platform-by-system system) + "Return the platform corresponding to the given SYSTEM." + (find (lambda (platform) + (let ((s (platform-system platform))) + (and (string? s) (string=? s system)))) + (platforms))) + +(define (lookup-platform-by-target target) + "Return the platform corresponding to the given TARGET." + (find (lambda (platform) + (let ((t (platform-target platform))) + (and (string? t) (string=? t target)))) + (platforms))) + +(define (lookup-platform-by-target-or-system target-or-system) + "Return the platform corresponding to the given TARGET or SYSTEM." + (or (lookup-platform-by-target target-or-system) + (lookup-platform-by-system target-or-system))) + +(define (platform-system->target system) + "Return the target matching the given SYSTEM if it exists or false +otherwise." + (let ((platform (lookup-platform-by-system system))) + (and=> platform platform-target))) + +(define (platform-target->system target) + "Return the system matching the given TARGET if it exists or false +otherwise." + (let ((platform (lookup-platform-by-target system))) + (and=> platform platform-system))) + + +;;; +;;; Systems & Targets. +;;; + +(define (systems) + "Return the list of supported systems." + (delete-duplicates + (filter-map platform-system (platforms)))) + +(define (targets) + "Return the list of supported targets." + (map platform-target (platforms))) diff --git a/guix/platforms/arm.scm b/guix/platforms/arm.scm new file mode 100644 index 0000000000..32c0fbc032 --- /dev/null +++ b/guix/platforms/arm.scm @@ -0,0 +1,37 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2021 Mathieu Othacehe +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix 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. +;;; +;;; GNU Guix 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 GNU Guix. If not, see . + +(define-module (guix platforms arm) + #:use-module (guix platform) + #:use-module (guix records) + #:export (armv7-linux + aarch64-linux)) + +(define armv7-linux + (platform + (target "arm-linux-gnueabihf") + (system "armhf-linux") + (linux-architecture "arm") + (glibc-dynamic-linker "/lib/ld-linux-armhf.so.3"))) + +(define aarch64-linux + (platform + (target "aarch64-linux-gnu") + (system "aarch64-linux") + (linux-architecture "arm64") + (glibc-dynamic-linker "/lib/ld-linux-aarch64.so.1"))) diff --git a/guix/platforms/hurd.scm b/guix/platforms/hurd.scm new file mode 100644 index 0000000000..baa6c23b41 --- /dev/null +++ b/guix/platforms/hurd.scm @@ -0,0 +1,28 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2021 Mathieu Othacehe +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix 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. +;;; +;;; GNU Guix 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 GNU Guix. If not, see . + +(define-module (guix platforms hurd) + #:use-module (guix platform) + #:use-module (guix records) + #:export (hurd)) + +(define hurd + (platform + (target "i586-pc-gnu") + (system "i586-gnu") + (glibc-dynamic-linker "/lib/ld.so.1"))) diff --git a/guix/platforms/mips.scm b/guix/platforms/mips.scm new file mode 100644 index 0000000000..e6fa9eb292 --- /dev/null +++ b/guix/platforms/mips.scm @@ -0,0 +1,29 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022 Mathieu Othacehe +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix 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. +;;; +;;; GNU Guix 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 GNU Guix. If not, see . + +(define-module (guix platforms mips) + #:use-module (guix platform) + #:use-module (guix records) + #:export (mips64-linux)) + +(define mips64-linux + (platform + (target "mips64el-linux-gnu") + (system "mips64el-linux") + (linux-architecture "mips") + (glibc-dynamic-linker "/lib/ld.so.1"))) diff --git a/guix/platforms/powerpc.scm b/guix/platforms/powerpc.scm new file mode 100644 index 0000000000..9d0b343bc3 --- /dev/null +++ b/guix/platforms/powerpc.scm @@ -0,0 +1,37 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022 Mathieu Othacehe +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix 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. +;;; +;;; GNU Guix 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 GNU Guix. If not, see . + +(define-module (guix platforms powerpc) + #:use-module (guix platform) + #:use-module (guix records) + #:export (powerpc-linux + powerpc64le-linux)) + +(define powerpc-linux + (platform + (target "powerpc-linux-gnu") + (system "powerpc-linux") + (linux-architecture "powerpc") + (glibc-dynamic-linker "/lib/ld.so.1"))) + +(define powerpc64le-linux + (platform + (target "powerpc64le-linux-gnu") + (system "powerpc64le-linux") + (linux-architecture "powerpc") + (glibc-dynamic-linker "/lib/ld64.so.2"))) diff --git a/guix/platforms/riscv.scm b/guix/platforms/riscv.scm new file mode 100644 index 0000000000..c716c12c12 --- /dev/null +++ b/guix/platforms/riscv.scm @@ -0,0 +1,29 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022 Mathieu Othacehe +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix 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. +;;; +;;; GNU Guix 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 GNU Guix. If not, see . + +(define-module (guix platforms riscv) + #:use-module (guix platform) + #:use-module (guix records) + #:export (riscv64-linux)) + +(define riscv64-linux + (platform + (target "riscv64-linux-gnu") + (system "riscv64-linux") + (linux-architecture "riscv") + (glibc-dynamic-linker "/lib/ld-linux-riscv64-lp64d.so.1"))) diff --git a/guix/platforms/s390.scm b/guix/platforms/s390.scm new file mode 100644 index 0000000000..b5477f1e5e --- /dev/null +++ b/guix/platforms/s390.scm @@ -0,0 +1,29 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022 Mathieu Othacehe +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix 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. +;;; +;;; GNU Guix 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 GNU Guix. If not, see . + +(define-module (guix platforms s390) + #:use-module (guix platform) + #:use-module (guix records) + #:export (s390x-linux)) + +(define s390x-linux + (platform + (target "s390x-linux-gnu") + (system "s390x-linux") + (linux-architecture "s390") + (glibc-dynamic-linker "/lib/ld64.so.1"))) diff --git a/guix/platforms/x86.scm b/guix/platforms/x86.scm new file mode 100644 index 0000000000..5338049d6f --- /dev/null +++ b/guix/platforms/x86.scm @@ -0,0 +1,58 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022 Mathieu Othacehe +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix 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. +;;; +;;; GNU Guix 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 GNU Guix. If not, see . + +(define-module (guix platforms x86) + #:use-module (guix platform) + #:use-module (guix records) + #:export (i686-linux + x86_64-linux + i686-mingw + x86_64-mingw + hurd)) + +(define i686-linux + (platform + (target "i686-linux-gnu") + (system "i686-linux") + (linux-architecture "i386") + (glibc-dynamic-linker "/lib/ld-linux.so.2"))) + +(define x86_64-linux + (platform + (target "x86_64-linux-gnu") + (system "x86_64-linux") + (linux-architecture "x86_64") + (glibc-dynamic-linker "/lib/ld-linux-x86-64.so.2"))) + +(define i686-mingw + (platform + (target "i686-w64-mingw32") + (system #f) + (glibc-dynamic-linker #f))) + +(define x86_64-mingw + (platform + (target "x86_64-w64-mingw32") + (system #f) + (glibc-dynamic-linker #f))) + +(define hurd + (platform + (target "i586-pc-gnu") + (system "i586-gnu") + (glibc-dynamic-linker "/lib/ld.so.1"))) diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index 4383a399a0..75bbb701ae 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -48,7 +48,7 @@ #:use-module (srfi srfi-35) #:use-module (srfi srfi-37) #:use-module (gnu packages) - #:use-module (gnu platform) + #:use-module (guix platform) #:use-module ((guix status) #:select (with-status-verbosity)) #:use-module ((guix progress) #:select (current-terminal-columns)) #:use-module ((guix build syscalls) #:select (terminal-columns)) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 73e3c299c1..eaa245eb44 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -66,7 +66,7 @@ (device-module-aliases matching-modules) #:use-module (gnu system linux-initrd) #:use-module (gnu image) - #:use-module (gnu platform) + #:use-module (guix platform) #:use-module (gnu system) #:use-module (gnu bootloader) #:use-module (gnu system file-systems) diff --git a/guix/self.scm b/guix/self.scm index 9fff0ade04..9a64051c32 100644 --- a/guix/self.scm +++ b/guix/self.scm @@ -888,7 +888,7 @@ itself." ,@(scheme-modules* source "gnu/system") ,@(scheme-modules* source "gnu/services") ,@(scheme-modules* source "gnu/machine") - ,@(scheme-modules* source "gnu/platforms/")) + ,@(scheme-modules* source "guix/platforms/")) (list *core-package-modules* *package-modules* *extra-modules* *core-modules*) #:extensions dependencies -- cgit v1.2.3