Commit Graph

236 Commits

Author SHA1 Message Date
Ludovic Courtès efb10f175f
packages: Ensure bags are insensitive to '%current-system'.
Fixes <https://bugs.gnu.org/42327>.
Reported by Jan Nieuwenhuizen <janneke@gnu.org>.

This is a followup to f52fbf7094.

* guix/packages.scm (bag-transitive-inputs, bag-transitive-build-inputs)
(bag-transitive-host-inputs, bag-transitive-target-inputs): Parameterize
%CURRENT-SYSTEM in addition to %CURRENT-TARGET-SYSTEM.
* tests/packages.scm ("package->bag, sensitivity to %current-system"):
New test.
2020-07-13 16:49:12 +02:00
Ludovic Courtès 0505eda9c7
packages: Recognize SHA3 and BLAKE2s for 'content-hash'.
* guix/packages.scm (build-content-hash): Add 'sha3-256', 'sha3-512',
and 'blake2s-256'.
* tests/packages.scm ("package-source-derivation, origin, sha3-512"):
New test.
2020-06-27 23:42:20 +02:00
Ludovic Courtès 03a70e4c19
packages: 'package-grafts' returns grafts for all the relevant outputs.
Fixes <https://bugs.gnu.org/41796>.
Reported by Jakub Kądziołka <kuba@kadziolka.net>.

* guix/packages.scm (input-graft): Add 'output' parameter and honor it.
Add OUTPUT to the cache key.
(input-cross-graft): Likewise.
(fold-bag-dependencies): Operate on inputs instead of nodes.  Turn
VISITED into a vhash instead of a set.  Pass PROC HEAD and OUTPUT
instead of just HEAD.
(bag-grafts): Adjust accordingly.
* tests/packages.scm ("package-grafts, dependency on several outputs"):
New test.
2020-06-11 19:05:05 +02:00
Ludovic Courtès b49caaa2b7
packages: Make 'bag-grafts' insensitive to '%current-target-system'.
Fixes <https://bugs.gnu.org/41713>.
Reported by Mathieu Othacehe.

