Makefile.am 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096
  1. # GNU Guix --- Functional package management for GNU
  2. # Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
  3. # Copyright © 2013 Andreas Enge <andreas@enge.fr>
  4. # Copyright © 2015, 2017 Alex Kost <alezost@gmail.com>
  5. # Copyright © 2016, 2018 Mathieu Lirzin <mthl@gnu.org>
  6. # Copyright © 2016, 2017, 2018, 2019 Mark H Weaver <mhw@netris.org>
  7. # Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
  8. # Copyright © 2017 Leo Famulari <leo@famulari.name>
  9. # Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
  10. # Copyright © 2017, 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
  11. # Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
  12. # Copyright © 2018 Nikita <nikita@n0.is>
  13. # Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
  14. # Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
  15. # Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
  16. # Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
  17. # Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
  18. # Copyright © 2021 Andrew Tropin <andrew@trop.in>
  19. #
  20. # This file is part of GNU Guix.
  21. #
  22. # GNU Guix is free software; you can redistribute it and/or modify it
  23. # under the terms of the GNU General Public License as published by
  24. # the Free Software Foundation; either version 3 of the License, or (at
  25. # your option) any later version.
  26. #
  27. # GNU Guix is distributed in the hope that it will be useful, but
  28. # WITHOUT ANY WARRANTY; without even the implied warranty of
  29. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  30. # GNU General Public License for more details.
  31. #
  32. # You should have received a copy of the GNU General Public License
  33. # along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  34. MSGMERGE_UPDATE = @MSGMERGE@ --update
  35. bin_SCRIPTS = scripts/guix
  36. # Handle substitution of fully-expanded Autoconf variables.
  37. do_subst = $(SED) \
  38. -e 's,[@]GUILE[@],$(GUILE),g' \
  39. -e 's,[@]guilemoduledir[@],$(guilemoduledir),g' \
  40. -e 's,[@]guileobjectdir[@],$(guileobjectdir),g' \
  41. -e 's,[@]abs_top_builddir[@],$(abs_top_builddir),g' \
  42. -e 's,[@]localedir[@],$(localedir),g'
  43. scripts/guix: scripts/guix.in Makefile
  44. $(AM_V_at)rm -f $@ $@-t
  45. $(AM_V_at)$(MKDIR_P) "$(@D)"
  46. $(AM_V_GEN)$(do_subst) < "$(srcdir)/$@.in" > "$@-t"
  47. $(AM_V_at)chmod a+x,a-w "$@-t" && mv -f "$@-t" "$@"
  48. # This is our variant of the 'guile' executable, one that doesn't complain
  49. # about locales.
  50. pkglibexec_PROGRAMS = guile
  51. guile_SOURCES = gnu/packages/aux-files/guile-launcher.c
  52. guile_LDADD = $(GUILE_LIBS)
  53. guile_CFLAGS = $(GUILE_CFLAGS)
  54. # Have the 'guix' command refer to our 'guile'.
  55. install-exec-hook:
  56. $(SED) -i "$(DESTDIR)$(bindir)/guix" \
  57. -e 's,^#![[:graph:]]\+,#!$(pkglibexecdir)/guile,g'
  58. nodist_noinst_SCRIPTS = \
  59. pre-inst-env \
  60. test-env
  61. # Modules that are not compiled but are installed nonetheless, such as
  62. # build-side modules with unusual dependencies.
  63. MODULES_NOT_COMPILED = \
  64. guix/build/po.scm \
  65. guix/man-db.scm
  66. include gnu/local.mk
  67. include po/doc/local.mk
  68. MODULES = \
  69. guix/base16.scm \
  70. guix/base32.scm \
  71. guix/base64.scm \
  72. guix/ci.scm \
  73. guix/cpio.scm \
  74. guix/deprecation.scm \
  75. guix/docker.scm \
  76. guix/records.scm \
  77. guix/openpgp.scm \
  78. guix/pki.scm \
  79. guix/progress.scm \
  80. guix/combinators.scm \
  81. guix/memoization.scm \
  82. guix/utils.scm \
  83. guix/sets.scm \
  84. guix/modules.scm \
  85. guix/download.scm \
  86. guix/discovery.scm \
  87. guix/android-repo-download.scm \
  88. guix/bzr-download.scm \
  89. guix/extracting-download.scm \
  90. guix/git-download.scm \
  91. guix/hg-download.scm \
  92. guix/swh.scm \
  93. guix/monads.scm \
  94. guix/monad-repl.scm \
  95. guix/gexp.scm \
  96. guix/profiles.scm \
  97. guix/serialization.scm \
  98. guix/nar.scm \
  99. guix/narinfo.scm \
  100. guix/derivations.scm \
  101. guix/grafts.scm \
  102. guix/repl.scm \
  103. guix/transformations.scm \
  104. guix/inferior.scm \
  105. guix/describe.scm \
  106. guix/quirks.scm \
  107. guix/channels.scm \
  108. guix/gnu-maintenance.scm \
  109. guix/self.scm \
  110. guix/substitutes.scm \
  111. guix/upstream.scm \
  112. guix/licenses.scm \
  113. guix/lint.scm \
  114. guix/glob.scm \
  115. guix/git.scm \
  116. guix/git-authenticate.scm \
  117. guix/graph.scm \
  118. guix/cache.scm \
  119. guix/cve.scm \
  120. guix/workers.scm \
  121. guix/ipfs.scm \
  122. guix/build-system.scm \
  123. guix/build-system/android-ndk.scm \
  124. guix/build-system/ant.scm \
  125. guix/build-system/cargo.scm \
  126. guix/build-system/chicken.scm \
  127. guix/build-system/clojure.scm \
  128. guix/build-system/cmake.scm \
  129. guix/build-system/dub.scm \
  130. guix/build-system/dune.scm \
  131. guix/build-system/emacs.scm \
  132. guix/build-system/font.scm \
  133. guix/build-system/go.scm \
  134. guix/build-system/meson.scm \
  135. guix/build-system/minify.scm \
  136. guix/build-system/minetest.scm \
  137. guix/build-system/asdf.scm \
  138. guix/build-system/copy.scm \
  139. guix/build-system/glib-or-gtk.scm \
  140. guix/build-system/gnu.scm \
  141. guix/build-system/guile.scm \
  142. guix/build-system/haskell.scm \
  143. guix/build-system/julia.scm \
  144. guix/build-system/linux-module.scm \
  145. guix/build-system/maven.scm \
  146. guix/build-system/node.scm \
  147. guix/build-system/perl.scm \
  148. guix/build-system/python.scm \
  149. guix/build-system/renpy.scm \
  150. guix/build-system/ocaml.scm \
  151. guix/build-system/qt.scm \
  152. guix/build-system/waf.scm \
  153. guix/build-system/r.scm \
  154. guix/build-system/rakudo.scm \
  155. guix/build-system/ruby.scm \
  156. guix/build-system/scons.scm \
  157. guix/build-system/texlive.scm \
  158. guix/build-system/trivial.scm \
  159. guix/ftp-client.scm \
  160. guix/http-client.scm \
  161. guix/gnupg.scm \
  162. guix/elf.scm \
  163. guix/profiling.scm \
  164. guix/store.scm \
  165. guix/cvs-download.scm \
  166. guix/svn-download.scm \
  167. guix/colors.scm \
  168. guix/i18n.scm \
  169. guix/diagnostics.scm \
  170. guix/ui.scm \
  171. guix/status.scm \
  172. guix/build/android-ndk-build-system.scm \
  173. guix/build/ant-build-system.scm \
  174. guix/build/download.scm \
  175. guix/build/download-nar.scm \
  176. guix/build/cargo-build-system.scm \
  177. guix/build/cargo-utils.scm \
  178. guix/build/chicken-build-system.scm \
  179. guix/build/cmake-build-system.scm \
  180. guix/build/dub-build-system.scm \
  181. guix/build/dune-build-system.scm \
  182. guix/build/emacs-build-system.scm \
  183. guix/build/meson-build-system.scm \
  184. guix/build/minify-build-system.scm \
  185. guix/build/font-build-system.scm \
  186. guix/build/go-build-system.scm \
  187. guix/build/android-repo.scm \
  188. guix/build/asdf-build-system.scm \
  189. guix/build/bzr.scm \
  190. guix/build/copy-build-system.scm \
  191. guix/build/git.scm \
  192. guix/build/hg.scm \
  193. guix/build/glib-or-gtk-build-system.scm \
  194. guix/build/gnu-bootstrap.scm \
  195. guix/build/gnu-build-system.scm \
  196. guix/build/gnu-dist.scm \
  197. guix/build/guile-build-system.scm \
  198. guix/build/maven-build-system.scm \
  199. guix/build/minetest-build-system.scm \
  200. guix/build/node-build-system.scm \
  201. guix/build/perl-build-system.scm \
  202. guix/build/python-build-system.scm \
  203. guix/build/ocaml-build-system.scm \
  204. guix/build/qt-build-system.scm \
  205. guix/build/r-build-system.scm \
  206. guix/build/renpy-build-system.scm \
  207. guix/build/rakudo-build-system.scm \
  208. guix/build/ruby-build-system.scm \
  209. guix/build/scons-build-system.scm \
  210. guix/build/texlive-build-system.scm \
  211. guix/build/waf-build-system.scm \
  212. guix/build/haskell-build-system.scm \
  213. guix/build/julia-build-system.scm \
  214. guix/build/linux-module-build-system.scm \
  215. guix/build/store-copy.scm \
  216. guix/build/json.scm \
  217. guix/build/pack.scm \
  218. guix/build/utils.scm \
  219. guix/build/union.scm \
  220. guix/build/profiles.scm \
  221. guix/build/compile.scm \
  222. guix/build/cvs.scm \
  223. guix/build/svn.scm \
  224. guix/build/syscalls.scm \
  225. guix/build/gremlin.scm \
  226. guix/build/debug-link.scm \
  227. guix/build/clojure-build-system.scm \
  228. guix/build/clojure-utils.scm \
  229. guix/build/emacs-utils.scm \
  230. guix/build/java-utils.scm \
  231. guix/build/lisp-utils.scm \
  232. guix/build/meson-configuration.scm \
  233. guix/build/maven/java.scm \
  234. guix/build/maven/plugin.scm \
  235. guix/build/maven/pom.scm \
  236. guix/build/graft.scm \
  237. guix/build/bournish.scm \
  238. guix/build/qt-utils.scm \
  239. guix/build/make-bootstrap.scm \
  240. guix/search-paths.scm \
  241. guix/packages.scm \
  242. guix/import/cabal.scm \
  243. guix/import/cpan.scm \
  244. guix/import/cran.scm \
  245. guix/import/crate.scm \
  246. guix/import/egg.scm \
  247. guix/import/elpa.scm \
  248. guix/import/gem.scm \
  249. guix/import/git.scm \
  250. guix/import/github.scm \
  251. guix/import/gnome.scm \
  252. guix/import/gnu.scm \
  253. guix/import/go.scm \
  254. guix/import/hackage.scm \
  255. guix/import/json.scm \
  256. guix/import/kde.scm \
  257. guix/import/launchpad.scm \
  258. guix/import/minetest.scm \
  259. guix/import/opam.scm \
  260. guix/import/print.scm \
  261. guix/import/pypi.scm \
  262. guix/import/stackage.scm \
  263. guix/import/texlive.scm \
  264. guix/import/utils.scm \
  265. guix/scripts.scm \
  266. guix/scripts/download.scm \
  267. guix/scripts/perform-download.scm \
  268. guix/scripts/build.scm \
  269. guix/scripts/archive.scm \
  270. guix/scripts/import.scm \
  271. guix/scripts/package.scm \
  272. guix/scripts/install.scm \
  273. guix/scripts/remove.scm \
  274. guix/scripts/upgrade.scm \
  275. guix/scripts/search.scm \
  276. guix/scripts/show.scm \
  277. guix/scripts/gc.scm \
  278. guix/scripts/hash.scm \
  279. guix/scripts/pack.scm \
  280. guix/scripts/pull.scm \
  281. guix/scripts/processes.scm \
  282. guix/scripts/substitute.scm \
  283. guix/scripts/authenticate.scm \
  284. guix/scripts/refresh.scm \
  285. guix/scripts/repl.scm \
  286. guix/scripts/describe.scm \
  287. guix/scripts/style.scm \
  288. guix/scripts/system.scm \
  289. guix/scripts/system/search.scm \
  290. guix/scripts/system/reconfigure.scm \
  291. guix/scripts/home.scm \
  292. guix/scripts/home/import.scm \
  293. guix/scripts/lint.scm \
  294. guix/scripts/challenge.scm \
  295. guix/scripts/import/crate.scm \
  296. guix/scripts/import/cran.scm \
  297. guix/scripts/import/egg.scm \
  298. guix/scripts/import/elpa.scm \
  299. guix/scripts/import/gem.scm \
  300. guix/scripts/import/gnu.scm \
  301. guix/scripts/import/go.scm \
  302. guix/scripts/import/hackage.scm \
  303. guix/scripts/import/json.scm \
  304. guix/scripts/import/minetest.scm \
  305. guix/scripts/import/opam.scm \
  306. guix/scripts/import/pypi.scm \
  307. guix/scripts/import/stackage.scm \
  308. guix/scripts/import/texlive.scm \
  309. guix/scripts/environment.scm \
  310. guix/scripts/publish.scm \
  311. guix/scripts/edit.scm \
  312. guix/scripts/size.scm \
  313. guix/scripts/git.scm \
  314. guix/scripts/git/authenticate.scm \
  315. guix/scripts/graph.scm \
  316. guix/scripts/weather.scm \
  317. guix/scripts/container.scm \
  318. guix/scripts/container/exec.scm \
  319. guix/scripts/deploy.scm \
  320. guix/scripts/time-machine.scm \
  321. guix.scm \
  322. $(GNU_SYSTEM_MODULES)
  323. if HAVE_GUILE_SSH
  324. MODULES += \
  325. guix/ssh.scm \
  326. guix/remote.scm \
  327. guix/scripts/copy.scm \
  328. guix/store/ssh.scm
  329. endif HAVE_GUILE_SSH
  330. if HAVE_GUILE_AVAHI
  331. MODULES += \
  332. guix/avahi.scm \
  333. guix/scripts/discover.scm
  334. endif HAVE_GUILE_AVAHI
  335. if BUILD_DAEMON_OFFLOAD
  336. MODULES += \
  337. guix/scripts/offload.scm
  338. endif BUILD_DAEMON_OFFLOAD
  339. # Scheme implementation of the build daemon and related functionality.
  340. STORE_MODULES = \
  341. guix/store/database.scm \
  342. guix/store/deduplication.scm \
  343. guix/store/roots.scm
  344. MODULES += $(STORE_MODULES)
  345. # Internal modules with test suite support.
  346. dist_noinst_DATA = \
  347. guix/tests.scm \
  348. guix/tests/http.scm \
  349. guix/tests/git.scm \
  350. guix/tests/gnupg.scm
  351. # Auxiliary files for packages.
  352. AUX_FILES = \
  353. gnu/packages/aux-files/chromium/master-preferences.json \
  354. gnu/packages/aux-files/emacs/guix-emacs.el \
  355. gnu/packages/aux-files/guix.vim \
  356. gnu/packages/aux-files/linux-libre/5.14-arm.conf \
  357. gnu/packages/aux-files/linux-libre/5.14-arm64.conf \
  358. gnu/packages/aux-files/linux-libre/5.14-i686.conf \
  359. gnu/packages/aux-files/linux-libre/5.14-x86_64.conf \
  360. gnu/packages/aux-files/linux-libre/5.10-arm.conf \
  361. gnu/packages/aux-files/linux-libre/5.10-arm64.conf \
  362. gnu/packages/aux-files/linux-libre/5.10-i686.conf \
  363. gnu/packages/aux-files/linux-libre/5.10-x86_64.conf \
  364. gnu/packages/aux-files/linux-libre/5.4-arm.conf \
  365. gnu/packages/aux-files/linux-libre/5.4-arm64.conf \
  366. gnu/packages/aux-files/linux-libre/5.4-i686.conf \
  367. gnu/packages/aux-files/linux-libre/5.4-x86_64.conf \
  368. gnu/packages/aux-files/linux-libre/4.19-arm.conf \
  369. gnu/packages/aux-files/linux-libre/4.19-arm64.conf \
  370. gnu/packages/aux-files/linux-libre/4.19-i686.conf \
  371. gnu/packages/aux-files/linux-libre/4.19-x86_64.conf \
  372. gnu/packages/aux-files/linux-libre/4.14-arm.conf \
  373. gnu/packages/aux-files/linux-libre/4.14-i686.conf \
  374. gnu/packages/aux-files/linux-libre/4.14-x86_64.conf \
  375. gnu/packages/aux-files/linux-libre/4.9-i686.conf \
  376. gnu/packages/aux-files/linux-libre/4.9-x86_64.conf \
  377. gnu/packages/aux-files/linux-libre/4.4-i686.conf \
  378. gnu/packages/aux-files/linux-libre/4.4-x86_64.conf \
  379. gnu/packages/aux-files/pack-audit.c \
  380. gnu/packages/aux-files/python/sanity-check.py \
  381. gnu/packages/aux-files/python/sitecustomize.py \
  382. gnu/packages/aux-files/run-in-namespace.c
  383. # Templates, examples.
  384. EXAMPLES = \
  385. gnu/system/examples/asus-c201.tmpl \
  386. gnu/system/examples/bare-bones.tmpl \
  387. gnu/system/examples/bare-hurd.tmpl \
  388. gnu/system/examples/beaglebone-black.tmpl \
  389. gnu/system/examples/desktop.tmpl \
  390. gnu/system/examples/lightweight-desktop.tmpl \
  391. gnu/system/examples/docker-image.tmpl \
  392. gnu/system/examples/vm-image.tmpl
  393. GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go $(dist_noinst_DATA:%.scm=%.go)
  394. nobase_dist_guilemodule_DATA = \
  395. guix/d3.v3.js \
  396. guix/graph.js \
  397. guix/store/schema.sql \
  398. $(MODULES) $(MODULES_NOT_COMPILED) $(AUX_FILES) $(EXAMPLES) \
  399. $(MISC_DISTRO_FILES)
  400. nobase_nodist_guilemodule_DATA = guix/config.scm
  401. nobase_nodist_guileobject_DATA = $(GOBJECTS)
  402. # Handy way to remove the .go files without removing all the rest.
  403. clean-go:
  404. -$(RM) -f $(GOBJECTS)
  405. @find . -path ./test-tmp -prune -o -name '*.go' -print | \
  406. if test -t 1; then \
  407. xargs -r echo -e "\033[31mwarning:\033[0m stray .go files:"; \
  408. else \
  409. xargs -r echo "warning: stray .go files:"; \
  410. fi
  411. # Test extensions; has to be unconditional.
  412. TEST_EXTENSIONS = .scm .sh
  413. if CAN_RUN_TESTS
  414. SCM_TESTS = \
  415. tests/accounts.scm \
  416. tests/base16.scm \
  417. tests/base32.scm \
  418. tests/base64.scm \
  419. tests/boot-parameters.scm \
  420. tests/bournish.scm \
  421. tests/builders.scm \
  422. tests/build-utils.scm \
  423. tests/cache.scm \
  424. tests/challenge.scm \
  425. tests/channels.scm \
  426. tests/combinators.scm \
  427. tests/containers.scm \
  428. tests/cpan.scm \
  429. tests/cpio.scm \
  430. tests/cran.scm \
  431. tests/crate.scm \
  432. tests/cve.scm \
  433. tests/debug-link.scm \
  434. tests/derivations.scm \
  435. tests/discovery.scm \
  436. tests/egg.scm \
  437. tests/elpa.scm \
  438. tests/file-systems.scm \
  439. tests/gem.scm \
  440. tests/gexp.scm \
  441. tests/git.scm \
  442. tests/git-authenticate.scm \
  443. tests/glob.scm \
  444. tests/gnu-maintenance.scm \
  445. tests/grafts.scm \
  446. tests/graph.scm \
  447. tests/gremlin.scm \
  448. tests/hackage.scm \
  449. tests/import-git.scm \
  450. tests/import-utils.scm \
  451. tests/inferior.scm \
  452. tests/lint.scm \
  453. tests/minetest.scm \
  454. tests/modules.scm \
  455. tests/monads.scm \
  456. tests/nar.scm \
  457. tests/networking.scm \
  458. tests/opam.scm \
  459. tests/openpgp.scm \
  460. tests/packages.scm \
  461. tests/pack.scm \
  462. tests/pki.scm \
  463. tests/print.scm \
  464. tests/processes.scm \
  465. tests/profiles.scm \
  466. tests/publish.scm \
  467. tests/pypi.scm \
  468. tests/records.scm \
  469. tests/scripts.scm \
  470. tests/search-paths.scm \
  471. tests/services.scm \
  472. tests/services/file-sharing.scm \
  473. tests/services/configuration.scm \
  474. tests/services/linux.scm \
  475. tests/services/telephony.scm \
  476. tests/sets.scm \
  477. tests/size.scm \
  478. tests/status.scm \
  479. tests/store-database.scm \
  480. tests/store-deduplication.scm \
  481. tests/store-roots.scm \
  482. tests/store.scm \
  483. tests/substitute.scm \
  484. tests/swh.scm \
  485. tests/syscalls.scm \
  486. tests/system.scm \
  487. tests/style.scm \
  488. tests/texlive.scm \
  489. tests/transformations.scm \
  490. tests/ui.scm \
  491. tests/union.scm \
  492. tests/upstream.scm \
  493. tests/utils.scm \
  494. tests/uuid.scm \
  495. tests/workers.scm
  496. if HAVE_GUILE_LIB
  497. SCM_TESTS += tests/go.scm
  498. else
  499. EXTRA_DIST += tests/go.scm
  500. endif
  501. if BUILD_DAEMON_OFFLOAD
  502. SCM_TESTS += tests/offload.scm
  503. else
  504. EXTRA_DIST += tests/offload.scm
  505. endif
  506. SH_TESTS = \
  507. tests/guix-build.sh \
  508. tests/guix-build-branch.sh \
  509. tests/guix-download.sh \
  510. tests/guix-gc.sh \
  511. tests/guix-git-authenticate.sh \
  512. tests/guix-hash.sh \
  513. tests/guix-pack.sh \
  514. tests/guix-pack-localstatedir.sh \
  515. tests/guix-pack-relocatable.sh \
  516. tests/guix-package.sh \
  517. tests/guix-package-aliases.sh \
  518. tests/guix-package-net.sh \
  519. tests/guix-system.sh \
  520. tests/guix-home.sh \
  521. tests/guix-archive.sh \
  522. tests/guix-authenticate.sh \
  523. tests/guix-environment.sh \
  524. tests/guix-environment-container.sh \
  525. tests/guix-graph.sh \
  526. tests/guix-describe.sh \
  527. tests/guix-repl.sh \
  528. tests/guix-lint.sh
  529. TESTS = $(SCM_TESTS) $(SH_TESTS)
  530. AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
  531. SCM_LOG_DRIVER = \
  532. $(top_builddir)/test-env --quiet-stderr \
  533. $(GUILE) --no-auto-compile -e main \
  534. $(top_srcdir)/build-aux/test-driver.scm
  535. AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
  536. SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
  537. AM_SH_LOG_FLAGS = -x -e
  538. # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
  539. # could end up removing files from the store while they are being used by
  540. # other instances of the daemon.
  541. tests/guix-gc.log: \
  542. $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
  543. $(SCM_TESTS:%.scm=%.log)
  544. else !CAN_RUN_TESTS
  545. TESTS =
  546. SH_TESTS =
  547. SCM_TESTS =
  548. # Automake always generates a 'check' target, so better not override it.
  549. check-local:
  550. @echo
  551. @echo "Cannot run tests because file name limits would be exceeded." >&2
  552. @echo "Look for 'length' in the 'config.log' file for details." >&2
  553. @echo
  554. @exit 1
  555. endif !CAN_RUN_TESTS
  556. check-system: $(GOBJECTS)
  557. $(AM_V_at)$(top_builddir)/pre-inst-env \
  558. guix build -m $(top_srcdir)/etc/system-tests.scm -K
  559. # Public keys used to sign substitutes.
  560. dist_pkgdata_DATA = \
  561. etc/substitutes/berlin.guix.gnu.org.pub \
  562. etc/substitutes/ci.guix.gnu.org.pub \
  563. etc/substitutes/ci.guix.info.pub \
  564. etc/substitutes/bordeaux.guix.gnu.org.pub
  565. # Bash completion file.
  566. dist_bashcompletion_DATA = etc/completion/bash/guix \
  567. etc/completion/bash/guix-daemon
  568. # Zsh completion file.
  569. dist_zshcompletion_DATA = etc/completion/zsh/_guix
  570. # Fish completion file.
  571. dist_fishcompletion_DATA = etc/completion/fish/guix.fish
  572. # SELinux policy
  573. nodist_selinux_policy_DATA = etc/guix-daemon.cil
  574. EXTRA_DIST += \
  575. HACKING \
  576. ROADMAP \
  577. TODO \
  578. CODE-OF-CONDUCT \
  579. .dir-locals.el \
  580. .guix-authorizations \
  581. .guix-channel \
  582. scripts/guix.in \
  583. etc/disarchive-manifest.scm \
  584. etc/guix-install.sh \
  585. etc/news.scm \
  586. etc/release-manifest.scm \
  587. etc/source-manifest.scm \
  588. etc/system-tests.scm \
  589. etc/historical-authorizations \
  590. build-aux/build-self.scm \
  591. build-aux/compile-all.scm \
  592. build-aux/cuirass/hurd-manifest.scm \
  593. build-aux/check-final-inputs-self-contained.scm \
  594. build-aux/check-channel-news.scm \
  595. build-aux/compile-as-derivation.scm \
  596. build-aux/convert-xref.scm \
  597. build-aux/generate-authors.scm \
  598. build-aux/test-driver.scm \
  599. build-aux/update-guix-package.scm \
  600. build-aux/update-NEWS.scm \
  601. tests/test.drv \
  602. tests/signing-key.pub \
  603. tests/signing-key.sec \
  604. tests/cve-sample.json \
  605. tests/civodul.key \
  606. tests/rsa.key \
  607. tests/dsa.key \
  608. tests/ed25519.key \
  609. tests/ed25519.sec \
  610. tests/ed25519bis.key \
  611. tests/ed25519bis.sec \
  612. build-aux/config.rpath \
  613. bootstrap \
  614. doc/build.scm \
  615. $(TESTS)
  616. if !BUILD_DAEMON_OFFLOAD
  617. EXTRA_DIST += \
  618. guix/scripts/offload.scm
  619. endif !BUILD_DAEMON_OFFLOAD
  620. CLEANFILES = \
  621. $(bin_SCRIPTS) \
  622. $(GOBJECTS) \
  623. $(SCM_TESTS:tests/%.scm=%.log)
  624. # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
  625. # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
  626. # there that are newer than the local .scm files (for instance because the
  627. # user ran 'make install' recently). When that happens, we end up loading
  628. # those previously-installed .go files, which may be stale, thereby breaking
  629. # the whole thing. Likewise, set 'XDG_CACHE_HOME' to avoid loading possibly
  630. # stale files from ~/.cache/guile/ccache.
  631. %.go: make-go ; @:
  632. make-go: make-core-go make-packages-go make-system-go make-cli-go
  633. # Define a rule to build a subset of the .go files.
  634. define guile-compilation-rule
  635. $(1): $(2)
  636. $(AM_V_at)echo "Compiling Scheme modules..." ; \
  637. unset GUILE_LOAD_COMPILED_PATH ; \
  638. XDG_CACHE_HOME=/nowhere \
  639. host=$(host) srcdir="$(top_srcdir)" \
  640. $(top_builddir)/pre-inst-env \
  641. $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \
  642. --no-auto-compile \
  643. -s "$(top_srcdir)"/build-aux/compile-all.scm \
  644. --total $(words $(MODULES)) \
  645. --completed $(3) \
  646. $$(filter %.scm,$$^)
  647. endef
  648. # Split compilation in several steps, each of which building a subset of
  649. # $(MODULES). The main goal is to reduce peak memory consumption, as reported
  650. # in <https://issues.guix.gnu.org/48963>. Each 'eval' call below creates a
  651. # 'make-*-go' phony target that builds the corresponding subset.
  652. MODULES_CORE = guix.scm $(filter-out guix/scripts/%,$(filter guix/%,$(MODULES)))
  653. MODULES_PACKAGES = $(filter gnu/packages/%,$(MODULES))
  654. MODULES_SYSTEM = gnu.scm $(filter-out gnu/packages/%,$(filter gnu/%,$(MODULES)))
  655. MODULES_CLI = $(filter guix/scripts/%,$(MODULES))
  656. MODULES_PO = guix/build/po.scm
  657. $(eval $(call guile-compilation-rule,make-core-go, \
  658. $(MODULES_CORE) guix/config.scm $(dist_noinst_DATA), \
  659. 0))
  660. .PHONY: make-core-go
  661. $(eval $(call guile-compilation-rule,make-packages-go, \
  662. $(MODULES_PACKAGES) make-core-go, \
  663. $(words $(MODULES_CORE))))
  664. .PHONY: make-packages-go
  665. $(eval $(call guile-compilation-rule,make-system-go, \
  666. $(MODULES_SYSTEM) make-packages-go make-core-go, \
  667. $(words $(MODULES_CORE) $(MODULES_PACKAGES))))
  668. .PHONY: make-system-go
  669. $(eval $(call guile-compilation-rule,make-cli-go, \
  670. $(MODULES_CLI) make-system-go make-packages-go make-core-go, \
  671. $(words $(MODULES_CORE) $(MODULES_PACKAGES) $(MODULES_SYSTEM))))
  672. .PHONY: make-cli-go
  673. $(eval $(call guile-compilation-rule,guix/build/po.go, \
  674. $(MODULES_PO), \
  675. 0))
  676. SUFFIXES = .go
  677. # Make sure source files are installed first, so that the mtime of
  678. # installed compiled files is greater than that of installed source
  679. # files. See
  680. # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
  681. # for details.
  682. guix_install_go_files = install-nobase_nodist_guileobjectDATA
  683. $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
  684. # The above trick doesn't work for 'config.go' because both 'config.scm' and
  685. # 'config.go' are listed in $(nobase_nodist_guileobject_DATA). Thus, give it
  686. # special treatment.
  687. install-data-hook:
  688. touch "$(DESTDIR)$(guileobjectdir)/guix/config.go"
  689. # Commit corresponding to the 'v1.0.0' tag.
  690. commit_v1_0_0 = 6298c3ffd9654d3231a6f25390b056483e8f407c
  691. # Introduction of the 'guix' channel. Keep in sync with (guix channels)!
  692. channel_intro_commit = 9edb3f66fd807b096b48283debdcddccfea34bad
  693. channel_intro_signer = BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA
  694. # Authenticate the current Git checkout by checking signatures on every commit.
  695. GUIX_GIT_KEYRING = origin/keyring
  696. authenticate:
  697. $(AM_V_at)echo "Authenticating Git checkout..." ; \
  698. guix git authenticate \
  699. --keyring=$(GUIX_GIT_KEYRING) \
  700. --cache-key=channels/guix --stats \
  701. "$(channel_intro_commit)" "$(channel_intro_signer)"
  702. # Assuming Guix is already installed and the daemon is up and running, this
  703. # rule builds from $(srcdir), creating and building derivations.
  704. as-derivation:
  705. $(AM_V_at)echo "Building Guix in Guix..." ; \
  706. $(GUILE) --no-auto-compile \
  707. "$(top_srcdir)/build-aux/compile-as-derivation.scm" \
  708. "$(abs_top_srcdir)"
  709. SUBDIRS = po/guix po/packages
  710. BUILT_SOURCES =
  711. include doc/local.mk
  712. if BUILD_DAEMON
  713. include nix/local.mk
  714. endif BUILD_DAEMON
  715. ACLOCAL_AMFLAGS = -I m4
  716. # Pass an explicit '--localstatedir' so that configure does not error out if
  717. # it finds an existing installation with a different localstatedir. Inherit
  718. # 'ac_cv_guix_test_root' so that "make check" in $(distdir) does not have to
  719. # repopulate the whole store, and to make sure $(GUIX_TEST_ROOT) is short
  720. # enough for shebangs.
  721. AM_DISTCHECK_CONFIGURE_FLAGS = \
  722. --localstatedir="$$dc_install_base/var" \
  723. --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
  724. --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
  725. --enable-daemon \
  726. ac_cv_guix_test_root="$(GUIX_TEST_ROOT)"
  727. # The self-contained tarball.
  728. guix-binary.%.tar.xz:
  729. $(AM_V_GEN)GUIX_PACKAGE_PATH= \
  730. tarball=`$(top_builddir)/pre-inst-env guix pack -C xz \
  731. --fallback \
  732. -s "$*" --localstatedir --profile-name=current-guix \
  733. guix` ; \
  734. cp "$$tarball" "$@.tmp" ; mv "$@.tmp" "$@"
  735. # The dependency on doc-pot-update is to generate the .pot files, which are
  736. # not checked in.
  737. dist: doc-pot-update
  738. dist-hook: gen-ChangeLog gen-AUTHORS gen-tarball-version
  739. dist-hook: assert-no-store-file-names
  740. distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
  741. EXTRA_DIST += $(top_srcdir)/.version
  742. BUILT_SOURCES += $(top_srcdir)/.version
  743. $(top_srcdir)/.version: config.status
  744. $(AM_V_GEN)echo $(VERSION) > "$@-t" && mv "$@-t" "$@"
  745. gen-tarball-version:
  746. echo $(VERSION) > "$(distdir)/.tarball-version"
  747. gen-ChangeLog:
  748. $(AM_V_GEN)if test -d .git; then \
  749. $(top_srcdir)/build-aux/gitlog-to-changelog \
  750. > $(distdir)/ChangeLog.tmp; \
  751. rm -f $(distdir)/ChangeLog; \
  752. mv $(distdir)/ChangeLog.tmp $(distdir)/ChangeLog; \
  753. fi
  754. gen-AUTHORS:
  755. $(AM_V_GEN)if test -d .git; then \
  756. rm -f "$(distdir)/AUTHORS"; \
  757. $(top_builddir)/pre-inst-env "$(GUILE)" \
  758. "$(top_srcdir)/build-aux/generate-authors.scm" \
  759. "$(top_srcdir)" "$(distdir)/AUTHORS"; \
  760. fi
  761. # Like 'dist', but regenerate 'configure' so we get an up-to-date
  762. # 'PACKAGE_VERSION' string. (In Gnulib, 'GNUmakefile' has a special trick to
  763. # do that whenever a 'dist' target is used.)
  764. dist-with-updated-version:
  765. @echo "Running './bootstrap' for new version string..."
  766. $(top_srcdir)/bootstrap
  767. $(MAKE) $(AM_MAKEFLAGS) $(top_srcdir)/.version dist
  768. .PHONY: dist-with-updated-version
  769. #
  770. # Release management.
  771. #
  772. releasedir = release-$(PACKAGE_VERSION)
  773. PACKAGE_FULL_TARNAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
  774. # List of source tarballs produced. This must be kept in sync with the
  775. # 'dist-' options of 'AM_INIT_AUTOMAKE' in 'configure.ac'.
  776. SOURCE_TARBALLS = \
  777. $(foreach ext,tar.gz,$(PACKAGE_FULL_TARNAME).$(ext))
  778. # Systems supported by Guix.
  779. SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux armhf-linux aarch64-linux \
  780. powerpc64le-linux
  781. # Guix binary tarballs.
  782. BINARY_TARBALLS = \
  783. $(foreach system,$(SUPPORTED_SYSTEMS),guix-binary.$(system).tar.xz)
  784. # Systems supported by Guix System.
  785. GUIX_SYSTEM_SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux
  786. # Systems for which we build Guix VMs.
  787. GUIX_SYSTEM_VM_SYSTEMS ?= x86_64-linux
  788. # Prefix of the Guix installation image file name.
  789. GUIX_SYSTEM_IMAGE_BASE = guix-system-install-$(PACKAGE_VERSION)
  790. # Prefix of the Guix VM image file name.
  791. GUIX_SYSTEM_VM_IMAGE_BASE = guix-system-vm-image-$(PACKAGE_VERSION)
  792. # Flags for 'guix system vm-image'. By default create a VM image that appears
  793. # to have a 20G hard disk.
  794. GUIX_SYSTEM_VM_IMAGE_FLAGS ?= --image-size=30G
  795. # Return the sequence of '-s' flags for the given systems.
  796. system_flags = $(foreach system,$(1),-s $(system))
  797. # The release process works in several phases:
  798. #
  799. # 0. We assume the developer created a 'vX.Y.Z' tag.
  800. # 1. Build the source tarball.
  801. # 2. Update the 'guix' package so that it corresponds to the 'vX.Y.Z' tag.
  802. # 3. Build the binary tarballs for that 'guix' package.
  803. # 4. Update the 'guix' package again.
  804. # 5. Build the installation and VM images. The images will run 'guix'
  805. # corresponding to 'vX.Y.Z' + 1 commit, and they will install 'vX.Y.Z'.
  806. #
  807. # This 'release' target takes care of everything and copies the resulting
  808. # files to $(releasedir).
  809. #
  810. # XXX: Depend on 'dist' rather than 'distcheck' to work around the Gettext
  811. # issue described at <https://savannah.gnu.org/bugs/index.php?51027>.
  812. release: dist-with-updated-version all
  813. @if ! git diff-index --quiet HEAD; then \
  814. echo "There are uncommitted changes; stopping." >&2 ; \
  815. exit 1 ; \
  816. fi
  817. $(MKDIR_P) "$(releasedir)"
  818. rm -f "$(releasedir)"/*
  819. mv $(SOURCE_TARBALLS) "$(releasedir)"
  820. # Bump the Guix package version and build it.
  821. GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT=yes \
  822. $(top_builddir)/pre-inst-env "$(GUILE)" \
  823. $(top_srcdir)/build-aux/update-guix-package.scm \
  824. "`git rev-parse HEAD`" "$(PACKAGE_VERSION)"
  825. git add $(top_srcdir)/gnu/packages/package-management.scm
  826. git commit -m "gnu: guix: Update to $(PACKAGE_VERSION)."
  827. $(top_builddir)/pre-inst-env guix build guix \
  828. $(call system_flags,$(SUPPORTED_SYSTEMS)) \
  829. -v1 --no-grafts --fallback
  830. # Generate the binary release tarballs.
  831. rm -f $(BINARY_TARBALLS)
  832. $(MAKE) $(BINARY_TARBALLS)
  833. for system in $(SUPPORTED_SYSTEMS) ; do \
  834. mv "guix-binary.$$system.tar.xz" \
  835. "$(releasedir)/guix-binary-$(PACKAGE_VERSION).$$system.tar.xz" ; \
  836. done
  837. # Bump the Guix package version and build it (again).
  838. GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT=yes \
  839. $(top_builddir)/pre-inst-env "$(GUILE)" \
  840. $(top_srcdir)/build-aux/update-guix-package.scm \
  841. "`git rev-parse HEAD`"
  842. git add $(top_srcdir)/gnu/packages/package-management.scm
  843. git commit -m "gnu: guix: Update to `git rev-parse HEAD | cut -c1-7`."
  844. $(top_builddir)/pre-inst-env guix build guix \
  845. $(call system_flags,$(GUIX_SYSTEM_SUPPORTED_SYSTEMS)) \
  846. -v1 --no-grafts --fallback
  847. # Generate the ISO installation images.
  848. for system in $(GUIX_SYSTEM_SUPPORTED_SYSTEMS) ; do \
  849. image=`$(top_builddir)/pre-inst-env \
  850. guix system image -t iso9660 \
  851. --label="GUIX_$${system}_$(VERSION)" \
  852. --system=$$system --fallback \
  853. gnu/system/install.scm` ; \
  854. if [ ! -f "$$image" ] ; then \
  855. echo "failed to produced Guix installation image for $$system" >&2 ; \
  856. exit 1 ; \
  857. fi ; \
  858. cp "$$image" "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.tmp" ; \
  859. mv "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.tmp" \
  860. "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso" ; \
  861. done
  862. # Generate the VM images.
  863. for system in $(GUIX_SYSTEM_VM_SYSTEMS) ; do \
  864. image=`$(top_builddir)/pre-inst-env \
  865. guix system image -t qcow2 $(GUIX_SYSTEM_VM_IMAGE_FLAGS) \
  866. --save-provenance \
  867. --system=$$system --fallback \
  868. gnu/system/examples/vm-image.tmpl` ; \
  869. if [ ! -f "$$image" ] ; then \
  870. echo "failed to produced Guix VM image for $$system" >&2 ; \
  871. exit 1 ; \
  872. fi ; \
  873. cp "$$image" "$(releasedir)/$(GUIX_SYSTEM_VM_IMAGE_BASE).$$system.qcow2"; \
  874. done
  875. @echo
  876. @echo "Congratulations! All the release files are now in $(releasedir)."
  877. @echo
  878. update-guix-package:
  879. git rev-parse HEAD
  880. $(top_builddir)/pre-inst-env "$(GUILE)" \
  881. $(top_srcdir)/build-aux/update-guix-package.scm \
  882. "`git rev-parse HEAD`"
  883. # Location of a checkout of <git://git.savannah.gnu.org/guix/maintenance.git>.
  884. # Package data from this checkout is used by 'update-NEWS.scm'.
  885. GUIX_MAINTENANCE_DIRECTORY ?= $(top_srcdir)/../guix-maintenance
  886. update-NEWS: $(GOBJECTS)
  887. $(top_builddir)/pre-inst-env "$(GUILE)" \
  888. $(top_srcdir)/build-aux/update-NEWS.scm \
  889. $(top_srcdir)/NEWS "$(GUIX_MAINTENANCE_DIRECTORY)/data"
  890. # Make sure we're not shipping a file that embeds a local /gnu/store file name.
  891. assert-no-store-file-names:
  892. $(AM_V_at)if grep -r --exclude=*.texi --exclude=*.info \
  893. --exclude=*.info-[0-9] --exclude=*.dot \
  894. --exclude=*.eps --exclude-dir=bootstrap \
  895. --exclude=guix-manual.pot --exclude=guix-manual.*.po \
  896. --exclude=guix-cookbook.pot --exclude=guix-cookbook.*.po \
  897. --exclude=guix-prettify.el \
  898. --exclude=ChangeLog* \
  899. --exclude=binutils-boot-2.20*.patch \
  900. -E "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
  901. then \
  902. echo "error: store file names embedded in the distribution" >&2 ; \
  903. exit 1 ; \
  904. fi
  905. # Make sure important substitutes are available.
  906. assert-binaries-available: $(GOBJECTS)
  907. $(AM_V_at)$(top_builddir)/pre-inst-env \
  908. guix weather -m "$(top_srcdir)/etc/release-manifest.scm" \
  909. --display-missing
  910. # Make sure the final inputs don't refer to bootstrap tools.
  911. assert-final-inputs-self-contained: $(GOBJECTS)
  912. $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
  913. "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
  914. # Validate channel news.
  915. check-channel-news: $(GOBJECTS)
  916. $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
  917. "$(top_srcdir)/build-aux/check-channel-news.scm"
  918. # Compute the Cuirass jobs.
  919. cuirass-jobs: $(GOBJECTS)
  920. rm -rf "$@"
  921. $(AM_V_at)$(MKDIR_P) "$@"
  922. $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)" \
  923. "$(top_srcdir)/build-aux/cuirass/evaluate.scm" "$@"
  924. .PHONY: gen-ChangeLog gen-AUTHORS gen-tarball-version
  925. .PHONY: assert-no-store-file-names assert-binaries-available
  926. .PHONY: assert-final-inputs-self-contained check-channel-news
  927. .PHONY: clean-go make-go as-derivation authenticate
  928. .PHONY: update-guix-package update-NEWS cuirass-jobs release
  929. # Downloading up-to-date PO files.
  930. WEBLATE_REPO = https://framagit.org/tyreunom/guix-translations
  931. # Shallow clone the Git repository behind Weblate and copy files from it if
  932. # they contain at least one translation, and they are well-formed (Scheme
  933. # format only), warn otherwise. Copied files are converted to a canonical
  934. # form.
  935. download-po:
  936. dir=$$(mktemp -d); \
  937. git clone --depth 1 "$(WEBLATE_REPO)" "$$dir/translations"; \
  938. for domain in po/doc po/guix po/packages; do \
  939. for po in "$$dir/translations/$$domain"/*.po; do \
  940. translated=$$(LANG=en_US.UTF-8 msgfmt --statistics "$$po" 2>&1 | cut -f1 -d' '); \
  941. target=$$(basename "$$po"); \
  942. target="$$domain/$$target"; \
  943. if msgfmt -c "$$po" && [ "$$translated" != "0" ]; then \
  944. msgfilter --no-wrap -i "$$po" cat > "$$po".tmp; \
  945. mv "$$po".tmp "$$target"; \
  946. echo "copied $$target."; \
  947. else \
  948. echo "WARN: $$target ($$translated translated messages) was not added/updated."; \
  949. fi; \
  950. done; \
  951. done; \
  952. rm -rf "$$dir"
  953. .PHONY: download-po
  954. ## -------------- ##
  955. ## Silent rules. ##
  956. ## -------------- ##
  957. AM_V_DL = $(AM_V_DL_$(V))
  958. AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY))
  959. AM_V_DL_0 = @echo " DL " $@;
  960. AM_V_DOT = $(AM_V_DOT_$(V))
  961. AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY))
  962. AM_V_DOT_0 = @echo " DOT " $@;
  963. AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
  964. AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
  965. AM_V_HELP2MAN_0 = @echo " HELP2MAN" $@;
  966. AM_V_PO4A = $(AM_V_PO4A_$(V))
  967. AM_V_PO4A_ = $(AM_V_PO4A_$(AM_DEFAULT_VERBOSITY))
  968. AM_V_PO4A_0 = @echo " PO4A" $@;
  969. AM_V_POXREF = $(AM_V_POXREF_$(V))
  970. AM_V_POXREF_ = $(AM_V_POXREF_$(AM_DEFAULT_VERBOSITY))
  971. AM_V_POXREF_0 = @echo " POXREF" $@;