Commit Graph

274 Commits

Author SHA1 Message Date
Ludovic Courtès 98c075c24e
packages: 'package-derivation' honors 'system' again.
Fixes a regression introduced in
7d873f194c.

Starting from 7d873f194c, running

  guix build -s aarch64-linux sed

on an x86_64-linux machine would return an x86_64-linux machine, whereby
only the top derivation of the graph would be aarch64-linux while all
its dependencies would be x86_64-linux.

* guix/packages.scm (expand-input): Add 'system' parameter and honor it.
(bag->derivation, bag->cross-derivation): Pass SYSTEM to 'expand-input'.
* tests/packages.scm ("package-derivation, different system"): New test.
2021-07-01 21:34:42 +02:00
Efraim Flashner cbdb7d4fea
gnu: bootstrap: Add support for powerpc-linux.
On 923bb70a1b
   gnu:glibc-for-bootstrap: Fix patch.

Run
    ./pre-inst-env guix build --target=powerpc-linux-gnu bootstrap-tarballs

Producing

    /gnu/store/dyj1wvayyp1ihaknkxniz1xamcf4yrhl-bootstrap-tarballs-0

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

    02xx2ydj28pwv3vflqffinpq1icj09gzi9icm8j4bwc4lca9irxn

* gnu/packages/bootstrap.scm (%bootstrap-executables): Add entries for
powerpc-linux.
(%bootstrap-guile-hash, %bootstrap-coreutils&co, %bootstrap-binutils,
%bootstrap-glibc, %bootstrap-gcc): Add entry for powerpc-linux.
* gnu/packages.scm (%supported-systems): Add powerpc-linux.
(%hydra-supported-systems): Remove powerpc-linux.
* m4/guix.m4: Add powerpc-linux as a supported system.
2021-05-23 22:23:18 +03:00
Marius Bakke f034264204
Merge branch 'master' into core-updates
Conflicts:
	gnu/local.mk
	gnu/packages/bioinformatics.scm
	gnu/packages/django.scm
	gnu/packages/gtk.scm
	gnu/packages/llvm.scm
	gnu/packages/python-web.scm
	gnu/packages/python.scm
	gnu/packages/tex.scm
	guix/build-system/asdf.scm
	guix/build/emacs-build-system.scm
	guix/profiles.scm
2021-05-09 21:29:46 +02:00
Ludovic Courtès 0ce1b28151
packages: 'package-with-patches' preserves package location.
* guix/packages.scm (package-with-patches): Preserve the 'location'
field of ORIGINAL.
2021-04-29 01:22:04 +02:00
Danny Milosavljevic d115747362
packages: Fix patch-and-repack for ZIP files.
* guix/packages.scm (patch-and-repack): Fix for ZIP files.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-04-22 14:04:27 +02:00
Ludovic Courtès 89b0c2390a
packages: Call 'bag-grafts' only on the tip of the package graph.
This reinstates pre-gexp behavior where 'expand-input' would explicitly
pass #:graft? #f in recursive calls, thereby preventing redundant calls
to 'bag-grafts'.

* guix/packages.scm (expand-input): Turn into a monadic procedure.
Lower INPUT when it's a package, passing #:graft? #f.
(bag->derivation, bag->cross-derivation): Adjust accordingly.
* tests/packages.scm ("search paths"): Adjust so BUILD aborts only when
passed the package of interest.
2021-03-30 22:48:44 +02:00
Ludovic Courtès e7477dd59b
packages: 'expand-input' accepts any file-like object.
* guix/packages.scm (expand-input)[valid?]: Remove.
Call 'file-like?' instead of 'valid?'.  Remove 'struct?' clause.
* tests/packages.scm ("&package-input-error"): Adjust accordingly.
2021-03-30 22:48:44 +02:00
Ludovic Courtès 83bdaf3150
packages: '%standard-patch-inputs' is not influenced by '%current-target-system'.
* guix/packages.scm (%standard-patch-inputs): Parameterize
%CURRENT-TARGET-SYSTEM around call to CANONICAL.
2021-03-30 22:48:44 +02:00
Ludovic Courtès f95fc73248
build-system: Use 'sexp->gexp' for plain sexps.
This reduces memory allocations and list traversals during 'gexp->sexp',
'gexp-inputs', etc.

