Commit graph

6005 commits

Author SHA1 Message Date
Ludovic Courtès ab270bf2e9
import: elpa: Emit new-style package inputs.
* guix/import/elpa.scm (elpa-package->sexp)[dependencies]: Turn into a
list of symbols.
[maybe-inputs]: Wrap in 'list' instead of 'quasiquote'.
2021-07-11 00:49:16 +02:00
Ludovic Courtès ff992fcfaf
import: print: Emit new-style package inputs when possible.
* guix/import/print.scm (redundant-input-labels?): New procedure.
(package->code)[package-lists->code]: Rename to...
[inputs->code]: ... this.  When 'redundant-input-labels?' returns true,
emit label-less inputs.  Adjust callers to new name.
* tests/print.scm (pkg-with-inputs): Adjust accordingly.
2021-07-11 00:49:16 +02:00
Ludovic Courtès aa6921634b
import: cran: Emit new-style package inputs.
* guix/import/cran.scm (format-inputs): Emit symbols or
'specification->package' calls.
(maybe-inputs): Wrap in 'list' instead of 'quasiquote'.
* tests/cran.scm ("description->package"): Adjust accordingly.
2021-07-11 00:49:16 +02:00
Ludovic Courtès 52a9a0712a
import: pypi: Emit new-style package inputs.
* guix/import/pypi.scm (maybe-inputs): Wrap PACKAGE-INPUTS in 'list'
instead of 'quasiquote'.
(compute-inputs)[requirement->package-name/sort]: Return a list of symbols.
* tests/pypi.scm ("pypi->guix-package, no wheel")
("pypi->guix-package, wheels"): Adjust accordingly.
2021-07-11 00:49:15 +02:00
Ludovic Courtès 7b7b8c909b
packages: 'hidden-package' inherits the original package location.
* guix/packages.scm (hidden-package): Inherit 'location' from P.
2021-07-11 00:49:15 +02:00
Ludovic Courtès f23803af20
Add 'guix style'.
* guix/scripts/style.scm, tests/style.scm: New files.
* Makefile.am (MODULES, SCM_TESTS): Add them.
* po/guix/POTFILES.in: Add 'guix/scripts/style.scm'.
* doc/guix.texi (Invoking guix style): New node.
(package Reference): Reference it.
(Invoking guix lint): Likewise.
2021-07-11 00:49:15 +02:00
Ludovic Courtès 73b08ad1a3
utils: 'edit-expression' copies part of the original source map.
* guix/utils.scm (source-location-key/stamp): New procedure.
(go-to-location): Use it.
(move-source-location-map!): New procedure.
(edit-expression): Call it.
2021-07-11 00:49:15 +02:00
Ludovic Courtès f05433f208
utils: 'edit-expression' modifies the file only if necessary.
* guix/utils.scm (edit-expression): Check whether STR* equals STR.
2021-07-11 00:49:15 +02:00
Ludovic Courtès ef1432f064
utils: Add 'go-to-location' with source location caching.
* guix/utils.scm (%source-location-map): New variable.
(go-to-location): New procedure.
(edit-expression): Use it instead of custom loop.
* guix/packages.scm (package-field-location)[goto]: Remove.
Use 'go-to-location' instead of 'goto'.
2021-07-11 00:49:15 +02:00
Ludovic Courtès 4dcc606766
utils: 'edit-expression' no longer leaks file ports.
* guix/utils.scm (edit-expression): Use 'call-with-input-file' to make
sure IN gets closed.
2021-07-11 00:49:14 +02:00
Ludovic Courtès 04b2f3dd80
packages: Add 'modify-inputs'.
* guix/packages.scm (inputs-sans-labels, replace-input): New procedures.
(prepend, replace, modify-inputs): New macros.
* doc/guix.texi (Defining Package Variants): Document 'modify-inputs'.
* dir-locals.el: Add 'modify-inputs' and its keywords.
2021-07-11 00:49:14 +02:00
Ludovic Courtès ba32f63638
packages: Add 'lookup-package-input' & co.
* guix/packages.scm (lookup-input, lookup-package-input)
(lookup-package-native-input, lookup-package-propagated-input)
(lookup-package-direct-input): New procedures.
* doc/guix.texi (package Reference): Document them.
2021-07-11 00:49:14 +02:00
Ludovic Courtès b7f1b4c1d0
lint: Add 'input-labels' checker.
* guix/lint.scm (check-input-labels): New procedure.
(%local-checkers): Add 'input-labels' checker.
* tests/lint.scm ("input labels: no warnings")
("input labels: one warning"): New tests.
* doc/guix.texi (Invoking guix lint): Mention it.
2021-07-11 00:49:14 +02:00
Ludovic Courtès 8524349f78
packages: Allow inputs to be plain package lists.
* guix/packages.scm (add-input-label, sanitize-inputs): New procedures.
(<package>)[inputs, propagated-inputs, native-inputs]: Add 'sanitize' property.
* doc/guix.texi (Defining Packages, package Reference):
(Defining Package Variants): Adjust examples accordingly.
* tests/packages.scm ("transaction-upgrade-entry, zero upgrades, propagated inputs")
("transaction-upgrade-entry, grafts")
("package-transitive-inputs")
("package-transitive-supported-systems")
("package-closure")
("supported-package?")
("package-derivation, inputs deduplicated")
("package-transitive-native-search-paths")
("package-grafts, indirect grafts")
("package-grafts, indirect grafts, propagated inputs")
("package-grafts, same replacement twice")
("package-grafts, dependency on several outputs")
("replacement also grafted")
("package->bag, sensitivity to %current-target-system")
("package->bag, propagated inputs")
("package->bag, sensitivity to %current-system")
("package-input-rewriting/spec, identity")
("package-input-rewriting, identity"): Use the label-less input style.
2021-07-11 00:49:14 +02:00
Ludovic Courtès 8be1632199
records: Support field sanitizers.
* guix/records.scm (make-syntactic-constructor): Add #:sanitizers.
[field-sanitizer]: New procedure.
[wrap-field-value]: Honor F's sanitizer.
(define-record-type*)[field-sanitizer]: New procedure.
Pass #:sanitizer to 'make-syntactic-constructor'.
* tests/records.scm ("define-record-type* & sanitize")
("define-record-type* & sanitize & thunked"): New tests.
2021-07-11 00:49:14 +02:00
Ludovic Courtès 7a9f4822c0
utils: Add 'search-input-directory'.
* guix/build/utils.scm (search-input-directory): New procedure.
* doc/guix.texi (Build Utilities): Document it next to
'search-input-file'.  Tweak wording.
2021-07-08 00:28:57 +02:00
Maxime Devos 198df03756
build-system/gnu: patch-shebangs: Also patch shebangs in "/libexec".
Shebangs in "/bin" and "/sbin" subdirectories are currently
patched by patch-shebangs. But shebangs in "/libexec" currently
aren't, even though they occasionally need to be. E.g. when using
wrap-program on an executable in "libexec" without an explicit #:sh
when cross-compiling.

