Makefile.am 23 KB

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