* guix/build-system/cargo.scm (cargo-build): Use 'sexp->gexp' for sexps
known to not contain file-like objects.  Change default #:phases to a
symbol.
* guix/build-system/cmake.scm (cmake-build, cmake-cross-build): Likewise.
* guix/build-system/copy.scm (copy-build): Likewise.
* guix/build-system/font.scm (font-build): Likewise.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build): Likewise.
* guix/build-system/gnu.scm (%strip-flags, %strip-directories): New
variables.
(gnu-build): Use them.  Use 'sexp->gexp' where appropriate.
(gnu-cross-build): Likewise.
* guix/build-system/meson.scm (meson-build): Likewise.
* guix/build-system/perl.scm (perl-build): Likewise.
* guix/build-system/python.scm (python-build): Likewise.
* guix/build-system/ruby.scm (ruby-build): Likewise.
* guix/build-system/scons.scm (scons-build): Likewise.
* guix/build-system/texlive.scm (texlive-build): Likewise.
* guix/build-system/trivial.scm (trivial-build): Likewise.
* guix/build-system/waf.scm (waf-build): Likewise.
* guix/build-system/android-ndk.scm (android-ndk-build): Likewise.
* guix/build-system/ant.scm (ant-build): Likewise.
* guix/build-system/asdf.scm (asdf-build/source, asdf-build): Likewise.
* guix/build-system/chicken.scm (chicken-build): Likewise.
* guix/build-system/clojure.scm (clojure-build): Likewise.
(source->output-path, maybe-guile->guile): Remove.
* guix/build-system/dub.scm (dub-build): Likewise.
* guix/build-system/emacs.scm (emacs-build): Likewise.
* guix/build-system/go.scm (go-build): Likewise.
* guix/build-system/haskell.scm (haskell-build): Likewise.
* guix/build-system/julia.scm (julia-build): Likewise.
* guix/build-system/linux-module.scm (linux-module-build)
(linux-module-build-cross): Likewise.
* guix/build-system/maven.scm (maven-build): Likewise.
* guix/build-system/minify.scm (minify-build): Likewise.
* guix/build-system/node.scm (node-build): Likewise.
* guix/build-system/qt.scm (qt-build, qt-cross-build): Likewise.
* guix/build-system/r.scm (r-build): Likewise.
* guix/build-system/rakudo.scm (rakudo-build): Likewise.
* guix/build-system/renpy.scm (renpy-build): Likewise.
* guix/packages.scm (patch-and-repack): Use 'sexp->gexp' when SNIPPET is
a pair.
* guix/svn-download.scm (svn-multi-fetch): Use 'sexp->gexp' for
'svn-multi-reference-locations'.
2021-03-30 22:48:44 +02:00
Ludovic Courtès 4f5f1d98ef
packages: Default origin 'patch-flags' is a gexp.
Using a gexp instead of a list means that 'gexp->sexp' & co. do not need
to scan that list for file-like objects.

* guix/packages.scm (<origin>)[patch-flags]: Default to
%DEFAULT-PATCH-FLAGS.
(%default-patch-flags): New variable.
(patch-and-repack): #:flags defaults to %DEFAULT-PATCH-FLAGS.
(origin->derivation): Don't expect FLAGS to be a list.
2021-03-30 22:48:44 +02:00
Ludovic Courtès 9e5812ac59
packages: Core procedures are written in monadic style.
This plays better with the functional object cache, which is no longer
lost across calls to procedures created by 'store-lift'.