* guix/build/gnu-build-system.scm (patch-shebangs):
  Add "/libexec" to 'bin-directories'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-07-08 00:28:57 +02:00
Ludovic Courtès 7d8c8b3194
build-system/trivial: Honor build inputs when cross-compiling.
Fixes a regression introduced in
7d873f194c whereby host inputs would be
missing altogether from '%build-inputs', which broke cross-compilation.

* guix/build-system/trivial.scm (trivial-cross-build): Append
HOST-INPUTS to the 'with-build-variables' argument.
2021-07-05 16:26:54 +02:00
Ludovic Courtès 99ea6a2996
tests: Unset NIX_STORE_DIR when running external tests.
This is a followup to cfcead2e51 and
47a6a938c3, which made (guix packages)
dependent on the value of NIX_STORE_DIR.

* guix/tests.scm (call-with-external-store): Unset NIX_STORE_DIR before
calling PROC.
2021-07-05 15:34:24 +02:00
Ludovic Courtès 8a48302318
build-system/gnu: Define '%build-inputs' when cross-compiling.
Reported by Maxime Devos.

* guix/build-system/gnu.scm (gnu-cross-build)[builder]: Define
'%build-inputs' as it existed before
7d873f194c.
2021-07-05 12:35:29 +02:00
Thiago Jung Bauermann 04f9f9158d
build-system/texlive: Change default format to pdftex
LuaTeX has a bug where sometimes it corrupts the heap and aborts. This
causes the build of texlive packages to fail at random. The problem is
being tracked at https://issues.guix.gnu.org/48064.

While a fix isn't found, switch the default TeX format (and consequently
also the engine) to pdftex to avoid the issue.

* guix/build-system/texlive.scm (texlive-build): Change default value of
the ‘tex-format’ key parameter to “pdftex”.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-07-05 11:13:46 +02:00
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
Tobias Geerinckx-Rice 9dea3f101f
Merge branch 'master' into core-updates
Conflicts:
	gnu/packages/cups.scm
	gnu/packages/python-web.scm
	gnu/packages/web.scm
	guix/build/maven/pom.scm
