Commit Graph

25 Commits

Author SHA1 Message Date
Ludovic Courtès ae587c2ef0
guix: Strip #:use-module lists.
This was obtained by setting up this environment:

  guix shell -D guix --with-input=guile@3.0.9=guile-next \
    --with-commit=guile-next=e2ed33ef0445c867fe56c247054aa67e834861f2
    -- make -j5

then adding 'unused-module' to (@@ (guix build compiler) %warnings),
building, and checking all the "unused module" warnings and removing
those that were definitely unused.
2023-03-13 15:08:33 +01:00
Guillaume Le Vaillant c232375340
build-system: asdf: Add asd-operation parameter.
The 'asd-operation' parameter can be used to specify the ASDF operation to use
in the build phase. It's default value is "load-system".

* guix/build-system/asdf.scm (package-with-build-system, asdf-build): Add
  'asd-operation' parameter.
* guix/build/asdf-buid-system.scm (build): Add 'asd-operation' parameter and
  use it.
* guix/build/lisp-utils.scm (compile-systems): Add 'asd-operation' parameter
  and use it.
2022-08-03 16:45:54 +02:00
Pierre Neidhardt 6181f1f263
build-system: asdf: Let ASDF locate the .asd files.
This approach has many benefits:

- It simplifies the build system.
- The package definitions are easier to write.
- It fixes a bug with systems that call asdf:clear-system which would cause
  the load to fail. See for instance test systems using Prove.

* guix/build-system/asdf.scm (package-with-build-system): Remove 'asd-files'
  and replace 'test-asd-file' by 'asd-test-systems'.
  (lower): Same.
* guix/build/asdf-build-system.scm (source-asd-file): Remove since ASDF does
  it better than us.
  (find-asd-files): Same.
  (build): Remove unused asd-files argument.
  (check): Remove asd-files argument and replace asd-systems by
  asd-test-systems.
* guix/build/lisp-utils.scm (compile-systems): Call to ASDF to find the
  systems.
  (test-system): Same.

Signed-off-by: Guillaume Le Vaillant <glv@posteo.net>
2022-08-03 16:45:53 +02:00
Ludovic Courtès b15e543d30
Merge branch 'master' into core-updates-frozen 2021-11-23 11:29:38 +01:00
Pierre Neidhardt 56db786591
build-system/asdf: Don't fail in sbcl-package->cl-source-package on non-package inputs.
Inputs can be non-packages, for instance (origin ...).
sbcl-package->cl-source-package used to fail if such inputs were present in
the parent sbcl-* package.

* guix/build-system/asdf.scm (package-with-build-system): Fix
'has-from-build-system?' function.
2021-11-19 11:06:50 +01:00
Mathieu Othacehe c0a8ba55b6
build-system: asdf: Remove %build-inputs reference.
This is a follow-up of 7d873f194c that removes
the %build-inputs variable.

* guix/build-system/asdf.scm (asdf-build): Remove %build-inputs reference.
2021-07-29 10:25:21 +02: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
Guillaume Le Vaillant 2fa8fd4af5
build-system: asdf: Work around package-name->name+version bug.
This patch modifies how the name of the main Common Lisp system is extracted
from the full Guix package name to work around bug#48225 concerning the
'package-name->name+version' function.

Fixes <https://issues.guix.gnu.org/41437>.

* guix/build-system/asdf.scm (asdf-build): Fix 'systems' function.
* guix/build/asdf-build-system.scm (main-system-name): Fix it.
2021-05-08 13:42:38 +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 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
Guillaume Le Vaillant 952fafb2a3
build-system: asdf: Read all .asd files if no #:asd-files specified.
* guix/build-system/asdf.scm (asdf-build): Remove the 'files' variable.
* guix/build/asd-build-system.scm (find-asd-files): New variable.
  (build, check): Use it.
2020-09-15 14:36:24 +02:00
Guillaume Le Vaillant a13f45c150
build-system: asdf: Switch from bundles to regular compilation.
* gnu/packages/lisp.scm (sbcl, ecl)[native-search-paths]: Add
  'XDG_CONFIG_DIRS'.
* guix/build-system/asdf.scm (asdf-build): Replace 'asd-file' and
  'asd-system-name' keywords by 'asd-files' and 'asd-systems'.
