Makefile.am 26 KB

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