2021-06-23 18:45:21 +02:00
Chris Marusich 7f0af119a1
tests: Remove stale reference to %derivation-cache.
* guix/tests.scm (call-with-external-store): Remove the stale reference to
%derivation-cache.  This was causing the tests to error out, since it was
removed from (guix packages) in 7d873f194c.
2021-06-22 18:32:20 -07:00
Ludovic Courtès b9a95420ab
profiles: Build union of inputs in the right order.
Fixes <https://bugs.gnu.org/49102>.
Reported by Mathieu Othacehe <othacehe@gnu.org>
and Tobias Geerinckx-Rice <me@tobias.gr>.

Fixes a regression introduced in
8cef92d063, whereby in case of file
collisions, the "wrong" one would take precedence.

* guix/build/profiles.scm (manifest-sexp->inputs+search-paths): Perform
a breadth-first traversal.  Reverse INPUTS and SEARCH-PATHS in the base
case.
* tests/profiles.scm ("profile-derivation, ordering & collisions"):
New test.
2021-06-22 17:55:05 +02:00
Julien Lepiller 7f902d368d
guix: java-utils: Look for actual jar files.
* guix/build/java-utils.scm (install-from-pom): Fix `find-files` to look
only for jar files.
2021-06-22 13:10:36 +02:00
Julien Lepiller cc09453862
guix: maven: Use a temporary file to fix pom files.
* guix/build/maven/pom.scm (fix-pom-dependencies): Actually use the
temporary file that was created.
2021-06-22 13:10:32 +02:00
Julien Lepiller 5bb3395c42
guix: maven: Look in local packages when searching for package version.
* guix/build/maven/pom.scm (fix-pom-dependencies): Also look at local
packages when looking for a package version.
2021-06-22 13:10:30 +02:00
Julien Lepiller 0db1393b73
guix: maven: Support fixing modules.
* guix/build/maven/pom.scm (fix-pom-dependencies): Support fixing
modules that do not exist.
* guix/build/maven-build-system.scm (fix-pom): Fix modules.
2021-06-22 13:10:28 +02:00
Julien Lepiller 9711970c99
guix: maven: Support fixing extensions.
* guix/build/maven/pom.scm (fix-pom-dependencies): Add support for fixing
extension versions.
2021-06-22 13:10:27 +02:00
Julien Lepiller 6ec2109ab6
guix: maven: Simplify finding local packages and modules.
* guix/build/maven-build-system (fix-pom): Fix a single pom file without
recursing
(fix-pom-files): Find local packages and all submodules, and fix them
all at once.
(add-local-package): Move to...
* guix/build/maven/pom.scm (add-local-package): ...here.
(pom-and-submodules, pom-local-packages): New procedures.
2021-06-22 13:10:24 +02:00
Julien Lepiller 573b43c116
guix: maven: Simplify finding version and group information.
* guix/build/maven/pom.scm (pom-version, pom-groupid): Do not use inputs
and local packages information anymore. Adapt file to new arguments.
* guix/build/maven-build-system.scm: Adapt to new arguments.
* guix/build/java-utils.scm: Adapt to new arguments.
2021-06-22 13:09:57 +02:00
Julien Lepiller 4c98db94b0
guix: java-utils: Factorize pom.xml generation.
* guix/build/java-utils.scm (generate-pom.xml): New procedure.
* gnu/packages/maven.scm (java-surefire-junit4): Use it.
* gnu/packages/java.scm (java-qdox, java-jsr250, java-jsr305)
(java-aopalliance, java-jboss-el-api-spec)
(java-jboss-interceptors-api-spec): Use it.
(java-qdox-M9): Ensure the generated pom file has the correct version.
2021-06-22 13:09:41 +02:00
Tobias Geerinckx-Rice fe255fb8bc
import: egg: Edit egg->guix-package docstring.
* guix/import/egg.scm (egg->guix-package): Edit docstring.
2021-06-21 18:27:19 +02:00
Brice Waegeneire 3aabe51e8c
import: launchpad: Fix typo.
* guix/import/launchpad.scm (latest-release): Rename 'origin-github-uri'
to 'origin-launchpad-uri'.
2021-06-19 22:21:47 +02:00
Matthew James Kraai 9171079e51
import: launchpad: Use repository to retrieve releases.
* guix/import/launchpad.scm (latest-released-version): Use repository instead
of package name.
(latest-release): Pass repository to latest-released-version.

Signed-off-by: Brice Waegeneire <brice@waegenei.re>
2021-06-19 22:20:08 +02:00
Marius Bakke 6f9a80b331
Merge branch 'master' into core-updates
Note: this merge actually changes the 'curl' and 'python-attrs' derivations,
as part of solving caf4a7a277 and
12964df69a respectively.

4604d43c0e (gnu: gnutls@3.6.16: Fix cross-compilation.) was ignored because it
cannot currently be tested.

 Conflicts:
	gnu/local.mk
	gnu/packages/aidc.scm
	gnu/packages/boost.scm
	gnu/packages/curl.scm
	gnu/packages/nettle.scm
	gnu/packages/networking.scm
	gnu/packages/python-xyz.scm
	gnu/packages/tls.scm