* guix/build/asdf-build-system.scm (%object-prefix,
  %lisp-source-install-prefix): Update variables.
  (install): Update variable.
  (main-system-name): New variable.
  (copy-source): Replace 'asd-file' and 'asd-system-name' keywords by
  'asd-files' and 'asd-systems'.
  (configure): New variable.
  (build, check): Replace 'asd-file' and 'asd-system-name' keywords by
  'asd-files' and 'asd-systems'.
  (create-asd-file, symlink-asd-files): Remove variables.
  (create-asdf-configuration): New variable.
  (cleanup-files): Update variable.
  (%standard-phases): Remove 'create-asd-file' and 'symlink-asd-files' phases.
  Add 'configure' and 'create-asdf-configuration' phases.
* guix/build/lisp-utils.scm (%bundle-install-prefix, normalize-dependency,
  inputs->asd-file-map, asdf-load-all, compile-system): Remove variables.
  (compile-systems): New variable.
  (system-dependencies, compiled-system, generate-system-definition): Remove
  variable.
  (test-system): Replace 'asd-file' parameter by 'asd-files'.
  (generate-executable-for-system): Update variable.
  (generate-dependency-links, make-asd-file, bundle-asd-file): Remove
  variables.
  (make-asdf-configuration): New variable.
  (build-program, build-image): Set 'XDG_CONFIG_DIRS'.
  (generate-executable): Update variable.
2020-09-12 11:18:56 +02:00
Pierre Neidhardt c3f1f09586
build: asdf-build-system: Use SBCL source in CL packages.
* guix/build/asdf-build-system.scm (copy-files-to-output): Don't attempt to
  reset timestamps on files without write access.
  (install): When parent SBCL package is in the inputs, use its source.  This
  way we get possibly patched sources in CL packages as well (e.g. for FFI).
  This is also useful for sources that generate files on load-op, like cl-unicode.

* guix/build-system/asdf.scm (package-with-build-system): Forward the SBCL
  parent as a native input so that it can be used in the above install phase.
2020-05-21 11:53:06 +02:00
Guillaume Le Vaillant 5cace974a4
build-system/asdf: Fix package transform.
* guix/build-system/asdf.scm (package-with-build-system):
  [find-input-package]: New function.
  [rewrite]: Use it.
2019-10-18 11:09:44 +02:00
Ludovic Courtès 804b9b18ac
build-system/asdf: 'package-with-build-system' accesses inputs lazily.
Fixes a bug whereby we would, at the top-level (while evaluation
lisp.scm package definitions), attempt to access package inputs.
Because of circular dependencies, this could lead to unbound variables
as reported by Arun Isaac <arunisaac@systemreboot.net> at
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=33801#56>.