* guix/packages.scm (input-graft, input-cross-graft): Remove 'store'
parameter.  Return a monadic procedure.
(bag-grafts): Remove 'store' parameter and turn into a monadic
procedure.
(graft-derivation*): New procedure.
(cached): Remove clause to match syntax without (=> CACHE).
(package-grafts): Define using 'store-lower'.
(package-grafts*): New procedure, from former 'package-grafts'.  Remove
'store' parameter and turn into a monadic procedure.
(package->derivation): Rewrite using 'mcached' and a monadic variant of
the former 'package-derivation' procedure.
(package->cross-derivation): Likewise.
(package-derivation, package-cross-derivation): Rewrite in terms of
'store-lower'.
(%graft-cache): Remove.
2021-03-30 22:48:43 +02:00
Ludovic Courtès 37c32caf2c
packages: Simplify patch instantiation.
* guix/packages.scm (patch-and-repack)[instantiate-patch]: Use
'local-file' instead of 'interned-file'.  When PATCH is a struct, return
it.  Use 'let' instead of 'mlet'.
2021-03-30 22:48:43 +02:00
Ludovic Courtès ba41f87ec7
packages: Turn 'bag->derivation' into a monadic procedure.
* guix/packages.scm (bag->derivation): Turn into a monadic procedure by
  remove 'store' parameter and removing the call to 'store-lower'.
  (bag->cross-derivation): Likewise.
  (bag->derivation*): New procedure.
  (package-derivation, package-cross-derivation): Use it instead of
  'bag->derivation'.
* tests/packages.scm ("bag->derivation"): Change to monadic style.
  ("bag->derivation, cross-compilation"): Likewise.
2021-03-30 22:48:43 +02:00
Ludovic Courtès 7d873f194c
build-system: Rewrite using gexps.
* guix/packages.scm (expand-input): Remove 'store', 'system', and
  'cross-system' parameters; add #:native?.  Rewrite to return
  name/gexp-input tuples.
  (bag->derivation): Adjust accordingly.  Lower (bag-build bag).
  (bag->cross-derivation): Ditto.  Instead of #:native-drvs and
  #:target-drvs, pass #:build-inputs, #:host-inputs, and #:target-inputs.
  (%derivation-cache): Remove.
* gnu/packages/bootstrap.scm (raw-build): Turn into a monadic procedure.
* gnu/packages/commencement.scm (glibc-final)[arguments]: Use
  'gexp-input' for the #:allowed-references argument.
* guix/build-system/cmake.scm (cmake-build): Remove 'store' parameter.
  Switch to the use of gexps and 'gexp->derivation'.
  (lower): Remove #:source from 'private-keywords'.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build, lower):
  Likewise.
* guix/build-system/font.scm (font-build): Likewise.
* guix/build-system/gnu.scm (gnu-build): Likewise, and remove
  'canonicalize-reference'.
  (gnu-cross-build): Likewise, and expect #:build-inputs, #:host-inputs,
  and #:target-inputs instead of #:native-drvs and #:target-drvs.
  (lower): Likewise.
* guix/build-system/perl.scm (perl-build, lower): Likewise.
* guix/build-system/python.scm (python-build, lower): Likewise.
* guix/build-system/ruby.scm (ruby-build, lower): Likewise.
* guix/build-system/waf.scm (waf-build, lower): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Remove.
  (trivial-build): Remove 'store' parameter, change to gexps.
  (trivial-cross-build): Ditto, and change to #:build-inputs & co.
* guix/build-system/cargo.scm (cargo-build): Change to 'gexp->derivation'.
* guix/build-system/copy.scm (copy-build): Likewise.
* guix/build-system/dune.scm (dune-build): Likewise.
* guix/build-system/guile.scm (guile-build, guile-cross-build):
  Likewise.
