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.
 
 
 
 
 
 

593 lines
17 KiB

  1. # GNU Guix --- Functional package management for GNU
  2. # Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
  3. # Copyright © 2013 Andreas Enge <andreas@enge.fr>
  4. # Copyright © 2015, 2017 Alex Kost <alezost@gmail.com>
  5. # Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
  6. # Copyright © 2016, 2017 Mark H Weaver <mhw@netris.org>
  7. # Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
  8. #
  9. # This file is part of GNU Guix.
  10. #
  11. # GNU Guix is free software; you can redistribute it and/or modify it
  12. # under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 3 of the License, or (at
  14. # your option) any later version.
  15. #
  16. # GNU Guix is distributed in the hope that it will be useful, but
  17. # WITHOUT ANY WARRANTY; without even the implied warranty of
  18. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. # GNU General Public License for more details.
  20. #
  21. # You should have received a copy of the GNU General Public License
  22. # along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  23. bin_SCRIPTS = \
  24. scripts/guix
  25. nodist_noinst_SCRIPTS = \
  26. pre-inst-env \
  27. test-env
  28. # Modules that are not compiled but are installed nonetheless, such as
  29. # build-side modules with unusual dependencies.
  30. MODULES_NOT_COMPILED =
  31. include gnu/local.mk
  32. MODULES = \
  33. guix/base16.scm \
  34. guix/base32.scm \
  35. guix/base64.scm \
  36. guix/cpio.scm \
  37. guix/records.scm \
  38. guix/gcrypt.scm \
  39. guix/hash.scm \
  40. guix/pk-crypto.scm \
  41. guix/pki.scm \
  42. guix/combinators.scm \
  43. guix/memoization.scm \
  44. guix/utils.scm \
  45. guix/sets.scm \
  46. guix/modules.scm \
  47. guix/download.scm \
  48. guix/discovery.scm \
  49. guix/git-download.scm \
  50. guix/hg-download.scm \
  51. guix/monads.scm \
  52. guix/monad-repl.scm \
  53. guix/gexp.scm \
  54. guix/profiles.scm \
  55. guix/serialization.scm \
  56. guix/nar.scm \
  57. guix/derivations.scm \
  58. guix/grafts.scm \
  59. guix/gnu-maintenance.scm \
  60. guix/upstream.scm \
  61. guix/licenses.scm \
  62. guix/graph.scm \
  63. guix/cache.scm \
  64. guix/cve.scm \
  65. guix/workers.scm \
  66. guix/zlib.scm \
  67. guix/build-system.scm \
  68. guix/build-system/ant.scm \
  69. guix/build-system/cargo.scm \
  70. guix/build-system/cmake.scm \
  71. guix/build-system/dub.scm \
  72. guix/build-system/emacs.scm \
  73. guix/build-system/asdf.scm \
  74. guix/build-system/glib-or-gtk.scm \
  75. guix/build-system/gnu.scm \
  76. guix/build-system/haskell.scm \
  77. guix/build-system/perl.scm \
  78. guix/build-system/python.scm \
  79. guix/build-system/ocaml.scm \
  80. guix/build-system/waf.scm \
  81. guix/build-system/r.scm \
  82. guix/build-system/ruby.scm \
  83. guix/build-system/trivial.scm \
  84. guix/ftp-client.scm \
  85. guix/http-client.scm \
  86. guix/gnupg.scm \
  87. guix/elf.scm \
  88. guix/store.scm \
  89. guix/cvs-download.scm \
  90. guix/svn-download.scm \
  91. guix/ui.scm \
  92. guix/build/ant-build-system.scm \
  93. guix/build/download.scm \
  94. guix/build/cargo-build-system.scm \
  95. guix/build/cmake-build-system.scm \
  96. guix/build/dub-build-system.scm \
  97. guix/build/emacs-build-system.scm \
  98. guix/build/asdf-build-system.scm \
  99. guix/build/git.scm \
  100. guix/build/hg.scm \
  101. guix/build/glib-or-gtk-build-system.scm \
  102. guix/build/gnu-build-system.scm \
  103. guix/build/gnu-dist.scm \
  104. guix/build/perl-build-system.scm \
  105. guix/build/python-build-system.scm \
  106. guix/build/ocaml-build-system.scm \
  107. guix/build/r-build-system.scm \
  108. guix/build/ruby-build-system.scm \
  109. guix/build/waf-build-system.scm \
  110. guix/build/haskell-build-system.scm \
  111. guix/build/store-copy.scm \
  112. guix/build/utils.scm \
  113. guix/build/union.scm \
  114. guix/build/profiles.scm \
  115. guix/build/pull.scm \
  116. guix/build/rpath.scm \
  117. guix/build/cvs.scm \
  118. guix/build/svn.scm \
  119. guix/build/syscalls.scm \
  120. guix/build/gremlin.scm \
  121. guix/build/emacs-utils.scm \
  122. guix/build/lisp-utils.scm \
  123. guix/build/graft.scm \
  124. guix/build/bournish.scm \
  125. guix/build/qt-utils.scm \
  126. guix/build/make-bootstrap.scm \
  127. guix/search-paths.scm \
  128. guix/packages.scm \
  129. guix/import/utils.scm \
  130. guix/import/gnu.scm \
  131. guix/import/snix.scm \
  132. guix/import/cabal.scm \
  133. guix/import/cran.scm \
  134. guix/import/hackage.scm \
  135. guix/import/elpa.scm \
  136. guix/scripts.scm \
  137. guix/scripts/download.scm \
  138. guix/scripts/perform-download.scm \
  139. guix/scripts/build.scm \
  140. guix/scripts/archive.scm \
  141. guix/scripts/import.scm \
  142. guix/scripts/package.scm \
  143. guix/scripts/gc.scm \
  144. guix/scripts/hash.scm \
  145. guix/scripts/pack.scm \
  146. guix/scripts/pull.scm \
  147. guix/scripts/substitute.scm \
  148. guix/scripts/authenticate.scm \
  149. guix/scripts/refresh.scm \
  150. guix/scripts/system.scm \
  151. guix/scripts/lint.scm \
  152. guix/scripts/challenge.scm \
  153. guix/scripts/import/cran.scm \
  154. guix/scripts/import/gnu.scm \
  155. guix/scripts/import/nix.scm \
  156. guix/scripts/import/hackage.scm \
  157. guix/scripts/import/stackage.scm \
  158. guix/scripts/import/elpa.scm \
  159. guix/scripts/environment.scm \
  160. guix/scripts/publish.scm \
  161. guix/scripts/edit.scm \
  162. guix/scripts/size.scm \
  163. guix/scripts/graph.scm \
  164. guix/scripts/container.scm \
  165. guix/scripts/container/exec.scm \
  166. guix.scm \
  167. $(GNU_SYSTEM_MODULES)
  168. if HAVE_GUILE_JSON
  169. MODULES += \
  170. guix/docker.scm \
  171. guix/import/cpan.scm \
  172. guix/import/crate.scm \
  173. guix/import/gem.scm \
  174. guix/import/github.scm \
  175. guix/import/json.scm \
  176. guix/import/pypi.scm \
  177. guix/import/stackage.scm \
  178. guix/scripts/import/crate.scm \
  179. guix/scripts/import/gem.scm \
  180. guix/scripts/import/pypi.scm
  181. endif
  182. if HAVE_GUILE_SSH
  183. MODULES += \
  184. guix/ssh.scm \
  185. guix/scripts/copy.scm \
  186. guix/store/ssh.scm
  187. endif HAVE_GUILE_SSH
  188. if BUILD_DAEMON_OFFLOAD
  189. MODULES += \
  190. guix/scripts/offload.scm
  191. endif BUILD_DAEMON_OFFLOAD
  192. # Internal modules with test suite support.
  193. dist_noinst_DATA = guix/tests.scm guix/tests/http.scm
  194. # Auxiliary files for packages.
  195. AUX_FILES = \
  196. gnu/packages/aux-files/emacs/guix-emacs.el \
  197. gnu/packages/aux-files/linux-libre/4.11-i686.conf \
  198. gnu/packages/aux-files/linux-libre/4.11-x86_64.conf \
  199. gnu/packages/aux-files/linux-libre/4.9-i686.conf \
  200. gnu/packages/aux-files/linux-libre/4.9-x86_64.conf \
  201. gnu/packages/aux-files/linux-libre/4.4-i686.conf \
  202. gnu/packages/aux-files/linux-libre/4.4-x86_64.conf \
  203. gnu/packages/aux-files/linux-libre/4.1-i686.conf \
  204. gnu/packages/aux-files/linux-libre/4.1-x86_64.conf
  205. # Templates, examples.
  206. EXAMPLES = \
  207. gnu/system/examples/bare-bones.tmpl \
  208. gnu/system/examples/desktop.tmpl \
  209. gnu/system/examples/lightweight-desktop.tmpl
  210. GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go $(dist_noinst_DATA:%.scm=%.go)
  211. nobase_dist_guilemodule_DATA = \
  212. $(MODULES) $(MODULES_NOT_COMPILED) $(AUX_FILES) $(EXAMPLES) \
  213. $(MISC_DISTRO_FILES)
  214. nobase_nodist_guilemodule_DATA = guix/config.scm
  215. nobase_nodist_guileobject_DATA = $(GOBJECTS)
  216. # Do we need to provide our own non-broken (srfi srfi-37) module?
  217. if INSTALL_SRFI_37
  218. nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
  219. GOBJECTS += srfi/srfi-37.go
  220. srfi/srfi-37.scm: srfi/srfi-37.scm.in
  221. $(MKDIR_P) srfi
  222. cp "$<" "$@"
  223. endif INSTALL_SRFI_37
  224. # Handy way to remove the .go files without removing all the rest.
  225. clean-go:
  226. -$(RM) -f $(GOBJECTS)
  227. @find . -name '*.go' -print | \
  228. if test -t 1; then \
  229. xargs -r echo -e "\033[31mwarning:\033[0m stray .go files:"; \
  230. else \
  231. xargs -r echo "warning: stray .go files:"; \
  232. fi
  233. # Test extensions; has to be unconditional.
  234. TEST_EXTENSIONS = .scm .sh
  235. if CAN_RUN_TESTS
  236. SCM_TESTS = \
  237. tests/base16.scm \
  238. tests/base32.scm \
  239. tests/base64.scm \
  240. tests/cpio.scm \
  241. tests/hash.scm \
  242. tests/pk-crypto.scm \
  243. tests/pki.scm \
  244. tests/sets.scm \
  245. tests/modules.scm \
  246. tests/gnu-maintenance.scm \
  247. tests/substitute.scm \
  248. tests/builders.scm \
  249. tests/derivations.scm \
  250. tests/grafts.scm \
  251. tests/ui.scm \
  252. tests/records.scm \
  253. tests/upstream.scm \
  254. tests/combinators.scm \
  255. tests/discovery.scm \
  256. tests/utils.scm \
  257. tests/build-utils.scm \
  258. tests/packages.scm \
  259. tests/snix.scm \
  260. tests/hackage.scm \
  261. tests/cran.scm \
  262. tests/elpa.scm \
  263. tests/store.scm \
  264. tests/monads.scm \
  265. tests/gexp.scm \
  266. tests/nar.scm \
  267. tests/union.scm \
  268. tests/profiles.scm \
  269. tests/search-paths.scm \
  270. tests/syscalls.scm \
  271. tests/gremlin.scm \
  272. tests/bournish.scm \
  273. tests/lint.scm \
  274. tests/publish.scm \
  275. tests/scripts.scm \
  276. tests/size.scm \
  277. tests/graph.scm \
  278. tests/challenge.scm \
  279. tests/cache.scm \
  280. tests/cve.scm \
  281. tests/workers.scm \
  282. tests/zlib.scm \
  283. tests/file-systems.scm \
  284. tests/system.scm \
  285. tests/services.scm \
  286. tests/scripts-build.scm \
  287. tests/containers.scm \
  288. tests/pack.scm \
  289. tests/import-utils.scm
  290. if HAVE_GUILE_JSON
  291. SCM_TESTS += \
  292. tests/pypi.scm \
  293. tests/cpan.scm \
  294. tests/gem.scm \
  295. tests/crate.scm
  296. endif
  297. SH_TESTS = \
  298. tests/guix-build.sh \
  299. tests/guix-download.sh \
  300. tests/guix-gc.sh \
  301. tests/guix-hash.sh \
  302. tests/guix-package.sh \
  303. tests/guix-package-net.sh \
  304. tests/guix-system.sh \
  305. tests/guix-archive.sh \
  306. tests/guix-authenticate.sh \
  307. tests/guix-environment.sh \
  308. tests/guix-environment-container.sh \
  309. tests/guix-graph.sh \
  310. tests/guix-lint.sh
  311. if BUILD_DAEMON
  312. SH_TESTS += tests/guix-register.sh
  313. endif BUILD_DAEMON
  314. TESTS = $(SCM_TESTS) $(SH_TESTS)
  315. AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
  316. SCM_LOG_DRIVER = \
  317. $(top_builddir)/test-env --quiet-stderr \
  318. $(GUILE) --no-auto-compile -e main \
  319. $(top_srcdir)/build-aux/test-driver.scm
  320. AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
  321. SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
  322. AM_SH_LOG_FLAGS = -x -e
  323. # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
  324. # could end up removing files from the store while they are being used by
  325. # other instances of the daemon.
  326. tests/guix-gc.log: \
  327. $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
  328. $(SCM_TESTS:%.scm=%.log)
  329. else !CAN_RUN_TESTS
  330. TESTS =
  331. SH_TESTS =
  332. SCM_TESTS =
  333. # Automake always generates a 'check' target, so better not override it.
  334. check-local:
  335. @echo
  336. @echo "Cannot run tests because file name limits would be exceeded." >&2
  337. @echo "Look for 'length' in the 'config.log' file for details." >&2
  338. @echo
  339. @exit 1
  340. endif !CAN_RUN_TESTS
  341. check-system: $(GOBJECTS) $(BOOTSTRAP_GUILE_TARBALLS)
  342. $(AM_V_at)$(top_builddir)/pre-inst-env \
  343. $(GUILE) --no-auto-compile \
  344. -e '(@@ (run-system-tests) run-system-tests)' \
  345. $(top_srcdir)/build-aux/run-system-tests.scm
  346. # Public key used to sign substitutes from hydra.gnu.org.
  347. dist_pkgdata_DATA = hydra.gnu.org.pub
  348. # Bash completion file.
  349. dist_bashcompletion_DATA = etc/completion/bash/guix
  350. # Zsh completion file.
  351. dist_zshcompletion_DATA = etc/completion/zsh/_guix
  352. EXTRA_DIST = \
  353. HACKING \
  354. ROADMAP \
  355. TODO \
  356. CODE-OF-CONDUCT \
  357. .dir-locals.el \
  358. build-aux/build-self.scm \
  359. build-aux/compile-all.scm \
  360. build-aux/hydra/evaluate.scm \
  361. build-aux/hydra/gnu-system.scm \
  362. build-aux/hydra/guix.scm \
  363. build-aux/check-available-binaries.scm \
  364. build-aux/check-final-inputs-self-contained.scm \
  365. build-aux/download.scm \
  366. build-aux/generate-authors.scm \
  367. build-aux/test-driver.scm \
  368. build-aux/run-system-tests.scm \
  369. d3.v3.js \
  370. graph.js \
  371. srfi/srfi-37.scm.in \
  372. srfi/srfi-64.scm \
  373. srfi/srfi-64.upstream.scm \
  374. tests/test.drv \
  375. tests/signing-key.pub \
  376. tests/signing-key.sec \
  377. tests/cve-sample.xml \
  378. build-aux/config.rpath \
  379. bootstrap \
  380. release.nix \
  381. $(TESTS)
  382. if !BUILD_DAEMON_OFFLOAD
  383. EXTRA_DIST += \
  384. guix/scripts/offload.scm
  385. endif !BUILD_DAEMON_OFFLOAD
  386. CLEANFILES = \
  387. $(GOBJECTS) \
  388. $(SCM_TESTS:tests/%.scm=%.log)
  389. # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
  390. # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
  391. # there that are newer than the local .scm files (for instance because the
  392. # user ran 'make install' recently). When that happens, we end up loading
  393. # those previously-installed .go files, which may be stale, thereby breaking
  394. # the whole thing. Likewise, set 'XDG_CACHE_HOME' to avoid loading possibly
  395. # stale files from ~/.cache/guile/ccache.
  396. %.go: make-go ; @:
  397. make-go: $(MODULES) guix/config.scm $(dist_noinst_DATA)
  398. $(AM_V_at)echo "Compiling Scheme modules..." ; \
  399. unset GUILE_LOAD_COMPILED_PATH ; \
  400. XDG_CACHE_HOME=/nowhere \
  401. host=$(host) srcdir="$(top_srcdir)" \
  402. $(top_builddir)/pre-inst-env \
  403. $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \
  404. --no-auto-compile \
  405. -s "$(top_srcdir)"/build-aux/compile-all.scm $^
  406. SUFFIXES = .go
  407. # Make sure source files are installed first, so that the mtime of
  408. # installed compiled files is greater than that of installed source
  409. # files. See
  410. # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
  411. # for details.
  412. guix_install_go_files = install-nobase_nodist_guileobjectDATA
  413. $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
  414. # The above trick doesn't work for 'config.go' because both 'config.scm' and
  415. # 'config.go' are listed in $(nobase_nodist_guileobject_DATA). Thus, give it
  416. # special treatment.
  417. install-data-hook: set-bootstrap-executable-permissions
  418. touch "$(DESTDIR)$(guileobjectdir)/guix/config.go"
  419. SUBDIRS = po/guix po/packages
  420. BUILT_SOURCES =
  421. include doc/local.mk
  422. if BUILD_DAEMON
  423. include nix/local.mk
  424. endif BUILD_DAEMON
  425. ACLOCAL_AMFLAGS = -I m4
  426. # Pass an explicit '--localstatedir' so that configure does not error out if
  427. # it finds an existing installation with a different localstatedir.
  428. AM_DISTCHECK_CONFIGURE_FLAGS = \
  429. --localstatedir="$$dc_install_base/var" \
  430. --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
  431. --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
  432. --with-nix-prefix="$(NIX_PREFIX)" \
  433. --enable-daemon
  434. # The self-contained tarball. Add 'glibc-utf8-locales' along with glibc just
  435. # so 'etc/profile' defines 'GUIX_LOCPATH' pointing to a valid set of locales.
  436. guix-binary.%.tar.xz:
  437. $(AM_V_GEN)GUIX_PACKAGE_PATH= \
  438. tarball=`$(top_builddir)/pre-inst-env guix pack -C xz \
  439. -s "$*" --localstatedir guix glibc-utf8-locales \
  440. -e '(@@ (gnu packages commencement) glibc-final)'` ; \
  441. cp "$$tarball" "$@.tmp" ; mv "$@.tmp" "$@"
  442. dist-hook: gen-ChangeLog gen-AUTHORS gen-tarball-version
  443. dist-hook: assert-no-store-file-names
  444. distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
  445. EXTRA_DIST += $(top_srcdir)/.version
  446. BUILT_SOURCES += $(top_srcdir)/.version
  447. $(top_srcdir)/.version:
  448. echo $(VERSION) > "$@-t" && mv "$@-t" "$@"
  449. gen-tarball-version:
  450. echo $(VERSION) > "$(distdir)/.tarball-version"
  451. gen-ChangeLog:
  452. $(AM_V_GEN)if test -d .git; then \
  453. $(top_srcdir)/build-aux/gitlog-to-changelog \
  454. > $(distdir)/cl-t; \
  455. rm -f $(distdir)/ChangeLog; \
  456. mv $(distdir)/cl-t $(distdir)/ChangeLog; \
  457. fi
  458. gen-AUTHORS:
  459. $(AM_V_GEN)if test -d .git; then \
  460. rm -f "$(distdir)/AUTHORS"; \
  461. $(top_builddir)/pre-inst-env "$(GUILE)" \
  462. "$(top_srcdir)/build-aux/generate-authors.scm" \
  463. "$(top_srcdir)" "$(distdir)/AUTHORS"; \
  464. fi
  465. # Make sure we're not shipping a file that embeds a local /gnu/store file name.
  466. assert-no-store-file-names:
  467. $(AM_V_at)if grep -r --exclude=*.texi --exclude=*.info \
  468. --exclude=*.info-[0-9] --exclude=*.dot \
  469. --exclude=*.eps --exclude-dir=bootstrap \
  470. --exclude=guix-prettify.el \
  471. --exclude=ChangeLog \
  472. -E "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
  473. then \
  474. echo "error: store file names embedded in the distribution" >&2 ; \
  475. exit 1 ; \
  476. fi
  477. # Make sure hydra.gnu.org has the important binaries.
  478. assert-binaries-available: $(GOBJECTS)
  479. $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
  480. "$(top_srcdir)/build-aux/check-available-binaries.scm"
  481. # Make sure the final inputs don't refer to bootstrap tools.
  482. assert-final-inputs-self-contained: $(GOBJECTS)
  483. $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
  484. "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
  485. # Compute the Hydra jobs and write them in the target file.
  486. hydra-jobs.scm: $(GOBJECTS)
  487. $(AM_V_at)$(MKDIR_P) "`dirname "$@"`"
  488. $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)" \
  489. "$(top_srcdir)/build-aux/hydra/evaluate.scm" \
  490. "$(top_srcdir)/build-aux/hydra/gnu-system.scm" > "$@.tmp"
  491. $(AM_V_at)mv "$@.tmp" "$@"
  492. .PHONY: gen-ChangeLog gen-AUTHORS gen-tarball-version
  493. .PHONY: assert-no-store-file-names assert-binaries-available
  494. .PHONY: assert-final-inputs-self-contained
  495. .PHONY: clean-go make-go
  496. ## -------------- ##
  497. ## Silent rules. ##
  498. ## -------------- ##
  499. AM_V_DL = $(AM_V_DL_$(V))
  500. AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY))
  501. AM_V_DL_0 = @echo " DL " $@;
  502. AM_V_DOT = $(AM_V_DOT_$(V))
  503. AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY))
  504. AM_V_DOT_0 = @echo " DOT " $@;
  505. AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
  506. AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
  507. AM_V_HELP2MAN_0 = @echo " HELP2MAN" $@;