Mirror of GNU Guix
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

129 lines
4.8 KiB

  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2020 Ludovic Courtès <ludo@gnu.org>
  3. ;;;
  4. ;;; This file is part of GNU Guix.
  5. ;;;
  6. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  7. ;;; under the terms of the GNU General Public License as published by
  8. ;;; the Free Software Foundation; either version 3 of the License, or (at
  9. ;;; your option) any later version.
  10. ;;;
  11. ;;; GNU Guix is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;;; GNU General Public License for more details.
  15. ;;;
  16. ;;; You should have received a copy of the GNU General Public License
  17. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  18. ;;; This file returns a manifest containing release-critical bit, for all the
  19. ;;; supported architectures and cross-compilation targets.
  20. (use-modules (gnu packages)
  21. (guix packages)
  22. (guix profiles)
  23. ((gnu ci) #:select (%cross-targets))
  24. ((gnu services xorg) #:select (%default-xorg-modules))
  25. (guix utils)
  26. (srfi srfi-1)
  27. (srfi srfi-26))
  28. (define* (package->manifest-entry* package system
  29. #:key target)
  30. "Return a manifest entry for PACKAGE on SYSTEM, optionally cross-compiled to
  31. TARGET."
  32. (manifest-entry
  33. (inherit (package->manifest-entry package))
  34. (name (string-append (package-name package) "." system
  35. (if target
  36. (string-append "." target)
  37. "'")))
  38. (item (with-parameters ((%current-system system)
  39. (%current-target-system target))
  40. package))))
  41. (define %base-packages
  42. ;; Packages that must be substitutable on all the platforms Guix supports.
  43. (map specification->package
  44. '("bootstrap-tarballs" "gcc-toolchain" "nss-certs"
  45. "openssh" "emacs" "vim" "python" "guile" "guix")))
  46. (define %system-packages
  47. ;; Key packages proposed by the Guix System installer.
  48. (append (map specification->package
  49. '("xorg-server" "xfce" "gnome" "mate" "enlightenment"
  50. "openbox" "awesome" "i3-wm" "ratpoison"
  51. "xlockmore" "slock" "libreoffice"
  52. "connman" "network-manager" "network-manager-applet"
  53. "openssh" "ntp" "tor"
  54. "linux-libre" "grub-hybrid"
  55. ;; FIXME: Add IceCat when Rust is available on i686.
  56. ;;"icecat"
  57. ))
  58. %default-xorg-modules))
  59. (define %packages-to-cross-build
  60. ;; Packages that must be cross-buildable from x86_64-linux.
  61. ;; FIXME: Add (@ (gnu packages gcc) gcc) when <https://bugs.gnu.org/40463>
  62. ;; is fixed.
  63. (append (list (@ (gnu packages guile) guile-3.0/fixed))
  64. (map specification->package
  65. '("coreutils" "grep" "sed" "findutils" "diffutils" "patch"
  66. "gawk" "gettext" "gzip" "xz"
  67. "hello" "zlib"))))
  68. (define %packages-to-cross-build-for-mingw
  69. ;; Many things don't build for MinGW. Restrict to what's known to work.
  70. (map specification->package '("hello")))
  71. (define %cross-bootstrap-targets
  72. ;; Cross-compilation triplets for which 'bootstrap-tarballs' must be
  73. ;; buildable.
  74. '("i586-pc-gnu"
  75. "arm-linux-gnueabihf"
  76. "aarch64-linux-gnu"))
  77. ;;;
  78. ;;; Manifests.
  79. ;;;
  80. (define %base-manifest
  81. (manifest
  82. (append-map (lambda (system)
  83. (map (cut package->manifest-entry* <> system)
  84. %base-packages))
  85. %hydra-supported-systems)))
  86. (define %system-manifest
  87. (manifest
  88. (append-map (lambda (system)
  89. (map (cut package->manifest-entry* <> system)
  90. %system-packages))
  91. '("x86_64-linux" "i686-linux")))) ;Guix System
  92. (define %cross-manifest
  93. (manifest
  94. (append-map (lambda (target)
  95. (map (cut package->manifest-entry* <> "x86_64-linux"
  96. #:target target)
  97. (if (target-mingw? target)
  98. %packages-to-cross-build-for-mingw
  99. %packages-to-cross-build)))
  100. ;; XXX: Important bits like libsigsegv and libffi don't support
  101. ;; RISCV at the moment, so don't require RISCV support.
  102. (delete "riscv64-linux-gnu" %cross-targets))))
  103. (define %cross-bootstrap-manifest
  104. (manifest
  105. (map (lambda (target)
  106. (package->manifest-entry*
  107. (specification->package "bootstrap-tarballs")
  108. "x86_64-linux" #:target target))
  109. %cross-bootstrap-targets)))
  110. ;; Return the union of all three manifests.
  111. (concatenate-manifests (list %base-manifest
  112. %system-manifest
  113. %cross-manifest
  114. %cross-bootstrap-manifest))