* guix/packages.scm (bag-grafts): Wrap 'fold-bag-dependencies' calls in
'parameterize'.
* tests/packages.scm ("package->bag, sensitivity to
%current-target-system"): New test.
2020-06-06 23:28:48 +02:00
Ludovic Courtès ce0be5675b
packages: Introduce <content-hash> and use it in <origin>.
* guix/packages.scm (<content-hash>): New record type.
(define-content-hash-constructor, build-content-hash)
(content-hash): New macros.
(print-content-hash): New procedure.
(<origin>): Rename constructor to '%origin'.
[sha256]: Remove field.
[hash]: New field.  Adjust users.
(origin-compatibility-helper, origin): New macros.
(origin-sha256): New deprecated procedure.
(origin->derivation): Adjust accordingly.
* tests/packages.scm ("package-source-derivation, origin, sha512"): New
test.
* guix/tests.scm: Hide (gcrypt hash) 'sha256' for proper syntax
matching.
* tests/challenge.scm: Add #:prefix for (gcrypt hash) and adjust users.
* tests/derivations.scm: Likewise.
* tests/store.scm: Likewise.
* tests/graph.scm ("bag DAG, including origins"): Provide 'sha256' field
with the right length.
* gnu/packages/aspell.scm (aspell-dictionary)
(aspell-dict-ca, aspell-dict-it): Use 'hash' and 'content-hash' for
proper syntax matching.
* gnu/packages/bash.scm (bash-patch): Rename 'sha256' to 'sha256-bv'.
* gnu/packages/bootstrap.scm (bootstrap-executable): Rename 'sha256' to 'bv'.
* gnu/packages/readline.scm (readline-patch): Likewise.
* gnu/packages/virtualization.scm (qemu-patch): Rename 'sha256' to
'sha256-bv'.
* guix/import/utils.scm: Hide (gcrypt hash) 'sha256'.
2020-05-22 01:29:39 +02:00
Ludovic Courtès 56f7ca6e7c
packages: Add 'base64' macro.
* guix/packages.scm (define-compile-time-decoder): New macro.
(base32): Redefine in terms of it.
(base64): New macro.
2020-05-22 00:35:24 +02:00
Ludovic Courtès f52fbf7094
packages: Ensure bags are insensitive to '%current-target-system'.
Fixes a bug whereby a bag's transitive dependencies would depend on the
global '%current-target-system' value.

Partly fixes <https://issues.guix.gnu.org/41182>.

* guix/packages.scm (bag-transitive-inputs)
(bag-transitive-build-inputs, bag-transitive-target-inputs):
Parameterize '%current-target-system'.
* tests/packages.scm ("package->bag, sensitivity to %current-target-system"):
New test.
2020-05-14 17:21:27 +02:00
Marius Bakke 030f6f489f
Merge branch 'master' into core-updates
Conflicts:
	etc/news.scm
	gnu/local.mk
	gnu/packages/bootloaders.scm
	gnu/packages/linphone.scm
	gnu/packages/linux.scm
	gnu/packages/tls.scm
	gnu/system.scm
2020-04-23 13:33:09 +02:00
Ludovic Courtès c8d8f6160e
packages: Recommend against the use of 'package-file'.
* guix/packages.scm (package-file): Recommend against its use in the
docstring.
* doc/guix.texi (The Store Monad): Likewise.
2020-04-21 00:06:40 +02:00
Marius Bakke 2778302399
Merge branch 'master' into core-updates
Conflicts:
	etc/news.scm
	gnu/local.mk
	gnu/packages/check.scm
	gnu/packages/cross-base.scm
	gnu/packages/gimp.scm
	gnu/packages/java.scm
	gnu/packages/mail.scm
	gnu/packages/sdl.scm
	gnu/packages/texinfo.scm
	gnu/packages/tls.scm
	gnu/packages/version-control.scm
2020-04-08 13:00:50 +02:00
Carl Dong b066c25026
gnu: Move PACKAGES-WITH-*PATCHES to (guix packages)
* gnu/packages/cross-base.scm (package-with-extra-patches,
package-with-patches): Move procedures from here...
* guix/packages.scm (package-with-extra-patches, package-with-patches):
...to here, and export.
2020-04-06 14:02:42 -04:00
Marius Bakke ae0badf5bb
Merge branch 'master' into core-updates
Conflicts:
	gnu/packages/admin.scm
	gnu/packages/commencement.scm
	gnu/packages/guile.scm
	gnu/packages/linux.scm
	gnu/packages/package-management.scm
	gnu/packages/pulseaudio.scm
	gnu/packages/web.scm
2020-03-30 12:17:33 +02:00
Ludovic Courtès 9f78552996
packages: 'package->bag' keys cache by replacement.
* guix/packages.scm (package->bag): When GRAFT? is true, use PACKAGE's
replacement as the cache key.  Remove GRAFT? from the list of
secondary cache keys.
2020-03-29 23:14:28 +02:00
Ludovic Courtès 033df23680
packages: Change 'guile-for-grafts' back to 2.0.
This reverts 2b6fe60599, due to reports of
segfaults of Guile 3.0.2 during grafting.

* guix/packages.scm (guile-for-grafts): Change back to GUILE-2.0.
2020-03-29 15:35:47 +02:00
Ludovic Courtès 2b6fe60599
packages: Use Guile 3.0 for grafts.
* guix/packages.scm (guile-2.0): Rename to...
(guile-for-grafts): ... this, and adjust callers.  Refer to 'guile-3.0'
instead of 'guile-2.0'.
2020-03-27 19:09:30 +01:00
Marius Bakke 18af687037
Merge branch 'master' into core-updates
Conflicts:
	gnu/packages/icu4c.scm
	gnu/packages/man.scm
	gnu/packages/python-xyz.scm
	guix/scripts/environment.scm
	guix/scripts/pack.scm
	guix/scripts/package.scm
	guix/scripts/pull.scm
	guix/store.scm
2020-03-27 00:12:15 +01:00
Efraim Flashner 6741f543e6
gnu: bootstrap: Add support for the Hurd.
On 3342a1182b
   gnu: make-bootstrap: Use _IOLBF on Guile 2.0 only.

Run
    ./pre-inst-env guix build --target=i586-pc-gnu bootstrap-tarballs --verbosity=1

Producing

    /gnu/store/lhca65c997pvic5cfrpm0dasniwqlg2a-bootstrap-tarballs-0

With guix hash -rx /gnu/store/lhca65c997pvic5cfrpm0dasniwqlg2a-bootstrap-tarballs-0

    07jnq2by98f2a45k8wd2gj62iazvwfa4z7p3w3id4m1g0fdsvc3b

* gnu/packages/bootstrap.scm (%bootstrap-executables): Add entries for the
Hurd.
(bootstrap-executable-url): Use lilypond url for the Hurd.
(bootstrap-guile-url-path): Likewise.
(bootstrap-guile-hash): Add entry for the Hurd.
(%bootstrap-coreutils&co): Likewise.
(%bootstrap-binutils): Likewise.
(%bootstrap-glibc): Likewise.
(%bootstrap-gcc): Likewise.
* guix/packages.scm (%supported-systems): Add i586-gnu.

Co-authored-by: Jan Nieuwenhuizen <janneke@gnu.org>
2020-03-26 12:58:51 +01:00
Ludovic Courtès 91601790d0
packages: 'package-field-location' handles missing source properties.
This is a followup to f2b24f01f4.

* guix/packages.scm (package-field-location): Check whether
'source-properties->location' returns #f.  This fixes the case where
'source-properties' returns the empty list.
2020-03-22 12:42:52 +01:00
Marius Bakke d19b14c834
Merge branch 'master' into core-updates 2020-03-21 22:16:02 +01:00
Ludovic Courtès f2b24f01f4
packages: 'package-field-location' preserves the original file name.
Fixes <https://bugs.gnu.org/39425>.
Reported by Alex ter Weele <alex.ter.weele@gmail.com>.

* guix/packages.scm (package-field-location): Remove 'with-fluids' for
'%file-port-name-canonicalization'.  Change the 'file' field of the
resulting location to FILE.
2020-03-20 23:59:31 +01:00
Ludovic Courtès 36930b2463
packages: 'patch-and-repack' sets the mtime to 1, not 0.
* guix/packages.scm (patch-and-repack)[build]: Pass "--mtime=@1" instead
of "--mtime=@0".
2020-01-17 21:21:07 +01:00
Efraim Flashner 003fcf23d9
guix: Fix %hurd-systems list.
* guix/packages.scm (%hurd-systems): Replace i585-gnu with i586-gnu.
2019-12-19 10:37:20 +02:00
Ludovic Courtès d04285647d
packages: Add "aarch64-linux" to '%hydra-supported-systems'.
* guix/packages.scm (%hydra-supported-systems): Keep "aarch64-linux".
2019-10-20 23:26:50 +02:00
Ludovic Courtès 9ff87bb996
Merge branch 'master' into core-updates 2019-09-17 16:27:15 +02:00
Ludovic Courtès 36eef80d45
packages: 'package-field-location' really catches 'system-error.
This had been wrong since forever (i.e., 2013).

* guix/packages.scm (package-field-location): Catch 'system-error, not
'system.
2019-09-10 00:34:40 +02:00
Ludovic Courtès bc60349b5b
packages: 'supported-package?' binds '%current-system' for graph traversal.
Previously, (supported-package? coreutils "armhf-linux")
with (%current-system) = "x86_64-linux" would return false.  That's
because 'supported-package?' would traverse the x86_64 dependency graph,
which contains 'tcc-boot0', which supports x86 only.

Consequently, 'supported-package?' would match only 53 packages for
"armhf-linux" when running on x86, as is the case during continuous
integration.

* guix/packages.scm (package-transitive-supported-systems): Add an
optional 'system' parameter.  Use 'mlambda' instead of 'mlambdaq' for
memoization.
(supported-package?): Pass 'system' to 'package-transitive-supported-systems'.
* tests/packages.scm ("package-transitive-supported-systems, implicit inputs")
("package-transitive-supported-systems: reduced binary seed, implicit inputs"):
Remove calls to 'invalidate-memoization!', which no longer work and were
presumably introduced to work around the bug we're fixing (see commit
0db65c168f).
* tests/packages.scm ("supported-package?"): Rewrite test to use only
existing system name since otherwise 'bootstrap-executable' raises an
exception.
("supported-package? vs. system-dependent graph"): New test.
2019-09-06 14:41:58 +02:00
Mark H Weaver 0481289cbc
Merge branch 'master' into core-updates 2019-08-29 17:19:18 -04:00
David Thompson 6cef554be8
packages: Apply target triplet in bag-transitive-host-inputs.
Fixes a bug where propagated inputs that should be cross-compiled are instead
compiled for the host system.

