From 6d1a5e5ffdbb7d15ffad7918213d96ee8c6e9164 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 1 May 2017 15:51:47 +0200 Subject: refresh: Report packages using the "@" syntax. * guix/scripts/refresh.scm (list-dependents)[full-name]: New procedure. Use 'full-name' instead of 'package-full-name'. * doc/guix.texi (Invoking guix refresh): Adjust example accordingly. --- doc/guix.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/guix.texi') diff --git a/doc/guix.texi b/doc/guix.texi index 957ce2bab3..9f63413bbf 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -5852,7 +5852,7 @@ an upgrade. More rebuilds might be required under some circumstances. @example $ guix refresh --list-dependent flex Building the following 120 packages would ensure 213 dependent packages are rebuilt: -hop-2.4.0 geiser-0.4 notmuch-0.18 mu-0.9.9.5 cflow-1.4 idutils-4.6 @dots{} +hop@@2.4.0 geiser@@0.4 notmuch@@0.18 mu@@0.9.9.5 cflow@@1.4 idutils@@4.6 @dots{} @end example The command above lists a set of packages that could be built to check -- cgit 1.4.1 From e30c2be10da8929e42aafc7770257e84de49ffbb Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 1 May 2017 15:45:41 +0200 Subject: packages: Remove support for PACKAGE-VERSION deprecated syntax. This syntax had been deprecated since 2016-02-28. * gnu/packages.scm (%find-package): Remove #:fallback? parameter and handling. * tests/guix-build.sh: Remove test for "time-1.7" syntax. * doc/guix.texi (Invoking guix lint): Update 'guix lint' output in example. --- doc/guix.texi | 6 +++--- gnu/packages.scm | 17 ++--------------- tests/guix-build.sh | 1 - 3 files changed, 5 insertions(+), 19 deletions(-) (limited to 'doc/guix.texi') diff --git a/doc/guix.texi b/doc/guix.texi index 9f63413bbf..9b2fe3fdb8 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -16281,9 +16281,9 @@ distribution: @smallexample $ guix lint -c cve -gnu/packages/base.scm:652:2: glibc-2.21: probably vulnerable to CVE-2015-1781, CVE-2015-7547 -gnu/packages/gcc.scm:334:2: gcc-4.9.3: probably vulnerable to CVE-2015-5276 -gnu/packages/image.scm:312:2: openjpeg-2.1.0: probably vulnerable to CVE-2016-1923, CVE-2016-1924 +gnu/packages/base.scm:652:2: glibc@@2.21: probably vulnerable to CVE-2015-1781, CVE-2015-7547 +gnu/packages/gcc.scm:334:2: gcc@@4.9.3: probably vulnerable to CVE-2015-5276 +gnu/packages/image.scm:312:2: openjpeg@@2.1.0: probably vulnerable to CVE-2016-1923, CVE-2016-1924 @dots{} @end smallexample diff --git a/gnu/packages.scm b/gnu/packages.scm index 92bab7228a..bec8163b2b 100644 --- a/gnu/packages.scm +++ b/gnu/packages.scm @@ -306,7 +306,7 @@ return its return value." ;;; Package specification. ;;; -(define* (%find-package spec name version #:key fallback?) +(define* (%find-package spec name version) (match (find-best-packages-by-name name version) ((pkg . pkg*) (unless (null? pkg*) @@ -314,10 +314,6 @@ return its return value." (warning (_ "choosing ~a@~a from ~a~%") (package-name pkg) (package-version pkg) (location->string (package-location pkg)))) - (when fallback? - (warning (_ "deprecated NAME-VERSION syntax; \ -use NAME@VERSION instead~%"))) - (match (package-superseded pkg) ((? package? new) (info (_ "package '~a' has been superseded by '~a'~%") @@ -328,16 +324,7 @@ use NAME@VERSION instead~%"))) (x (if version (leave (_ "~A: package not found for version ~a~%") name version) - (if (not fallback?) - ;; XXX: Fallback to the older specification style with an hyphen - ;; between NAME and VERSION, for backward compatibility. - (call-with-values - (lambda () - (hyphen-separated-name->name+version name)) - (cut %find-package spec <> <> #:fallback? #t)) - - ;; The fallback case didn't find anything either, so bail out. - (leave (_ "~A: unknown package~%") name)))))) + (leave (_ "~A: unknown package~%") name))))) (define (specification->package spec) "Return a package matching SPEC. SPEC may be a package name, or a package diff --git a/tests/guix-build.sh b/tests/guix-build.sh index 9494e7371f..880a582777 100644 --- a/tests/guix-build.sh +++ b/tests/guix-build.sh @@ -185,7 +185,6 @@ test "`guix build superseded -d`" = "`guix build bar -d`" # Parsing package names and versions. guix build -n time # PASS guix build -n time@1.7 # PASS, version found -guix build -n time-1.7 # PASS, deprecated version syntax if guix build -n time@3.2; # FAIL, version not found then false; else true; fi if guix build -n something-that-will-never-exist; # FAIL -- cgit 1.4.1 From fc06b15e86d40549dc30097621a2c7c6bcd69f2e Mon Sep 17 00:00:00 2001 From: humanitiesNerd Date: Wed, 29 Mar 2017 11:43:55 +0200 Subject: doc: Add 'Debugging Build Failures' node. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/guix.texi (Debugging Build Failures): New node. Co-authored-by: Ludovic Courtès --- doc/guix.texi | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 83 insertions(+), 2 deletions(-) (limited to 'doc/guix.texi') diff --git a/doc/guix.texi b/doc/guix.texi index 9b2fe3fdb8..0054022fb9 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -34,7 +34,8 @@ Copyright @copyright{} 2017 Clément Lassieur@* Copyright @copyright{} 2017 Mathieu Othacehe@* Copyright @copyright{} 2017 Federico Beffa@* Copyright @copyright{} 2017 Carlo Zancanaro@* -Copyright @copyright{} 2017 Thomas Danckaert +Copyright @copyright{} 2017 Thomas Danckaert@* +Copyright @copyright{} 2017 humanitiesNerd Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -2879,7 +2880,8 @@ unavailable to the build process, possibly leading to a build failure. Once a package definition is in place, the package may actually be built using the @code{guix build} command-line -tool (@pxref{Invoking guix build}). You can easily jump back to the +tool (@pxref{Invoking guix build}), troubleshooting any build failures +you encounter (@pxref{Debugging Build Failures}). You can easily jump back to the package definition using the @command{guix edit} command (@pxref{Invoking guix edit}). @xref{Packaging Guidelines}, for @@ -4832,6 +4834,7 @@ described in the subsections below. * Common Build Options:: Build options for most commands. * Package Transformation Options:: Creating variants of packages. * Additional Build Options:: Options specific to 'guix build'. +* Debugging Build Failures:: Real life packaging experience @end menu @node Common Build Options @@ -4857,6 +4860,8 @@ the command-line tools. Keep the build tree of failed builds. Thus, if a build fails, its build tree is kept under @file{/tmp}, in a directory whose name is shown at the end of the build log. This is useful when debugging build issues. +@xref{Debugging Build Failures}, for tips and tricks on how to debug +build issues. @item --keep-going @itemx -k @@ -5244,6 +5249,82 @@ https://hydra.gnu.org/log/@dots{}-gdb-7.10 You can freely access a huge library of build logs! @end table +@node Debugging Build Failures +@subsection Debugging Build Failures + +@cindex build failures, debugging +When defining a new package (@pxref{Defining Packages}), you will +probably find yourself spending some time debugging and tweaking the +build until it succeeds. To do that, you need to operate the build +commands yourself in an environment as close as possible to the one the +build daemon uses. + +To that end, the first thing to do is to use the @option{--keep-failed} +or @option{-K} option of @command{guix build}, which will keep the +failed build tree in @file{/tmp} or whatever directory you specified as +@code{TMPDIR} (@pxref{Invoking guix build, @code{--keep-failed}}). + +From there on, you can @command{cd} to the failed build tree and source +the @file{environment-variables} file, which contains all the +environment variable definitions that were in place when the build +failed. So let's say you're debugging a build failure in package +@code{foo}; a typical session would look like this: + +@example +$ guix build foo -K +@dots{} @i{build fails} +$ cd /tmp/guix-build-foo.drv-0 +$ source ./environment-variables +$ cd foo-1.2 +@end example + +Now, you can invoke commands as if you were the daemon (almost) and +troubleshoot your build process. + +Sometimes it happens that, for example, a package's tests pass when you +run them manually but they fail when the daemon runs them. This can +happen because the daemon runs builds in containers where, unlike in our +environment above, network access is missing, @file{/bin/sh} does not +exist, etc. (@pxref{Build Environment Setup}). + +In such cases, you may need to run inspect the build process from within +a container similar to the one the build daemon creates: + +@example +$ guix build -K foo +@dots{} +$ cd /tmp/guix-build-foo.drv-0 +$ guix environment -C foo --ad-hoc strace gdb +[env]# source ./environment-variables +[env]# cd foo-1.2 +@end example + +Here, @command{guix environment -C} creates a container and spawns a new +shell in it (@pxref{Invoking guix environment}). The @command{--ad-hoc +strace gdb} part adds the @command{strace} and @command{gdb} commands to +the container, which would may find handy while debugging. + +To get closer to a container like that used by the build daemon, we can +remove @file{/bin/sh}: + +@example +[env]# rm /bin/sh +@end example + +(Don't worry, this is harmless: this is all happening in the throw-away +container created by @command{guix environment}.) + +The @command{strace} command is probably not in the search path, but we +can run: + +@example +[env]# $GUIX_ENVIRONMENT/bin/strace -f -o log make check +@end example + +In this way, not only you will have reproduced the environment variables +the daemon uses, you will also be running the build process in a container +similar to the one the daemon uses. + @node Invoking guix edit @section Invoking @command{guix edit} -- cgit 1.4.1 From 8ca0c88a894c685b624757e38ee7663534f03460 Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Fri, 28 Apr 2017 15:52:21 +0300 Subject: doc: Add references to Emacs-Guix manual. * doc/htmlxref.cnf: Add links to the real manual. * doc/contributing.texi (Formatting Code): Add reference to it. * doc/guix.texi (Package Management): Likewise. --- doc/contributing.texi | 5 ++++- doc/guix.texi | 12 +++++++----- doc/htmlxref.cnf | 4 +++- 3 files changed, 14 insertions(+), 7 deletions(-) (limited to 'doc/guix.texi') diff --git a/doc/contributing.texi b/doc/contributing.texi index bbc93424b4..8465745ee9 100644 --- a/doc/contributing.texi +++ b/doc/contributing.texi @@ -248,7 +248,10 @@ please do read it. Some special forms introduced in Guix, such as the @code{substitute*} macro, have special indentation rules. These are defined in the -@file{.dir-locals.el} file, which Emacs automatically uses. +@file{.dir-locals.el} file, which Emacs automatically uses. Also note +that Emacs-Guix provides @code{guix-devel-mode} mode that indents and +highlights Guix code properly (@pxref{Development,,, emacs-guix, The +Emacs-Guix Reference Manual}). @cindex indentation, of code @cindex formatting, of code diff --git a/doc/guix.texi b/doc/guix.texi index 0054022fb9..79942d7cd1 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -1430,11 +1430,13 @@ remove software packages, without having to know about their build procedures or dependencies. Guix also goes beyond this obvious set of features. -This chapter describes the main features of Guix, as well as the package -management tools it provides. Along with the command-line interface -described below (@pxref{Invoking guix package, @code{guix package}}), -you may also use Emacs Interface, after installing @code{emacs-guix} -package (run @kbd{M-x guix-help} command to start with it): +This chapter describes the main features of Guix, as well as the +package management tools it provides. Along with the command-line +interface described below (@pxref{Invoking guix package, @code{guix +package}}), you may also use Emacs Interface (@pxref{Top,,, +emacs-guix, The Emacs-Guix Reference Manual}), after installing +@code{emacs-guix} package (run @kbd{M-x guix-help} command to start +with it): @example guix package -i emacs-guix diff --git a/doc/htmlxref.cnf b/doc/htmlxref.cnf index 93e214fcc5..78f427bd07 100644 --- a/doc/htmlxref.cnf +++ b/doc/htmlxref.cnf @@ -219,7 +219,9 @@ emacs node ${EMACS}/html_node/emacs/ easejs mono ${GS}/easejs/manual/easejs.html easejs node ${GS}/easejs/manual/ -emacs-guix mono https://notabug.org/alezost/emacs-guix +EMACS_GUIX = https://alezost.github.io/guix.el/manual/latest +emacs-guix mono ${EMACS_GUIX}/emacs-guix.html +emacs-guix node ${EMACS_GUIX}/html_node/index.html emacs-muse node ${GS}/emacs-muse/manual/muse.html emacs-muse node ${GS}/emacs-muse/manual/html_node/ -- cgit 1.4.1 From fe0915cf24a2bd2edd2b7d38d4ba85998e486f20 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Mon, 1 May 2017 15:44:31 +0200 Subject: doc: Document (list package output) syntax in operanting-system-packages. * doc/guix.texi (Globally-Visible Packages): Document (PACKAGE OUTPUT) syntax. --- doc/guix.texi | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'doc/guix.texi') diff --git a/doc/guix.texi b/doc/guix.texi index 79942d7cd1..4446909ed6 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -7761,7 +7761,19 @@ provides all the tools one would expect for basic user and administrator tasks---including the GNU Core Utilities, the GNU Networking Utilities, the GNU Zile lightweight text editor, @command{find}, @command{grep}, etc. The example above adds tcpdump to those, taken from the @code{(gnu -packages admin)} module (@pxref{Package Modules}). +packages admin)} module (@pxref{Package Modules}). The +@code{(list package output)} syntax can be used to add a specific output +of a package: + +@lisp +(use-modules (gnu packages)) +(use-modules (gnu packages dns)) + +(operating-system + ;; ... + (packages (cons (list bind "utils") + %base-packages))) +@end lisp @findex specification->package Referring to packages by variable name, like @var{tcpdump} above, has -- cgit 1.4.1 From 4902d3c4e0376974356481f222583580b49f39e1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 9 May 2017 15:45:04 +0200 Subject: pull: Honor the standard build options. Reported by Niall Dooley in . * guix/scripts/pull.scm (%options): Add --dry-run and all of %STANDARD-BUILD-OPTIONS. (show-help): Add call to 'show-build-options-help'. (%default-options): Add 'system', 'substitutes?', 'graft?', 'max-silent-time', and 'verbosity'. (guix-pull)[parse-options]: Remove. Use 'parse-command-line' instead. Honor --dry-run. --- doc/guix.texi | 6 ++- guix/scripts/pull.scm | 103 +++++++++++++++++++++++++++----------------------- 2 files changed, 59 insertions(+), 50 deletions(-) (limited to 'doc/guix.texi') diff --git a/doc/guix.texi b/doc/guix.texi index 4446909ed6..22dc8b3f90 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -2390,13 +2390,13 @@ For example, to download and deploy version 0.12.0 of Guix from the canonical Git repo: @example -guix pull --url=http://git.savannah.gnu.org/cgit/guix.git/snapshot/v0.12.0.tar.gz +guix pull --url=https://git.savannah.gnu.org/cgit/guix.git/snapshot/v0.12.0.tar.gz @end example It can also be used to deploy arbitrary Git revisions: @example -guix pull --url=http://git.savannah.gnu.org/cgit/guix.git/snapshot/74d862e8a.tar.gz +guix pull --url=https://git.savannah.gnu.org/cgit/guix.git/snapshot/74d862e8a.tar.gz @end example @item --bootstrap @@ -2404,6 +2404,8 @@ Use the bootstrap Guile to build the latest Guix. This option is only useful to Guix developers. @end table +In addition, @command{guix pull} supports all the common build options +(@pxref{Common Build Options}). @node Invoking guix pack @section Invoking @command{guix pack} diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm index 82fcaa248c..5ab95628b4 100644 --- a/guix/scripts/pull.scm +++ b/guix/scripts/pull.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2017 Ludovic Courtès ;;; Copyright © 2017 Marius Bakke ;;; ;;; This file is part of GNU Guix. @@ -28,6 +28,7 @@ #:use-module (guix download) #:use-module (guix gexp) #:use-module (guix monads) + #:use-module (guix scripts build) #:use-module ((guix build utils) #:select (with-directory-excursion delete-file-recursively)) #:use-module ((guix build download) @@ -72,7 +73,12 @@ (define %default-options ;; Alist of default option values. - `((tarball-url . ,%snapshot-url))) + `((tarball-url . ,%snapshot-url) + (system . ,(%current-system)) + (substitutes? . #t) + (graft? . #t) + (max-silent-time . 3600) + (verbosity . 0))) (define (show-help) (display (G_ "Usage: guix pull [OPTION]... @@ -84,6 +90,7 @@ Download and deploy the latest version of Guix.\n")) (display (G_ " --bootstrap use the bootstrap Guile to build the new Guix")) (newline) + (show-build-options-help) (display (G_ " -h, --help display this help and exit")) (display (G_ " @@ -93,24 +100,29 @@ Download and deploy the latest version of Guix.\n")) (define %options ;; Specifications of the command-line options. - (list (option '("verbose") #f #f - (lambda (opt name arg result) - (alist-cons 'verbose? #t result))) - (option '("url") #t #f - (lambda (opt name arg result) - (alist-cons 'tarball-url arg - (alist-delete 'tarball-url result)))) - (option '("bootstrap") #f #f - (lambda (opt name arg result) - (alist-cons 'bootstrap? #t result))) + (cons* (option '("verbose") #f #f + (lambda (opt name arg result) + (alist-cons 'verbose? #t result))) + (option '("url") #t #f + (lambda (opt name arg result) + (alist-cons 'tarball-url arg + (alist-delete 'tarball-url result)))) + (option '(#\n "dry-run") #f #f + (lambda (opt name arg result) + (alist-cons 'dry-run? #t (alist-cons 'graft? #f result)))) + (option '("bootstrap") #f #f + (lambda (opt name arg result) + (alist-cons 'bootstrap? #t result))) - (option '(#\h "help") #f #f - (lambda args - (show-help) - (exit 0))) - (option '(#\V "version") #f #f - (lambda args - (show-version-and-exit "guix pull"))))) + (option '(#\h "help") #f #f + (lambda args + (show-help) + (exit 0))) + (option '(#\V "version") #f #f + (lambda args + (show-version-and-exit "guix pull"))) + + %standard-build-options)) (define what-to-build (store-lift show-what-to-build)) @@ -215,16 +227,8 @@ contained therein." (return #t)))) (leave (G_ "failed to update Guix, check the build log~%"))))) + (define (guix-pull . args) - (define (parse-options) - ;; Return the alist of option values. - (args-fold* args %options - (lambda (opt name arg result) - (leave (G_ "~A: unrecognized option~%") name)) - (lambda (arg result) - (leave (G_ "~A: unexpected argument~%") arg)) - %default-options)) - (define (use-le-certs? url) (string-prefix? "https://git.savannah.gnu.org/" url)) @@ -232,28 +236,31 @@ contained therein." (download-to-store store url "guix-latest.tar.gz")) (with-error-handling - (let* ((opts (parse-options)) + (let* ((opts (parse-command-line args %options + (list %default-options))) (store (open-connection)) (url (assoc-ref opts 'tarball-url))) - (let ((tarball - (if (use-le-certs? url) - (let* ((drv (package-derivation store le-certs)) - (certs (string-append (derivation->output-path drv) - "/etc/ssl/certs"))) - (build-derivations store (list drv)) - (parameterize ((%x509-certificate-directory certs)) - (fetch-tarball store url))) - (fetch-tarball store url)))) - (unless tarball - (leave (G_ "failed to download up-to-date source, exiting\n"))) - (parameterize ((%guile-for-build - (package-derivation store - (if (assoc-ref opts 'bootstrap?) - %bootstrap-guile - (canonical-package guile-2.0))))) - (run-with-store store - (build-and-install tarball (config-directory) - #:verbose? (assoc-ref opts 'verbose?)))))))) + (set-build-options-from-command-line store opts) + (unless (assoc-ref opts 'dry-run?) ;XXX: not very useful + (let ((tarball + (if (use-le-certs? url) + (let* ((drv (package-derivation store le-certs)) + (certs (string-append (derivation->output-path drv) + "/etc/ssl/certs"))) + (build-derivations store (list drv)) + (parameterize ((%x509-certificate-directory certs)) + (fetch-tarball store url))) + (fetch-tarball store url)))) + (unless tarball + (leave (G_ "failed to download up-to-date source, exiting\n"))) + (parameterize ((%guile-for-build + (package-derivation store + (if (assoc-ref opts 'bootstrap?) + %bootstrap-guile + (canonical-package guile-2.0))))) + (run-with-store store + (build-and-install tarball (config-directory) + #:verbose? (assoc-ref opts 'verbose?))))))))) ;; Local Variables: ;; eval: (put 'with-PATH 'scheme-indent-function 1) -- cgit 1.4.1 From 8df64f7384263764a3c1bcfdb783c8188570cce7 Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Fri, 9 Sep 2016 16:51:01 +0200 Subject: ant-build-system: Allow specifying source directory. * guix/build-system/ant.scm (ant-build), guix/build/ant-build-system.scm (default-build.xml): Add parameter source-dir. * guix/build/ant-build-system.scm (configure): Pass source-dir on to default-build.xml. * doc/guix.texi (Build Systems): Document it. Co-authored-by: Ricardo Wurmus --- doc/guix.texi | 3 ++- guix/build-system/ant.scm | 2 ++ guix/build/ant-build-system.scm | 10 ++++++---- 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'doc/guix.texi') diff --git a/doc/guix.texi b/doc/guix.texi index 22dc8b3f90..81aa957c6d 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -3327,7 +3327,8 @@ parameters, respectively. When the original package does not provide a suitable Ant build file, the parameter @code{#:jar-name} can be used to generate a minimal Ant build file @file{build.xml} with tasks to build the specified jar -archive. +archive. In this case the parameter @code{#:source-dir} can be used to +specify the source sub-directory, defaulting to ``src''. The parameter @code{#:build-target} can be used to specify the Ant task that should be run during the @code{build} phase. By default the diff --git a/guix/build-system/ant.scm b/guix/build-system/ant.scm index 550f92bc7f..a309a0c86b 100644 --- a/guix/build-system/ant.scm +++ b/guix/build-system/ant.scm @@ -98,6 +98,7 @@ (make-flags ''()) (build-target "jar") (jar-name #f) + (source-dir "src") (phases '(@ (guix build ant-build-system) %standard-phases)) (outputs '("out")) @@ -126,6 +127,7 @@ #:test-target ,test-target #:build-target ,build-target #:jar-name ,jar-name + #:source-dir ,source-dir #:phases ,phases #:outputs %outputs #:search-paths ',(map search-path-specification->sexp diff --git a/guix/build/ant-build-system.scm b/guix/build/ant-build-system.scm index 00a4a46d81..8ec7a94869 100644 --- a/guix/build/ant-build-system.scm +++ b/guix/build/ant-build-system.scm @@ -35,7 +35,8 @@ ;; ;; Code: -(define (default-build.xml jar-name prefix) +(define* (default-build.xml jar-name prefix #:optional + (source-dir ".")) "Create a simple build.xml with standard targets for Ant." (call-with-output-file "build.xml" (lambda (port) @@ -58,7 +59,7 @@ (target (@ (name "compile")) (mkdir (@ (dir "${classes.dir}"))) (javac (@ (includeantruntime "false") - (srcdir "src") + (srcdir ,source-dir) (destdir "${classes.dir}") (classpath (@ (refid "classpath")))))) @@ -98,11 +99,12 @@ to the default GNU unpack strategy." ((assq-ref gnu:%standard-phases 'unpack) #:source source))) (define* (configure #:key inputs outputs (jar-name #f) - #:allow-other-keys) + (source-dir "src") #:allow-other-keys) (when jar-name (default-build.xml jar-name (string-append (assoc-ref outputs "out") - "/share/java"))) + "/share/java") + source-dir)) (setenv "JAVA_HOME" (assoc-ref inputs "jdk")) (setenv "CLASSPATH" (generate-classpath inputs))) -- cgit 1.4.1 From 5899fafbfefcd7682aec8f2caaaad3add678a3c4 Mon Sep 17 00:00:00 2001 From: Roel Janssen Date: Thu, 11 May 2017 16:17:49 +0200 Subject: graph: Add Cypher backend. * guix/graph.scm (%cypher-backend): New variable. * doc/guix.texi: Add documentation for the Cypher backend of 'guix graph'. --- doc/guix.texi | 4 +++- guix/graph.scm | 32 +++++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) (limited to 'doc/guix.texi') diff --git a/doc/guix.texi b/doc/guix.texi index 81aa957c6d..a5b787510b 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -6197,7 +6197,9 @@ provides a visual representation of the DAG. By default, @uref{http://www.graphviz.org/, Graphviz}, so its output can be passed directly to the @command{dot} command of Graphviz. It can also emit an HTML page with embedded JavaScript code to display a ``chord diagram'' -in a Web browser, using the @uref{https://d3js.org/, d3.js} library. +in a Web browser, using the @uref{https://d3js.org/, d3.js} library, or +emit Cypher queries to construct a graph in a graph database supporting +the @uref{http://www.opencypher.org/, openCypher} query language. The general syntax is: @example diff --git a/guix/graph.scm b/guix/graph.scm index 7af2cd3b80..d7fd5f3e4b 100644 --- a/guix/graph.scm +++ b/guix/graph.scm @@ -229,6 +229,35 @@ nodeArray.push(nodes[\"~a\"]);~%" emit-d3js-prologue emit-d3js-epilogue emit-d3js-node emit-d3js-edge)) + + +;;; +;;; Cypher export. +;;; + +(define (emit-cypher-prologue name port) + (format port "")) + +(define (emit-cypher-epilogue port) + (format port "")) + +(define (emit-cypher-node id label port) + (format port "MERGE (p:Package { id: ~s }) SET p.name = ~s;~%" + id label )) + +(define (emit-cypher-edge id1 id2 port) + (format port "MERGE (a:Package { id: ~s });~%" id1) + (format port "MERGE (b:Package { id: ~s });~%" id2) + (format port "MATCH (a:Package { id: ~s }), (b:Package { id: ~s }) CREATE UNIQUE (a)-[:NEEDS]->(b);~%" + id1 id2)) + +(define %cypher-backend + (graph-backend "cypher" + "Generate Cypher queries." + emit-cypher-prologue emit-cypher-epilogue + emit-cypher-node emit-cypher-edge)) + + ;;; ;;; Shared. @@ -236,7 +265,8 @@ nodeArray.push(nodes[\"~a\"]);~%" (define %graph-backends (list %graphviz-backend - %d3js-backend)) + %d3js-backend + %cypher-backend)) (define* (export-graph sinks port #:key -- cgit 1.4.1 From 0be9b4a9c18502ddd9fc56612e076121958be2ef Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 12 May 2017 22:22:32 +0200 Subject: doc: Update "Limitations". * doc/guix.texi (Limitations): Mention LXDE; increase the package count; reword sentence about services. --- doc/guix.texi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'doc/guix.texi') diff --git a/doc/guix.texi b/doc/guix.texi index a5b787510b..5227ad4ba0 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -7206,15 +7206,15 @@ get a feel of what that means.) Support for the Logical Volume Manager (LVM) is missing. @item -Few system services are currently supported out-of-the-box -(@pxref{Services}). +More and more system services are provided (@pxref{Services}), but some +may be missing. @item -More than 5,000 packages are available, but you may +More than 5,300 packages are available, but you may occasionally find that a useful package is missing. @item -GNOME, Xfce, and Enlightenment are available (@pxref{Desktop Services}), +GNOME, Xfce, LXDE, and Enlightenment are available (@pxref{Desktop Services}), as well as a number of X11 window managers. However, some graphical applications may be missing, as well as KDE. @end itemize -- cgit 1.4.1