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.
 
 
 
 
 
 

780 lines
24 KiB

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