| 1 | # GNU Guix --- Functional package management for GNU |
| 2 | # Copyright © 2012, 2013, 2014 Ludovic Courtès <[email protected]> |
| 3 | # Copyright © 2013 Andreas Enge <[email protected]> |
| 4 | # |
| 5 | # This file is part of GNU Guix. |
| 6 | # |
| 7 | # GNU Guix is free software; you can redistribute it and/or modify it |
| 8 | # under the terms of the GNU General Public License as published by |
| 9 | # the Free Software Foundation; either version 3 of the License, or (at |
| 10 | # your option) any later version. |
| 11 | # |
| 12 | # GNU Guix is distributed in the hope that it will be useful, but |
| 13 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | # GNU General Public License for more details. |
| 16 | # |
| 17 | # You should have received a copy of the GNU General Public License |
| 18 | # along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
| 19 | |
| 20 | bin_SCRIPTS = \ |
| 21 | scripts/guix |
| 22 | |
| 23 | nodist_noinst_SCRIPTS = \ |
| 24 | pre-inst-env \ |
| 25 | test-env |
| 26 | |
| 27 | include gnu-system.am |
| 28 | |
| 29 | MODULES = \ |
| 30 | guix/base32.scm \ |
| 31 | guix/base64.scm \ |
| 32 | guix/records.scm \ |
| 33 | guix/hash.scm \ |
| 34 | guix/pk-crypto.scm \ |
| 35 | guix/pki.scm \ |
| 36 | guix/utils.scm \ |
| 37 | guix/download.scm \ |
| 38 | guix/git-download.scm \ |
| 39 | guix/monads.scm \ |
| 40 | guix/monad-repl.scm \ |
| 41 | guix/gexp.scm \ |
| 42 | guix/profiles.scm \ |
| 43 | guix/serialization.scm \ |
| 44 | guix/nar.scm \ |
| 45 | guix/derivations.scm \ |
| 46 | guix/gnu-maintenance.scm \ |
| 47 | guix/licenses.scm \ |
| 48 | guix/build-system.scm \ |
| 49 | guix/build-system/cmake.scm \ |
| 50 | guix/build-system/glib-or-gtk.scm \ |
| 51 | guix/build-system/gnu.scm \ |
| 52 | guix/build-system/perl.scm \ |
| 53 | guix/build-system/python.scm \ |
| 54 | guix/build-system/ruby.scm \ |
| 55 | guix/build-system/trivial.scm \ |
| 56 | guix/ftp-client.scm \ |
| 57 | guix/http-client.scm \ |
| 58 | guix/gnupg.scm \ |
| 59 | guix/store.scm \ |
| 60 | guix/svn-download.scm \ |
| 61 | guix/ui.scm \ |
| 62 | guix/build/download.scm \ |
| 63 | guix/build/cmake-build-system.scm \ |
| 64 | guix/build/git.scm \ |
| 65 | guix/build/glib-or-gtk-build-system.scm \ |
| 66 | guix/build/gnu-build-system.scm \ |
| 67 | guix/build/gnu-dist.scm \ |
| 68 | guix/build/perl-build-system.scm \ |
| 69 | guix/build/python-build-system.scm \ |
| 70 | guix/build/ruby-build-system.scm \ |
| 71 | guix/build/store-copy.scm \ |
| 72 | guix/build/utils.scm \ |
| 73 | guix/build/union.scm \ |
| 74 | guix/build/pull.scm \ |
| 75 | guix/build/rpath.scm \ |
| 76 | guix/build/svn.scm \ |
| 77 | guix/build/syscalls.scm \ |
| 78 | guix/build/emacs-utils.scm \ |
| 79 | guix/build/graft.scm \ |
| 80 | guix/packages.scm \ |
| 81 | guix/import/utils.scm \ |
| 82 | guix/import/gnu.scm \ |
| 83 | guix/import/snix.scm \ |
| 84 | guix/scripts/download.scm \ |
| 85 | guix/scripts/build.scm \ |
| 86 | guix/scripts/archive.scm \ |
| 87 | guix/scripts/import.scm \ |
| 88 | guix/scripts/package.scm \ |
| 89 | guix/scripts/gc.scm \ |
| 90 | guix/scripts/hash.scm \ |
| 91 | guix/scripts/pull.scm \ |
| 92 | guix/scripts/substitute-binary.scm \ |
| 93 | guix/scripts/authenticate.scm \ |
| 94 | guix/scripts/refresh.scm \ |
| 95 | guix/scripts/system.scm \ |
| 96 | guix/scripts/lint.scm \ |
| 97 | guix/scripts/import/gnu.scm \ |
| 98 | guix/scripts/import/nix.scm \ |
| 99 | guix/scripts/environment.scm \ |
| 100 | guix.scm \ |
| 101 | $(GNU_SYSTEM_MODULES) |
| 102 | |
| 103 | if BUILD_DAEMON_OFFLOAD |
| 104 | |
| 105 | MODULES += \ |
| 106 | guix/scripts/offload.scm |
| 107 | |
| 108 | endif BUILD_DAEMON_OFFLOAD |
| 109 | |
| 110 | # Internal module with test suite support. |
| 111 | dist_noinst_DATA = guix/tests.scm |
| 112 | |
| 113 | # Because of the autoload hack in (guix build download), we must build it |
| 114 | # first to avoid errors on systems where (gnutls) is unavailable. |
| 115 | guix/scripts/download.go: guix/build/download.go |
| 116 | guix/download.go: guix/build/download.go |
| 117 | |
| 118 | # Linux-Libre configurations. |
| 119 | KCONFIGS = \ |
| 120 | gnu/packages/linux-libre-i686.conf \ |
| 121 | gnu/packages/linux-libre-x86_64.conf |
| 122 | |
| 123 | # Templates, examples. |
| 124 | EXAMPLES = \ |
| 125 | gnu/system/os-config.tmpl |
| 126 | |
| 127 | GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go guix/tests.go |
| 128 | |
| 129 | nobase_dist_guilemodule_DATA = $(MODULES) $(KCONFIGS) $(EXAMPLES) |
| 130 | nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm |
| 131 | |
| 132 | # Do we need to provide our own non-broken (srfi srfi-37) module? |
| 133 | if INSTALL_SRFI_37 |
| 134 | |
| 135 | nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm |
| 136 | GOBJECTS += srfi/srfi-37.go |
| 137 | |
| 138 | srfi/srfi-37.scm: srfi/srfi-37.scm.in |
| 139 | $(MKDIR_P) srfi |
| 140 | cp "$<" "$@" |
| 141 | |
| 142 | endif INSTALL_SRFI_37 |
| 143 | |
| 144 | # Handy way to remove the .go files without removing all the rest. |
| 145 | clean-go: |
| 146 | -$(RM) -f $(GOBJECTS) |
| 147 | |
| 148 | |
| 149 | SCM_TESTS = \ |
| 150 | tests/base32.scm \ |
| 151 | tests/base64.scm \ |
| 152 | tests/hash.scm \ |
| 153 | tests/pk-crypto.scm \ |
| 154 | tests/pki.scm \ |
| 155 | tests/substitute-binary.scm \ |
| 156 | tests/builders.scm \ |
| 157 | tests/derivations.scm \ |
| 158 | tests/ui.scm \ |
| 159 | tests/records.scm \ |
| 160 | tests/utils.scm \ |
| 161 | tests/build-utils.scm \ |
| 162 | tests/packages.scm \ |
| 163 | tests/snix.scm \ |
| 164 | tests/store.scm \ |
| 165 | tests/monads.scm \ |
| 166 | tests/gexp.scm \ |
| 167 | tests/nar.scm \ |
| 168 | tests/union.scm \ |
| 169 | tests/profiles.scm \ |
| 170 | tests/syscalls.scm \ |
| 171 | tests/lint.scm |
| 172 | |
| 173 | if HAVE_GUILE_JSON |
| 174 | |
| 175 | MODULES += \ |
| 176 | guix/import/pypi.scm \ |
| 177 | guix/scripts/import/pypi.scm |
| 178 | |
| 179 | SCM_TESTS += tests/pypi.scm |
| 180 | |
| 181 | endif |
| 182 | |
| 183 | SH_TESTS = \ |
| 184 | tests/guix-build.sh \ |
| 185 | tests/guix-download.sh \ |
| 186 | tests/guix-gc.sh \ |
| 187 | tests/guix-hash.sh \ |
| 188 | tests/guix-package.sh \ |
| 189 | tests/guix-system.sh \ |
| 190 | tests/guix-archive.sh \ |
| 191 | tests/guix-authenticate.sh \ |
| 192 | tests/guix-lint.sh |
| 193 | |
| 194 | if BUILD_DAEMON |
| 195 | |
| 196 | SH_TESTS += tests/guix-register.sh |
| 197 | |
| 198 | endif BUILD_DAEMON |
| 199 | |
| 200 | |
| 201 | TESTS = $(SCM_TESTS) $(SH_TESTS) |
| 202 | |
| 203 | TEST_EXTENSIONS = .scm .sh |
| 204 | |
| 205 | AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" |
| 206 | |
| 207 | SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE) |
| 208 | AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)" |
| 209 | |
| 210 | SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL) |
| 211 | AM_SH_LOG_FLAGS = -x -e |
| 212 | |
| 213 | # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it |
| 214 | # could end up removing files from the store while they are being used by |
| 215 | # other instances of the daemon. |
| 216 | tests/guix-gc.log: \ |
| 217 | $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \ |
| 218 | $(SCM_TESTS:%.scm=%.log) |
| 219 | |
| 220 | # Public key used to sign substitutes from hydra.gnu.org. |
| 221 | dist_pkgdata_DATA = hydra.gnu.org.pub |
| 222 | |
| 223 | EXTRA_DIST = \ |
| 224 | HACKING \ |
| 225 | ROADMAP \ |
| 226 | TODO \ |
| 227 | .dir-locals.el \ |
| 228 | build-aux/build-self.scm \ |
| 229 | build-aux/hydra/gnu-system.scm \ |
| 230 | build-aux/hydra/demo-os.scm \ |
| 231 | build-aux/hydra/guix.scm \ |
| 232 | build-aux/check-available-binaries.scm \ |
| 233 | build-aux/check-final-inputs-self-contained.scm \ |
| 234 | build-aux/download.scm \ |
| 235 | build-aux/list-packages.scm \ |
| 236 | build-aux/sync-descriptions.scm \ |
| 237 | srfi/srfi-37.scm.in \ |
| 238 | srfi/srfi-64.scm \ |
| 239 | srfi/srfi-64.upstream.scm \ |
| 240 | tests/test.drv \ |
| 241 | tests/signing-key.pub \ |
| 242 | tests/signing-key.sec \ |
| 243 | build-aux/config.rpath \ |
| 244 | bootstrap \ |
| 245 | release.nix \ |
| 246 | $(TESTS) |
| 247 | |
| 248 | if !BUILD_DAEMON_OFFLOAD |
| 249 | |
| 250 | EXTRA_DIST += \ |
| 251 | guix/scripts/offload.scm |
| 252 | |
| 253 | endif !BUILD_DAEMON_OFFLOAD |
| 254 | |
| 255 | |
| 256 | CLEANFILES = \ |
| 257 | $(GOBJECTS) \ |
| 258 | $(SCM_TESTS:tests/%.scm=%.log) |
| 259 | |
| 260 | AM_V_GUILEC = $(AM_V_GUILEC_$(V)) |
| 261 | AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY)) |
| 262 | AM_V_GUILEC_0 = @echo " GUILEC" $@; |
| 263 | |
| 264 | # XXX: Use the C locale for when Guile lacks |
| 265 | # <http://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>. |
| 266 | .scm.go: |
| 267 | $(AM_V_GUILEC)$(MKDIR_P) `dirname "$@"` ; \ |
| 268 | LC_ALL=C \ |
| 269 | $(top_builddir)/pre-inst-env \ |
| 270 | $(GUILD) compile -L "$(top_builddir)" -L "$(top_srcdir)" \ |
| 271 | -Wformat -Wunbound-variable -Warity-mismatch \ |
| 272 | --target="$(host)" \ |
| 273 | -o "$@" "$<" |
| 274 | |
| 275 | SUFFIXES = .go |
| 276 | |
| 277 | # Make sure source files are installed first, so that the mtime of |
| 278 | # installed compiled files is greater than that of installed source |
| 279 | # files. See |
| 280 | # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html> |
| 281 | # for details. |
| 282 | guix_install_go_files = install-nobase_nodist_guilemoduleDATA |
| 283 | $(guix_install_go_files): install-nobase_dist_guilemoduleDATA |
| 284 | |
| 285 | SUBDIRS = po/guix po/packages |
| 286 | BUILT_SOURCES = |
| 287 | |
| 288 | include doc.am |
| 289 | |
| 290 | if BUILD_DAEMON |
| 291 | |
| 292 | include daemon.am |
| 293 | |
| 294 | endif BUILD_DAEMON |
| 295 | |
| 296 | ACLOCAL_AMFLAGS = -I m4 |
| 297 | AM_DISTCHECK_CONFIGURE_FLAGS = \ |
| 298 | --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \ |
| 299 | --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \ |
| 300 | --with-nix-prefix="$(NIX_PREFIX)" \ |
| 301 | --enable-daemon |
| 302 | |
| 303 | dist_emacsui_DATA = emacs/guix-main.scm |
| 304 | nodist_emacsui_DATA = emacs/guix-helper.scm |
| 305 | include emacs.am |
| 306 | |
| 307 | dist-hook: sync-descriptions gen-ChangeLog assert-no-store-file-names |
| 308 | distcheck-hook: assert-binaries-available assert-final-inputs-self-contained |
| 309 | |
| 310 | sync-descriptions: |
| 311 | -$(top_builddir)/pre-inst-env $(GUILE) \ |
| 312 | $(top_srcdir)/build-aux/sync-descriptions.scm |
| 313 | |
| 314 | gen-ChangeLog: |
| 315 | if test -d .git; then \ |
| 316 | $(top_srcdir)/build-aux/gitlog-to-changelog \ |
| 317 | > $(distdir)/cl-t; \ |
| 318 | rm -f $(distdir)/ChangeLog; \ |
| 319 | mv $(distdir)/cl-t $(distdir)/ChangeLog; \ |
| 320 | fi |
| 321 | |
| 322 | # Make sure we're not shipping a file that embeds a local /gnu/store file name. |
| 323 | assert-no-store-file-names: |
| 324 | if grep -r --exclude=*.texi --exclude=*.info \ |
| 325 | "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \ |
| 326 | then \ |
| 327 | echo "error: store file names embedded in the distribution" >&2 ; \ |
| 328 | exit 1 ; \ |
| 329 | fi |
| 330 | |
| 331 | # Make sure hydra.gnu.org has the important binaries. |
| 332 | assert-binaries-available: |
| 333 | $(top_builddir)/pre-inst-env "$(GUILE)" \ |
| 334 | "$(top_srcdir)/build-aux/check-available-binaries.scm" |
| 335 | |
| 336 | # Make sure the final inputs don't refer to bootstrap tools. |
| 337 | assert-final-inputs-self-contained: |
| 338 | $(top_builddir)/pre-inst-env "$(GUILE)" \ |
| 339 | "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm" |
| 340 | |
| 341 | .PHONY: sync-descriptions gen-ChangeLog clean-go |
| 342 | .PHONY: assert-no-store-file-names assert-binaries-available |
| 343 | .PHONY: assert-final-inputs-self-contained |