maav / guix-mirror (public) (License: GPLv3+) (since 2019-11-02) (hash sha1)
Mirror of GNU Guix (https://git.savannah.gnu.org/git/guix.git) with personal branches integrated into master branch.
List of commits:
Subject Hash Author Date (UTC)
packages: Add 'package-with-c-toolchain'. 46135ce4cefab9e164d75697d7ea0c8359b842e4 Ludovic Courtès 2020-09-28 15:36:42
gnu: clang-toolchain: Create 'cc' and 'c++' symlinks. b668450716f0949e6a66550c38b6ba738f66bba7 Ludovic Courtès 2020-09-28 19:09:50
gnu: clang-toolchain: Add 'GUIX_LOCPATH' to the search paths. 61a5380bfd89c77bb45c9b77203ddfbe27eb0865 Ludovic Courtès 2020-09-28 19:19:32
gnu: gcc-toolchain: Add 'GUIX_LOCPATH' to the search paths. f848c276f0be22e66b661fe45d60d53fc0013172 Ludovic Courtès 2020-09-28 19:07:09
substitute: Reduce default narinfo negative TTL to 1h. 099d709caf55db44414475c27b7b39f8becb0d64 Ludovic Courtès 2020-10-12 15:30:35
tests: Add missing copyright line. d3162b98a824a32ce955de18b9b891fbc4342d44 Ludovic Courtès 2020-10-12 09:51:13
upgrade: Mention '--do-not-upgrade' in '--help' output. 75e72dd34ef7001ac16e1abfd117672378326aad Ludovic Courtès 2020-10-12 09:48:45
gnu: rust-clang-sys: Fix package references. 51d36964800013b679a499927208444cf1374ba1 Efraim Flashner 2020-10-12 10:22:04
gnu: rust-core-foundation-0.7: Downgrade to 0.7.0. 8bcfd15c2abd6b7d7d82ab3260df06379febff1f Efraim Flashner 2020-10-12 10:12:39
gnu: rust-tokio-util-0.3: Skip tests. af211eb5209bf031d1846743cc15667349fd6bb2 Efraim Flashner 2020-10-12 10:08:32
gnu: rust-xml-rs-0.7: Downgrade to 0.7.0. 1bea13cbd5cc9251d4b1d9040032ff1235c672a4 Efraim Flashner 2020-10-12 10:03:30
gnu: rust-syn-0.11: Skip tests. b01644cf5363431f13a5b54070c970b69a74a344 Efraim Flashner 2020-10-12 09:53:39
gnu: rust-fluid-attributes-0.4: Skip tests. d94a56d52e10ab41fbec2c75359e9c5b526622c7 Efraim Flashner 2020-10-12 09:49:03
gnu: r-rgdal: Update to 1.5-17. 328cf4e9a90cf98eb126eec35c17c020590be422 Arun Isaac 2020-10-12 10:15:40
gnu: r-rgdal: Replace proj.4 with proj. 265b2bc5d37b57ced243522e370191c42363409f Arun Isaac 2020-02-22 19:16:32
news: Update copyright. 9a7bea11d699ef13ecd90772d321eecd5992a26e Florian Pelz 2020-09-24 08:37:51
lint: cve: Set a connection timeout. baa4a2ef8109601dcd6d28b16d2d41c203f849e4 Ludovic Courtès 2020-10-12 09:25:09
http-client: 'http-fetch' and 'http-fetch/cached' accept #:timeout. d11f7f62b6ba2fbef8e4b00c7ae0d621f2d4281c Ludovic Courtès 2020-10-12 09:19:32
channels: Address test failure. 6c46e477eb50c6ee7c9b7c8199bdfb3708dc32b5 Ludovic Courtès 2020-10-12 08:10:03
gnu: rust-xz2-0.1: Fix building. 8608d40b2aeae69a6054b8e053b0474a58932ee0 Efraim Flashner 2020-10-12 09:21:35
Commit 46135ce4cefab9e164d75697d7ea0c8359b842e4 - packages: Add 'package-with-c-toolchain'.
* guix/build-system.scm (build-system-with-c-toolchain): New procedure.
* guix/packages.scm (package-with-c-toolchain): New procedure.
* tests/packages.scm ("package-with-c-toolchain"): New test.
* doc/guix.texi (package Reference): Document 'package-with-c-toolchain'.
(Build Systems): Mention it.
Author: Ludovic Courtès
Author date (UTC): 2020-09-28 15:36
Committer name: Ludovic Courtès
Committer date (UTC): 2020-10-12 16:23
Parent(s): b668450716f0949e6a66550c38b6ba738f66bba7
Signer:
Signing key: 090B11993D9AEBB5
Signing status: E
Tree: c3b9377edff08b149b46ab1a11332542c5ff7181
File Lines added Lines deleted
doc/guix.texi 32 0
guix/build-system.scm 33 2
guix/packages.scm 9 0
tests/packages.scm 20 0
File doc/guix.texi changed (mode: 100644) (index 8514dfe86f..e084144a82)
... ... cross-compiling:
6558 6558 It is an error to refer to @code{this-package} outside a package definition. It is an error to refer to @code{this-package} outside a package definition.
6559 6559 @end deffn @end deffn
6560 6560
6561 Because packages are regular Scheme objects that capture a complete
6562 dependency graph and associated build procedures, it is often useful to
6563 write procedures that take a package and return a modified version
6564 thereof according to some parameters. Below are a few examples.
6565
6566 @cindex tool chain, choosing a package's tool chain
6567 @deffn {Scheme Procedure} package-with-c-toolchain @var{package} @var{toolchain}
6568 Return a variant of @var{package} that uses @var{toolchain} instead of
6569 the default GNU C/C++ toolchain. @var{toolchain} must be a list of
6570 inputs (label/package tuples) providing equivalent functionality, such
6571 as the @code{gcc-toolchain} package.
6572
6573 The example below returns a variant of the @code{hello} package built
6574 with GCC@tie{}10.x and the rest of the GNU tool chain (Binutils and the
6575 GNU C Library) instead of the default tool chain:
6576
6577 @lisp
6578 (let ((toolchain (specification->package "gcc-toolchain@@10")))
6579 (package-with-c-toolchain hello `(("toolchain" ,toolchain))))
6580 @end lisp
6581
6582 The build tool chain is part of the @dfn{implicit inputs} of
6583 packages---it's usually not listed as part of the various ``inputs''
6584 fields and is instead pulled in by the build system. Consequently, this
6585 procedure works by changing the build system of @var{package} so that it
6586 pulls in @var{toolchain} instead of the defaults. @ref{Build Systems},
6587 for more on build systems.
6588 @end deffn
6589
6561 6590 @node origin Reference @node origin Reference
6562 6591 @subsection @code{origin} Reference @subsection @code{origin} Reference
6563 6592
 
... ... ornamentation---in other words, a bag is a lower-level representation of
6694 6723 a package, which includes all the inputs of that package, including some a package, which includes all the inputs of that package, including some
6695 6724 that were implicitly added by the build system. This intermediate that were implicitly added by the build system. This intermediate
6696 6725 representation is then compiled to a derivation (@pxref{Derivations}). representation is then compiled to a derivation (@pxref{Derivations}).
6726 The @code{package-with-c-toolchain} is an example of a way to change the
6727 implicit inputs that a package's build system pulls in (@pxref{package
6728 Reference, @code{package-with-c-toolchain}}).
6697 6729
6698 6730 Build systems accept an optional list of @dfn{arguments}. In package Build systems accept an optional list of @dfn{arguments}. In package
6699 6731 definitions, these are passed @i{via} the @code{arguments} field definitions, these are passed @i{via} the @code{arguments} field
File guix/build-system.scm changed (mode: 100644) (index 4174972b98..76d670995c)
1 1 ;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
2 ;;; Copyright © 2012, 2013, 2014, 2020 Ludovic Courtès <ludo@gnu.org>
3 3 ;;; ;;;
4 4 ;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
5 5 ;;; ;;;
 
18 18
19 19 (define-module (guix build-system) (define-module (guix build-system)
20 20 #:use-module (guix records) #:use-module (guix records)
21 #:use-module (srfi srfi-1)
21 22 #:use-module (ice-9 match) #:use-module (ice-9 match)
22 23 #:export (build-system #:export (build-system
23 24 build-system? build-system?
 
37 38 bag-arguments bag-arguments
38 39 bag-build bag-build
39 40
40 make-bag))
41 make-bag
42
43 build-system-with-c-toolchain))
41 44
42 45 (define-record-type* <build-system> build-system make-build-system (define-record-type* <build-system> build-system make-build-system
43 46 build-system? build-system?
 
... ... intermediate representation just above derivations."
98 101 #:outputs outputs #:outputs outputs
99 102 #:target target #:target target
100 103 arguments)))) arguments))))
104
105 (define (build-system-with-c-toolchain bs toolchain)
106 "Return a variant of BS, a build system, that uses TOOLCHAIN instead of the
107 default GNU C/C++ toolchain. TOOLCHAIN must be a list of
108 inputs (label/package tuples) providing equivalent functionality, such as the
109 'gcc-toolchain' package."
110 (define lower
111 (build-system-lower bs))
112
113 (define toolchain-packages
114 ;; These are the GNU toolchain packages pulled in by GNU-BUILD-SYSTEM and
115 ;; all the build systems that inherit from it. Keep the list in sync with
116 ;; 'standard-packages' in (guix build-system gnu).
117 '("gcc" "binutils" "libc" "libc:static" "ld-wrapper"))
118
119 (define (lower* . args)
120 (let ((lowered (apply lower args)))
121 (bag
122 (inherit lowered)
123 (build-inputs
124 (append (fold alist-delete
125 (bag-build-inputs lowered)
126 toolchain-packages)
127 toolchain)))))
128
129 (build-system
130 (inherit bs)
131 (lower lower*)))
File guix/packages.scm changed (mode: 100644) (index 4f2bb432be..24d6417065)
124 124 package-patched-vulnerabilities package-patched-vulnerabilities
125 125 package-with-patches package-with-patches
126 126 package-with-extra-patches package-with-extra-patches
127 package-with-c-toolchain
127 128 package/inherit package/inherit
128 129
129 130 transitive-input-references transitive-input-references
 
... ... specifies modules in scope when evaluating SNIPPET."
790 791 (append (origin-patches (package-source original)) (append (origin-patches (package-source original))
791 792 patches))) patches)))
792 793
794 (define (package-with-c-toolchain package toolchain)
795 "Return a variant of PACKAGE that uses TOOLCHAIN instead of the default GNU
796 C/C++ toolchain. TOOLCHAIN must be a list of inputs (label/package tuples)
797 providing equivalent functionality, such as the 'gcc-toolchain' package."
798 (let ((bs (package-build-system package)))
799 (package/inherit package
800 (build-system (build-system-with-c-toolchain bs toolchain)))))
801
793 802 (define (transitive-inputs inputs) (define (transitive-inputs inputs)
794 803 "Return the closure of INPUTS when considering the 'propagated-inputs' "Return the closure of INPUTS when considering the 'propagated-inputs'
795 804 edges. Omit duplicate inputs, except for those already present in INPUTS edges. Omit duplicate inputs, except for those already present in INPUTS
File tests/packages.scm changed (mode: 100644) (index 5d5abcbd76..2d13d91344)
1430 1430 (derivation-file-name (derivation-file-name
1431 1431 (package-derivation %store coreutils)))))))) (package-derivation %store coreutils))))))))
1432 1432
1433 (test-assert "package-with-c-toolchain"
1434 (let* ((dep (dummy-package "chbouib"
1435 (build-system gnu-build-system)
1436 (native-inputs `(("x" ,grep)))))
1437 (p0 (dummy-package "thingie"
1438 (build-system gnu-build-system)
1439 (inputs `(("foo" ,grep)
1440 ("bar" ,dep)))))
1441 (tc (dummy-package "my-toolchain"))
1442 (p1 (package-with-c-toolchain p0 `(("toolchain" ,tc)))))
1443 (define toolchain-packages
1444 '("gcc" "binutils" "glibc" "ld-wrapper"))
1445
1446 (match (bag-build-inputs (package->bag p1))
1447 ((("foo" foo) ("bar" bar) (_ (= package-name packages) . _) ...)
1448 (and (not (any (cut member <> packages) toolchain-packages))
1449 (member "my-toolchain" packages)
1450 (eq? foo grep)
1451 (eq? bar dep))))))
1452
1433 1453 (test-equal "package-patched-vulnerabilities" (test-equal "package-patched-vulnerabilities"
1434 1454 '(("CVE-2015-1234") '(("CVE-2015-1234")
1435 1455 ("CVE-2016-1234" "CVE-2018-4567") ("CVE-2016-1234" "CVE-2018-4567")
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/maav/guix-mirror

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/maav/guix-mirror

Clone this repository using git:
git clone git://git.rocketgit.com/user/maav/guix-mirror

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main