aboutsummaryrefslogtreecommitdiff
# GNU Guix --- Functional package management for GNU
# Copyright © 2018, 2019 Ludovic Courtès <ludo@gnu.org>
#
# This file is part of GNU Guix.
#
# GNU Guix is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or (at
# your option) any later version.
#
# GNU Guix is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

#
# Test the 'guix pack --localstatedir' command-line utility.
#

guix pack --version

# 'guix pack --localstatedir' produces derivations that depend on
# guile-sqlite3 and guile-gcrypt.  To make that relatively inexpensive, run
# the test in the user's global store if possible, on the grounds that
# binaries may already be there or can be built or downloaded inexpensively.

storedir="`guile -c '(use-modules (guix config))(display %storedir)'`"
localstatedir="`guile -c '(use-modules (guix config))(display %localstatedir)'`"
NIX_STORE_DIR="$storedir"
GUIX_DAEMON_SOCKET="$localstatedir/guix/daemon-socket/socket"
export NIX_STORE_DIR GUIX_DAEMON_SOCKET

if ! guile -c '(use-modules (guix)) (exit (false-if-exception (open-connection)))'
then
    exit 77
fi

# Build a tarball with '--localstatedir'
the_pack="`guix pack -C none --localstatedir --profile-name=current-guix \
            guile-bootstrap`"
test_directory="`mktemp -d`"
trap 'chmod -Rf +w "$test_directory"; rm -rf "$test_directory"' EXIT

cd "$test_directory"
tar -xf "$the_pack"

profile="`find -name current-guix`"
test "`readlink $profile`" = "current-guix-1-link"
test -s "`dirname $profile`/../../../db/db.sqlite"
test -x ".`guix build guile-bootstrap`/bin/guile"
cd -