* guix/packages.scm (bag-transitive-host-inputs): Call transitive-inputs in
  the context of the bag's target system triplet.
2019-08-26 09:40:17 -04:00
Marius Bakke 814e12dc87
packages: Retain version in file name when repacking source checkouts.
Fixes <https://bugs.gnu.org/34066>.

* guix/packages.scm (patch-and-repack)<tarxz-name>: If FILE-NAME is a source
checkout, reuse the name without the '-checkout' part.
2019-06-20 23:56:57 +02:00
Ludovic Courtès 25c639e2a3
packages: 'patch-and-repack' no longer uses #:deprecation-warnings.
* guix/packages.scm (patch-and-repack): Remove #:deprecation-warnings
argument passed to 'gexp->derivation'.
2019-06-17 15:55:36 +02:00
Ludovic Courtès 3c6b9fb5d2
gexp: Remove #:pre-load-modules? parameter.
* guix/gexp.scm (gexp->derivation): Remove #:pre-load-modules?.
(compiled-modules): Likewise.  Inline the case correspoding to
PRE-LOAD-MODULES? = #t.
* guix/packages.scm (patch-and-repack): Remove #:pre-load-modules?.
2019-06-17 15:54:17 +02:00
Marius Bakke 3b458d5462
Merge branch 'master' into core-updates 2019-05-01 23:11:41 +02:00
Ludovic Courtès a31174e896
gexp: 'compiled-modules' loads modules before compiling them.
This works around <https://bugs.gnu.org/15602> in the context of
modules specified with 'with-imported-modules'.