* guix/build-system/meson.scm (meson-build): Likewise.
* guix/build-system/ocaml.scm (ocaml-build): Likewise.
* guix/build-system/scons.scm (scons-build): Likewise.
* guix/build-system/texlive.scm (texlive-build): Likewise.
* guix/build-system/android-ndk.scm (android-ndk-build): Likewise.
* guix/build-system/ant.scm (ant-build): Likewise.
* guix/build-system/asdf.scm (asdf-build/source, asdf-build): Likewise.
* guix/build-system/chicken.scm (chicken-build): Likewise.
* guix/build-system/clojure.scm (clojure-build): Likewise.
(source->output-path, maybe-guile->guile): Remove.
* guix/build-system/dub.scm (dub-build): Likewise.
* guix/build-system/emacs.scm (emacs-build): Likewise.
* guix/build-system/go.scm (go-build): Likewise.
* guix/build-system/haskell.scm (haskell-build): Likewise.
* guix/build-system/julia.scm (julia-build): Likewise.
* guix/build-system/linux-module.scm (linux-module-build)
(linux-module-build-cross): Likewise.
* guix/build-system/maven.scm (maven-build): Likewise.
* guix/build-system/minify.scm (minify-build): Likewise.
* guix/build-system/node.scm (node-build): Likewise.
* guix/build-system/qt.scm (qt-build, qt-cross-build): Likewise.
* guix/build-system/r.scm (r-build): Likewise.
* guix/build-system/rakudo.scm (rakudo-build): Likewise.
* guix/build-system/renpy.scm (renpy-build): Likewise.
* tests/builders.scm ("gnu-build"): Call 'store-lower' on 'gnu-build'.
  Pass #:source parameter.
* tests/packages.scm ("search paths"): Use 'abort-to-prompt' instead of
  a normal return from the 'build' method.
  ("package->bag, sensitivity to %current-target-system"): Change 'build'
  to match the new build system signature.

squash! build-system: Rewrite using gexps.

squash! build-system: Rewrite using gexps.
2021-03-30 22:48:43 +02:00
Efraim Flashner 2aab587f84
Merge remote-tracking branch 'origin/master' into core-updates 2021-03-24 20:50:44 +02:00
Chris Marusich a16eb6c5f9
Add powerpc64le-linux as a supported Guix architecture.
This makes powerpc64le-linux a supported architecture for Guix, but not for
Guix System.

* Makefile.am (SUPPORTED_SYSTEMS): Add an entry for powerpc64le-linux.
* etc/guix-install.sh (chk_sys_arch): Same.
* guix/packages.scm (%supported-systems): Same.
* m4/guix.m4 (GUIX_ASSERT_SUPPORTED_SYSTEM): Same.
* tests/guix-build.sh (all_systems): Same.
2021-03-23 23:19:57 -07:00
Mathieu Othacehe 33bb89c939
ci: Remove hydra support.
This removes hydra support to use Cuirass as the only continuous integration
system.

* build-aux/hydra/gnu-system.scm: Remove it.
* build-aux/hydra/guix-modular.scm: Ditto.
* build-aux/hydra/guix.scm: Ditto.
* build-aux/cuirass/hydra-to-cuirass.scm: Ditto.
* Makefile.am (EXTRA_DIST): Update it.
(hydra-jobs.scm): Remove it.
(cuirass-jobs.scm): Update it.
* build-aux/hydra/evaluate.scm: Move it to ...
* build-aux/cuirass/evaluate.scm: ... here.
* build-aux/cuirass/guix-modular.scm: Remove it.
* build-aux/cuirass/gnu-system.scm: Ditto.
* guix/packages.scm (%hydra-supported-systems): Rename it to ...
(%cuirass-supported-systems): ... this variable.
* build-aux/check-final-inputs-self-contained: Adapt it.
* etc/release-manifest.scm: Ditto.
* gnu/ci.scm (package->alist): Remove it.
(derivation->job): New procedure.
(package-job, package-cross-job, cross-jobs, image-jobs, system-test-jobs,
tarball-jobs): Use it.
(guix-jobs): New procedure.
(hydra-jobs): Rename it to ...
(cuirass-jobs): ... this procedure.
2021-03-10 19:41:15 +01:00
Mathieu Othacehe 76bea3f8bc
ci: Remove hydra support.
This removes hydra support to use Cuirass as the only continuous integration
system.

