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.
 
 
 
 
 
 

922 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/show.scm \
  237. guix/scripts/gc.scm \
  238. guix/scripts/hash.scm \
  239. guix/scripts/pack.scm \
  240. guix/scripts/pull.scm \
  241. guix/scripts/processes.scm \
  242. guix/scripts/substitute.scm \
  243. guix/scripts/authenticate.scm \
  244. guix/scripts/refresh.scm \
  245. guix/scripts/repl.scm \
  246. guix/scripts/describe.scm \
  247. guix/scripts/system.scm \
  248. guix/scripts/system/search.scm \
  249. guix/scripts/system/reconfigure.scm \
  250. guix/scripts/lint.scm \
  251. guix/scripts/challenge.scm \
  252. guix/scripts/import/crate.scm \
  253. guix/scripts/import/cran.scm \
  254. guix/scripts/import/elpa.scm \
  255. guix/scripts/import/gem.scm \
  256. guix/scripts/import/gnu.scm \
  257. guix/scripts/import/hackage.scm \
  258. guix/scripts/import/json.scm \
  259. guix/scripts/import/nix.scm \
  260. guix/scripts/import/opam.scm \
  261. guix/scripts/import/pypi.scm \
  262. guix/scripts/import/stackage.scm \
  263. guix/scripts/import/texlive.scm \
  264. guix/scripts/environment.scm \
  265. guix/scripts/publish.scm \
  266. guix/scripts/edit.scm \
  267. guix/scripts/size.scm \
  268. guix/scripts/graph.scm \
  269. guix/scripts/weather.scm \
  270. guix/scripts/container.scm \
  271. guix/scripts/container/exec.scm \
  272. guix/scripts/deploy.scm \
  273. guix.scm \
  274. $(GNU_SYSTEM_MODULES)
  275. if HAVE_GUILE_SSH
  276. MODULES += \
  277. guix/ssh.scm \
  278. guix/remote.scm \
  279. guix/scripts/copy.scm \
  280. guix/store/ssh.scm
  281. endif HAVE_GUILE_SSH
  282. if BUILD_DAEMON_OFFLOAD
  283. MODULES += \
  284. guix/scripts/offload.scm
  285. endif BUILD_DAEMON_OFFLOAD
  286. # Scheme implementation of the build daemon and related functionality.
  287. STORE_MODULES = \
  288. guix/store/database.scm \
  289. guix/store/deduplication.scm \
  290. guix/store/roots.scm
  291. MODULES += $(STORE_MODULES)
  292. # Internal modules with test suite support.
  293. dist_noinst_DATA = \
  294. guix/tests.scm \
  295. guix/tests/http.scm \
  296. guix/tests/git.scm
  297. # Auxiliary files for packages.
  298. AUX_FILES = \
  299. gnu/packages/aux-files/chromium/master-preferences.json \
  300. gnu/packages/aux-files/emacs/guix-emacs.el \
  301. gnu/packages/aux-files/linux-libre/5.2-arm.conf \
  302. gnu/packages/aux-files/linux-libre/5.2-arm-veyron.conf \
  303. gnu/packages/aux-files/linux-libre/5.2-arm64.conf \
  304. gnu/packages/aux-files/linux-libre/5.2-i686.conf \
  305. gnu/packages/aux-files/linux-libre/5.2-x86_64.conf \
  306. gnu/packages/aux-files/linux-libre/4.19-arm.conf \
  307. gnu/packages/aux-files/linux-libre/4.19-arm64.conf \
  308. gnu/packages/aux-files/linux-libre/4.19-i686.conf \
  309. gnu/packages/aux-files/linux-libre/4.19-x86_64.conf \
  310. gnu/packages/aux-files/linux-libre/4.14-arm.conf \
  311. gnu/packages/aux-files/linux-libre/4.14-i686.conf \
  312. gnu/packages/aux-files/linux-libre/4.14-x86_64.conf \
  313. gnu/packages/aux-files/linux-libre/4.9-i686.conf \
  314. gnu/packages/aux-files/linux-libre/4.9-x86_64.conf \
  315. gnu/packages/aux-files/linux-libre/4.4-i686.conf \
  316. gnu/packages/aux-files/linux-libre/4.4-x86_64.conf \
  317. gnu/packages/aux-files/run-in-namespace.c
  318. # Templates, examples.
  319. EXAMPLES = \
  320. gnu/system/examples/asus-c201.tmpl \
  321. gnu/system/examples/bare-bones.tmpl \
  322. gnu/system/examples/beaglebone-black.tmpl \
  323. gnu/system/examples/desktop.tmpl \
  324. gnu/system/examples/lightweight-desktop.tmpl \
  325. gnu/system/examples/docker-image.tmpl \
  326. gnu/system/examples/vm-image.tmpl
  327. GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go $(dist_noinst_DATA:%.scm=%.go)
  328. nobase_dist_guilemodule_DATA = \
  329. guix/store/schema.sql \
  330. $(MODULES) $(MODULES_NOT_COMPILED) $(AUX_FILES) $(EXAMPLES) \
  331. $(MISC_DISTRO_FILES)
  332. nobase_nodist_guilemodule_DATA = guix/config.scm
  333. nobase_nodist_guileobject_DATA = $(GOBJECTS)
  334. # Handy way to remove the .go files without removing all the rest.
  335. clean-go:
  336. -$(RM) -f $(GOBJECTS)
  337. @find . -path ./test-tmp -prune -o -name '*.go' -print | \
  338. if test -t 1; then \
  339. xargs -r echo -e "\033[31mwarning:\033[0m stray .go files:"; \
  340. else \
  341. xargs -r echo "warning: stray .go files:"; \
  342. fi
  343. # Test extensions; has to be unconditional.
  344. TEST_EXTENSIONS = .scm .sh
  345. if CAN_RUN_TESTS
  346. SCM_TESTS = \
  347. tests/accounts.scm \
  348. tests/base16.scm \
  349. tests/base32.scm \
  350. tests/base64.scm \
  351. tests/bournish.scm \
  352. tests/builders.scm \
  353. tests/build-utils.scm \
  354. tests/cache.scm \
  355. tests/challenge.scm \
  356. tests/channels.scm \
  357. tests/combinators.scm \
  358. tests/containers.scm \
  359. tests/cpan.scm \
  360. tests/cpio.scm \
  361. tests/cran.scm \
  362. tests/crate.scm \
  363. tests/cve.scm \
  364. tests/debug-link.scm \
  365. tests/derivations.scm \
  366. tests/discovery.scm \
  367. tests/elpa.scm \
  368. tests/file-systems.scm \
  369. tests/gem.scm \
  370. tests/gexp.scm \
  371. tests/git.scm \
  372. tests/glob.scm \
  373. tests/gnu-maintenance.scm \
  374. tests/grafts.scm \
  375. tests/graph.scm \
  376. tests/gremlin.scm \
  377. tests/hackage.scm \
  378. tests/import-utils.scm \
  379. tests/inferior.scm \
  380. tests/lint.scm \
  381. tests/lzlib.scm \
  382. tests/modules.scm \
  383. tests/monads.scm \
  384. tests/nar.scm \
  385. tests/networking.scm \
  386. tests/opam.scm \
  387. tests/packages.scm \
  388. tests/pack.scm \
  389. tests/pki.scm \
  390. tests/print.scm \
  391. tests/processes.scm \
  392. tests/profiles.scm \
  393. tests/publish.scm \
  394. tests/pypi.scm \
  395. tests/records.scm \
  396. tests/scripts.scm \
  397. tests/scripts-build.scm \
  398. tests/search-paths.scm \
  399. tests/services.scm \
  400. tests/sets.scm \
  401. tests/size.scm \
  402. tests/snix.scm \
  403. tests/status.scm \
  404. tests/store-database.scm \
  405. tests/store-deduplication.scm \
  406. tests/store-roots.scm \
  407. tests/store.scm \
  408. tests/substitute.scm \
  409. tests/swh.scm \
  410. tests/syscalls.scm \
  411. tests/system.scm \
  412. tests/texlive.scm \
  413. tests/ui.scm \
  414. tests/union.scm \
  415. tests/upstream.scm \
  416. tests/utils.scm \
  417. tests/uuid.scm \
  418. tests/workers.scm \
  419. tests/zlib.scm
  420. SH_TESTS = \
  421. tests/guix-build.sh \
  422. tests/guix-build-branch.sh \
  423. tests/guix-download.sh \
  424. tests/guix-gc.sh \
  425. tests/guix-hash.sh \
  426. tests/guix-pack.sh \
  427. tests/guix-pack-localstatedir.sh \
  428. tests/guix-pack-relocatable.sh \
  429. tests/guix-package.sh \
  430. tests/guix-package-aliases.sh \
  431. tests/guix-package-net.sh \
  432. tests/guix-system.sh \
  433. tests/guix-archive.sh \
  434. tests/guix-authenticate.sh \
  435. tests/guix-environment.sh \
  436. tests/guix-environment-container.sh \
  437. tests/guix-graph.sh \
  438. tests/guix-describe.sh \
  439. tests/guix-lint.sh
  440. TESTS = $(SCM_TESTS) $(SH_TESTS)
  441. AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
  442. SCM_LOG_DRIVER = \
  443. $(top_builddir)/test-env --quiet-stderr \
  444. $(GUILE) --no-auto-compile -e main \
  445. $(top_srcdir)/build-aux/test-driver.scm
  446. AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
  447. SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
  448. AM_SH_LOG_FLAGS = -x -e
  449. # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
  450. # could end up removing files from the store while they are being used by
  451. # other instances of the daemon.
  452. tests/guix-gc.log: \
  453. $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
  454. $(SCM_TESTS:%.scm=%.log)
  455. else !CAN_RUN_TESTS
  456. TESTS =
  457. SH_TESTS =
  458. SCM_TESTS =
  459. # Automake always generates a 'check' target, so better not override it.
  460. check-local:
  461. @echo
  462. @echo "Cannot run tests because file name limits would be exceeded." >&2
  463. @echo "Look for 'length' in the 'config.log' file for details." >&2
  464. @echo
  465. @exit 1
  466. endif !CAN_RUN_TESTS
  467. check-system: $(GOBJECTS)
  468. $(AM_V_at)$(top_builddir)/pre-inst-env \
  469. $(GUILE) --no-auto-compile \
  470. -e '(@@ (run-system-tests) run-system-tests)' \
  471. $(top_srcdir)/build-aux/run-system-tests.scm
  472. # Public keys used to sign substitutes.
  473. dist_pkgdata_DATA = \
  474. etc/substitutes/berlin.guixsd.org.pub \
  475. etc/substitutes/ci.guix.gnu.org.pub \
  476. etc/substitutes/ci.guix.info.pub
  477. # Bash completion file.
  478. dist_bashcompletion_DATA = etc/completion/bash/guix \
  479. etc/completion/bash/guix-daemon
  480. # Zsh completion file.
  481. dist_zshcompletion_DATA = etc/completion/zsh/_guix
  482. # Fish completion file.
  483. dist_fishcompletion_DATA = etc/completion/fish/guix.fish
  484. # SELinux policy
  485. dist_selinux_policy_DATA = etc/guix-daemon.cil
  486. EXTRA_DIST += \
  487. HACKING \
  488. ROADMAP \
  489. TODO \
  490. CODE-OF-CONDUCT \
  491. .dir-locals.el \
  492. .guix-channel \
  493. scripts/guix.in \
  494. etc/guix-install.sh \
  495. build-aux/build-self.scm \
  496. build-aux/compile-all.scm \
  497. build-aux/hydra/evaluate.scm \
  498. build-aux/hydra/gnu-system.scm \
  499. build-aux/hydra/guix.scm \
  500. build-aux/hydra/guix-modular.scm \
  501. build-aux/cuirass/gnu-system.scm \
  502. build-aux/cuirass/guix-modular.scm \
  503. build-aux/cuirass/hydra-to-cuirass.scm \
  504. build-aux/check-available-binaries.scm \
  505. build-aux/check-final-inputs-self-contained.scm \
  506. build-aux/compile-as-derivation.scm \
  507. build-aux/generate-authors.scm \
  508. build-aux/test-driver.scm \
  509. build-aux/update-guix-package.scm \
  510. build-aux/update-NEWS.scm \
  511. build-aux/run-system-tests.scm \
  512. d3.v3.js \
  513. graph.js \
  514. tests/test.drv \
  515. tests/signing-key.pub \
  516. tests/signing-key.sec \
  517. tests/cve-sample.xml \
  518. build-aux/config.rpath \
  519. bootstrap \
  520. doc/build.scm \
  521. $(TESTS)
  522. if !BUILD_DAEMON_OFFLOAD
  523. EXTRA_DIST += \
  524. guix/scripts/offload.scm
  525. endif !BUILD_DAEMON_OFFLOAD
  526. CLEANFILES = \
  527. $(bin_SCRIPTS) \
  528. $(GOBJECTS) \
  529. $(SCM_TESTS:tests/%.scm=%.log)
  530. # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
  531. # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
  532. # there that are newer than the local .scm files (for instance because the
  533. # user ran 'make install' recently). When that happens, we end up loading
  534. # those previously-installed .go files, which may be stale, thereby breaking
  535. # the whole thing. Likewise, set 'XDG_CACHE_HOME' to avoid loading possibly
  536. # stale files from ~/.cache/guile/ccache.
  537. %.go: make-go ; @:
  538. make-go: $(MODULES) guix/config.scm $(dist_noinst_DATA)
  539. $(AM_V_at)echo "Compiling Scheme modules..." ; \
  540. unset GUILE_LOAD_COMPILED_PATH ; \
  541. XDG_CACHE_HOME=/nowhere \
  542. host=$(host) srcdir="$(top_srcdir)" \
  543. $(top_builddir)/pre-inst-env \
  544. $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \
  545. --no-auto-compile \
  546. -s "$(top_srcdir)"/build-aux/compile-all.scm $^
  547. SUFFIXES = .go
  548. # Make sure source files are installed first, so that the mtime of
  549. # installed compiled files is greater than that of installed source
  550. # files. See
  551. # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
  552. # for details.
  553. guix_install_go_files = install-nobase_nodist_guileobjectDATA
  554. $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
  555. # The above trick doesn't work for 'config.go' because both 'config.scm' and
  556. # 'config.go' are listed in $(nobase_nodist_guileobject_DATA). Thus, give it
  557. # special treatment.
  558. install-data-hook: set-bootstrap-executable-permissions
  559. touch "$(DESTDIR)$(guileobjectdir)/guix/config.go"
  560. # Assuming Guix is already installed and the daemon is up and running, this
  561. # rule builds from $(srcdir), creating and building derivations.
  562. as-derivation:
  563. $(AM_V_at)echo "Building Guix in Guix..." ; \
  564. $(GUILE) --no-auto-compile \
  565. "$(top_srcdir)/build-aux/compile-as-derivation.scm" \
  566. "$(abs_top_srcdir)"
  567. SUBDIRS = po/guix po/packages
  568. BUILT_SOURCES =
  569. include doc/local.mk
  570. if BUILD_DAEMON
  571. include nix/local.mk
  572. endif BUILD_DAEMON
  573. ACLOCAL_AMFLAGS = -I m4
  574. # Pass an explicit '--localstatedir' so that configure does not error out if
  575. # it finds an existing installation with a different localstatedir. Inherit
  576. # 'ac_cv_guix_test_root' so that "make check" in $(distdir) does not have to
  577. # repopulate the whole store, and to make sure $(GUIX_TEST_ROOT) is short
  578. # enough for shebangs.
  579. AM_DISTCHECK_CONFIGURE_FLAGS = \
  580. --localstatedir="$$dc_install_base/var" \
  581. --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
  582. --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
  583. --with-nix-prefix="$(NIX_PREFIX)" \
  584. --enable-daemon \
  585. ac_cv_guix_test_root="$(GUIX_TEST_ROOT)"
  586. # The self-contained tarball.
  587. guix-binary.%.tar.xz:
  588. $(AM_V_GEN)GUIX_PACKAGE_PATH= \
  589. tarball=`$(top_builddir)/pre-inst-env guix pack -K -C xz \
  590. -s "$*" --localstatedir --profile-name=current-guix guix` ; \
  591. cp "$$tarball" "$@.tmp" ; mv "$@.tmp" "$@"
  592. dist-hook: gen-ChangeLog gen-AUTHORS gen-tarball-version
  593. dist-hook: assert-no-store-file-names
  594. dist-hook: doc-po-update
  595. distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
  596. EXTRA_DIST += $(top_srcdir)/.version
  597. BUILT_SOURCES += $(top_srcdir)/.version
  598. $(top_srcdir)/.version:
  599. echo $(VERSION) > "$@-t" && mv "$@-t" "$@"
  600. gen-tarball-version:
  601. echo $(VERSION) > "$(distdir)/.tarball-version"
  602. gen-ChangeLog:
  603. $(AM_V_GEN)if test -d .git; then \
  604. $(top_srcdir)/build-aux/gitlog-to-changelog \
  605. > $(distdir)/ChangeLog.tmp; \
  606. rm -f $(distdir)/ChangeLog; \
  607. mv $(distdir)/ChangeLog.tmp $(distdir)/ChangeLog; \
  608. fi
  609. gen-AUTHORS:
  610. $(AM_V_GEN)if test -d .git; then \
  611. rm -f "$(distdir)/AUTHORS"; \
  612. $(top_builddir)/pre-inst-env "$(GUILE)" \
  613. "$(top_srcdir)/build-aux/generate-authors.scm" \
  614. "$(top_srcdir)" "$(distdir)/AUTHORS"; \
  615. fi
  616. #
  617. # Release management.
  618. #
  619. releasedir = release-$(PACKAGE_VERSION)
  620. PACKAGE_FULL_TARNAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
  621. # List of source tarballs produced. This must be kept in sync with the
  622. # 'dist-' options of 'AM_INIT_AUTOMAKE' in 'configure.ac'.
  623. SOURCE_TARBALLS = \
  624. $(foreach ext,tar.gz,$(PACKAGE_FULL_TARNAME).$(ext))
  625. # Systems supported by Guix.
  626. SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux armhf-linux aarch64-linux
  627. # Guix binary tarballs.
  628. BINARY_TARBALLS = \
  629. $(foreach system,$(SUPPORTED_SYSTEMS),guix-binary.$(system).tar.xz)
  630. # Systems supported by Guix System.
  631. GUIX_SYSTEM_SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux
  632. # Systems for which we build Guix VMs.
  633. GUIX_SYSTEM_VM_SYSTEMS ?= x86_64-linux
  634. # Prefix of the Guix installation image file name.
  635. GUIX_SYSTEM_IMAGE_BASE = guix-system-install-$(PACKAGE_VERSION)
  636. # Prefix of the Guix VM image file name.
  637. GUIX_SYSTEM_VM_IMAGE_BASE = guix-system-vm-image-$(PACKAGE_VERSION)
  638. # Flags for 'guix system vm-image'. By default create a VM image that appears
  639. # to have a 20G hard disk.
  640. GUIX_SYSTEM_VM_IMAGE_FLAGS ?= --image-size=30G
  641. # Return the sequence of '-s' flags for the given systems.
  642. system_flags = $(foreach system,$(1),-s $(system))
  643. # The release process works in several phases:
  644. #
  645. # 0. We assume the developer created a 'vX.Y' tag.
  646. # 1. Build the source tarball.
  647. # 2. Update the 'guix' package so that it corresponds to the 'vX.Y' tag.
  648. # 3. Build the binary tarballs for that 'guix' package.
  649. # 4. Update the 'guix' package again.
  650. # 5. Build the installation images. The images will run 'guix'
  651. # corresponding to 'vX.Y' + 1 commit, and they will install 'vX.Y'.
  652. #
  653. # This 'release' target takes care of everything and copies the resulting
  654. # files to $(releasedir).
  655. #
  656. # XXX: Depend on 'dist' rather than 'distcheck' to work around the Gettext
  657. # issue described at <https://savannah.gnu.org/bugs/index.php?51027>.
  658. release: dist
  659. cd po; git checkout .
  660. @if ! git diff-index --quiet HEAD; then \
  661. echo "There are uncommitted changes; stopping." >&2 ; \
  662. exit 1 ; \
  663. fi
  664. $(MKDIR_P) "$(releasedir)"
  665. rm -f "$(releasedir)"/*
  666. mv $(SOURCE_TARBALLS) "$(releasedir)"
  667. $(top_builddir)/pre-inst-env "$(GUILE)" \
  668. $(top_srcdir)/build-aux/update-guix-package.scm \
  669. "`git rev-parse HEAD`" "$(PACKAGE_VERSION)"
  670. git add $(top_srcdir)/gnu/packages/package-management.scm
  671. git commit -m "gnu: guix: Update to $(PACKAGE_VERSION)."
  672. $(top_builddir)/pre-inst-env guix build guix \
  673. $(call system_flags,$(SUPPORTED_SYSTEMS)) \
  674. -v1 --no-grafts -K
  675. rm -f $(BINARY_TARBALLS)
  676. $(MAKE) $(BINARY_TARBALLS)
  677. for system in $(SUPPORTED_SYSTEMS) ; do \
  678. mv "guix-binary.$$system.tar.xz" \
  679. "$(releasedir)/guix-binary-$(PACKAGE_VERSION).$$system.tar.xz" ; \
  680. done
  681. $(top_builddir)/pre-inst-env "$(GUILE)" \
  682. $(top_srcdir)/build-aux/update-guix-package.scm \
  683. "`git rev-parse HEAD`"
  684. git add $(top_srcdir)/gnu/packages/package-management.scm
  685. git commit -m "gnu: guix: Update to `git rev-parse HEAD | cut -c1-7`."
  686. $(top_builddir)/pre-inst-env guix build guix \
  687. $(call system_flags,$(GUIX_SYSTEM_SUPPORTED_SYSTEMS)) \
  688. -v1 --no-grafts -K
  689. for system in $(GUIX_SYSTEM_SUPPORTED_SYSTEMS) ; do \
  690. image=`$(top_builddir)/pre-inst-env \
  691. guix system disk-image \
  692. --file-system-type=iso9660 \
  693. --system=$$system \
  694. gnu/system/install.scm` ; \
  695. if [ ! -f "$$image" ] ; then \
  696. echo "failed to produced Guix installation image for $$system" >&2 ; \
  697. exit 1 ; \
  698. fi ; \
  699. xz < "$$image" > "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.xz.tmp" ; \
  700. mv "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.xz.tmp" \
  701. "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.xz" ; \
  702. done
  703. for system in $(GUIX_SYSTEM_VM_SYSTEMS) ; do \
  704. image=`$(top_builddir)/pre-inst-env \
  705. guix system vm-image $(GUIX_SYSTEM_VM_IMAGE_FLAGS) \
  706. --system=$$system \
  707. gnu/system/examples/vm-image.tmpl` ; \
  708. if [ ! -f "$$image" ] ; then \
  709. echo "failed to produced Guix VM image for $$system" >&2 ; \
  710. exit 1 ; \
  711. fi ; \
  712. xz < "$$image" > "$(releasedir)/$(GUIX_SYSTEM_VM_IMAGE_BASE).$$system.xz.tmp" ; \
  713. mv "$(releasedir)/$(GUIX_SYSTEM_VM_IMAGE_BASE).$$system.xz.tmp" \
  714. "$(releasedir)/$(GUIX_SYSTEM_VM_IMAGE_BASE).$$system.xz" ; \
  715. done
  716. @echo
  717. @echo "Congratulations! All the release files are now in $(releasedir)."
  718. @echo
  719. update-guix-package:
  720. git rev-parse HEAD
  721. $(top_builddir)/pre-inst-env "$(GUILE)" \
  722. $(top_srcdir)/build-aux/update-guix-package.scm \
  723. "`git rev-parse HEAD`"
  724. # Location of a checkout of <git://git.savannah.gnu.org/guix/maintenance.git>.
  725. # Package data from this checkout is used by 'update-NEWS.scm'.
  726. GUIX_MAINTENANCE_DIRECTORY ?= $(top_srcdir)/../guix-maintenance
  727. update-NEWS: $(GOBJECTS)
  728. $(top_builddir)/pre-inst-env "$(GUILE)" \
  729. $(top_srcdir)/build-aux/update-NEWS.scm \
  730. $(top_srcdir)/NEWS "$(GUIX_MAINTENANCE_DIRECTORY)/data"
  731. # Make sure we're not shipping a file that embeds a local /gnu/store file name.
  732. assert-no-store-file-names:
  733. $(AM_V_at)if grep -r --exclude=*.texi --exclude=*.info \
  734. --exclude=*.info-[0-9] --exclude=*.dot \
  735. --exclude=*.eps --exclude-dir=bootstrap \
  736. --exclude=guix-manual.pot --exclude=guix-manual.*.po \
  737. --exclude=guix-cookbook.pot --exclude=guix-cookbook.*.po \
  738. --exclude=guix-prettify.el \
  739. --exclude=ChangeLog* \
  740. -E "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
  741. then \
  742. echo "error: store file names embedded in the distribution" >&2 ; \
  743. exit 1 ; \
  744. fi
  745. # Make sure important substitutes are available.
  746. assert-binaries-available: $(GOBJECTS)
  747. $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
  748. "$(top_srcdir)/build-aux/check-available-binaries.scm"
  749. # Make sure the final inputs don't refer to bootstrap tools.
  750. assert-final-inputs-self-contained: $(GOBJECTS)
  751. $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
  752. "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
  753. # Compute the Hydra jobs and write them in the target file.
  754. hydra-jobs.scm: $(GOBJECTS)
  755. $(AM_V_at)$(MKDIR_P) "`dirname "$@"`"
  756. $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)" \
  757. "$(top_srcdir)/build-aux/hydra/evaluate.scm" \
  758. "$(top_srcdir)/build-aux/hydra/gnu-system.scm" > "$@.tmp"
  759. $(AM_V_at)mv "$@.tmp" "$@"
  760. # Compute the Cuirass jobs and write them in the target file.
  761. cuirass-jobs.scm: $(GOBJECTS)
  762. $(AM_V_at)$(MKDIR_P) "`dirname "$@"`"
  763. $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)" \
  764. "$(top_srcdir)/build-aux/hydra/evaluate.scm" \
  765. "$(top_srcdir)/build-aux/cuirass/gnu-system.scm" \
  766. cuirass > "$@.tmp"
  767. $(AM_V_at)mv "$@.tmp" "$@"
  768. .PHONY: gen-ChangeLog gen-AUTHORS gen-tarball-version
  769. .PHONY: assert-no-store-file-names assert-binaries-available
  770. .PHONY: assert-final-inputs-self-contained
  771. .PHONY: clean-go make-go as-derivation
  772. .PHONY: update-guix-package update-NEWS release
  773. # Downloading up-to-date PO files.
  774. # make-download-po-rule DOMAIN DIRECTORY [FILE-NAME-PREFIX]
  775. define make-download-po-rule
  776. download-po.$(1):
  777. if [ -f "$(top_srcdir)/$(2)/LINGUAS" ]; then \
  778. LINGUAS="`grep -v '^[[:blank:]]*#' < $(top_srcdir)/$(2)/LINGUAS`" ; \
  779. else \
  780. LINGUAS="`(cd $(top_srcdir)/$(2); \
  781. for i in *.po; do echo $$$$i; done) | cut -d . -f 2`" ; \
  782. fi ; \
  783. for lang in $$$$LINGUAS; do \
  784. if wget -nv -O "$(top_srcdir)/$(2)/$(3)$$$$lang.po.tmp" \
  785. "https://translationproject.org/latest/$(1)/$$$$lang.po" ; \
  786. then \
  787. mv "$(top_srcdir)/$(2)/$(3)$$$$lang.po"{.tmp,} ; \
  788. else \
  789. rm "$(top_srcdir)/$(2)/$(3)$$$$lang.po.tmp" ; \
  790. fi ; \
  791. done
  792. .PHONY: download-po.$(1)
  793. endef
  794. $(eval $(call make-download-po-rule,guix,po/guix))
  795. $(eval $(call make-download-po-rule,guix-packages,po/packages))
  796. $(eval $(call make-download-po-rule,guix-manual,po/doc,guix-manual.))
  797. download-po: $(foreach domain,guix guix-packages guix-manual,download-po.$(domain))
  798. .PHONY: download-po
  799. ## -------------- ##
  800. ## Silent rules. ##
  801. ## -------------- ##
  802. AM_V_DL = $(AM_V_DL_$(V))
  803. AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY))
  804. AM_V_DL_0 = @echo " DL " $@;
  805. AM_V_DOT = $(AM_V_DOT_$(V))
  806. AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY))
  807. AM_V_DOT_0 = @echo " DOT " $@;
  808. AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
  809. AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
  810. AM_V_HELP2MAN_0 = @echo " HELP2MAN" $@;
  811. AM_V_PO4A = $(AM_V_PO4A_$(V))
  812. AM_V_PO4A_ = $(AM_V_PO4A_$(AM_DEFAULT_VERBOSITY))
  813. AM_V_PO4A_0 = @echo " PO4A" $@;
  814. AM_V_POXREF = $(AM_V_POXREF_$(V))
  815. AM_V_POXREF_ = $(AM_V_POXREF_$(AM_DEFAULT_VERBOSITY))
  816. AM_V_POXREF_0 = @echo " POXREF" $@;