aboutsummaryrefslogtreecommitdiff
path: root/build-aux/build-self.scm
blob: b78f3cb4372b402a8db9d23ba42719a1a1e8f3a9 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
;;;
;;; 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 <http://www.gnu.org/licenses/>.

(define-module (build-self)
  #:use-module (gnu)
  #:use-module (guix)
  #:use-module (srfi srfi-1)
  #:export (build))

;;; Commentary:
;;;
;;; When loaded, this module returns a monadic procedure of at least one
;;; argument: the source tree to build.  It returns a derivation that
;;; builds it.
;;;
;;; This file uses modules provided by the already-installed Guix.  Those
;;; modules may be arbitrarily old compared to the version we want to
;;; build.  Because of that, it must rely on the smallest set of features
;;; that are likely to be provided by the (guix) and (gnu) modules, and by
;;; Guile itself, forever and ever.
;;;
;;; Code:


;; The dependencies.  Don't refer explicitly to the variables because they
;; could be renamed or shuffled around in modules over time.  Conversely,
;; 'find-best-packages-by-name' is expected to always have the same semantics.

(define libgcrypt
  (first (find-best-packages-by-name "libgcrypt" #f)))

(define guile-json
  (first (find-best-packages-by-name "guile-json" #f)))



;; The actual build procedure.

(define (top-source-directory)
  "Return the name of the top-level directory of this source tree."
  (and=> (assoc-ref (current-source-location) 'filename)
         (lambda (file)
           (string-append (dirname file) "/.."))))

;; The procedure below is our return value.
(define* (build source #:key verbose?
                #:allow-other-keys
                #:rest rest)
  "Return a derivation that unpacks SOURCE into STORE and compiles Scheme
files."
  (define builder
    #~(begin
        (use-modules (guix build pull))

        (let ((json (string-append #$guile-json "/share/guile/site/2.0")))
          (set! %load-path (cons json %load-path))
          (set! %load-compiled-path (cons json %load-compiled-path)))

        (build-guix #$output #$source

                    ;; XXX: This is not perfect, enabling VERBOSE? means
                    ;; building a different derivation.
                    #:debug-port (if #$verbose?
                                     (current-error-port)
                                     (%make-void-port "w"))
                    #:gcrypt #$libgcrypt)))

  (gexp->derivation "guix-latest" builder
                    #:modules '((guix build pull)
                                (guix build utils))

                    ;; Arrange so that our own (guix build …) modules are
                    ;; used.
                    #:module-path (list (top-source-directory))))

;; This file is loaded by 'guix pull'; return it the build procedure.
build

;; Local Variables:
;; eval: (put 'with-load-path 'scheme-indent-function 1)
;; End:

;;; build-self.scm ends here
d>Marius Bakke 2019-07-02Merge branch 'staging' into core-updatesMarius Bakke 2019-07-02gnu: tzdata: Update to 2019b....* gnu/packages/base.scm (tzdata): Update to 2019b. Marius Bakke 2019-07-02gnu: glibc: Update to 2.29....* gnu/packages/patches/glibc-bootstrap-system.patch, gnu/packages/patches/glibc-supported-locales.patch: Adjust for glibc 2.29. * gnu/packages/patches/glibc-2.28-supported-locales.patch, gnu/packages/patches/glibc-CVE-2019-7309.patch, gnu/packages/patches/glibc-CVE-2019-9169.patch, gnu/packages/patches/glibc-2.29-git-updates.patch: New files. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/base.scm (glibc): Update to 2.29. [source](patches): Add 'glibc-CVE-2019-7309.patch', 'glibc-CVE-2019-9169.patch', and 'glibc-2.29-git-updates.patch'. Remove 'glibc-hurd-magic-pid.patch'. [native-inputs]: Add PYTHON-MINIMAL. (glibc-2.28): New public variable. * gnu/packages/commencement.scm (expat-sans-tests, python-boot0): New variables. (glibc-final-with-bootstrap-bash)[native-inputs]: Add PYTHON-BOOT0. * gnu/packages/python.scm (python-3.7)[arguments]: Disable test that fails with glibc 2.29. Marius Bakke 2019-07-02gnu: tzdata: Update source URI....* gnu/packages/base.scm (tzdata, tzdata-for-tests)[source, native-inputs]: Update redirected URIs. Marius Bakke 2019-06-13Merge branch 'master' into core-updatesLudovic Courtès 2019-06-07gnu: glibc-locales: Install symlinks using the normalized codeset....Fixes <https://bugs.gnu.org/36076>. Reported by Jack Hill <jackhill@jackhill.us> and Giovanni Biscuolo <g@xelera.eu> * gnu/build/locale.scm (locale->name+codeset): New file. * gnu/packages/base.scm (make-glibc-locales): Add #:modules and #:imported-modules. Add a 'symlink-normalized-codesets' phase. Ludovic Courtès 2019-05-25Merge branch 'staging' into core-updatesMarius Bakke 2019-05-13gnu: Remove 'gcc-glibc-2.27' and 'gcc-glibc-2.26'....These top-level references to GCC could cause problems, such as: $ guix build -e '(@ (gnu packages gcc) gcc)' -n guix build: error: failed to evaluate expression '(@ (gnu packages gcc) gcc)': In procedure module-lookup: Unbound variable: gcc Regression introduced in 3ed497d42a5af8756bd95c64f9f9bed4de5f6d3c. * gnu/packages/base.scm (gcc-glibc-2.27, gcc-glibc-2.26): Remove. Ludovic Courtès 2019-05-13gnu: Allow building gcc with non-default libc....* gnu/packages/base.scm (make-gcc-libc): New procedure, returns a gcc that targets a specified libc. (gcc-glibc-2.26, gcc-glibc-2.27): New public variables. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Carl Dong 2019-05-01Merge branch 'master' into core-updatesMarius Bakke