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.
 
 
 
 
 
 

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