* build-aux/hydra/gnu-system.scm: Remove it.
* build-aux/hydra/guix-modular.scm: Ditto.
* build-aux/hydra/guix.scm: Ditto.
* build-aux/cuirass/hydra-to-cuirass.scm: Ditto.
* Makefile.am (EXTRA_DIST): Update it.
(hydra-jobs.scm): Remove it.
(cuirass-jobs.scm): Update it.
* build-aux/hydra/evaluate.scm: Move it to ...
* build-aux/cuirass/evaluate.scm: ... here.
* build-aux/cuirass/guix-modular.scm: Remove it.
* build-aux/cuirass/gnu-system.scm: Ditto.
* guix/packages.scm (%hydra-supported-systems): Rename it to ...
(%cuirass-supported-systems): ... this variable.
* build-aux/check-final-inputs-self-contained: Adapt it.
* etc/release-manifest.scm: Ditto.
* gnu/ci.scm (package->alist): Remove it.
(derivation->job): New procedure.
(package-job, package-cross-job, cross-jobs, image-jobs, system-test-jobs,
tarball-jobs): Use it.
(guix-jobs): New procedure.
(hydra-jobs): Rename it to ...
(cuirass-jobs): ... this procedure.
2021-03-10 08:49:48 +01:00
Christopher Baines a8448da0f4
Merge branch 'master' into core-updates 2021-03-06 00:18:30 +00:00
Leo Famulari 56733080c4
packages: Improve the docstring of PACKAGE/INHERIT.
* guix/packages.scm (package/inherit): Try to clarify the docstring.
2021-02-23 14:12:34 -05:00
Ludovic Courtès 66c9bc35ef
packages: 'package-field-location' preserves the original file name.
This fixes a regression introduced in
9a38bed2cf.

* guix/packages.scm (package-field-location): Do not shadow the 'file'
variable.
2021-02-22 23:42:08 +01:00
Ludovic Courtès 9a38bed2cf
packages: 'package-field-location' handles 'search-path' returning #f.
Fixes <https://bugs.gnu.org/46390>.
Reported by zimoun <zimon.toutoune@gmail.com>.

This is similar to the fix in d10474c38d.

* guix/packages.scm (package-field-location): Handle FILE not in %LOAD-PATH.
* tests/guix-lint.sh: Add test.
2021-02-22 12:07:45 +01:00
Maxim Cournoyer cfcead2e51
build-systems/gnu: Allow unpacking/repacking more kind of files.
Before this change, only plain directories, tar or zip archives were supported
as the source of a package for the GNU build system; anything else would cause
the unpack phase to fail.  Origins relying on snippets would suffer from the
same problem.

This change adds the support to use files of the following extensions: .gz,
.Z, .bz2, .lz, and .xz, even when they are not tarballs.  Files of unknown
extensions are treated as uncompressed files and supported as well.

* guix/packages.scm (patch-and-repack): Only add the compressor utility to the
PATH when the file is compressed.  Bind more inputs in the mlet, and use them
for decompressing single files.  Adjust the decompression and compression
routines.
[decompression-type]: Remove nested variable.
* guix/build/utils.scm (compressor, tarball?): New procedures.  Move
%xz-parallel-args to the new 'compression helpers' section.
* tests/packages.scm: Add tests.  Add missing copyright year for Jan.
* guix/build/gnu-build-system.scm (first-subdirectory): Return #f when no
sub-directory was found.
(unpack): Support more file types, including uncompressed plain files.
2021-01-26 22:48:35 -05:00
Ludovic Courtès f41ff53293
packages: 'patch-and-repack' returns a directory when given a directory.
Previously, 'patch-and-repack' would always create a tar.xz archive as a
result, even if the input was a directory (a checkout).  This change
reduces gratuitous CPU and storage overhead.

