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.
 
 
 
 
 
 

815 lines
25 KiB

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