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.
 
 
 
 
 
 

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