* guix/packages.scm (patch-and-repack)[tarxz-name]: Remove 'checkout?' case.
[build](repack): New procedure, with "tar" invocation formerly at the
top level.
If SOURCE is a directory, call 'copy-recursively'; otherwise, call
'repack'.
Change NAME to ORIGINAL-FILE-NAME when it matches 'checkout?'.
2021-01-18 15:55:14 +01:00
Maxim Cournoyer 8152fd1af5
packages: Fix 'base32' used before definition warning.
Before this change, compiling the module would emit the following message:
"guix/packages.scm:213:25: warning: macro `base32' used before definition".

* guix/packages.scm (define-compile-time-decoder)
(base32, base64): Move definitions to the top of the module.
2021-01-11 08:15:08 -05:00
Maxim Cournoyer 31ebecf73d
packages: Fix 'base32' used before definition warning.
Before this change, compiling the module would emit the following message:
"guix/packages.scm:213:25: warning: macro `base32' used before definition".

* guix/packages.scm (define-compile-time-decoder)
(base32, base64): Move definitions to the top of the module.
2021-01-10 17:12:22 -05:00
Christopher Baines ff01206345
Merge remote-tracking branch 'origin/master' into core-updates 2020-11-29 17:34:18 +00:00
Ludovic Courtès 325d00e619
packages: Ignore return value of origin snippets.
* guix/packages.scm (patch-and-repack): Ignore return value of SNIPPET
and remove warning about non #t return value.
2020-11-25 00:02:30 +01:00
Ludovic Courtès 8db4ebb0cd
packages: Better preserve object identity when rewriting.
Fixes a bug whereby the presence of propagated inputs could lead to two
non-eq? but actually equal packages in a bag's inputs.  The problem
would manifest itself when running, for instance:

  guix build inkscape -d --with-graft=glib=glib-networking --no-grafts

The resulting derivation would differ due from that without
'--with-graft'.  This was due to the fact that glib propagates libffi;
this instance of libffi was not rewritten even though other instances in
the graph were rewritten.  Thus, glib would end up with two non-eq?
libffi instances, which in turn would lead to duplicate entries in its
'%build-inputs' variable.

Fixes <https://bugs.gnu.org/43890>.

* guix/packages.scm (package-mapping)[rewrite]: Remove call to 'cut?'
and call 'replace' unconditionally.
[replace]: Add 'cut?' case.
* tests/guix-build.sh: Add test combining '--no-grafts' and
'--with-graft'.
* tests/packages.scm ("package-input-rewriting/spec, identity")
("package-input-rewriting, identity"): New tests.
2020-10-20 16:30:15 +02:00
Maxim Cournoyer 5e2140511c
Merge branch 'staging'
Conflicts:
	gnu/packages/admin.scm
	gnu/packages/commencement.scm
	gnu/packages/gdb.scm
	gnu/packages/llvm.scm
	gnu/packages/package-management.scm
	gnu/packages/tls.scm
2020-10-19 13:11:40 -04:00
Ludovic Courtès 6b4663363c
packages: Delete duplicate inputs when lowering bags.
This is a followup to 18fa433bf5 and
<https://issues.guix.gnu.org/43508>.

* guix/packages.scm (derivation=?, input=?): New procedures.
(bag->derivation, bag->cross-derivation): Add calls to
'delete-duplicates'.
* tests/packages.scm ("package-derivation, inputs deduplicated"): New
test.
2020-10-15 23:05:32 +02:00
Ludovic Courtès 46135ce4ce
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.
2020-10-12 18:23:47 +02:00
Maxim Cournoyer 5a0997ef7f
packages, scripts, utils: Enable multi-threaded xz compression.
xz compression is slow; using the multi-thread mode of xz can make it more
than 6 times faster, for example when compressing the large linux-libre
source.

