You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

916 lines
29 KiB

  1. # GNU Guix --- Functional package management for GNU
  2. # Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 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 Jan Nieuwenhuizen <janneke@gnu.org>
  11. # Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
  12. # Copyright © 2018 ng0 <ng0@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. #
  18. # This file is part of GNU Guix.
  19. #
  20. # GNU Guix is free software; you can redistribute it and/or modify it
  21. # under the terms of the GNU General Public License as published by
  22. # the Free Software Foundation; either version 3 of the License, or (at
  23. # your option) any later version.
  24. #
  25. # GNU Guix is distributed in the hope that it will be useful, but
  26. # WITHOUT ANY WARRANTY; without even the implied warranty of
  27. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  28. # GNU General Public License for more details.
  29. #
  30. # You should have received a copy of the GNU General Public License
  31. # along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  32. MSGMERGE_UPDATE = @MSGMERGE@ --update
  33. bin_SCRIPTS = scripts/guix
  34. # Handle substitution of fully-expanded Autoconf variables.
  35. do_subst = $(SED) \
  36. -e 's,[@]GUILE[@],$(GUILE),g' \
  37. -e 's,[@]guilemoduledir[@],$(guilemoduledir),g' \
  38. -e 's,[@]guileobjectdir[@],$(guileobjectdir),g' \
  39. -e 's,[@]localedir[@],$(localedir),g'
  40. scripts/guix: scripts/guix.in Makefile
  41. $(AM_V_at)rm -f $@ $@-t
  42. $(AM_V_at)$(MKDIR_P) "$(@D)"
  43. $(AM_V_GEN)$(do_subst) < "$(srcdir)/$@.in" > "$@-t"
  44. $(AM_V_at)chmod a+x,a-w "$@-t" && mv -f "$@-t" "$@"
  45. nodist_noinst_SCRIPTS = \
  46. pre-inst-env \
  47. test-env
  48. # Modules that are not compiled but are installed nonetheless, such as
  49. # build-side modules with unusual dependencies.
  50. MODULES_NOT_COMPILED = \
  51. guix/build/po.scm \
  52. guix/man-db.scm
  53. include gnu/local.mk
  54. include po/doc/local.mk
  55. MODULES = \
  56. guix/base16.scm \
  57. guix/base32.scm \
  58. guix/base64.scm \
  59. guix/ci.scm \
  60. guix/cpio.scm \
  61. guix/deprecation.scm \
  62. guix/docker.scm \
  63. guix/json.scm \
  64. guix/records.scm \
  65. guix/pki.scm \
  66. guix/progress.scm \
  67. guix/combinators.scm \
  68. guix/memoization.scm \
  69. guix/utils.scm \
  70. guix/sets.scm \
  71. guix/modules.scm \
  72. guix/download.scm \
  73. guix/discovery.scm \
  74. guix/bzr-download.scm \
  75. guix/git-download.scm \
  76. guix/hg-download.scm \
  77. guix/swh.scm \
  78. guix/monads.scm \
  79. guix/monad-repl.scm \
  80. guix/gexp.scm \
  81. guix/profiles.scm \
  82. guix/serialization.scm \
  83. guix/nar.scm \
  84. guix/derivations.scm \
  85. guix/grafts.scm \
  86. guix/repl.scm \
  87. guix/inferior.scm \
  88. guix/describe.scm \
  89. guix/channels.scm \
  90. guix/gnu-maintenance.scm \
  91. guix/self.scm \
  92. guix/upstream.scm \
  93. guix/licenses.scm \
  94. guix/lint.scm \
  95. guix/glob.scm \
  96. guix/git.scm \
  97. guix/graph.scm \
  98. guix/cache.scm \
  99. guix/cve.scm \
  100. guix/workers.scm \
  101. guix/zlib.scm \
  102. guix/lzlib.scm \
  103. guix/build-system.scm \
  104. guix/build-system/android-ndk.scm \
  105. guix/build-system/ant.scm \
  106. guix/build-system/cargo.scm \
  107. guix/build-system/clojure.scm \
  108. guix/build-system/cmake.scm \
  109. guix/build-system/dub.scm \
  110. guix/build-system/dune.scm \
  111. guix/build-system/emacs.scm \
  112. guix/build-system/font.scm \
  113. guix/build-system/go.scm \
  114. guix/build-system/meson.scm \
  115. guix/build-system/minify.scm \
  116. guix/build-system/asdf.scm \
  117. guix/build-system/glib-or-gtk.scm \
  118. guix/build-system/gnu.scm \
  119. guix/build-system/guile.scm \
  120. guix/build-system/haskell.scm \
  121. guix/build-system/julia.scm \
  122. guix/build-system/linux-module.scm \
  123. guix/build-system/node.scm \
  124. guix/build-system/perl.scm \
  125. guix/build-system/python.scm \
  126. guix/build-system/ocaml.scm \
  127. guix/build-system/waf.scm \
  128. guix/build-system/r.scm \
  129. guix/build-system/rakudo.scm \
  130. guix/build-system/ruby.scm \
  131. guix/build-system/scons.scm \
  132. guix/build-system/texlive.scm \
  133. guix/build-system/trivial.scm \
  134. guix/ftp-client.scm \
  135. guix/http-client.scm \
  136. guix/gnupg.scm \
  137. guix/elf.scm \
  138. guix/profiling.scm \
  139. guix/store.scm \
  140. guix/cvs-download.scm \
  141. guix/svn-download.scm \
  142. guix/colors.scm \
  143. guix/i18n.scm \
  144. guix/diagnostics.scm \
  145. guix/ui.scm \
  146. guix/status.scm \
  147. guix/build/android-ndk-build-system.scm \
  148. guix/build/ant-build-system.scm \
  149. guix/build/download.scm \
  150. guix/build/download-nar.scm \
  151. guix/build/cargo-build-system.scm \
  152. guix/build/cargo-utils.scm \
  153. guix/build/cmake-build-system.scm \
  154. guix/build/dub-build-system.scm \
  155. guix/build/dune-build-system.scm \
  156. guix/build/emacs-build-system.scm \
  157. guix/build/meson-build-system.scm \
  158. guix/build/minify-build-system.scm \
  159. guix/build/font-build-system.scm \
  160. guix/build/go-build-system.scm \
  161. guix/build/asdf-build-system.scm \
  162. guix/build/bzr.scm \
  163. guix/build/git.scm \
  164. guix/build/hg.scm \
  165. guix/build/glib-or-gtk-build-system.scm \
  166. guix/build/gnu-build-system.scm \
  167. guix/build/gnu-dist.scm \
  168. guix/build/guile-build-system.scm \
  169. guix/build/node-build-system.scm \
  170. guix/build/perl-build-system.scm \
  171. guix/build/python-build-system.scm \
  172. guix/build/ocaml-build-system.scm \
  173. guix/build/r-build-system.scm \
  174. guix/build/rakudo-build-system.scm \
  175. guix/build/ruby-build-system.scm \
  176. guix/build/scons-build-system.scm \
  177. guix/build/texlive-build-system.scm \
  178. guix/build/waf-build-system.scm \
  179. guix/build/haskell-build-system.scm \
  180. guix/build/julia-build-system.scm \
  181. guix/build/linux-module-build-system.scm \
  182. guix/build/store-copy.scm \
  183. guix/build/json.scm \
  184. guix/build/utils.scm \
  185. guix/build/union.scm \
  186. guix/build/profiles.scm \
  187. guix/build/compile.scm \
  188. guix/build/rpath.scm \
  189. guix/build/cvs.scm \
  190. guix/build/svn.scm \
  191. guix/build/syscalls.scm \
  192. guix/build/gremlin.scm \
  193. guix/build/debug-link.scm \
  194. guix/build/clojure-build-system.scm \
  195. guix/build/clojure-utils.scm \
  196. guix/build/emacs-utils.scm \
  197. guix/build/java-utils.scm \
  198. guix/build/lisp-utils.scm \
  199. guix/build/graft.scm \
  200. guix/build/bournish.scm \
  201. guix/build/qt-utils.scm \
  202. guix/build/make-bootstrap.scm \
  203. guix/search-paths.scm \
  204. guix/packages.scm \
  205. guix/import/cabal.scm \
  206. guix/import/cpan.scm \
  207. guix/import/cran.scm \
  208. guix/import/crate.scm \
  209. guix/import/elpa.scm \
  210. guix/import/gem.scm \
  211. guix/import/github.scm \
  212. guix/import/gnome.scm \
  213. guix/import/gnu.scm \
  214. guix/import/hackage.scm \
  215. guix/import/json.scm \
  216. guix/import/kde.scm \
  217. guix/import/launchpad.scm \
  218. guix/import/opam.scm \
  219. guix/import/print.scm \
  220. guix/import/pypi.scm \
  221. guix/import/snix.scm \
  222. guix/import/stackage.scm \
  223. guix/import/texlive.scm \
  224. guix/import/utils.scm \
  225. guix/scripts.scm \
  226. guix/scripts/download.scm \
  227. guix/scripts/perform-download.scm \
  228. guix/scripts/build.scm \
  229. guix/scripts/archive.scm \
  230. guix/scripts/import.scm \
  231. guix/scripts/package.scm \
  232. guix/scripts/install.scm \
  233. guix/scripts/remove.scm \
  234. guix/scripts/upgrade.scm \
  235. guix/scripts/search.scm \
  236. guix/scripts/gc.scm \
  237. guix/scripts/hash.scm \
  238. guix/scripts/pack.scm \
  239. guix/scripts/pull.scm \
  240. guix/scripts/processes.scm \
  241. guix/scripts/substitute.scm \
  242. guix/scripts/authenticate.scm \
  243. guix/scripts/refresh.scm \
  244. guix/scripts/repl.scm \
  245. guix/scripts/describe.scm \
  246. guix/scripts/system.scm \
  247. guix/scripts/system/search.scm \
  248. guix/scripts/system/reconfigure.scm \
  249. guix/scripts/lint.scm \
  250. guix/scripts/challenge.scm \
  251. guix/scripts/import/crate.scm \
  252. guix/scripts/import/cran.scm \
  253. guix/scripts/import/elpa.scm \
  254. guix/scripts/import/gem.scm \
  255. guix/scripts/import/gnu.scm \
  256. guix/scripts/import/hackage.scm \
  257. guix/scripts/import/json.scm \
  258. guix/scripts/import/nix.scm \
  259. guix/scripts/import/opam.scm \
  260. guix/scripts/import/pypi.scm \
  261. guix/scripts/import/stackage.scm \
  262. guix/scripts/import/texlive.scm \
  263. guix/scripts/environment.scm \
  264. guix/scripts/publish.scm \
  265. guix/scripts/edit.scm \
  266. guix/scripts/size.scm \
  267. guix/scripts/graph.scm \
  268. guix/scripts/weather.scm \
  269. guix/scripts/container.scm \
  270. guix/scripts/container/exec.scm \
  271. guix/scripts/deploy.scm \
  272. guix.scm \
  273. $(GNU_SYSTEM_MODULES)
  274. if HAVE_GUILE_SSH
  275. MODULES += \
  276. guix/ssh.scm \
  277. guix/remote.scm \
  278. guix/scripts/copy.scm \
  279. guix/store/ssh.scm
  280. endif HAVE_GUILE_SSH
  281. if BUILD_DAEMON_OFFLOAD
  282. MODULES += \
  283. guix/scripts/offload.scm
  284. endif BUILD_DAEMON_OFFLOAD
  285. # Scheme implementation of the build daemon and related functionality.
  286. STORE_MODULES = \
  287. guix/store/database.scm \
  288. guix/store/deduplication.scm \
  289. guix/store/roots.scm
  290. MODULES += $(STORE_MODULES)
  291. # Internal modules with test suite support.
  292. dist_noinst_DATA = guix/tests.scm guix/tests/http.scm
  293. # Auxiliary files for packages.
  294. AUX_FILES = \
  295. gnu/packages/aux-files/chromium/master-preferences.json \
  296. gnu/packages/aux-files/emacs/guix-emacs.el \
  297. gnu/packages/aux-files/linux-libre/5.2-arm.conf \
  298. gnu/packages/aux-files/linux-libre/5.2-arm-veyron.conf \
  299. gnu/packages/aux-files/linux-libre/5.2-arm64.conf \
  300. gnu/packages/aux-files/linux-libre/5.2-i686.conf \
  301. gnu/packages/aux-files/linux-libre/5.2-x86_64.conf \
  302. gnu/packages/aux-files/linux-libre/4.19-arm.conf \
  303. gnu/packages/aux-files/linux-libre/4.19-arm64.conf \
  304. gnu/packages/aux-files/linux-libre/4.19-i686.conf \
  305. gnu/packages/aux-files/linux-libre/4.19-x86_64.conf \
  306. gnu/packages/aux-files/linux-libre/4.14-arm.conf \
  307. gnu/packages/aux-files/linux-libre/4.14-i686.conf \
  308. gnu/packages/aux-files/linux-libre/4.14-x86_64.conf \
  309. gnu/packages/aux-files/linux-libre/4.9-i686.conf \
  310. gnu/packages/aux-files/linux-libre/4.9-x86_64.conf \
  311. gnu/packages/aux-files/linux-libre/4.4-i686.conf \
  312. gnu/packages/aux-files/linux-libre/4.4-x86_64.conf \
  313. gnu/packages/aux-files/run-in-namespace.c
  314. # Templates, examples.
  315. EXAMPLES = \
  316. gnu/system/examples/asus-c201.tmpl \
  317. gnu/system/examples/bare-bones.tmpl \
  318. gnu/system/examples/beaglebone-black.tmpl \
  319. gnu/system/examples/desktop.tmpl \
  320. gnu/system/examples/lightweight-desktop.tmpl \
  321. gnu/system/examples/docker-image.tmpl \
  322. gnu/system/examples/vm-image.tmpl
  323. GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go $(dist_noinst_DATA:%.scm=%.go)
  324. nobase_dist_guilemodule_DATA = \
  325. guix/store/schema.sql \
  326. $(MODULES) $(MODULES_NOT_COMPILED) $(AUX_FILES) $(EXAMPLES) \
  327. $(MISC_DISTRO_FILES)
  328. nobase_nodist_guilemodule_DATA = guix/config.scm
  329. nobase_nodist_guileobject_DATA = $(GOBJECTS)
  330. # Handy way to remove the .go files without removing all the rest.
  331. clean-go:
  332. -$(RM) -f $(GOBJECTS)
  333. @find . -path ./test-tmp -prune -o -name '*.go' -print | \
  334. if test -t 1; then \
  335. xargs -r echo -e "\033[31mwarning:\033[0m stray .go files:"; \
  336. else \
  337. xargs -r echo "warning: stray .go files:"; \
  338. fi
  339. # Test extensions; has to be unconditional.
  340. TEST_EXTENSIONS = .scm .sh
  341. if CAN_RUN_TESTS
  342. SCM_TESTS = \
  343. tests/accounts.scm \
  344. tests/base16.scm \
  345. tests/base32.scm \
  346. tests/base64.scm \
  347. tests/bournish.scm \
  348. tests/builders.scm \
  349. tests/build-utils.scm \
  350. tests/cache.scm \
  351. tests/challenge.scm \
  352. tests/channels.scm \
  353. tests/combinators.scm \
  354. tests/containers.scm \
  355. tests/cpan.scm \
  356. tests/cpio.scm \
  357. tests/cran.scm \
  358. tests/crate.scm \
  359. tests/cve.scm \
  360. tests/debug-link.scm \
  361. tests/derivations.scm \
  362. tests/discovery.scm \
  363. tests/elpa.scm \
  364. tests/file-systems.scm \
  365. tests/gem.scm \
  366. tests/gexp.scm \
  367. tests/glob.scm \
  368. tests/gnu-maintenance.scm \
  369. tests/grafts.scm \
  370. tests/graph.scm \
  371. tests/gremlin.scm \
  372. tests/hackage.scm \
  373. tests/import-utils.scm \
  374. tests/inferior.scm \
  375. tests/lint.scm \
  376. tests/lzlib.scm \
  377. tests/modules.scm \
  378. tests/monads.scm \
  379. tests/nar.scm \
  380. tests/networking.scm \
  381. tests/opam.scm \
  382. tests/packages.scm \
  383. tests/pack.scm \
  384. tests/pki.scm \
  385. tests/print.scm \
  386. tests/processes.scm \
  387. tests/profiles.scm \
  388. tests/publish.scm \
  389. tests/pypi.scm \
  390. tests/records.scm \
  391. tests/scripts.scm \
  392. tests/scripts-build.scm \
  393. tests/search-paths.scm \
  394. tests/services.scm \
  395. tests/sets.scm \
  396. tests/size.scm \
  397. tests/snix.scm \
  398. tests/status.scm \
  399. tests/store-database.scm \
  400. tests/store-deduplication.scm \
  401. tests/store-roots.scm \
  402. tests/store.scm \
  403. tests/substitute.scm \
  404. tests/swh.scm \
  405. tests/syscalls.scm \
  406. tests/system.scm \
  407. tests/texlive.scm \
  408. tests/ui.scm \
  409. tests/union.scm \
  410. tests/upstream.scm \
  411. tests/utils.scm \
  412. tests/uuid.scm \
  413. tests/workers.scm \
  414. tests/zlib.scm
  415. SH_TESTS = \
  416. tests/guix-build.sh \
  417. tests/guix-build-branch.sh \
  418. tests/guix-download.sh \
  419. tests/guix-gc.sh \
  420. tests/guix-hash.sh \
  421. tests/guix-pack.sh \
  422. tests/guix-pack-localstatedir.sh \
  423. tests/guix-pack-relocatable.sh \
  424. tests/guix-package.sh \
  425. tests/guix-package-aliases.sh \
  426. tests/guix-package-net.sh \
  427. tests/guix-system.sh \
  428. tests/guix-archive.sh \
  429. tests/guix-authenticate.sh \
  430. tests/guix-environment.sh \
  431. tests/guix-environment-container.sh \
  432. tests/guix-graph.sh \
  433. tests/guix-describe.sh \
  434. tests/guix-lint.sh
  435. TESTS = $(SCM_TESTS) $(SH_TESTS)
  436. AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
  437. SCM_LOG_DRIVER = \
  438. $(top_builddir)/test-env --quiet-stderr \
  439. $(GUILE) --no-auto-compile -e main \
  440. $(top_srcdir)/build-aux/test-driver.scm
  441. AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
  442. SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
  443. AM_SH_LOG_FLAGS = -x -e
  444. # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
  445. # could end up removing files from the store while they are being used by
  446. # other instances of the daemon.
  447. tests/guix-gc.log: \
  448. $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
  449. $(SCM_TESTS:%.scm=%.log)
  450. else !CAN_RUN_TESTS
  451. TESTS =
  452. SH_TESTS =
  453. SCM_TESTS =
  454. # Automake always generates a 'check' target, so better not override it.
  455. check-local:
  456. @echo
  457. @echo "Cannot run tests because file name limits would be exceeded." >&2
  458. @echo "Look for 'length' in the 'config.log' file for details." >&2
  459. @echo
  460. @exit 1
  461. endif !CAN_RUN_TESTS
  462. check-system: $(GOBJECTS)
  463. $(AM_V_at)$(top_builddir)/pre-inst-env \
  464. $(GUILE) --no-auto-compile \
  465. -e '(@@ (run-system-tests) run-system-tests)' \
  466. $(top_srcdir)/build-aux/run-system-tests.scm
  467. # Public keys used to sign substitutes.
  468. dist_pkgdata_DATA = \
  469. etc/substitutes/berlin.guixsd.org.pub \
  470. etc/substitutes/ci.guix.gnu.org.pub \
  471. etc/substitutes/ci.guix.info.pub
  472. # Bash completion file.
  473. dist_bashcompletion_DATA = etc/completion/bash/guix \
  474. etc/completion/bash/guix-daemon
  475. # Zsh completion file.
  476. dist_zshcompletion_DATA = etc/completion/zsh/_guix
  477. # Fish completion file.
  478. dist_fishcompletion_DATA = etc/completion/fish/guix.fish
  479. # SELinux policy
  480. dist_selinux_policy_DATA = etc/guix-daemon.cil
  481. EXTRA_DIST += \
  482. HACKING \
  483. ROADMAP \
  484. TODO \
  485. CODE-OF-CONDUCT \
  486. .dir-locals.el \
  487. scripts/guix.in \
  488. etc/guix-install.sh \
  489. build-aux/build-self.scm \
  490. build-aux/compile-all.scm \
  491. build-aux/hydra/evaluate.scm \
  492. build-aux/hydra/gnu-system.scm \
  493. build-aux/hydra/guix.scm \
  494. build-aux/hydra/guix-modular.scm \
  495. build-aux/cuirass/gnu-system.scm \
  496. build-aux/cuirass/guix-modular.scm \
  497. build-aux/cuirass/hydra-to-cuirass.scm \
  498. build-aux/check-available-binaries.scm \
  499. build-aux/check-final-inputs-self-contained.scm \
  500. build-aux/compile-as-derivation.scm \
  501. build-aux/generate-authors.scm \
  502. build-aux/test-driver.scm \
  503. build-aux/update-guix-package.scm \
  504. build-aux/update-NEWS.scm \
  505. build-aux/run-system-tests.scm \
  506. d3.v3.js \
  507. graph.js \
  508. tests/test.drv \
  509. tests/signing-key.pub \
  510. tests/signing-key.sec \
  511. tests/cve-sample.xml \
  512. build-aux/config.rpath \
  513. bootstrap \
  514. doc/build.scm \
  515. $(TESTS)
  516. if !BUILD_DAEMON_OFFLOAD
  517. EXTRA_DIST += \
  518. guix/scripts/offload.scm
  519. endif !BUILD_DAEMON_OFFLOAD
  520. CLEANFILES = \
  521. $(bin_SCRIPTS) \
  522. $(GOBJECTS) \
  523. $(SCM_TESTS:tests/%.scm=%.log)
  524. # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
  525. # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
  526. # there that are newer than the local .scm files (for instance because the
  527. # user ran 'make install' recently). When that happens, we end up loading
  528. # those previously-installed .go files, which may be stale, thereby breaking
  529. # the whole thing. Likewise, set 'XDG_CACHE_HOME' to avoid loading possibly
  530. # stale files from ~/.cache/guile/ccache.
  531. %.go: make-go ; @:
  532. make-go: $(MODULES) guix/config.scm $(dist_noinst_DATA)
  533. $(AM_V_at)echo "Compiling Scheme modules..." ; \
  534. unset GUILE_LOAD_COMPILED_PATH ; \
  535. XDG_CACHE_HOME=/nowhere \
  536. host=$(host) srcdir="$(top_srcdir)" \
  537. $(top_builddir)/pre-inst-env \
  538. $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \
  539. --no-auto-compile \
  540. -s "$(top_srcdir)"/build-aux/compile-all.scm $^
  541. SUFFIXES = .go
  542. # Make sure source files are installed first, so that the mtime of
  543. # installed compiled files is greater than that of installed source
  544. # files. See
  545. # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
  546. # for details.
  547. guix_install_go_files = install-nobase_nodist_guileobjectDATA
  548. $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
  549. # The above trick doesn't work for 'config.go' because both 'config.scm' and
  550. # 'config.go' are listed in $(nobase_nodist_guileobject_DATA). Thus, give it
  551. # special treatment.
  552. install-data-hook: set-bootstrap-executable-permissions
  553. touch "$(DESTDIR)$(guileobjectdir)/guix/config.go"
  554. # Assuming Guix is already installed and the daemon is up and running, this
  555. # rule builds from $(srcdir), creating and building derivations.
  556. as-derivation:
  557. $(AM_V_at)echo "Building Guix in Guix..." ; \
  558. $(GUILE) --no-auto-compile \
  559. "$(top_srcdir)/build-aux/compile-as-derivation.scm" \
  560. "$(abs_top_srcdir)"
  561. SUBDIRS = po/guix po/packages
  562. BUILT_SOURCES =
  563. include doc/local.mk
  564. if BUILD_DAEMON
  565. include nix/local.mk
  566. endif BUILD_DAEMON
  567. ACLOCAL_AMFLAGS = -I m4
  568. # Pass an explicit '--localstatedir' so that configure does not error out if
  569. # it finds an existing installation with a different localstatedir. Inherit
  570. # 'ac_cv_guix_test_root' so that "make check" in $(distdir) does not have to
  571. # repopulate the whole store, and to make sure $(GUIX_TEST_ROOT) is short
  572. # enough for shebangs.
  573. AM_DISTCHECK_CONFIGURE_FLAGS = \
  574. --localstatedir="$$dc_install_base/var" \
  575. --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
  576. --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
  577. --with-nix-prefix="$(NIX_PREFIX)" \
  578. --enable-daemon \
  579. ac_cv_guix_test_root="$(GUIX_TEST_ROOT)"
  580. # The self-contained tarball.
  581. guix-binary.%.tar.xz:
  582. $(AM_V_GEN)GUIX_PACKAGE_PATH= \
  583. tarball=`$(top_builddir)/pre-inst-env guix pack -K -C xz \
  584. -s "$*" --localstatedir --profile-name=current-guix guix` ; \
  585. cp "$$tarball" "$@.tmp" ; mv "$@.tmp" "$@"
  586. dist-hook: gen-ChangeLog gen-AUTHORS gen-tarball-version
  587. dist-hook: assert-no-store-file-names
  588. dist-hook: doc-po-update
  589. distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
  590. EXTRA_DIST += $(top_srcdir)/.version
  591. BUILT_SOURCES += $(top_srcdir)/.version
  592. $(top_srcdir)/.version:
  593. echo $(VERSION) > "$@-t" && mv "$@-t" "$@"
  594. gen-tarball-version:
  595. echo $(VERSION) > "$(distdir)/.tarball-version"
  596. gen-ChangeLog:
  597. $(AM_V_GEN)if test -d .git; then \
  598. $(top_srcdir)/build-aux/gitlog-to-changelog \
  599. > $(distdir)/ChangeLog.tmp; \
  600. rm -f $(distdir)/ChangeLog; \
  601. mv $(distdir)/ChangeLog.tmp $(distdir)/ChangeLog; \
  602. fi
  603. gen-AUTHORS:
  604. $(AM_V_GEN)if test -d .git; then \
  605. rm -f "$(distdir)/AUTHORS"; \
  606. $(top_builddir)/pre-inst-env "$(GUILE)" \
  607. "$(top_srcdir)/build-aux/generate-authors.scm" \
  608. "$(top_srcdir)" "$(distdir)/AUTHORS"; \
  609. fi
  610. #
  611. # Release management.
  612. #
  613. releasedir = release-$(PACKAGE_VERSION)
  614. PACKAGE_FULL_TARNAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
  615. # List of source tarballs produced. This must be kept in sync with the
  616. # 'dist-' options of 'AM_INIT_AUTOMAKE' in 'configure.ac'.
  617. SOURCE_TARBALLS = \
  618. $(foreach ext,tar.gz,$(PACKAGE_FULL_TARNAME).$(ext))
  619. # Systems supported by Guix.
  620. SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux armhf-linux aarch64-linux
  621. # Guix binary tarballs.
  622. BINARY_TARBALLS = \
  623. $(foreach system,$(SUPPORTED_SYSTEMS),guix-binary.$(system).tar.xz)
  624. # Systems supported by Guix System.
  625. GUIX_SYSTEM_SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux
  626. # Systems for which we build Guix VMs.
  627. GUIX_SYSTEM_VM_SYSTEMS ?= x86_64-linux
  628. # Prefix of the Guix installation image file name.
  629. GUIX_SYSTEM_IMAGE_BASE = guix-system-install-$(PACKAGE_VERSION)
  630. # Prefix of the Guix VM image file name.
  631. GUIX_SYSTEM_VM_IMAGE_BASE = guix-system-vm-image-$(PACKAGE_VERSION)
  632. # Flags for 'guix system vm-image'. By default create a VM image that appears
  633. # to have a 20G hard disk.
  634. GUIX_SYSTEM_VM_IMAGE_FLAGS ?= --image-size=30G
  635. # Return the sequence of '-s' flags for the given systems.
  636. system_flags = $(foreach system,$(1),-s $(system))
  637. # The release process works in several phases:
  638. #
  639. # 0. We assume the developer created a 'vX.Y' tag.
  640. # 1. Build the source tarball.
  641. # 2. Update the 'guix' package so that it corresponds to the 'vX.Y' tag.
  642. # 3. Build the binary tarballs for that 'guix' package.
  643. # 4. Update the 'guix' package again.
  644. # 5. Build the installation images. The images will run 'guix'
  645. # corresponding to 'vX.Y' + 1 commit, and they will install 'vX.Y'.
  646. #
  647. # This 'release' target takes care of everything and copies the resulting
  648. # files to $(releasedir).
  649. #
  650. # XXX: Depend on 'dist' rather than 'distcheck' to work around the Gettext
  651. # issue described at <https://savannah.gnu.org/bugs/index.php?51027>.
  652. release: dist
  653. cd po; git checkout .
  654. @if ! git diff-index --quiet HEAD; then \
  655. echo "There are uncommitted changes; stopping." >&2 ; \
  656. exit 1 ; \
  657. fi
  658. $(MKDIR_P) "$(releasedir)"
  659. rm -f "$(releasedir)"/*
  660. mv $(SOURCE_TARBALLS) "$(releasedir)"
  661. $(top_builddir)/pre-inst-env "$(GUILE)" \
  662. $(top_srcdir)/build-aux/update-guix-package.scm \
  663. "`git rev-parse HEAD`" "$(PACKAGE_VERSION)"
  664. git add $(top_srcdir)/gnu/packages/package-management.scm
  665. git commit -m "gnu: guix: Update to $(PACKAGE_VERSION)."
  666. $(top_builddir)/pre-inst-env guix build guix \
  667. $(call system_flags,$(SUPPORTED_SYSTEMS)) \
  668. -v1 --no-grafts -K
  669. rm -f $(BINARY_TARBALLS)
  670. $(MAKE) $(BINARY_TARBALLS)
  671. for system in $(SUPPORTED_SYSTEMS) ; do \
  672. mv "guix-binary.$$system.tar.xz" \
  673. "$(releasedir)/guix-binary-$(PACKAGE_VERSION).$$system.tar.xz" ; \
  674. done
  675. $(top_builddir)/pre-inst-env "$(GUILE)" \
  676. $(top_srcdir)/build-aux/update-guix-package.scm \
  677. "`git rev-parse HEAD`"
  678. git add $(top_srcdir)/gnu/packages/package-management.scm
  679. git commit -m "gnu: guix: Update to `git rev-parse HEAD | cut -c1-7`."
  680. $(top_builddir)/pre-inst-env guix build guix \
  681. $(call system_flags,$(GUIX_SYSTEM_SUPPORTED_SYSTEMS)) \
  682. -v1 --no-grafts -K
  683. for system in $(GUIX_SYSTEM_SUPPORTED_SYSTEMS) ; do \
  684. image=`$(top_builddir)/pre-inst-env \
  685. guix system disk-image \
  686. --file-system-type=iso9660 \
  687. --system=$$system \
  688. gnu/system/install.scm` ; \
  689. if [ ! -f "$$image" ] ; then \
  690. echo "failed to produced Guix installation image for $$system" >&2 ; \
  691. exit 1 ; \
  692. fi ; \
  693. xz < "$$image" > "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.xz.tmp" ; \
  694. mv "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.xz.tmp" \
  695. "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.xz" ; \
  696. done
  697. for system in $(GUIX_SYSTEM_VM_SYSTEMS) ; do \
  698. image=`$(top_builddir)/pre-inst-env \
  699. guix system vm-image $(GUIX_SYSTEM_VM_IMAGE_FLAGS) \
  700. --system=$$system \
  701. gnu/system/examples/vm-image.tmpl` ; \
  702. if [ ! -f "$$image" ] ; then \
  703. echo "failed to produced Guix VM image for $$system" >&2 ; \
  704. exit 1 ; \
  705. fi ; \
  706. xz < "$$image" > "$(releasedir)/$(GUIX_SYSTEM_VM_IMAGE_BASE).$$system.xz.tmp" ; \
  707. mv "$(releasedir)/$(GUIX_SYSTEM_VM_IMAGE_BASE).$$system.xz.tmp" \
  708. "$(releasedir)/$(GUIX_SYSTEM_VM_IMAGE_BASE).$$system.xz" ; \
  709. done
  710. @echo
  711. @echo "Congratulations! All the release files are now in $(releasedir)."
  712. @echo
  713. update-guix-package:
  714. git rev-parse HEAD
  715. $(top_builddir)/pre-inst-env "$(GUILE)" \
  716. $(top_srcdir)/build-aux/update-guix-package.scm \
  717. "`git rev-parse HEAD`"
  718. # Location of a checkout of <git://git.savannah.gnu.org/guix/maintenance.git>.
  719. # Package data from this checkout is used by 'update-NEWS.scm'.
  720. GUIX_MAINTENANCE_DIRECTORY ?= $(top_srcdir)/../guix-maintenance
  721. update-NEWS: $(GOBJECTS)
  722. $(top_builddir)/pre-inst-env "$(GUILE)" \
  723. $(top_srcdir)/build-aux/update-NEWS.scm \
  724. $(top_srcdir)/NEWS "$(GUIX_MAINTENANCE_DIRECTORY)/data"
  725. # Make sure we're not shipping a file that embeds a local /gnu/store file name.
  726. assert-no-store-file-names:
  727. $(AM_V_at)if grep -r --exclude=*.texi --exclude=*.info \
  728. --exclude=*.info-[0-9] --exclude=*.dot \
  729. --exclude=*.eps --exclude-dir=bootstrap \
  730. --exclude=guix-manual.pot --exclude=guix-manual.*.po \
  731. --exclude=guix-cookbook.pot --exclude=guix-cookbook.*.po \
  732. --exclude=guix-prettify.el \
  733. --exclude=ChangeLog* \
  734. -E "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
  735. then \
  736. echo "error: store file names embedded in the distribution" >&2 ; \
  737. exit 1 ; \
  738. fi
  739. # Make sure important substitutes are available.
  740. assert-binaries-available: $(GOBJECTS)
  741. $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
  742. "$(top_srcdir)/build-aux/check-available-binaries.scm"
  743. # Make sure the final inputs don't refer to bootstrap tools.
  744. assert-final-inputs-self-contained: $(GOBJECTS)
  745. $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
  746. "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
  747. # Compute the Hydra jobs and write them in the target file.
  748. hydra-jobs.scm: $(GOBJECTS)
  749. $(AM_V_at)$(MKDIR_P) "`dirname "$@"`"
  750. $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)" \
  751. "$(top_srcdir)/build-aux/hydra/evaluate.scm" \
  752. "$(top_srcdir)/build-aux/hydra/gnu-system.scm" > "$@.tmp"
  753. $(AM_V_at)mv "$@.tmp" "$@"
  754. # Compute the Cuirass jobs and write them in the target file.
  755. cuirass-jobs.scm: $(GOBJECTS)
  756. $(AM_V_at)$(MKDIR_P) "`dirname "$@"`"
  757. $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)" \
  758. "$(top_srcdir)/build-aux/hydra/evaluate.scm" \
  759. "$(top_srcdir)/build-aux/cuirass/gnu-system.scm" \
  760. cuirass > "$@.tmp"
  761. $(AM_V_at)mv "$@.tmp" "$@"
  762. .PHONY: gen-ChangeLog gen-AUTHORS gen-tarball-version
  763. .PHONY: assert-no-store-file-names assert-binaries-available
  764. .PHONY: assert-final-inputs-self-contained
  765. .PHONY: clean-go make-go as-derivation
  766. .PHONY: update-guix-package update-NEWS release
  767. # Downloading up-to-date PO files.
  768. # make-download-po-rule DOMAIN DIRECTORY [FILE-NAME-PREFIX]
  769. define make-download-po-rule
  770. download-po.$(1):
  771. if [ -f "$(top_srcdir)/$(2)/LINGUAS" ]; then \
  772. LINGUAS="`grep -v '^[[:blank:]]*#' < $(top_srcdir)/$(2)/LINGUAS`" ; \
  773. else \
  774. LINGUAS="`(cd $(top_srcdir)/$(2); \
  775. for i in *.po; do echo $$$$i; done) | cut -d . -f 2`" ; \
  776. fi ; \
  777. for lang in $$$$LINGUAS; do \
  778. if wget -nv -O "$(top_srcdir)/$(2)/$(3)$$$$lang.po.tmp" \
  779. "https://translationproject.org/latest/$(1)/$$$$lang.po" ; \
  780. then \
  781. mv "$(top_srcdir)/$(2)/$(3)$$$$lang.po"{.tmp,} ; \
  782. else \
  783. rm "$(top_srcdir)/$(2)/$(3)$$$$lang.po.tmp" ; \
  784. fi ; \
  785. done
  786. .PHONY: download-po.$(1)
  787. endef
  788. $(eval $(call make-download-po-rule,guix,po/guix))
  789. $(eval $(call make-download-po-rule,guix-packages,po/packages))
  790. $(eval $(call make-download-po-rule,guix-manual,po/doc,guix-manual.))
  791. download-po: $(foreach domain,guix guix-packages guix-manual,download-po.$(domain))
  792. .PHONY: download-po
  793. ## -------------- ##
  794. ## Silent rules. ##
  795. ## -------------- ##
  796. AM_V_DL = $(AM_V_DL_$(V))
  797. AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY))
  798. AM_V_DL_0 = @echo " DL " $@;
  799. AM_V_DOT = $(AM_V_DOT_$(V))
  800. AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY))
  801. AM_V_DOT_0 = @echo " DOT " $@;
  802. AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
  803. AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
  804. AM_V_HELP2MAN_0 = @echo " HELP2MAN" $@;
  805. AM_V_PO4A = $(AM_V_PO4A_$(V))
  806. AM_V_PO4A_ = $(AM_V_PO4A_$(AM_DEFAULT_VERBOSITY))
  807. AM_V_PO4A_0 = @echo " PO4A" $@;
  808. AM_V_POXREF = $(AM_V_POXREF_$(V))
  809. AM_V_POXREF_ = $(AM_V_POXREF_$(AM_DEFAULT_VERBOSITY))
  810. AM_V_POXREF_0 = @echo " POXREF" $@;