* guix/build-system/asdf.scm (package-with-build-system)[transform]
(new-propagated-inputs): Turn into a procedure.
Adjust user accordingly.
2019-01-09 15:01:40 +01:00
Pierre Neidhardt dece8c91a9
build-system/asdf: Fix typo in "dependency".
* guix/build-system/asdf.scm (default-lisp): Fix typo in "dependency".
2018-08-21 16:27:03 +02:00
Ludovic Courtès 8bc1935c7c
build-system/asdf: Use 'mlambda'.
* guix/build-system/asdf.scm (package-with-build-system): Use 'mlambda'
instead of 'memoize'.
2017-12-10 23:44:58 +01:00
Andy Patterson 0383afa02a
build-system/asdf: Handle tests defined in external systems.
* guix/build-system/asdf.scm (asdf-build): Add a #:test-asd-file argument.
[builder]: Pass it to the build system.
(package-with-build-system)[transform]: Strip it from source systems' arguments.
* guix/build/asdf-build-system.scm (check): Pass the fully qualified path to
it on to the test-system procedure.
* guix/build/lisp-utils.scm (test-system): Load the file, or otherwise one of
the often used names for it, before running the tests.  Adjust the docstring
accordingly.
2017-05-16 15:18:16 +02:00
Andy Patterson 0186a463d0
build-system/asdf: Always pre-load the system's definition file.
* guix/build-system/asdf.scm (asdf-build)[builder]: Pass a default
`#:asd-file' argument to the build procedure, using the system's name.
* guix/build/asdf-build-system.scm (build, check): Adjust to assume that
`asd-file' will always be a string.
* guix/build/lisp-utils.scm (compile-system, system-dependencies)
(test-system): Likewise.
2017-05-16 15:18:15 +02:00
Andy Patterson 457702b1d9
build-system/asdf: Pass the system name as an argument to the builder.
* guix/build-system/asdf.scm (asdf-build): Use the user-defined system name,
or calculate it from the package's full name.
[builder]: Pass the value along to the build procedure.
(package-with-build-system): Remove #:asd-system-name from source packages'
arguments.
* guix/build/asdf-build-system.scm: Adjust accordingly.
* guix/build/lisp-utils.scm (remove-lisp-from-name): Delete variable.
2017-05-16 15:18:15 +02:00
Andy Patterson b4c9f0c50d
build-system/asdf: Parameterize the lisp type and implementation globally.
* guix/build-system/asdf.scm (asdf-build)[builder]: Parameterize %lisp-type
and %lisp before invoking the build procedure. Don't pass #:lisp-type as an
argument to said procedure.
* guix/build/asdf-build-system.scm: Adjust accordingly.
(source-install-prefix): Rename to %lisp-source-install-prefix.
* guix/build/lisp-utils.scm: Adjust accordingly.
(%lisp-type): New parameter.
(bundle-install-prefix): Rename to %bundle-install-prefix.
* gnu/packages/lisp.scm: Adjust accordingly.
2017-05-16 15:18:15 +02:00
Andy Patterson 6de91ba2a1
build-system/asdf: Make #:lisp a package argument.
* guix/build-system/asdf.scm (lower): Change argument name to `lisp-type'.
(asdf-build): Change argument name to `lisp-type'.  Remove `lisp' as an
argument to the returned procedure.  Change the argument passed to build
phases to `lisp-type'.
* guix/build/asdf-build-system.scm (copy-source, build, check)
(create-asd-file, symlink-asd-files, cleanup-files, strip): Respect
`lisp-type` argument.
* gnu/packages/lisp.scm (sbcl-stumpwm, sbcl-stumpwm+slynk): Likewise.
2017-05-16 15:18:15 +02:00
Andy Patterson 0e1371be09
build-system/asdf: Don't rename inputs.
* guix/build-system/asdf.scm (package-with-build-system)[transform]: Use updated
`new-inputs' procedure for inputs and native-inputs.
<rewrite>: Don't rename inputs.
<new-propagated-inputs>: Draw from package-inputs and package-native-inputs
for source packages.  Use the original package's propagated-inputs otherwise.
<new-inputs>: Convert into a function to be used to transform inputs and
native-inputs.
* gnu/packages/lisp.scm (sbcl-fiveam, sbcl-bordeaux-threads)
(sbcl-flexi-streams, sbcl-cl-ppcre, sbcl-stumpwm, sbcl-slynk-arglists)
(sbcl-slynk-fancy-inspector): Don't prefix input names.
2017-05-16 15:18:14 +02:00
Andy Patterson 35189728cd
build-system/asdf: Use asdf to determine dependencies.
This removes the need for conventions to determine which inputs are run-time
dependencies, and also the need to specify "special" dependencies.

* guix/build/lisp-utils.scm (patch-asd-file, lisp-dependencies)
(wrap-perform-method): Remove them.
(inputs->asd-file-map, system-dependencies, generate-system-definition)
(generate-dependency-links, make-asd-file): New procedures.
(lisp-eval-program): Add an error if no lisp matches.
(compile-system): Don't use asdf's in-built asd-file generator.
2017-05-16 15:18:14 +02:00
Andy Patterson a1b30f99a8
build-system: Add asdf-build-system.
* guix/build-system/asdf.scm: New file.
* guix/build/asdf-build-system.scm: New file.
* guix/build/lisp-utils.scm: New file.
* Makefile.am (MODULES): Add them.
* doc/guix.texi (Build Systems): Document 'asdf-build-system'.

Signed-off-by: 宋文武 <iyzsong@gmail.com>
2016-10-08 21:20:35 +08:00