Makefile.am 26 KB

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