# Make sure the store database is not completely bogus.
guile -c "(use-modules (sqlite3) (guix config) (ice-9 match))

  (define db
    (sqlite-open (string-append \"$test_directory\"
                                %localstatedir
                               \"/guix/db/db.sqlite\")
                 SQLITE_OPEN_READONLY))

  (define stmt
    (sqlite-prepare db \"SELECT * FROM ValidPaths;\"))

  (match (sqlite-fold cons '() stmt)
    ((#(ids paths hashes times derivers sizes) ...)
     (exit (member \"`guix build guile-bootstrap`\" paths))))"
/td> 2020-10-17doc: Generate cross-references in code snippets to the Guile manual....Occurrences of 'list', 'cons', etc. in code snippets now link to the relevant section of the Guile manual. * doc/build.scm (guile-manual, %guile-manual-base-url) (guile-mono-node-indexes, guile-split-node-indexes): New variables. (for-all-languages, merge-index-alists): New procedures. <top level>: Rename 'mono-node-indexes' and 'split-node-indexes' to 'guix-mono-node-indexes' and 'guix-split-node-indexes' respectively. Add 'mono-node-indexes' and 'split-node-indexes' defined as calls to 'merge-index-alists'. Ludovic Courtès 2020-10-17doc: Allow code snippets in the cookbook to link to the manual....Until now, only code snippets in the manual itself would contain links to identifier definitions. Now snippets in the cookbook also link to definitions in the manual. * doc/build.scm (html-manual): Add #:mono-node-indexes and #:multi-node-indexes and pass it to 'syntax-highlighted-html'. (pdf+html-manual): Likewise, and pass it to 'html-manual'. <top level>: Factorize 'version' and 'source'. Define 'guix-manual', 'mono-node-indexes', and 'split-node-indexes'. Pass #:mono-node-indexes and #:split-node-indexes to 'pdf+html-manual'. Ludovic Courtès 2020-10-17doc: Move manual index creation to a separate derivation....* doc/build.scm (normalize-language-code, html-manual-identifier-index): New procedures. (syntax-highlighted-html): Add #:mono-node-indexes and #:split-node-indexes. [build](underscore-decode, anchor-id->key, collect-anchors): Remove. (language+node-anchors, mono-node-anchors, multi-node-anchors): New variables. Use them. Ludovic Courtès 2020-10-17doc: Remove 'build.scm' from the source of the manual....That way we no longer have to rebuild the whole manual when fiddling with 'build.scm'. * doc/build.scm <top level>: Define 'select?' and pass it to 'pdf+html-manual'. Ludovic Courtès 2020-09-04doc: Syntax highlighting now handles @var within @lisp....* doc/build.scm (syntax-highlighted-html)[build](concatenate-pieces): Handle @var{name}. Ludovic Courtès 2020-05-25doc: Remove one use of 'file-append*'....* doc/build.scm (texinfo-manual-source)[build]: Use 'file-append', not 'file-append*', for 'htmlxref.cnf', to ensure it has the right basename. Ludovic Courtès 2020-05-18doc: Inherit md5.scm fix in custom 'guile-lib' variant....* doc/build.scm (guile-lib/htmlprag-fixed)[source]: Remove. [arguments]: Add 'fix-htmlprag' phase. Ludovic Courtès 2020-05-02doc: Fix building the cookbook....Fixes <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40803>. Reported by "operator.name" <operator.name@protonmail.com>. * doc/build.scm (%languages): Add smaller list for the cookbook. (syntax-highlighted-html): Adapt regexp for mono-node files to include the cookbook. Björn Höfling 2020-04-21doc: Include *.json files in the source....This is a followup to c9f321e52a99dea93fcc099372ea0167150b9aac. * doc/build.scm (texinfo-manual-source)[build]: Add *.json to #$output. Ludovic Courtès 2020-04-13doc: Improve anchor collection....This allows us to catch "operating_002dsystem-1", for instance. * doc/build.scm (syntax-highlighted-html)[build](anchor-id->key): Drop "-1" & co. from ID. Ludovic Courtès 2020-04-13doc: Avoid invalid 'match' pattern in 'syntax-highlighted-html'....This is a followup to da9deba13d551e316f5a99a614834efa27ddc7d1. Last-minute modification of the 'match' pattern would lead to an error: "multiple ellipsis patterns not allowed at same level" * doc/build.scm (syntax-highlighted-html)[build](collect-anchors): Add 'worthy-entry?' procedure and use it instead of the unsupported pattern for ('dt ...). Ludovic Courtès 2020-04-13doc: Emit hyperlinks in HTML output for @lisp snippets....This makes it easier to jump to the definition of a procedure or variable when looking at a code snippet. There can be false-positive because scoping rules are ignored, for example, but it should be a good approximation. * doc/build.scm (syntax-highlighted-html)[build](highlights->sxml*): Add 'anchors' parameter. Add clause for ('symbol text). (syntax-highlight): Add 'anchors' parameter. Wrap body in named let and use it in recursive calls. Pass ANCHORS to 'highlights->sxml*'. (underscore-decode, anchor-id->key, collect-anchors, html?): New procedures. (process-file): Add 'anchors' parameter. and honor it. Rewrite mono-node and multi-node HTML files separately. Ludovic Courtès 2020-01-12doc: Make sure 'htmlxref.cnf' is honored....Fixes <https://bugs.gnu.org/39060>. Reported by Tobias Geerinckx-Rice <me@tobias.gr>. * doc/build.scm (html-manual)[build]: Copy 'htmlxref.cnf' to the current directory so that 'makeinfo' honors it. Ludovic Courtès 2019-11-28doc: Handle right arrows in 'syntax-highlighted-html'....* doc/build.scm (syntax-highlighted-html)[build](entity->string): Add "rarr". Ludovic Courtès 2019-10-22doc: Use the right title in HTML indices for the cookbook....* doc/build.scm (html-manual-indexes): Add #:title. [build]: Replace "GNU Guix Reference Manual" by references to TITLE. Ludovic Courtès 2019-10-21doc: More responsive online manual....* doc/build.scm (%makeinfo-html-options): Add viewport to all generated html pages for better mobile device support. Julien Lepiller 2019-10-21doc: Add support for "guix-cookbook.texi" to 'build.scm'....* doc/build.scm (%manual): New variable. (html-manual): #:manual now defaults to %MANUAL. [build]: Define 'language->texi-file-name' and use it. Filter out items of LANGUAGES that lack a .texi file. (pdf-manual, html-manual-indexes, pdf+html-manual): #:manual now defaults to %MANUAL. Ludovic Courtès 2019-09-25doc: Support paren matching via CSS hover....* doc/build.scm (syntax-highlighted-html)[build](pair-open/close) (highlights->sxml*): New procedures. (syntax-highlight): Use 'highlights->sxml*'. Ludovic Courtès 2019-09-07doc: Work around (htmlprag) parser issue....* doc/build.scm (guile-lib/htmlprag-fixed): New variable. (syntax-highlighted-html): Use it instead of GUILE-LIB. Ludovic Courtès 2019-09-07doc: Highlight Scheme syntax in the HTML output....* doc/build.scm (syntax-highlighted-html): New procedure. (html-manual): Use it. Ludovic Courtès 2019-07-16doc: Add 'images' directory next to HTML pages....* doc/build.scm (html-manual): Add images/ symlinks. Ludovic Courtès 2019-07-15doc: Build a top-level index of the manuals....Suggested by Julien Lepiller. * doc/build.scm (html-manual-indexes)[build]: Add 'with-extensions'. (translate): Actually honor DOMAIN. Add call to 'bindtextdomain' for ISO-CODES. (%iso639-languages): New variable. (language-code->name, top-level-index): New procedures. Add call to 'write-html' for OUTPUT/index.html. Ludovic Courtès 2019-07-15doc: Generalize build procedures of HTML indexes....* doc/build.scm (html-manual-indexes)[build](sxml-index): Generalize; add a 'title' and a 'body' parameter and honor them. (language-index): New procedure. (write-index): Remove. (write-html): New procedure. Use 'write-html' and 'language-index'. Ludovic Courtès 2019-07-07build: Add 'doc/build.scm' to build on-line copies of the manual....* doc/build.scm: New file. * Makefile.am (EXTRA_DIST): Add it. Ludovic Courtès