* guix/gexp.scm (gexp->derivation): Add #:pre-load-modules? parameter
and pass it to 'compiled-modules'.
(compiled-modules): Add #:pre-load-modules? parameter and honor it.
* guix/packages.scm (patch-and-repack): Pass #:pre-load-modules? to
'gexp->derivation'.
2019-04-04 17:47:02 +02:00
Ludovic Courtès 154f1f0937
packages: Remove 'maintainers' field.
This field was never used and doesn't match the way we collectively
maintain packages.

* guix/packages.scm (<package>)[maintainers]: Remove.
2019-03-30 15:19:32 +01:00
Ludovic Courtès a7646bc5e1
packages: Remove 'self-native-input?' field.
This field has become unnecessary with the addition of 'this-package'.

* guix/packages.scm (<package>)[self-native-input?]: Remove.
(package->bag): Adjust accordingly.
* doc/guix.texi (package Reference): Remove 'self-native-input?'.
2019-03-30 15:19:32 +01:00
Ludovic Courtès adb6462c4c
packages: Define 'this-package' and 'this-origin'.
* guix/packages.scm (<origin>): Choose 'this-origin' as the 'this'
identifier.
(<package>): Choose 'this-package'.
* gnu/packages/gnucash.scm (gnucash)[arguments]: Use 'this-package'
instead of 'this-record'.
* gnu/packages/version-control.scm (git)[arguments]: Likewise.
2019-03-30 11:08:39 +01:00
Ludovic Courtès e6301fb76d
packages: Adjust to new calling convention for "thunked" fields.
Fixes <https://bugs.gnu.org/34995>.

This is a followup to abd4d6b33d.

