X-Git-Url: http://git.hcoop.net/jackhill/guix/guix.git/blobdiff_plain/868113126c89ecb7f928c49de893122fa0fe272c..4fb6ef6636acd7608889639c1b2e492517256f76:/Makefile.am diff --git a/Makefile.am b/Makefile.am index 8d059eb033..8b92a4a9bb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ # GNU Guix --- Functional package management for GNU -# Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès +# Copyright © 2012-2022 Ludovic Courtès # Copyright © 2013 Andreas Enge # Copyright © 2015, 2017 Alex Kost # Copyright © 2016, 2018 Mathieu Lirzin @@ -15,6 +15,7 @@ # Copyright © 2018 Alex Vong # Copyright © 2019 Efraim Flashner # Copyright © 2021 Chris Marusich +# Copyright © 2021 Andrew Tropin # # This file is part of GNU Guix. # @@ -80,6 +81,7 @@ MODULES = \ guix/base64.scm \ guix/ci.scm \ guix/cpio.scm \ + guix/cpu.scm \ guix/deprecation.scm \ guix/docker.scm \ guix/records.scm \ @@ -95,8 +97,10 @@ MODULES = \ guix/discovery.scm \ guix/android-repo-download.scm \ guix/bzr-download.scm \ + guix/extracting-download.scm \ guix/git-download.scm \ guix/hg-download.scm \ + guix/hash.scm \ guix/swh.scm \ guix/monads.scm \ guix/monad-repl.scm \ @@ -141,6 +145,7 @@ MODULES = \ guix/build-system/go.scm \ guix/build-system/meson.scm \ guix/build-system/minify.scm \ + guix/build-system/minetest.scm \ guix/build-system/asdf.scm \ guix/build-system/copy.scm \ guix/build-system/glib-or-gtk.scm \ @@ -203,6 +208,7 @@ MODULES = \ guix/build/gnu-dist.scm \ guix/build/guile-build-system.scm \ guix/build/maven-build-system.scm \ + guix/build/minetest-build-system.scm \ guix/build/node-build-system.scm \ guix/build/perl-build-system.scm \ guix/build/python-build-system.scm \ @@ -220,11 +226,11 @@ MODULES = \ guix/build/linux-module-build-system.scm \ guix/build/store-copy.scm \ guix/build/json.scm \ + guix/build/pack.scm \ guix/build/utils.scm \ guix/build/union.scm \ guix/build/profiles.scm \ guix/build/compile.scm \ - guix/build/rpath.scm \ guix/build/cvs.scm \ guix/build/svn.scm \ guix/build/syscalls.scm \ @@ -235,6 +241,7 @@ MODULES = \ guix/build/emacs-utils.scm \ guix/build/java-utils.scm \ guix/build/lisp-utils.scm \ + guix/build/meson-configuration.scm \ guix/build/maven/java.scm \ guix/build/maven/plugin.scm \ guix/build/maven/pom.scm \ @@ -248,8 +255,10 @@ MODULES = \ guix/import/cpan.scm \ guix/import/cran.scm \ guix/import/crate.scm \ + guix/import/egg.scm \ guix/import/elpa.scm \ guix/import/gem.scm \ + guix/import/git.scm \ guix/import/github.scm \ guix/import/gnome.scm \ guix/import/gnu.scm \ @@ -258,6 +267,7 @@ MODULES = \ guix/import/json.scm \ guix/import/kde.scm \ guix/import/launchpad.scm \ + guix/import/minetest.scm \ guix/import/opam.scm \ guix/import/print.scm \ guix/import/pypi.scm \ @@ -286,24 +296,30 @@ MODULES = \ guix/scripts/refresh.scm \ guix/scripts/repl.scm \ guix/scripts/describe.scm \ + guix/scripts/style.scm \ guix/scripts/system.scm \ guix/scripts/system/search.scm \ guix/scripts/system/reconfigure.scm \ + guix/scripts/home.scm \ + guix/scripts/home/import.scm \ guix/scripts/lint.scm \ guix/scripts/challenge.scm \ guix/scripts/import/crate.scm \ guix/scripts/import/cran.scm \ + guix/scripts/import/egg.scm \ guix/scripts/import/elpa.scm \ guix/scripts/import/gem.scm \ guix/scripts/import/gnu.scm \ guix/scripts/import/go.scm \ guix/scripts/import/hackage.scm \ guix/scripts/import/json.scm \ + guix/scripts/import/minetest.scm \ guix/scripts/import/opam.scm \ guix/scripts/import/pypi.scm \ guix/scripts/import/stackage.scm \ guix/scripts/import/texlive.scm \ guix/scripts/environment.scm \ + guix/scripts/shell.scm \ guix/scripts/publish.scm \ guix/scripts/edit.scm \ guix/scripts/size.scm \ @@ -363,10 +379,14 @@ AUX_FILES = \ gnu/packages/aux-files/chromium/master-preferences.json \ gnu/packages/aux-files/emacs/guix-emacs.el \ gnu/packages/aux-files/guix.vim \ - gnu/packages/aux-files/linux-libre/5.11-arm.conf \ - gnu/packages/aux-files/linux-libre/5.11-arm64.conf \ - gnu/packages/aux-files/linux-libre/5.11-i686.conf \ - gnu/packages/aux-files/linux-libre/5.11-x86_64.conf \ + gnu/packages/aux-files/linux-libre/5.17-arm.conf \ + gnu/packages/aux-files/linux-libre/5.17-arm64.conf \ + gnu/packages/aux-files/linux-libre/5.17-i686.conf \ + gnu/packages/aux-files/linux-libre/5.17-x86_64.conf \ + gnu/packages/aux-files/linux-libre/5.15-arm.conf \ + gnu/packages/aux-files/linux-libre/5.15-arm64.conf \ + gnu/packages/aux-files/linux-libre/5.15-i686.conf \ + gnu/packages/aux-files/linux-libre/5.15-x86_64.conf \ gnu/packages/aux-files/linux-libre/5.10-arm.conf \ gnu/packages/aux-files/linux-libre/5.10-arm64.conf \ gnu/packages/aux-files/linux-libre/5.10-i686.conf \ @@ -387,6 +407,9 @@ AUX_FILES = \ gnu/packages/aux-files/linux-libre/4.4-i686.conf \ gnu/packages/aux-files/linux-libre/4.4-x86_64.conf \ gnu/packages/aux-files/pack-audit.c \ + gnu/packages/aux-files/python/sanity-check.py \ + gnu/packages/aux-files/python/sitecustomize.py \ + gnu/packages/aux-files/renpy/renpy.in \ gnu/packages/aux-files/run-in-namespace.c # Templates, examples. @@ -449,6 +472,7 @@ SCM_TESTS = \ tests/debug-link.scm \ tests/derivations.scm \ tests/discovery.scm \ + tests/egg.scm \ tests/elpa.scm \ tests/file-systems.scm \ tests/gem.scm \ @@ -457,14 +481,18 @@ SCM_TESTS = \ tests/git-authenticate.scm \ tests/glob.scm \ tests/gnu-maintenance.scm \ - tests/go.scm \ tests/grafts.scm \ tests/graph.scm \ tests/gremlin.scm \ tests/hackage.scm \ + tests/home-import.scm \ + tests/http-client.scm \ + tests/import-git.scm \ + tests/import-github.scm \ tests/import-utils.scm \ tests/inferior.scm \ tests/lint.scm \ + tests/minetest.scm \ tests/modules.scm \ tests/monads.scm \ tests/nar.scm \ @@ -484,7 +512,9 @@ SCM_TESTS = \ tests/search-paths.scm \ tests/services.scm \ tests/services/file-sharing.scm \ + tests/services/configuration.scm \ tests/services/linux.scm \ + tests/services/telephony.scm \ tests/sets.scm \ tests/size.scm \ tests/status.scm \ @@ -496,6 +526,7 @@ SCM_TESTS = \ tests/swh.scm \ tests/syscalls.scm \ tests/system.scm \ + tests/style.scm \ tests/texlive.scm \ tests/transformations.scm \ tests/ui.scm \ @@ -505,6 +536,12 @@ SCM_TESTS = \ tests/uuid.scm \ tests/workers.scm +if HAVE_GUILE_LIB +SCM_TESTS += tests/go.scm +else +EXTRA_DIST += tests/go.scm +endif + if BUILD_DAEMON_OFFLOAD SCM_TESTS += tests/offload.scm else @@ -525,10 +562,13 @@ SH_TESTS = \ tests/guix-package-aliases.sh \ tests/guix-package-net.sh \ tests/guix-system.sh \ + tests/guix-home.sh \ tests/guix-archive.sh \ tests/guix-authenticate.sh \ tests/guix-environment.sh \ tests/guix-environment-container.sh \ + tests/guix-shell.sh \ + tests/guix-shell-export-manifest.sh \ tests/guix-graph.sh \ tests/guix-describe.sh \ tests/guix-repl.sh \ @@ -579,7 +619,8 @@ check-system: $(GOBJECTS) dist_pkgdata_DATA = \ etc/substitutes/berlin.guix.gnu.org.pub \ etc/substitutes/ci.guix.gnu.org.pub \ - etc/substitutes/ci.guix.info.pub + etc/substitutes/ci.guix.info.pub \ + etc/substitutes/bordeaux.guix.gnu.org.pub # Bash completion file. dist_bashcompletion_DATA = etc/completion/bash/guix \ @@ -603,9 +644,11 @@ EXTRA_DIST += \ .guix-authorizations \ .guix-channel \ scripts/guix.in \ + etc/disarchive-manifest.scm \ etc/guix-install.sh \ etc/news.scm \ etc/release-manifest.scm \ + etc/source-manifest.scm \ etc/system-tests.scm \ etc/historical-authorizations \ build-aux/build-self.scm \ @@ -614,21 +657,24 @@ EXTRA_DIST += \ build-aux/check-final-inputs-self-contained.scm \ build-aux/check-channel-news.scm \ build-aux/compile-as-derivation.scm \ + build-aux/convert-xref.scm \ build-aux/generate-authors.scm \ build-aux/test-driver.scm \ build-aux/update-guix-package.scm \ build-aux/update-NEWS.scm \ tests/test.drv \ - tests/signing-key.pub \ - tests/signing-key.sec \ tests/cve-sample.json \ - tests/civodul.key \ - tests/rsa.key \ - tests/dsa.key \ - tests/ed25519.key \ - tests/ed25519.sec \ - tests/ed25519bis.key \ - tests/ed25519bis.sec \ + tests/keys/signing-key.pub \ + tests/keys/signing-key.sec \ + tests/keys/civodul.pub \ + tests/keys/rsa.pub \ + tests/keys/dsa.pub \ + tests/keys/ed25519.pub \ + tests/keys/ed25519.sec \ + tests/keys/ed25519-2.pub \ + tests/keys/ed25519-2.sec \ + tests/keys/ed25519-3.pub \ + tests/keys/ed25519-3.sec \ build-aux/config.rpath \ bootstrap \ doc/build.scm \ @@ -655,15 +701,60 @@ CLEANFILES = \ # the whole thing. Likewise, set 'XDG_CACHE_HOME' to avoid loading possibly # stale files from ~/.cache/guile/ccache. %.go: make-go ; @: -make-go: $(MODULES) guix/config.scm $(dist_noinst_DATA) - $(AM_V_at)echo "Compiling Scheme modules..." ; \ - unset GUILE_LOAD_COMPILED_PATH ; \ - XDG_CACHE_HOME=/nowhere \ - host=$(host) srcdir="$(top_srcdir)" \ - $(top_builddir)/pre-inst-env \ - $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \ - --no-auto-compile \ - -s "$(top_srcdir)"/build-aux/compile-all.scm $^ +make-go: make-core-go make-packages-go make-system-go make-cli-go + +# Define a rule to build a subset of the .go files. +define guile-compilation-rule + +$(1): $(2) + $(AM_V_at)echo "Compiling Scheme modules..." ; \ + unset GUILE_LOAD_COMPILED_PATH ; \ + XDG_CACHE_HOME=/nowhere \ + host=$(host) srcdir="$(top_srcdir)" \ + $(top_builddir)/pre-inst-env \ + $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \ + --no-auto-compile \ + -s "$(top_srcdir)"/build-aux/compile-all.scm \ + --total $(words $(MODULES)) \ + --completed $(3) \ + $$(filter %.scm,$$^) + +endef + +# Split compilation in several steps, each of which building a subset of +# $(MODULES). The main goal is to reduce peak memory consumption, as reported +# in . Each 'eval' call below creates a +# 'make-*-go' phony target that builds the corresponding subset. + +MODULES_CORE = guix.scm $(filter-out guix/scripts/%,$(filter guix/%,$(MODULES))) +MODULES_PACKAGES = $(filter gnu/packages/%,$(MODULES)) +MODULES_SYSTEM = gnu.scm $(filter-out gnu/packages/%,$(filter gnu/%,$(MODULES))) +MODULES_CLI = $(filter guix/scripts/%,$(MODULES)) +MODULES_PO = guix/build/po.scm + +$(eval $(call guile-compilation-rule,make-core-go, \ + $(MODULES_CORE) guix/config.scm $(dist_noinst_DATA), \ + 0)) +.PHONY: make-core-go + +$(eval $(call guile-compilation-rule,make-packages-go, \ + $(MODULES_PACKAGES) make-core-go, \ + $(words $(MODULES_CORE)))) +.PHONY: make-packages-go + +$(eval $(call guile-compilation-rule,make-system-go, \ + $(MODULES_SYSTEM) make-packages-go make-core-go, \ + $(words $(MODULES_CORE) $(MODULES_PACKAGES)))) +.PHONY: make-system-go + +$(eval $(call guile-compilation-rule,make-cli-go, \ + $(MODULES_CLI) make-system-go make-packages-go make-core-go, \ + $(words $(MODULES_CORE) $(MODULES_PACKAGES) $(MODULES_SYSTEM)))) +.PHONY: make-cli-go + +$(eval $(call guile-compilation-rule,guix/build/po.go, \ + $(MODULES_PO), \ + 0)) SUFFIXES = .go @@ -740,9 +831,9 @@ guix-binary.%.tar.xz: cp "$$tarball" "$@.tmp" ; mv "$@.tmp" "$@" -# The dependency on doc-po-update is to generate the .pot files, which are not -# checked in. -dist: doc-po-update +# The dependency on doc-pot-update is to generate the .pot files, which are +# not checked in. +dist: doc-pot-update dist-hook: gen-ChangeLog gen-AUTHORS gen-tarball-version dist-hook: assert-no-store-file-names @@ -840,7 +931,6 @@ system_flags = $(foreach system,$(1),-s $(system)) # XXX: Depend on 'dist' rather than 'distcheck' to work around the Gettext # issue described at . release: dist-with-updated-version all - cd po; git checkout . @if ! git diff-index --quiet HEAD; then \ echo "There are uncommitted changes; stopping." >&2 ; \ exit 1 ; \ @@ -883,12 +973,12 @@ release: dist-with-updated-version all --system=$$system --fallback \ gnu/system/install.scm` ; \ if [ ! -f "$$image" ] ; then \ - echo "failed to produced Guix installation image for $$system" >&2 ; \ + echo "failed to produce Guix installation image for $$system" >&2 ; \ exit 1 ; \ fi ; \ - xz < "$$image" > "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.xz.tmp" ; \ - mv "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.xz.tmp" \ - "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.xz" ; \ + cp "$$image" "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.tmp" ; \ + mv "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.tmp" \ + "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso" ; \ done # Generate the VM images. for system in $(GUIX_SYSTEM_VM_SYSTEMS) ; do \ @@ -898,12 +988,10 @@ release: dist-with-updated-version all --system=$$system --fallback \ gnu/system/examples/vm-image.tmpl` ; \ if [ ! -f "$$image" ] ; then \ - echo "failed to produced Guix VM image for $$system" >&2 ; \ + echo "failed to produce Guix VM image for $$system" >&2 ; \ exit 1 ; \ fi ; \ - xz < "$$image" > "$(releasedir)/$(GUIX_SYSTEM_VM_IMAGE_BASE).$$system.qcow2.xz.tmp" ; \ - mv "$(releasedir)/$(GUIX_SYSTEM_VM_IMAGE_BASE).$$system.qcow2.xz.tmp" \ - "$(releasedir)/$(GUIX_SYSTEM_VM_IMAGE_BASE).$$system.qcow2.xz" ; \ + cp "$$image" "$(releasedir)/$(GUIX_SYSTEM_VM_IMAGE_BASE).$$system.qcow2"; \ done @echo @echo "Congratulations! All the release files are now in $(releasedir)." @@ -940,10 +1028,12 @@ assert-no-store-file-names: exit 1 ; \ fi -# Make sure important substitutes are available. +# Make sure important substitutes are available. Check only the primary +# server so that '--display-missing' doesn't print two lists. assert-binaries-available: $(GOBJECTS) $(AM_V_at)$(top_builddir)/pre-inst-env \ guix weather -m "$(top_srcdir)/etc/release-manifest.scm" \ + --substitute-urls="https://ci.guix.gnu.org" \ --display-missing # Make sure the final inputs don't refer to bootstrap tools. @@ -971,76 +1061,46 @@ cuirass-jobs: $(GOBJECTS) # Downloading up-to-date PO files. -# make-download-po-rule DOMAIN DIRECTORY [FILE-NAME-PREFIX] -define make-download-po-rule - -download-po.$(1): - if [ -f "$(top_srcdir)/$(2)/LINGUAS" ]; then \ - LINGUAS="`grep -v '^[[:blank:]]*#' < $(top_srcdir)/$(2)/LINGUAS`" ; \ - else \ - LINGUAS="`(cd $(top_srcdir)/$(2); \ - for i in *.po; do echo $$$$i; done) | cut -d . -f 2`" ; \ - fi ; \ - for lang in $$$$LINGUAS; do \ - if wget -nv -O "$(top_srcdir)/$(2)/$(3)$$$$lang.po.tmp" \ - "https://translate.fedoraproject.org/api/translations/guix/$(1)/$$$$lang/file/" ; \ - then \ - msgfilter --no-wrap -i "$(top_srcdir)/$(2)/$(3)$$$$lang.po.tmp" \ - cat > "$(top_srcdir)/$(2)/$(3)$$$$lang.po.tmp2" ; \ - rm "$(top_srcdir)/$(2)/$(3)$$$$lang.po.tmp" ; \ - mv "$(top_srcdir)/$(2)/$(3)$$$$lang.po"{.tmp2,} ; \ - else \ - rm "$(top_srcdir)/$(2)/$(3)$$$$lang.po.tmp" ; \ - fi ; \ - done - -.PHONY: download-po.$(1) - -endef - -# Checking po files for issues. This is useful to run after downloading new -# po files. - -# make-check-po-rule DOMAIN DIRECTORY [FILE-NAME-PREFIX] -define make-check-po-rule - -check-po.$(1): - if [ -f "$(top_srcdir)/$(2)/LINGUAS" ]; then \ - LINGUAS="`grep -v '^[[:blank:]]*#' < $(top_srcdir)/$(2)/LINGUAS`" ; \ - else \ - LINGUAS="`(cd $(top_srcdir)/$(2); \ - for i in *.po; do echo $$$$i; done) | cut -d . -f 2`" ; \ - fi ; \ - for lang in $$$$LINGUAS; do \ - if [ -f "$(top_srcdir)/$(2)/$(3)$$$$lang.po" ]; \ - then \ - if ! msgfmt -c "$(top_srcdir)/$(2)/$(3)$$$$lang.po" ; \ - then \ - exit 1 ; \ - fi ; \ - fi ; \ - done - -.PHONY: check-po.$(1) - -endef - -$(eval $(call make-download-po-rule,documentation-cookbook,po/doc,guix-cookbook.)) -$(eval $(call make-download-po-rule,documentation-manual,po/doc,guix-manual.)) -$(eval $(call make-download-po-rule,guix,po/guix)) -$(eval $(call make-download-po-rule,packages,po/packages)) - -$(eval $(call make-check-po-rule,documentation-cookbook,po/doc,guix-cookbook.)) -$(eval $(call make-check-po-rule,documentation-manual,po/doc,guix-manual.)) -$(eval $(call make-check-po-rule,guix,po/guix)) -$(eval $(call make-check-po-rule,packages,po/packages)) - -download-po: $(foreach domain,guix packages documentation-manual documentation-cookbook,download-po.$(domain)) +WEBLATE_REPO = https://framagit.org/tyreunom/guix-translations + +# Shallow clone the Git repository behind Weblate and copy files from it if +# they contain at least one translation, and they are well-formed (Scheme +# format only), warn otherwise. Copied files are converted to a canonical +# form. +download-po: + dir=$$(mktemp -d); \ + git clone --depth 1 "$(WEBLATE_REPO)" "$$dir/translations" && \ + for domain in po/doc po/guix po/packages; do \ + for po in "$$dir/translations/$$domain"/*.po; do \ + translated=$$(LANG=en_US.UTF-8 msgfmt --statistics "$$po" 2>&1 | cut -f1 -d' '); \ + untranslated=$$(LANG=en_US.UTF-8 msgfmt --statistics "$$po" 2>&1 | rev | cut -f3 -d' ' | rev); \ + untranslated=$${untranslated:-0}; \ + total=$$(($$translated+$$untranslated)); \ + target=$$(basename "$$po"); \ + target="$$domain/$$target"; \ + msgfmt -c "$$po"; \ + if msgfmt -c "$$po" && [ "$$translated" != "0" ] && ([ "$$domain" != "po/doc" ] || [ "$$translated" -gt $$(($$total/10)) ] || [ -f $$target ]); then \ + msgfilter --no-wrap -i "$$po" cat > "$$po".tmp; \ + mv "$$po".tmp "$$target"; \ + echo "copied $$target."; \ + else \ + echo "WARN: $$target ($$translated translated messages ($$((translated/total*100))%)) was not added/updated."; \ + fi; \ + done; \ + done; \ + for po in po/doc/*.po; do \ + translated=$$(LANG=en_US.UTF-8 msgfmt --statistics "$$po" 2>&1 | cut -f1 -d' '); \ + untranslated=$$(LANG=en_US.UTF-8 msgfmt --statistics "$$po" 2>&1 | rev | cut -f3 -d' ' | rev); \ + untranslated=$${untranslated:-0}; \ + total=$$(($$translated + $$untranslated)); \ + if [ "$$translated" -lt "$$(($$total/20))" ]; then \ + echo "WARN: $$po was removed because it is below the 5% threshold: $$((translated/total*100))%"; \ + rm $$po; \ + fi; \ + done; \ + rm -rf "$$dir" .PHONY: download-po -check-po: $(foreach domain,guix packages documentation-manual documentation-cookbook,check-po.$(domain)) -.PHONY: check-po - ## -------------- ## ## Silent rules. ## ## -------------- ##