2021-06-19 17:38:47 +02:00
Marius Bakke e6ab2f0097
build-system/haskell: Import build variables.
* guix/build-system/haskell.scm (haskell-build): Wrap in WITH-BUILD-VARIABLES
in order to get %build-inputs and friends.
2021-06-19 17:08:37 +02:00
Marius Bakke 68d280a512
build-system/node: Add missing module import.
This accidentally disappeared in fcc39864db.

* guix/build-system/node.scm: Import (guix store).
2021-06-19 17:08:37 +02:00
Ludovic Courtès 01f5795578
profiles: Add "XAUTHORITY" to the precious variables.
Suggested by Maxime Devos <maximedevos@telenet.be>.

* guix/profiles.scm (%precious-variables): Add "XAUTHORITY".
2021-06-18 14:18:07 +02:00
Ludovic Courtès ee61777a32
profiles: Add 'load-profile'.
* guix/profiles.scm (%precious-variables): New variable.
(purify-environment, load-profile): New procedures.
* guix/scripts/environment.scm (%precious-variables)
(purify-environment, create-environment): Remove.
(launch-environment): Call 'load-profile' instead of 'create-environment'.
* tests/profiles.scm ("load-profile"): New test.
2021-06-18 14:18:07 +02:00
Ludovic Courtès c5b1b48f09
lint: check-patch-headers: Recognize Git diffs.
* guix/lint.scm (check-patch-headers): Add "diff --git " prefix.
2021-06-18 14:18:06 +02:00
Ludovic Courtès f371972e78
import: launchpad: Gracefully handle 404s from api.launchpad.net.
Fixes <https://bugs.gnu.org/49031>.
Reported by Emad Alblueshi <emad.albloushi@gmail.com>.

* guix/import/launchpad.scm (latest-released-version): Gracefully handle
'json-fetch' returning #f.
2021-06-18 14:18:06 +02:00
Christopher Baines 4985a42724
Start enabling substitutes from bordeaux.guix.gnu.org.
In addition to substitutes from ci.guix.gnu.org.  There are more changes that
can be made in the future, but these changes seem like a good start.

* config-daemon.ac (guix_substitute_urls): Add https://bordeaux.guix.gnu.org.
* guix/scripts/substitute.scm (%default-substitute-urls): Add
http://bordeaux.guix.gnu.org.
* guix/store.scm (%default-substitute-urls): Add bordeaux.guix.gnu.org.
* doc/guix.texi: Adjust accordingly.
* doc/contributing.texi: Adjust accordingly.
2021-06-18 11:25:41 +01:00
Maxim Cournoyer 375d5d03c9
pack: Fix the system value passed to build-docker-image.
Before this change, the system value would be passed as x86_64 when using a
i686-linux emulated system, e.g.:

  $ guix environment --system=i686-linux --ad-hoc  guile -- \
      guile -c '(display (utsname:machine (uname))) (newline)'
  x86_64

This change uses the Guile builtin %host-type variable, which doesn't have
this problem:

  $ guix environment --system=i686-linux --ad-hoc guile -- \
      guile -c '(display %host-type) (newline)'
  i686-unknown-linux-gnu

* guix/scripts/pack.scm (docker-image)[#:system] Use %host-type as a fall-back
when target is not defined.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2021-06-16 21:44:33 -04:00
Ludovic Courtès 0b535f7b8b
hg-download: Make (guix swh) output visible.
* guix/hg-download.scm (hg-fetch)[build]: Add 'setvbuf' calls.
2021-06-14 18:35:18 +02:00
Xinglu Chen 69d7333217
hg-download: Support falling back to SWH.
* guix/hg-download.scm (hg-fetch): Fall back to fetching the source from SWH
if the upstream source is missing.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-06-14 18:35:18 +02:00
Xinglu Chen c4ff492879
swh: Support lookup of Hg tags.
* guix/swh.scm (lookup-origin-revision): Support lookup of Hg tags, not just
Git tags.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-06-14 18:35:18 +02:00
itd 1aa8cc2f0e
hg-download: Remove bogus hg-reference-recursive? export.
* guix/hg-download.scm: Do not export undefined hg-reference-recursive?.

Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
2021-06-14 10:02:15 +02:00
Ludovic Courtès 0294cfc25a
guix package: Do not say "nothing to do" upon rollback & co.
Previously, "guix package --switch-generations=4" or similar would print
"nothing to do".

* guix/scripts/package.scm (process-actions): Do not warn about "nothing
to do" when one of %ACTIONS is requested.
2021-06-13 23:57:45 +02:00