Mirror of GNU Guix
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.

311 lines
9.1 KiB

maint: Switch to Guile-JSON 3.x. Guile-JSON 3.x is incompatible with Guile-JSON 1.x, which we relied on until now: it maps JSON dictionaries to alists (instead of hash tables), and JSON arrays to vectors (instead of lists). This commit is about adjusting all the existing code to this new mapping. * m4/guix.m4 (GUIX_CHECK_GUILE_JSON): New macro. * configure.ac: Use it. * doc/guix.texi (Requirements): Mention the Guile-JSON version. * guix/git-download.scm (git-fetch)[guile-json]: Use GUILE-JSON-3. * guix/import/cpan.scm (string->license): Expect vectors instead of lists. (module->dist-name): Use 'json-fetch' instead of 'json-fetch-alist'. (cpan-fetch): Likewise. * guix/import/crate.scm (crate-fetch): Likewise, and call 'vector->list' for DEPS. * guix/import/gem.scm (rubygems-fetch): Likewise. * guix/import/json.scm (json-fetch-alist): Remove. * guix/import/pypi.scm (pypi-fetch): Use 'json-fetch' instead of 'json-fetch-alist'. (latest-source-release, latest-wheel-release): Call 'vector->list' on RELEASES. * guix/import/stackage.scm (stackage-lts-info-fetch): Use 'json-fetch' instead of 'json-fetch-alist'. (lts-package-version): Use 'vector->list'. * guix/import/utils.scm (hash-table->alist): Remove. (alist->package): Pass 'vector->list' on the inputs fields, and default to the empty vector. * guix/scripts/import/json.scm (guix-import-json): Remove call to 'hash-table->alist'. * guix/swh.scm (define-json-reader): Expect pair? or null? instead of hash-table?. [extract-field]: Use 'assoc-ref' instead of 'hash-ref'. (json->branches): Use 'map' instead of 'hash-map->list'. (json->checksums): Likewise. (json->directory-entries, origin-visits): Call 'vector->list' on the result of 'json->scm'. * tests/import-utils.scm ("alist->package with dependencies"): New test. * gnu/installer.scm (build-compiled-file)[builder]: Use GUILE-JSON-3. * gnu/installer.scm (installer-program)[installer-builder]: Likewise. * gnu/installer/locale.scm (iso639->iso639-languages): Use 'assoc-ref' instead of 'hash-ref', and pass vectors through 'vector->list'. (iso3166->iso3166-territories): Likewise. * gnu/system/vm.scm (system-docker-image)[build]: Use GUILE-JSON-3. * guix/docker.scm (manifest, config): Adjust for Guile-JSON 3. * guix/scripts/pack.scm (docker-image)[build]: Use GUILE-JSON-3. * guix/import/github.scm (fetch-releases-or-tags): Update docstring. (latest-released-version): Use 'assoc-ref' instead of 'hash-ref'. Pass the result of 'fetch-releases-or-tags' to 'vector->list'. * guix/import/launchpad.scm (latest-released-version): Likewise.
2 years ago
Switch to Guile-Gcrypt. This removes (guix hash) and (guix pk-crypto), which now live as part of Guile-Gcrypt (version 0.1.0.) * guix/gcrypt.scm, guix/hash.scm, guix/pk-crypto.scm, tests/hash.scm, tests/pk-crypto.scm: Remove. * configure.ac: Test for Guile-Gcrypt. Remove LIBGCRYPT and LIBGCRYPT_LIBDIR assignments. * m4/guix.m4 (GUIX_ASSERT_LIBGCRYPT_USABLE): Remove. * README: Add Guile-Gcrypt to the dependencies; move libgcrypt as "required unless --disable-daemon". * doc/guix.texi (Requirements): Likewise. * gnu/packages/bash.scm, guix/derivations.scm, guix/docker.scm, guix/git.scm, guix/http-client.scm, guix/import/cpan.scm, guix/import/cran.scm, guix/import/crate.scm, guix/import/elpa.scm, guix/import/gnu.scm, guix/import/hackage.scm, guix/import/texlive.scm, guix/import/utils.scm, guix/nar.scm, guix/pki.scm, guix/scripts/archive.scm, guix/scripts/authenticate.scm, guix/scripts/download.scm, guix/scripts/hash.scm, guix/scripts/pack.scm, guix/scripts/publish.scm, guix/scripts/refresh.scm, guix/scripts/substitute.scm, guix/store.scm, guix/store/deduplication.scm, guix/tests.scm, tests/base32.scm, tests/builders.scm, tests/challenge.scm, tests/cpan.scm, tests/crate.scm, tests/derivations.scm, tests/gem.scm, tests/nar.scm, tests/opam.scm, tests/pki.scm, tests/publish.scm, tests/pypi.scm, tests/store-deduplication.scm, tests/store.scm, tests/substitute.scm: Adjust imports. * gnu/system/vm.scm: Likewise. (guile-sqlite3&co): Rename to... (gcrypt-sqlite3&co): ... this. Add GUILE-GCRYPT. (expression->derivation-in-linux-vm)[config]: Remove. (iso9660-image)[config]: Remove. (qemu-image)[config]: Remove. (system-docker-image)[config]: Remove. * guix/scripts/pack.scm: Adjust imports. (guile-sqlite3&co): Rename to... (gcrypt-sqlite3&co): ... this. Add GUILE-GCRYPT. (self-contained-tarball)[build]: Call 'make-config.scm' without #:libgcrypt argument. (squashfs-image)[libgcrypt]: Remove. [build]: Call 'make-config.scm' without #:libgcrypt. (docker-image)[config, json]: Remove. [build]: Add GUILE-GCRYPT to the extensions Remove (guix config) from the imported modules. * guix/self.scm (specification->package): Remove "libgcrypt", add "guile-gcrypt". (compiled-guix): Remove #:libgcrypt. [guile-gcrypt]: New variable. [dependencies]: Add it. [*core-modules*]: Remove #:libgcrypt from 'make-config.scm' call. Add #:extensions. [*config*]: Remove #:libgcrypt from 'make-config.scm' call. (%dependency-variables): Remove %libgcrypt. (make-config.scm): Remove #:libgcrypt. * build-aux/build-self.scm (guile-gcrypt): New variable. (make-config.scm): Remove #:libgcrypt. (build-program)[fake-gcrypt-hash]: New variable. Add (gcrypt hash) to the imported modules. Adjust load path assignments. * gnu/packages/package-management.scm (guix)[propagated-inputs]: Add GUILE-GCRYPT. [arguments]: In 'wrap-program' phase, add GUILE-GCRYPT to the search path.
3 years ago
Switch to Guile-Gcrypt. This removes (guix hash) and (guix pk-crypto), which now live as part of Guile-Gcrypt (version 0.1.0.) * guix/gcrypt.scm, guix/hash.scm, guix/pk-crypto.scm, tests/hash.scm, tests/pk-crypto.scm: Remove. * configure.ac: Test for Guile-Gcrypt. Remove LIBGCRYPT and LIBGCRYPT_LIBDIR assignments. * m4/guix.m4 (GUIX_ASSERT_LIBGCRYPT_USABLE): Remove. * README: Add Guile-Gcrypt to the dependencies; move libgcrypt as "required unless --disable-daemon". * doc/guix.texi (Requirements): Likewise. * gnu/packages/bash.scm, guix/derivations.scm, guix/docker.scm, guix/git.scm, guix/http-client.scm, guix/import/cpan.scm, guix/import/cran.scm, guix/import/crate.scm, guix/import/elpa.scm, guix/import/gnu.scm, guix/import/hackage.scm, guix/import/texlive.scm, guix/import/utils.scm, guix/nar.scm, guix/pki.scm, guix/scripts/archive.scm, guix/scripts/authenticate.scm, guix/scripts/download.scm, guix/scripts/hash.scm, guix/scripts/pack.scm, guix/scripts/publish.scm, guix/scripts/refresh.scm, guix/scripts/substitute.scm, guix/store.scm, guix/store/deduplication.scm, guix/tests.scm, tests/base32.scm, tests/builders.scm, tests/challenge.scm, tests/cpan.scm, tests/crate.scm, tests/derivations.scm, tests/gem.scm, tests/nar.scm, tests/opam.scm, tests/pki.scm, tests/publish.scm, tests/pypi.scm, tests/store-deduplication.scm, tests/store.scm, tests/substitute.scm: Adjust imports. * gnu/system/vm.scm: Likewise. (guile-sqlite3&co): Rename to... (gcrypt-sqlite3&co): ... this. Add GUILE-GCRYPT. (expression->derivation-in-linux-vm)[config]: Remove. (iso9660-image)[config]: Remove. (qemu-image)[config]: Remove. (system-docker-image)[config]: Remove. * guix/scripts/pack.scm: Adjust imports. (guile-sqlite3&co): Rename to... (gcrypt-sqlite3&co): ... this. Add GUILE-GCRYPT. (self-contained-tarball)[build]: Call 'make-config.scm' without #:libgcrypt argument. (squashfs-image)[libgcrypt]: Remove. [build]: Call 'make-config.scm' without #:libgcrypt. (docker-image)[config, json]: Remove. [build]: Add GUILE-GCRYPT to the extensions Remove (guix config) from the imported modules. * guix/self.scm (specification->package): Remove "libgcrypt", add "guile-gcrypt". (compiled-guix): Remove #:libgcrypt. [guile-gcrypt]: New variable. [dependencies]: Add it. [*core-modules*]: Remove #:libgcrypt from 'make-config.scm' call. Add #:extensions. [*config*]: Remove #:libgcrypt from 'make-config.scm' call. (%dependency-variables): Remove %libgcrypt. (make-config.scm): Remove #:libgcrypt. * build-aux/build-self.scm (guile-gcrypt): New variable. (make-config.scm): Remove #:libgcrypt. (build-program)[fake-gcrypt-hash]: New variable. Add (gcrypt hash) to the imported modules. Adjust load path assignments. * gnu/packages/package-management.scm (guix)[propagated-inputs]: Add GUILE-GCRYPT. [arguments]: In 'wrap-program' phase, add GUILE-GCRYPT to the search path.
3 years ago
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_PREREQ(2.68)
  4. AC_INIT([GNU Guix],
  5. [m4_esyscmd([build-aux/git-version-gen .tarball-version])],
  6. [bug-guix@gnu.org], [guix],
  7. [https://www.gnu.org/software/guix/])
  8. AC_CONFIG_AUX_DIR([build-aux])
  9. AM_INIT_AUTOMAKE([1.14 gnu silent-rules subdir-objects \
  10. color-tests parallel-tests -Woverride -Wno-portability])
  11. # Enable silent rules by default.
  12. AM_SILENT_RULES([yes])
  13. AC_CONFIG_SRCDIR([guix.scm])
  14. AC_CONFIG_MACRO_DIR([m4])
  15. dnl For the C++ code. This must be used early.
  16. AC_USE_SYSTEM_EXTENSIONS
  17. AM_GNU_GETTEXT([external])
  18. AM_GNU_GETTEXT_VERSION([0.18.1])
  19. GUIX_SYSTEM_TYPE
  20. GUIX_ASSERT_SUPPORTED_SYSTEM
  21. AC_ARG_WITH(store-dir,
  22. AC_HELP_STRING([--with-store-dir=PATH],
  23. [file name of the store (defaults to /gnu/store)]),
  24. [storedir="$withval"],
  25. [storedir="/gnu/store"])
  26. AC_SUBST(storedir)
  27. AC_ARG_WITH([bash-completion-dir],
  28. AC_HELP_STRING([--with-bash-completion-dir=DIR],
  29. [name of the Bash completion directory]),
  30. [bashcompletiondir="$withval"],
  31. [bashcompletiondir='${sysconfdir}/bash_completion.d'])
  32. AC_SUBST([bashcompletiondir])
  33. AC_ARG_WITH([zsh-completion-dir],
  34. AC_HELP_STRING([--with-zsh-completion-dir=DIR],
  35. [name of the Zsh completion directory]),
  36. [zshcompletiondir="$withval"],
  37. [zshcompletiondir='${datadir}/zsh/site-functions'])
  38. AC_SUBST([zshcompletiondir])
  39. AC_ARG_WITH([fish-completion-dir],
  40. AC_HELP_STRING([--with-fish-completion-dir=DIR],
  41. [name of the Fish completion directory]),
  42. [fishcompletiondir="$withval"],
  43. [fishcompletiondir='${datadir}/fish/vendor_completions.d'])
  44. AC_SUBST([fishcompletiondir])
  45. AC_ARG_WITH([selinux-policy-dir],
  46. AC_HELP_STRING([--with-selinux-policy-dir=DIR],
  47. [name of the SELinux policy directory]),
  48. [selinux_policydir="$withval"],
  49. [selinux_policydir='${datadir}/selinux/'])
  50. AC_SUBST([selinux_policydir])
  51. dnl Better be verbose.
  52. AC_MSG_CHECKING([for the store directory])
  53. AC_MSG_RESULT([$storedir])
  54. AC_ARG_ENABLE([daemon],
  55. [AS_HELP_STRING([--disable-daemon], [do not build the Nix daemon (C++)])],
  56. [guix_build_daemon="$enableval"],
  57. [guix_build_daemon="yes"])
  58. # Prepare a version of $localstatedir & co. that does not contain references
  59. # to shell variables.
  60. guix_prefix="`eval echo $prefix | sed -e"s|NONE|/usr/local|g"`"
  61. guix_localstatedir="`eval echo $localstatedir | sed -e "s|NONE|$guix_prefix|g"`"
  62. guix_sysconfdir="`eval echo $sysconfdir | sed -e "s|NONE|$guix_prefix|g"`"
  63. guix_sbindir="`eval echo $sbindir | sed -e "s|NONE|$guix_prefix|g"`"
  64. AC_SUBST([guix_localstatedir])
  65. AC_SUBST([guix_sysconfdir])
  66. AC_SUBST([guix_sbindir])
  67. GUIX_CHECK_FILE_NAME_LIMITS([can_run_tests])
  68. AM_CONDITIONAL([CAN_RUN_TESTS], [test "x$can_run_tests" = "xyes"])
  69. dnl We require pkg.m4 (from pkg-config) and guile.m4 (from Guile.)
  70. dnl Make sure they are available.
  71. m4_pattern_forbid([PKG_CHECK_MODULES])
  72. m4_pattern_forbid([GUILE_MODULE_AVAILABLE])
  73. m4_pattern_forbid([^GUILE_P])
  74. m4_pattern_allow([^GUILE_PKG_ERRORS])
  75. m4_pattern_forbid([^GUIX_])
  76. dnl Search for 'guile' and 'guild'. This macro defines
  77. dnl 'GUILE_EFFECTIVE_VERSION'.
  78. GUILE_PKG([3.0 2.2])
  79. GUILE_PROGS
  80. if test "x$GUILD" = "x"; then
  81. AC_MSG_ERROR(['guild' binary not found; please check your guile-2.x installation.])
  82. fi
  83. dnl Installation directories for .scm and .go files.
  84. guilemoduledir="${datarootdir}/guile/site/$GUILE_EFFECTIVE_VERSION"
  85. guileobjectdir="${libdir}/guile/$GUILE_EFFECTIVE_VERSION/site-ccache"
  86. AC_SUBST([guilemoduledir])
  87. AC_SUBST([guileobjectdir])
  88. dnl The GnuTLS bindings are necessary for substitutes over HTTPS and for 'guix
  89. dnl pull', among other things.
  90. GUILE_MODULE_AVAILABLE([have_gnutls], [(gnutls)])
  91. if test "x$have_gnutls" != "xyes"; then
  92. AC_MSG_ERROR([The Guile bindings of GnuTLS are missing; please install them.])
  93. fi
  94. dnl Check for Guile-Git.
  95. GUILE_MODULE_AVAILABLE([have_guile_git], [(git)])
  96. if test "x$have_guile_git" != "xyes"; then
  97. AC_MSG_ERROR([Guile-Git is missing; please install it.])
  98. fi
  99. dnl Check for Guile-JSON.
  100. GUIX_CHECK_GUILE_JSON
  101. if test "x$guix_cv_have_recent_guile_json" != "xyes"; then
  102. AC_MSG_ERROR([Guile-JSON is missing; please install it.])
  103. fi
  104. dnl Guile-Sqlite3 is used by the (guix store ...) modules.
  105. GUIX_CHECK_GUILE_SQLITE3
  106. if test "x$guix_cv_have_recent_guile_sqlite3" != "xyes"; then
  107. AC_MSG_ERROR([A recent Guile-SQLite3 could not be found; please install it.])
  108. fi
  109. GUILE_MODULE_AVAILABLE([have_guile_gcrypt], [(gcrypt hash)])
  110. if test "x$have_guile_gcrypt" != "xyes"; then
  111. AC_MSG_ERROR([Guile-Gcrypt could not be found; please install it.])
  112. fi
  113. dnl Guile-newt is used by the graphical installer.
  114. GUILE_MODULE_AVAILABLE([have_guile_newt], [(newt)])
  115. AC_ARG_ENABLE([installer],
  116. AS_HELP_STRING([--enable-installer], [Build the graphical installer sources.]))
  117. AS_IF([test "x$enable_installer" = "xyes"], [
  118. if test "x$have_guile_newt" != "xyes"; then
  119. AC_MSG_ERROR([Guile-newt could not be found; please install it.])
  120. fi
  121. ])
  122. AM_CONDITIONAL([ENABLE_INSTALLER],
  123. [test "x$enable_installer" = "xyes"])
  124. dnl Make sure we have a full-fledged Guile.
  125. GUIX_ASSERT_GUILE_FEATURES([regex posix socket net-db threads])
  126. dnl Make sure we don't suffer from the bug in 'equal?' wrt. syntax objects
  127. dnl found in 2.2.1. See <https://bugs.gnu.org/29903>.
  128. GUIX_ASSERT_SYNTAX_OBJECT_EQUAL
  129. AC_PROG_SED
  130. dnl Decompressors, for use by the substituter and other modules.
  131. AC_PATH_PROG([GZIP], [gzip])
  132. AC_PATH_PROG([BZIP2], [bzip2])
  133. AC_PATH_PROG([XZ], [xz])
  134. AC_SUBST([GZIP])
  135. AC_SUBST([BZIP2])
  136. AC_SUBST([XZ])
  137. AC_ARG_WITH([nix-prefix],
  138. [AS_HELP_STRING([--with-nix-prefix=DIR],
  139. [search for Nix in DIR (for testing purposes and '--disable-daemon' builds)])],
  140. [case "$withval" in
  141. yes|no) ;;
  142. *)
  143. NIX_PREFIX="$withval"
  144. PATH="$NIX_PREFIX/bin:$PATH"; export PATH
  145. AC_SUBST([NIX_PREFIX])
  146. ;;
  147. esac],
  148. [])
  149. AC_PATH_PROG([NIX_HASH], [nix-hash])
  150. if test "x$guix_build_daemon$NIX_HASH" = "xno"; then
  151. AC_MSG_ERROR([Nix programs not found; please install Nix or use `--with-nix-prefix'.])
  152. fi
  153. AC_ARG_WITH([nixpkgs],
  154. [AS_HELP_STRING([--with-nixpkgs=DIR],
  155. [search for Nixpkgs in DIR (for testing purposes only)])],
  156. [case "$withval" in
  157. yes|no) AC_MSG_ERROR([Please use `--with-nixpkgs=DIR'.]);;
  158. *) NIXPKGS="$withval";;
  159. esac],
  160. [])
  161. AC_MSG_CHECKING([for Nixpkgs source tree])
  162. if test -f "$NIXPKGS/default.nix"; then
  163. AC_MSG_RESULT([$NIXPKGS])
  164. AC_SUBST([NIXPKGS])
  165. else
  166. AC_MSG_RESULT([not found])
  167. fi
  168. LIBGCRYPT_LIBDIR="no"
  169. LIBGCRYPT_PREFIX="no"
  170. AC_ARG_WITH([libgcrypt-prefix],
  171. [AS_HELP_STRING([--with-libgcrypt-prefix=DIR], [search for GNU libgcrypt in DIR])],
  172. [case "$withval" in
  173. yes|no)
  174. ;;
  175. *)
  176. LIBGCRYPT_PREFIX="$withval"
  177. LIBGCRYPT_LIBDIR="$withval/lib"
  178. ;;
  179. esac])
  180. AC_ARG_WITH([libgcrypt-libdir],
  181. [AS_HELP_STRING([--with-libgcrypt-libdir=DIR],
  182. [search for GNU libgcrypt's shared library in DIR])],
  183. [case "$withval" in
  184. yes|no)
  185. LIBGCRYPT_LIBDIR="no"
  186. ;;
  187. *)
  188. LIBGCRYPT_LIBDIR="$withval"
  189. ;;
  190. esac])
  191. dnl If none of the --with-libgcrypt-* options was used, try to determine the
  192. dnl the library directory.
  193. case "x$LIBGCRYPT_PREFIX$LIBGCRYPT_LIBDIR" in
  194. xnono)
  195. GUIX_LIBGCRYPT_LIBDIR([LIBGCRYPT_LIBDIR])
  196. ;;
  197. esac
  198. AC_SUBST([LIBGCRYPT_PREFIX])
  199. AC_SUBST([LIBGCRYPT_LIBDIR])
  200. dnl Library name of zlib suitable for 'dynamic-link'.
  201. GUIX_LIBZ_LIBDIR([libz_libdir])
  202. if test "x$libz_libdir" = "x"; then
  203. LIBZ="libz"
  204. else
  205. LIBZ="$libz_libdir/libz"
  206. fi
  207. AC_MSG_CHECKING([for zlib's shared library name])
  208. AC_MSG_RESULT([$LIBZ])
  209. AC_SUBST([LIBZ])
  210. dnl Library name of lzlib suitable for 'dynamic-link'.
  211. GUIX_LIBLZ_FILE_NAME([LIBLZ])
  212. if test "x$LIBLZ" = "x"; then
  213. LIBLZ="liblz"
  214. else
  215. # Strip the .so or .so.1 extension since that's what 'dynamic-link' expects.
  216. LIBLZ="`echo $LIBLZ | sed -es'/\.so\(\.[[0-9.]]\+\)\?//g'`"
  217. fi
  218. AC_SUBST([LIBLZ])
  219. dnl Check for Guile-SSH, for the (guix ssh) module.
  220. GUIX_CHECK_GUILE_SSH
  221. AM_CONDITIONAL([HAVE_GUILE_SSH],
  222. [test "x$guix_cv_have_recent_guile_ssh" = "xyes"])
  223. AC_CACHE_SAVE
  224. m4_include([config-daemon.ac])
  225. dnl `dot' (from the Graphviz package) is only needed for maintainers.
  226. dnl See `Building from Git' in the manual for more info.
  227. AM_MISSING_PROG([DOT], [dot])
  228. dnl Manual pages.
  229. AM_MISSING_PROG([HELP2MAN], [help2man])
  230. dnl Documentation translation.
  231. AM_MISSING_PROG([PO4A_TRANSLATE], [po4a-translate])
  232. AM_MISSING_PROG([PO4A_UPDATEPO], [po4a-updatepo])
  233. dnl Emacs (optional), for 'etc/indent-code.el'.
  234. AC_PATH_PROG([EMACS], [emacs])
  235. if test "x$EMACS" = x; then
  236. AC_MSG_WARN([Please install GNU Emacs to use etc/indent-code.el.])
  237. else
  238. AC_SUBST([EMACS])
  239. AC_CONFIG_FILES([etc/indent-code.el], [chmod +x etc/indent-code.el])
  240. fi
  241. case "$storedir" in
  242. /gnu/store)
  243. ;;
  244. *)
  245. AC_MSG_WARN([Using a store directory other than '/gnu/store' will prevent you])
  246. AC_MSG_WARN([from downloading substitutes from gnu.org.])
  247. ;;
  248. esac
  249. AC_CONFIG_FILES([Makefile
  250. po/guix/Makefile.in
  251. po/packages/Makefile.in
  252. etc/guix-daemon.cil
  253. guix/config.scm])
  254. AC_CONFIG_FILES([test-env:build-aux/test-env.in], [chmod +x test-env])
  255. AC_CONFIG_FILES([pre-inst-env:build-aux/pre-inst-env.in],
  256. [chmod +x pre-inst-env])
  257. AC_OUTPUT