* guix/packages.scm (package->bag): Adjust calls to INPUTS,
PROPAGATED-INPUTS, NATIVE-INPUTS, and ARGS, passing them SELF as an
argument.
* gnu/packages/gnucash.scm (gnucash)[arguments]: Use (package-inputs
this-record) intead of (inputs).
* gnu/packages/version-control.scm (git)[arguments]: Likewise.
2019-03-26 10:26:02 +01:00
Marius Bakke 8c14f7f8a7
Merge branch 'staging' into core-updates 2019-03-23 23:16:55 +01:00
Ludovic Courtès f258d88628
packages: Add 'package-input-rewriting/spec'.
* guix/packages.scm (package-input-rewriting/spec): New procedure.
* tests/packages.scm ("package-input-rewriting/spec")
("package-input-rewriting/spec, partial match"): New tests.
* doc/guix.texi (Defining Packages): Document it.
2019-03-17 22:55:01 +01:00
Marius Bakke 19008a22d1
Merge branch 'staging' into core-updates 2019-03-14 16:30:19 +01:00
Ludovic Courtès c9c51ac39a
Revert "packages: 'package-input-rewriting' can take a promise."
This reverts commit 7d2be1277b, which
turned out to be unhelpful for the problem at hand:

  https://lists.gnu.org/archive/html/guix-devel/2019-01/msg00486.html
2019-03-12 23:51:32 +01:00
Ludovic Courtès ea89b62a18
packages: 'patch-and-repack' specifies a 'type' property for the derivation.
* guix/packages.scm (patch-and-repack): Pass #:properties to 'gexp->derivation'.
2019-03-10 22:24:09 +01:00
Ludovic Courtès 7d2be1277b
packages: 'package-input-rewriting' can take a promise.
* guix/packages.scm (package-input-rewriting): Allow REPLACEMENTS to be
a promise.
* gnu/packages/guile.scm (package-for-guile-2.0): Delay the first
argument to 'package-input-rewriting'.
2019-01-28 15:45:48 +01:00
Ludovic Courtès 3e223a22a7
packages: Add 'package-closure'.
* guix/packages.scm (package-closure): New procedure.
* tests/packages.scm ("package-closure"): New test.
2019-01-25 14:06:37 +01:00
Ludovic Courtès 0b1be8fd57
packages: Turn 'cache!' into a single-value-return cache.
* guix/packages.scm (cache!): Assume THUNK returns a single value.
(cached): Likewise.
2018-12-19 23:52:24 +01:00
Ludovic Courtès 8c7bebd6ea
gexp: Remove backward compatibility hack for 'imported-files'.
* guix/gexp.scm (gexp->derivation): Remove #:import-creates-derivation?.
(imported-files): Remove #:derivation? and adjust callers.
(imported-modules), compiled-modules): Likewise.
* guix/packages.scm (patch-and-repack): Adjust 'gexp->derivation' call.
2018-07-26 22:59:49 +02:00
Ludovic Courtès 28c4905b12
packages: 'patch-and-repack' compresses tarballs again.
* guix/packages.scm (patch-and-repack): Add missing "a" in "tar cvfa".
Fixes a regression introduced in
3e95125e9b whereby we'd always create
uncompressed tarballs.
2018-07-26 22:58:30 +02:00
Marius Bakke 706ae8e15c
Merge branch 'master' into core-updates 2018-07-24 19:56:35 +02:00
Marius Bakke 3e95125e9b
Revert "packages: Enable threaded compression of source tarballs."
Threaded compression makes tarballs non-deterministic: the result depends on
the number of threads used for compressing.  See <https://bugs.gnu.org/31015>.

This reverts commit c8a3dea847.
2018-07-22 17:58:16 +02:00
Ludovic Courtès 8df2eca6b0
gexp: 'imported-files' no longer creates a derivation by default.
* guix/gexp.scm (gexp->derivation): Add #:import-creates-derivation?.
Pass #:derivation? to 'imported-modules' and 'compiled-modules'.  In -L
argument, check whether MODULES is a derivation.
(%not-slash): New variable.
(file-mapping->tree): New procedure.
(imported-files): Rename to...
(imported-files/derivation): ... this.
(imported-files): New procedure.  Rewrite in terms of
'interned-file-tree' when possible; add #:derivation? parameter.
(imported-modules, compiled-modules): Add #:derivation? parameter and
pass it to 'imported-files'.
* guix/packages.scm (patch-and-repack): Pass
 #:import-creates-derivation? to 'gexp->derivation'.
* tests/gexp.scm ("imported-files"): Adjust to no longer expect a
derivation.
2018-07-19 11:48:04 +02:00