* guix/build/utils.scm (%xz-parallel-args): New procedure.
* guix/packages.scm (patch-and-repack): Specify the required above xz
arguments by setting the XZ_DEFAULTS environment variable.
* guix/scripts/pack.scm (%compressors, bootstrap-xz): Modify the commands
Gexps so they do not need to be quoted.  This allows lazily evaluating the
arguments on the builder's side.  Specify the required xz arguments.
(self-contained-tarball): Do not quote the compressor command value.
(docker-image): Likewise.
* guix/utils.scm (decompressed-port, compressed-port)
(compressed-output-port): Specify the required above xz arguments.
2020-10-08 12:27:02 -04:00
Ludovic Courtès 8819551c8d
packages: 'package-input-rewriting' has a #:deep? parameter.
* guix/packages.scm (package-input-rewriting): Add #:deep? and pass it
to 'package-mapping'.
[replacement-property]: New variable.
[rewrite]: Check it.
[cut?]: New procedure.
* tests/packages.scm ("package-input-rewriting"): Pass #:deep? #f and
ensure implicit inputs were not rewritten.  Avoid 'eq?' comparisons.
("package-input-rewriting, deep"): New test.
* gnu/packages/guile.scm (package-for-guile-2.0, package-for-guile-3.0):
Pass #:deep? #f.
2020-09-27 21:41:15 +02:00
Ludovic Courtès b3fc03ee26
packages: 'package-mapping' correctly recurses into 'replacement'.
Previously, something like:

  guix build glib --with-graft=glibc=glibc@2.29

would produce a result showing that rewriting rules were not applied to
libx11@1.6.A (a replacement).

* guix/packages.scm (package-mapping): Call REPLACE instead of PROC to
'replacement'.
* tests/packages.scm ("package-input-rewriting/spec, graft"): New test.
2020-09-27 21:41:11 +02:00
Ludovic Courtès 2bf6f962b9
packages: 'package-input-rewriting/spec' can rewrite implicit dependencies.
With this change, '--with-input', '--with-graft', etc. also apply to
implicit dependencies.  Thus, it's now possible to do:

  guix build python-itsdangerous --with-input=python-wrapper=python@2

or:

  guix build hello --with-graft=glibc=glibc@2.29

Additionally, before, implicit inputs were not rewritten, which could
lead to duplicates in the output of 'bag-transitive-inputs' (packages
that are not 'eq?' but lead to the same derivation).  This in turn would
lead to unnecessary rebuilds when using '--with-input' & co.  This
change fixes it by ensuring even implicit inputs are rewritten.

Fixes <https://bugs.gnu.org/42156>.

* guix/packages.scm (package-input-rewriting/spec): Add #:deep?
defaulting to #true, and pass it to 'package-mapping'.
[replacement-property]: New variable.
[rewrite]: Check that property and set it on the result of PROC.
[cut?]: New procedure.
* tests/packages.scm ("package-input-rewriting/spec"): Ensure implicit
inputs were unchanged.
("package-input-rewriting/spec, partial match"): Pass #:deep? #f.
("package-input-rewriting/spec, deep")
("package-input-rewriting/spec, no duplicates"): New tests.
(package/inherit): Move before use.
* tests/guix-build.sh: Add tests.
* tests/scripts-build.scm ("options->transformation, with-graft"):
Compare dependencies by package name or derivation file name.
* doc/guix.texi (Defining Packages): Adjust accordingly.
2020-09-27 21:41:08 +02:00
Ludovic Courtès ff39361c80
packages: 'package-mapping' can recurse on implicit inputs.
* guix/packages.scm (build-system-with-package-mapping): New procedure.
(package-mapping): Add #:deep? and honor it.
* tests/packages.scm ("package-mapping"): Compare the direct inputs of
the bag of P0 and that of P1.
("package-mapping, deep"): New test.
2020-09-27 21:41:05 +02:00
Ludovic Courtès 83ec969cc7
packages: <content-hash> printer gracefully handle #f values.
Suggested by Robin Green <greenrd@greenrd.org>.

* guix/packages.scm (print-content-hash): Gracefully deal with cases
with 'content-hash-value' returns #f, as is the case for 'linux-libre'.
2020-08-31 15:50:35 +02:00
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