Commit Graph

3222 Commits (71e08fde28fa335bdba2ec2150fd6663390bba5a)

Author SHA1 Message Date
Ludovic Courtès ffa5e0a6d2
publish: Fix narinfo rendering for already-compressed items.
Fixes <http://bugs.gnu.org/26975>.
Reported by Mark H Weaver <mhw@netris.org>.

* guix/scripts/publish.scm (bake-narinfo+nar): Pass #f as the 2nd
argument to 'stat' and properly handle #f.
* tests/publish.scm (wait-for-file): New procedure.
("with cache"): Remove 'wait-for-file' procedure.
("with cache, uncompressed"): New test.
2017-05-18 21:35:35 +02:00
Ludovic Courtès 27c81fcb86
lint: inputs-should-be-native: Add "cmake".
Suggested by Nicolas Goaziou <mail@nicolasgoaziou.fr>.

* guix/scripts/lint.scm (check-inputs-should-be-native)[input-names]:
Add "cmake".
2017-05-18 14:22:03 +02:00
Ludovic Courtès 22ef06b801
union: Gracefully handle dangling symlinks in the input.
Fixes <http://bugs.gnu.org/26949>.
Reported by Pjotr Prins <pjotr.public12@thebird.nl>.

* guix/build/union.scm (file-is-directory?): Return #f when FILE does
not exist or is a dangling symlink.
(file=?): Pass #f as a second argument to 'stat'; return #f when both
ST1 or ST2 is #f.
* tests/profiles.scm (test-equalm): New macro.
("union vs. dangling symlink"): New test.
2017-05-18 11:38:48 +02:00
Maxim Cournoyer 516bfed7a3
profiles: Add elapsed time to manual-database hook to output message.
* guix/profiles.scm (manual-database): Add elapsed time to manual-database
hook to output message.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-05-16 23:10:10 +02:00
Ricardo Wurmus 17a69cf623
import cran: Check if pkg-config is needed.
* guix/import/cran.scm (needs-pkg-config?): New procedure.
(description->package): Use it.
2017-05-16 21:43:35 +02:00
Ricardo Wurmus a0f43208cb
import cran: Refactor "needs-zlib?".
* guix/import/cran.scm (tarball-files-match-pattern?): New procedure.
(needs-zlib?): Implement in terms of "tarball-files-match-pattern?".
2017-05-16 21:43:15 +02:00
Ricardo Wurmus ff8c179ab6
import cran: Export package predicates.
* guix/import/cran.scm (cran-package?, bioconductor-package?,
bioconductor-data-package?, bioconductor-experiment-package?): Export
procedures.
2017-05-16 21:42:18 +02:00
Ricardo Wurmus daaa270ecc
import cran: Add predicate for Bioconductor experiment packages.
* guix/import/cran.scm (bioconductor-experiment-package?): New variable.
2017-05-16 21:40:39 +02:00
Ricardo Wurmus c9ffa91fd3
import cran: Exclude experiment packages in predicate "bioconductor-package?".
* guix/import/cran.scm (bioconductor-package?): Exclude experiment packages,
because they cannot be updated with the default bioconductor updater.
2017-05-16 21:40:03 +02:00
Ricardo Wurmus 7c9fcb0825
import cran: Fetch DESCRIPTION files from Github mirror.
* guix/import/cran.scm (%bioconductor-svn-url): Remove variable.
(bioconductor-mirror-url): New procedure.
(fetch-description): Take a REPOSITORY symbol instead of a BASE-URL string.
(cran->guix-package): Pass REPOSITORY symbol to "fetch-description".
(latest-cran-release, latest-bioconductor-release): Adjust accordingly.
(bioconductor-package?): Update comment about SVN.
2017-05-16 21:39:06 +02:00
Andy Patterson 0383afa02a
build-system/asdf: Handle tests defined in external systems.
* guix/build-system/asdf.scm (asdf-build): Add a #:test-asd-file argument.
[builder]: Pass it to the build system.
(package-with-build-system)[transform]: Strip it from source systems' arguments.
* guix/build/asdf-build-system.scm (check): Pass the fully qualified path to
it on to the test-system procedure.
* guix/build/lisp-utils.scm (test-system): Load the file, or otherwise one of
the often used names for it, before running the tests.  Adjust the docstring
accordingly.
2017-05-16 15:18:16 +02:00
Andy Patterson 4209c31b8f
build-system/asdf: Retain references to source files for binary outputs.
In support of long-running programs in which the users would like to be able
to jump to the source of a definition of any of the dependencies (itself
included) of the program.

* guix/build/asdf-build-system.scm (library-outputs): Move from here ...
* guix/build/lisp-utils.scm (library-outputs): ... to here.
(build-program): Accept dependency-prefixes argument, to allow the caller to
specify references which should be retained.  Default to the library's output.
(build-image): Likewise.
(generate-executable): Likewise.
* gnu/packages/lisp.scm (sbcl-stumpwm+slynk, sbcl-slynk, sbcl-stumpwm): Adjust
accordingly to the new interface.
(sbcl-stumpwm+slynk)[native-inputs]: Move to ...
[inputs]: ... here.
2017-05-16 15:18:16 +02:00
Andy Patterson b9afcb9ed4
build-system/asdf: Simplify the use of lisp-eval-program.
Accept a list of statements, each run within its own `--eval' argument. This
allows statements to use reader package namespacing after a package has been
loaded.

* guix/build/lisp-utils.scm (spread-statements): New procedure.
(lisp-invoke): Rename to ...
(lisp-invocation): ... this. Use spread-statements. Change interface to accept
list of statements instead of a single statement.
(asdf-load-all-systems): Simplify returned statements.
(compile-system): Simplify the program passed to `lisp-eval-program'.
(test-system): Likewise.
(generate-executable-for-system): Likewise. Accept the full symbol describing
the asdf operation to use.
(generate-executable): Document the change.
(build-program, build-image): Use the new interface.
2017-05-16 15:18:15 +02:00
Andy Patterson 40f56176c5
build-system/asdf: Handle unusually-named systems.
* guix/build/lisp-utils.scm (valid-char-set): New variable.
(normalize-string): New procedure.
(compiled-system): Truncate the name of a system which contains slashes.
(generate-system-definition, make-asd-file): Use `normalize-string' to alter
the names of the created system and its dependencies.
* guix/build/asdf-build-system.scm (create-asd-file): Normalize the name of
the asd file being created.
2017-05-16 15:18:15 +02:00
Andy Patterson 0186a463d0
build-system/asdf: Always pre-load the system's definition file.
* guix/build-system/asdf.scm (asdf-build)[builder]: Pass a default
`#:asd-file' argument to the build procedure, using the system's name.
* guix/build/asdf-build-system.scm (build, check): Adjust to assume that
`asd-file' will always be a string.
* guix/build/lisp-utils.scm (compile-system, system-dependencies)
(test-system): Likewise.
2017-05-16 15:18:15 +02:00
Andy Patterson 457702b1d9
build-system/asdf: Pass the system name as an argument to the builder.
* guix/build-system/asdf.scm (asdf-build): Use the user-defined system name,
or calculate it from the package's full name.
[builder]: Pass the value along to the build procedure.
(package-with-build-system): Remove #:asd-system-name from source packages'
arguments.
* guix/build/asdf-build-system.scm: Adjust accordingly.
* guix/build/lisp-utils.scm (remove-lisp-from-name): Delete variable.
2017-05-16 15:18:15 +02:00
Andy Patterson b4c9f0c50d
build-system/asdf: Parameterize the lisp type and implementation globally.
* guix/build-system/asdf.scm (asdf-build)[builder]: Parameterize %lisp-type
and %lisp before invoking the build procedure. Don't pass #:lisp-type as an
argument to said procedure.
* guix/build/asdf-build-system.scm: Adjust accordingly.
(source-install-prefix): Rename to %lisp-source-install-prefix.
* guix/build/lisp-utils.scm: Adjust accordingly.
(%lisp-type): New parameter.
(bundle-install-prefix): Rename to %bundle-install-prefix.
* gnu/packages/lisp.scm: Adjust accordingly.
2017-05-16 15:18:15 +02:00
Andy Patterson 6de91ba2a1
build-system/asdf: Make #:lisp a package argument.
* guix/build-system/asdf.scm (lower): Change argument name to `lisp-type'.
(asdf-build): Change argument name to `lisp-type'.  Remove `lisp' as an
argument to the returned procedure.  Change the argument passed to build
phases to `lisp-type'.
* guix/build/asdf-build-system.scm (copy-source, build, check)
(create-asd-file, symlink-asd-files, cleanup-files, strip): Respect
`lisp-type` argument.
* gnu/packages/lisp.scm (sbcl-stumpwm, sbcl-stumpwm+slynk): Likewise.
2017-05-16 15:18:15 +02:00
Andy Patterson 26a16d37ff
build-system/asdf: Keep ecl's generated archive files.
This may be necessary to produce programs or images with ecl.

* guix/build/asdf-build-system.scm (cleanup-files): Don't delete .a files.
2017-05-16 15:18:14 +02:00
Andy Patterson 0e1371be09
build-system/asdf: Don't rename inputs.
* guix/build-system/asdf.scm (package-with-build-system)[transform]: Use updated
`new-inputs' procedure for inputs and native-inputs.
<rewrite>: Don't rename inputs.
<new-propagated-inputs>: Draw from package-inputs and package-native-inputs
for source packages.  Use the original package's propagated-inputs otherwise.
<new-inputs>: Convert into a function to be used to transform inputs and
native-inputs.
* gnu/packages/lisp.scm (sbcl-fiveam, sbcl-bordeaux-threads)
(sbcl-flexi-streams, sbcl-cl-ppcre, sbcl-stumpwm, sbcl-slynk-arglists)
(sbcl-slynk-fancy-inspector): Don't prefix input names.
2017-05-16 15:18:14 +02:00
Andy Patterson 35189728cd
build-system/asdf: Use asdf to determine dependencies.
This removes the need for conventions to determine which inputs are run-time
dependencies, and also the need to specify "special" dependencies.

* guix/build/lisp-utils.scm (patch-asd-file, lisp-dependencies)
(wrap-perform-method): Remove them.
(inputs->asd-file-map, system-dependencies, generate-system-definition)
(generate-dependency-links, make-asd-file): New procedures.
(lisp-eval-program): Add an error if no lisp matches.
(compile-system): Don't use asdf's in-built asd-file generator.
2017-05-16 15:18:14 +02:00
Andy Patterson 6c76ce39ac
build-system/asdf: Make it possible to use "lib" as the build output.
* guix/build/asdf-build-system.scm (library-output): New procedure.
(copy-source, build, check, patch-asd-files, symlink-asd-files)
(cleanup-files): Use it.
(copy-files-to-output): Rework to take an output instead of an outputs and
string pair.
(install, copy-source): Use the new method.
2017-05-16 15:18:14 +02:00
Andy Patterson bc389c20a9
build-system/asdf: Rename %install-prefix to %source-install-prefix.
* guix/build/lisp-utils.scm (%install-prefix): Rename to
%source-install-prefix.
(build-install-prefix): Use it.
* guix/build/asdf-build-system.scm (source-install-prefix)
(%system-install-prefix, source-directory, copy-source): Likewise.
2017-05-16 15:18:14 +02:00
Mathieu Othacehe 5641dffb07
scripts: system: Display bootloader name in "list-generations".
* guix/scripts/system.scm (display-system-generation): Display
  bootloader name.
2017-05-16 14:41:02 +02:00
Mathieu Othacehe 3241f7ff92
scripts: system: Adapt "switch-generation" to new bootloader API.
* guix/scripts/system.scm (reinstall-grub): Rename to
  reinstall-bootloader. Read boot-device and boot-type from parameters file to
  be able to restore the correct bootloader on specified device.
  Factorize bootloader installation code by calling install-bootloader.
 (system-bootloader-name): New procedure.
 (switch-to-system-generation): Adapt.
2017-05-16 14:41:02 +02:00
Mathieu Othacehe 1229d328fb
scripts: system: Adapt "init" to new bootloader API.
* guix/scripts/system.scm (install): Pass installer a new
argument. Rename other arguments.
Call install-bootloader instead of install-grub*.
(perform-action): Adapt.
2017-05-16 14:41:02 +02:00
Mathieu Othacehe 3042c5d8bb
scripts: system: Adapt "reconfigure" to new bootloader API.
* guix/scripts/system.scm (install-grub*): Rename to install-bootloader.  Use
keys to pass arguments.  Pass a new argument, "installer-drv" which is a script
in store dealing with bootloader-specific install actions.  Also call
"install-boot-config" to install the bootloader config file.

(install-bootloader-derivation): New procedure.  It returns a derivation that
builds a file containing "install-procedure" gexp.

(perform-action): Build install-proc derivation and call install-bootloader
with the resulting file.  Stop adding GRUB to PATH as bootloaders are called in
install-proc with direct store paths.
2017-05-16 14:41:01 +02:00
Mathieu Othacehe b09a8da4a2
bootloader: Add extlinux support.
* gnu/bootloader.scm: New file.
* gnu/bootloader/extlinux.scm: New file.
* gnu/bootloader/grub.scm: New file.
* gnu/local.mk: Build new files.
* gnu/system.scm: Adapt to new bootloader api.
* gnu/scripts/system.scm: Adapt to new bootloader api.
* gnu.scm: Remove (gnu system grub) and replace by (gnu bootloader) and (gnu
bootloader grub) modules.
* gnu/system/grub.scm: Moved content to gnu/bootloader/grub.scm.
* gnu/system/vm: Replace (gnu system grub) module by (gnu bootloader).
* gnu/tests.scm: Ditto.
* gnu/tests/nfs.scm: Ditto.
2017-05-16 14:41:01 +02:00
Ludovic Courtès ce92d269fe
ui: Disable Guile deprecation warnings by default.
* guix/ui.scm (initialize-guix): Call (debug-disable 'warn-deprecated)
when "GUILE_WARN_DEPRECATED" is not set.
2017-05-16 14:31:37 +02:00
Ludovic Courtès f411124321
utils: 'compressed-file?' matches ".lzma" files.
* guix/utils.scm (compressed-file?): Add "lzma" to the list.
2017-05-15 23:55:10 +02:00
Ricardo Wurmus 095494ed6c
licenses: Add EDL 1.0.
* guix/licenses.scm (edl1.0): New variable.
2017-05-15 22:33:17 +02:00
Ludovic Courtès 1812205cf5
bournish: 'ls' adjusts the column width depending on the entries.
* guix/build/bournish.scm (display-tabulated): Remove #:columns and
  #:column-width parameters.  Add #:terminal-width and #:column-gap.
  Compute COLUMN-WIDTH and COLUMNS.
2017-05-13 16:52:11 +02:00
Ludovic Courtès c7d1b061f5
bournish: 'ls' lists directory contents.
Suggested by Ricardo Wurmus.

* guix/build/bournish.scm (ls-command-implementation): When FILE is a
directory, list its contents rather than FILE itself.
2017-05-13 16:52:11 +02:00
Mathieu Othacehe 22fc581db3
import: pypi: Robustify latest-release.
* guix/import/pypi.scm (latest-release): Check if pypi-fetch has
  failed. If so return #f, else construct the <upstream-source>.
2017-05-13 12:40:20 +02:00
Mathieu Othacehe db427602d8
import: cran: Robustify cran-package?.
* guix/import/cran.scm (package->upstream-name): Return #f if url
  start and end index could not be determined.
  (cran-package?): Check if the upstream-name can be extracted from
  given package.
* tests/cran.scm: Add "r-minimal is not a cran package" to make sure that
  r-minimal is not detected as a cran package.

This fixes a failure of guix refresh on r-minimal because no
upsteam-name can be determined from ".../R-version.tar.gz" uri.
2017-05-13 12:40:20 +02:00
Ludovic Courtès e06ca952ed
scripts: Do not create the config directory.
This fixes runs of 'guix package' and 'guix system' tests in
environments where $HOME is read-only.

* guix/ui.scm (config-directory): Add #:ensure? parameter and honor it.
* guix/scripts.scm (warn-about-old-distro): Pass #:ensure? #f to
'config-directory'.
2017-05-13 00:03:46 +02:00
Ludovic Courtès 5db5dff53d
substitute: Honor 'Cache-Control' on 404 responses.
* guix/scripts/substitute.scm (cached-narinfo): When VALUE is #f, use
the TTL that is read instead of %NARINFO-NEGATIVE-TTL.
(cached-narinfo-expiration-time): Likewise.
2017-05-11 18:05:42 +02:00
Ludovic Courtès 24b21720f7
publish: Advertise a short TTL for "baking" 404s.
* guix/scripts/publish.scm (not-found): Add #:phrase and #:ttl
parameters and honor them.
* tests/publish.scm ("with cache"): Check the 'cache-control' header on
of the 404 response.
2017-05-11 18:05:42 +02:00
Roel Janssen 5899fafbfe
graph: Add Cypher backend.
* guix/graph.scm (%cypher-backend): New variable.
* doc/guix.texi: Add documentation for the Cypher backend of 'guix graph'.
2017-05-11 16:17:49 +02:00
Ludovic Courtès bc0e6c9312
scripts: Fix singular/plural message mismatch.
* guix/scripts.scm (warn-about-old-distro): Swap singular and plural
forms in 'N_' call.
2017-05-10 23:38:04 +02:00
Ben Woodcroft c6cfec42b0
build-system: Add package-with-ocaml4.01.
* guix/build-system/ocaml.scm (default-ocaml4.01, default-ocaml4.01-findlib,
package-with-explicit-ocaml, package-with-ocaml4.01,
strip-ocaml4.01-variant): New variables.
2017-05-10 22:13:54 +02:00
Ludovic Courtès 7fd952e052
scripts: Warn about old distro.
Fixes <http://bugs.gnu.org/25852>.
Suggested by Mark H Weaver <mhw@netris.org>.

* guix/scripts.scm (%distro-age-warning): New variable.
(warn-about-old-distro): New procedure.
* guix/scripts/package.scm (process-actions): Call
'warn-about-old-distro'.
* guix/scripts/system.scm (process-action): Likewise.
2017-05-10 22:09:08 +02:00
Ludovic Courtès 30d2397f73
ui: 'string->duration' correctly handles hours.
* guix/ui.scm (string->duration): Add missing '=>' for hours.
* tests/ui.scm ("duration, 2 hours"): New test.
2017-05-10 22:05:21 +02:00
Hartmut Goebel 59135f0d7e
guix: Add java-utils.
* guix/build/java-utils.scm: New file.
* guix/build-system/ant.scm: Use it.
* Makefile.am (MODULES): Add it.

Co-authored-by: Ricardo Wurmus <rekado@elephly.net>
2017-05-10 17:59:22 +02:00
Ricardo Wurmus 52a791f50f
ant-build-system: Add default "check" target.
* guix/build-system/ant.scm (ant-build): Change default test target to
"check"; add "test-dir" argument.
* guix/build/ant-build-system.scm (default-build.xml): Add "test-dir"
argument; add ant targets "compile-tests" and "check".
(configure): Add "test-dir" argument; pass it to "default-build.xml".
2017-05-10 17:59:22 +02:00
Hartmut Goebel 8df64f7384
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 <rekado@elephly.net>
2017-05-10 17:59:22 +02:00
Ludovic Courtès 07a0f68fa5
pull: Build package modules without optimizations on Guile 2.2.
* guix/build/pull.scm (%default-optimizations)
(%lightweight-optimizations): New variables.
(optimization-options): New procedure.  Taken from
build-aux/compile-all.scm.
(build-guix): Pass it to 'compile-file'.
2017-05-09 18:08:24 +02:00
Ludovic Courtès 838ba73d6e
pull: Build with the matching Guile major version.
Previously, 'guix pull' would always build with Guile 2.0.
Now it builds with the Guile that matches (effective-version).

* build-aux/build-self.scm (false-if-wrong-guile)
(package-for-current-guile): New procedures.
(guile-json, guile-ssh): Use it.
(guile-for-build): New procedure.
(build): Use (effective-version) instead of the hard-coded "/2.0".
Add (guix modules) closure to #:modules argument.  Pass
\#:guile-for-build argument to 'gexp->derivation'.
* guix/build/pull.scm (depends-on-guile-ssh?, all-scheme-files): New
procedures.
(build-guix): Show the output of (version).  Use the above procedures.
Filter out files that match 'depends-on-guile-ssh?' when (ssh session)
is missing.
2017-05-09 18:08:24 +02:00
Ludovic Courtès 402e98c524
pull: Use 'with-store'.
* guix/scripts/pull.scm (guix-pull): Remove call to 'open-connection'.
Use 'with-store' instead.
2017-05-09 18:08:24 +02:00
Ludovic Courtès 4902d3c4e0
pull: Honor the standard build options.
Reported by Niall Dooley <dooleyn@gmail.com>
in <https://lists.gnu.org/archive/html/help-guix/2017-05/msg00038.html>.

* 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.
2017-05-09 18:08:24 +02:00
Ludovic Courtès ba2260dbbc
git-download: Fix 'git-predicate' file membership.
Previously, it the predicate would return #t for "m4/ChangeLog" if
"ChangeLog" (in the top-level directory) was in FILES.  This commit
fixes the ambiguity.

* guix/git-download.scm (git-predicate): Add 'inodes' variable.  Use it
to determine file membership.
2017-05-07 18:08:11 +02:00
Ludovic Courtès 950d51c9d9
store: Use 'TCP_NODELAY' when connecting to a daemon over PF_INET.
* guix/store.scm (open-inet-socket): Add 'cond-expand' form to define
'TCP_NODELAY' when needed.  Add call to 'setsockopt' after 'connect'.
2017-05-07 00:18:36 +02:00
Leo Famulari 40d728a87d
Revert "guix: git: Add new module."
This reverts commit a70b784708.

Commit a70b784708 caused `guix pull` to fail:

ERROR: In procedure scm-error:
ERROR: no code for module (git)
2017-05-05 20:12:57 -04:00
Mathieu Othacehe a70b784708
guix: git: Add new module.
* guix/git.scm: New file.
* configure.ac: Check for (guile git).
* Makefile.am: Build guix/git.scm if (guile git) is available.
2017-05-05 19:52:38 +02:00
Danny Milosavljevic 7e3f7acbe0
scripts: Remove profile-grub-entries.
* guix/scripts/system.scm (profile-grub-entries): Delete variable.
2017-05-05 15:03:48 +02:00
Danny Milosavljevic bf8b09169c
system: grub: Use boot-parameters instead of menu-entry where possible.
* gnu/system/grub.scm (boot-parameters->menu-entry): New variable.
(grub-configuration-file): Use boot-parameters
instead of menu-entry where possible.
* guix/scripts/system.scm (profile-boot-parameters): Update docstring.
(reinstall-grub): Use profile-boot-parameters.
(perform-action): Use profile-boot-parameters.
2017-05-05 15:03:48 +02:00
Danny Milosavljevic 0315abe608
scripts: Make boot-parameters label include generation number and time.
* guix/scripts/system.scm (system->boot-parameters): Make label include
generation number and time.
2017-05-05 15:03:47 +02:00
Danny Milosavljevic 9530e73b49
system: Introduce read-boot-parameters-file.
* gnu/system.scm (read-boot-parameters): Remove export.
(read-boot-parameters-file): New variable. Export it.
* guix/scripts/system.scm (profile-boot-parameters): Use
read-boot-parameters-file.
(profile-grub-entries): Use read-boot-parameters-file.
(reinstall-grub): Use read-boot-parameters-file.
(display-system-generation): Use read-boot-parameters-file.
2017-05-05 15:03:47 +02:00
Ludovic Courtès 396d12faea
store: Use 'write-bytevector' instead of hand-coded equivalent.
* guix/store.scm (process-stderr): Use 'write-bytevector' in the
%STDERR-READ case.
2017-05-04 18:05:05 +02:00
Ludovic Courtès cd041b268e
store: Add store path computation procedures.
* guix/derivations.scm (compressed-hash, store-path)
(output-path, fixed-output-path): Move to...
* guix/store.scm: ... here.
2017-05-04 18:05:05 +02:00
Tobias Geerinckx-Rice 74067fedce
environment: Correct typo.
* guix/scripts/environment.scm (create-environment): Fix typo.
2017-05-04 12:52:23 +02:00
Ludovic Courtès 634088a565
refresh: Use (guix discovery).
* guix/scripts/refresh.scm (maybe-updater, list-updaters): Remove.
(importer-modules): New procedure.
(%updaters): Define using 'fold-module-public-variables'.  Turn into a
promise and adjust users.
2017-05-03 23:50:15 +02:00
Ludovic Courtès cd903ef787
Add (guix discovery).
* guix/discovery.scm, tests/discovery.scm: New files.
* gnu/packages.scm (scheme-files, file-name->module-name)
(scheme-modules, all-package-modules): Remove.
(fold-packages): Rewrite in terms of 'fold-module-public-variables'.
* gnu/tests.scm: Use (guix discovery).
* Makefile.am (MODULES): Add guix/discovery.scm.
(SCM_TESTS): Add tests/discovery.scm.
2017-05-03 23:50:15 +02:00
Ludovic Courtès 69daee23af
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance.  See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.

* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'.  Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 16:16:17 +02:00
Petter 2f3108ad03
gnu: Avoid circular dependencies by Perl license.
* guix/licenses.scm (perl-license): New variable.
* gnu/packages/bioinformatics.scm: Change (package-license perl) to perl-license.
* gnu/packages/compression.scm: Same.
* gnu/packages/databases.scm: Same.
* gnu/packages/gd.scm: Same.
* gnu/packages/language.scm: Same.
* gnu/packages/libevent.scm: Same.
* gnu/packages/mail.scm: Same.
* gnu/packages/messaging.scm: Same.
* gnu/packages/ncurses.scm: Same.
* gnu/packages/networking.scm: Same.
* gnu/packages/photo.scm: Same.
* gnu/packages/tcl.scm: Same.
* gnu/packages/tex.scm: Same.
* gnu/packages/tls.scm: Same.
* gnu/packages/web.scm: Same.
* gnu/packages/wm.scm: Same.
* gnu/packages/xml.scm: Same.
* gnu/packages/xorg.scm: Same.
* gnu/packages/zip.scm: Same.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-05-02 23:41:14 +02:00
Ludovic Courtès dcb95c1fc9
monads: Add a template and specialization mechanism for monadic procedures.
* guix/monads.scm (%templates, %template-instances): New variables.
(register-template!, register-template-instance!): New procedures.
(template-directory, define-template): New macro.
(foldm, sequence, anym): Define using 'define-template'.  Avoid replace
ellipses with dots.
(mapm): Likewise, but do not use 'foldm'.
* guix/store.scm: Add 'template-directory' invocation.
2017-05-02 23:41:13 +02:00
Ludovic Courtès 7b9ac883ea
download: Continue handshake upon TLS warning alerts.
This allows us to download from site such as
<https://fusionforge.int-evry.fr> where the server does not recognize
the server name passed via the 'server_name' extension.

* guix/build/download.scm (tls-wrap): Catch 'gnutls-error' around
'handshake'.  Upon ERROR/WARNING-ALERT-RECEIVED, print a message and
call 'handshake'.
2017-05-02 23:41:13 +02:00
Ludovic Courtès 756be979cb
licenses: Add CeCILL and CeCILL-B.
* guix/licenses.scm (cecill, cecill-b): New variables.
2017-05-02 23:41:13 +02:00
Ludovic Courtès 8a2105078b
substitute: Validate substitute URLs.
Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>
at <https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00548.html>.

* guix/scripts/substitute.scm (validate-uri): New procedure.
(guix-substitute): Use it.
2017-05-02 12:32:52 +02:00
Ludovic Courtès e723178a10
publish: Use a larger zlib buffer for compression with '--cache'.
* guix/scripts/publish.scm (bake-narinfo+nar): Pass #:buffer-size to
'call-with-gzip-output-port'.
2017-05-02 12:32:51 +02:00
Mark H Weaver bedba06426
Add package/inherit.
* guix/packages.scm (package/inherit): New public macro.
2017-05-02 04:19:09 -04:00
Clément Lassieur 3314396138
licenses: Add new meta-license fsdg-compatible.
* guix/licenses.scm (fsdg-compatible): New record with constructor.
2017-05-01 21:32:15 +02:00
Ludovic Courtès dff3189c7d
publish: Produce a "FileSize" narinfo field when possible.
* guix/scripts/publish.scm (narinfo-string): Add #:file-size parameter.
Produce a "FileSize" field when COMPRESSION is eq? to '%no-compression'
or when FILE-SIZE is true.
(bake-narinfo+nar): Pass #:file-size.
* tests/publish.scm ("/*.narinfo")
("/*.narinfo with properly encoded '+' sign")
("with cache"): Check for "FileSize".
2017-05-01 17:28:20 +02:00
Ludovic Courtès 6d1a5e5ffd
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.
2017-05-01 16:38:30 +02:00
Roel Janssen 7c3e4660a5
import: Update Bioconductor release to 3.5.
* guix/import/cran.scm: Change Bioconductor release to 3.5.
2017-04-28 11:02:26 +02:00
Ludovic Courtès 25a49294ca
cache: Work around 'time-monotonic' bug in Guile 2.2.2.
* guix/cache.scm (time-monotonic) [guile-2.2]: New variable.
* tests/cache.scm (time-monotonic) [guile-2.2]: Likewise.
* guix/build/download.scm (time-monotonic) [guile-2.2]: Adjust comment:
it's a 2.2.2 bug.
2017-04-22 14:42:15 +02:00
Ludovic Courtès 1fe958d62a
download: Work around Guile 2.2 bug with 'time-monotonic' objects.
* guix/build/download.scm (time-monotonic) [guile-2.2]: New variable.
2017-04-22 01:25:22 +02:00
Ludovic Courtès 9231ef12f2
derivations: Restore UTF-8 encoding of build scripts.
Reported by Mark H Weaver <mhw@netris.org>
at <https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00457.html>.

* guix/derivations.scm (build-expression->derivation): Use a string
output port for the expression.  This reverts part of
2dce88d5bb.
* tests/derivations.scm ("build-expression->derivation and builder
encoding"): New test.
2017-04-21 22:45:29 +02:00
Ludovic Courtès 285f63e805
store: Support 'ssh://' URIs in 'GUIX_DAEMON_SOCKET'.
This allows 'guix' commands to talk to a remote store over SSH.

* guix/store.scm (connect-to-daemon)[connect]: Call 'resolve-interface'
for unknown URI schemes.
* guix/store/ssh.scm: New file.
* Makefile.am (MODULES): Add it.
* doc/guix.texi (The Store): Document it.  Mark remote access as
experimental.
2017-04-21 19:17:36 +02:00
Ludovic Courtès e537833726
ssh: Decompose 'connect-to-remote-daemon'.
* guix/ssh.scm (remote-daemon-channel): New procedure.
(connect-to-remote-daemon): Implement in terms of it.
2017-04-21 19:17:36 +02:00
Ludovic Courtès 615c5298f7
ssh: Move 'open-ssh-session' to (guix ssh).
* guix/scripts/copy.scm (%compression, open-ssh-session): Move to...
* guix/ssh.scm: ... here.  Use '&message' conditions instead of calling
'leave'.
2017-04-21 19:17:34 +02:00
Ludovic Courtès ba97e454bf
offload: Avoid using '_' as a 'match' pattern.
* guix/scripts/offload.scm (host-key->type+key, machine-load)
(process-request, guix-offload): Do not use '_' as a 'match' pattern.
2017-04-21 17:23:37 +02:00
Ludovic Courtès 3dff90ce34
store: Add support for remote connections via 'guix://' URIs.
* guix/store.scm (open-inet-socket): New procedure.
(connect-to-daemon): Support the 'guix' URI scheme.
* doc/guix.texi (The Store): Document it.
2017-04-21 17:23:37 +02:00
Ludovic Courtès 3b5cd17a97
store: Add 'system-error-to-connection-error' macro.
* guix/store.scm (system-error-to-connection-error): New macro.
(open-unix-domain-socket): Use it instead of 'catch'.
2017-04-21 17:23:37 +02:00
Ludovic Courtès 1397b422e2
store: 'GUIX_DAEMON_SOCKET' can now be a URI.
* guix/store.scm (%daemon-socket-file): Rename to...
(%daemon-socket-uri): ... this.
(connect-to-daemon): New procedure.
(open-connection): Rename 'file' to 'uri'.  Use 'connect-to-daemon'
instead of 'open-unix-domain-socket'.
* guix/tests.scm (open-connection-for-tests): Rename 'file' to 'uri'.
* tests/guix-build.sh: Add tests.
* tests/store.scm ("open-connection with file:// URI"): New tests.
2017-04-21 17:23:37 +02:00
Ludovic Courtès 2dce88d5bb
derivations: Avoid string-to-bytevector conversions.
On Guile 2.2.1, this yields a 5% speedup on:

  guix build libreoffice xmonad certbot -n --no-substitutes --no-build-hook

* guix/derivations.scm (derivation->string): Rename to...
(derivation->bytevector): ... this.  Use 'open-bytevector-output-port'
instead of 'call-with-output-string'.
(derivation-hash): Remove string-to-bytevector conversion before
'sha256' call.
(build-expression->derivation): Use 'add-data-to-store' and an
bytevector port instead of a string port for the expression.
2017-04-20 23:35:55 +02:00
Ludovic Courtès e1bbc0e38d
publish: Add a handler for / and /index.html.
Suggested by Quiliro <quiliro@riseup.net>
in <https://bugs.gnu.org/26567>.

* guix/scripts/publish.scm (render-home-page): New procedure.
(make-request-handler): Handle it.
2017-04-19 23:43:51 +02:00
Ludovic Courtès 2363bdd707
gexp: 'gexp-modules' accepts plain Scheme objects.
* guix/gexp.scm (gexp-modules): Return '() when not (gexp? GEXP).
* tests/gexp.scm ("gexp-modules and literal Scheme object"): New test.
2017-04-19 17:51:39 +02:00
Ludovic Courtès d72b42064b
publish: Remove expired cache entries when '--ttl' is used.
* guix/scripts/publish.scm (narinfo-files): New procedure.
(render-narinfo/cached)[delete-file]: New procedure.  Add call to
'maybe-remove-expired-cache-entries'.
* doc/guix.texi (Invoking guix publish): Document the interation between
--cache and --ttl.
2017-04-18 23:19:30 +02:00
Ludovic Courtès 2ea2aac6e9
Add (guix cache) and use it in (guix scripts substitute).
* guix/cache.scm, tests/cache.scm: New files.
* Makefile.am (MODULES, SCM_TESTS): Add them.
* guix/scripts/substitute.scm (obsolete?): Remove.
(remove-expired-cached-narinfos): Rename to...
(cached-narinfo-expiration-time): ... this.  Remove the removal part and
only keep the expiration time part.
(narinfo-cache-directories): Add optional 'directory' parameter and
honor it.
(maybe-remove-expired-cached-narinfo): Remove.
(cached-narinfo-files): New procedure.
(guix-substitute): Use 'maybe-remove-expired-cache-entries' instead of
'maybe-remove-expired-cached-narinfo'.
2017-04-18 23:19:30 +02:00
Ludovic Courtès 00753f7038
publish: Add '--cache' and '--workers'.
Fixes <http://bugs.gnu.org/26201>.
Reported by <dian_cecht@zoho.com>.

These options allow nars to be "baked" off-line and cached instead of
being compressed on the fly.  As a side-effect, this allows us to
provide a 'Content-Length' header for nars.

* guix/scripts/publish.scm (show-help, %options): Add '--cache' and
'--workers'.
(%default-options): Add 'workers'.
(nar-cache-file, narinfo-cache-file, run-single-baker): New procedures.
(single-baker): New macro.
(render-narinfo/cached, bake-narinfo+nar)
(render-nar/cached): New procedures.
(make-request-handler): Add #:cache and #:pool parameters and honor
them.
(run-publish-server): Likewise.
(guix-publish): Honor '--cache' and '--workers'.
* tests/publish.scm ("with cache"): New test.
* doc/guix.texi (Invoking guix publish): Document it.
2017-04-18 23:18:41 +02:00
Ludovic Courtès 339a79fd6a
publish: Use 'sendfile' when possible.
* guix/scripts/publish.scm (http-write): In the
'application/octet-stream' case, use 'sendfile' when OUTPUT is a file
port.
2017-04-18 23:17:18 +02:00
Ludovic Courtès 905ae5276d
publish: Introduce 'actual-compression'.
* guix/scripts/publish.scm (actual-compression): New procedure.
(narinfo-string): Use it.
2017-04-18 23:17:18 +02:00
Ludovic Courtès 1563d6c79f
Add (guix workers).
* guix/workers.scm, tests/workers.scm: New files.
* Makefile.am (MODULES, SCM_TESTS): Add them.
* .dir-locals.el: Add rule for 'eventually'.
2017-04-18 23:17:17 +02:00
Ludovic Courtès e16c823f80
serialization: Remove Guile < 2.0.9 workaround.
* guix/serialization.scm (write-contents): Assume 'sendfile' is always
defined.
2017-04-17 23:31:28 +02:00
Ludovic Courtès 94df39cc08
records: Slight simplification.
* guix/records.scm (make-syntactic-constructor): Simplify 'find' expression.
2017-04-17 23:31:28 +02:00
Marius Bakke 7c7b802cce
download: Add netfilter mirror.
* guix/download.scm (%mirrors): Add mirrors for www.netfilter.org.
2017-04-17 23:05:46 +02:00
Mathieu Othacehe a9eadc06ac
scripts: system: Rename --no-grub option to --no-bootloader.
* guix/scripts/system.scm (%options, show-help): Adjust accordingly.
Keep "--no-grub" for compatibility reasons, but do not mention it in the help.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
2017-04-17 17:41:54 +02:00
Ludovic Courtès 1730c5b509
lint: Avoid non-literal format strings.
Reported by Mathieu Othacehe <m.othacehe@gmail.com>
at <http://bugs.gnu.org/26498>.

* guix/scripts/lint.scm (warn-if-package-has-input): Rename to...
(package-input-intersection): ... this.  Remove 'linted' and 'message'
parameters.  Return a list of inputs.
(check-inputs-should-be-native): Adjust accordingly.
(check-inputs-should-not-be-an-input-at-all): Likewise.
2017-04-16 12:08:30 +02:00
Ludovic Courtès f816dba680
ui: Gracefully report '&message' conditions.
* guix/ui.scm (report-load-error, warn-about-load-error)
(read/eval): Add special-case for SRFI-35 &message conditions.
2017-04-16 00:48:07 +02:00
Ludovic Courtès efe7d19a9e
services: 'service-parameters' becomes 'service-value'.
* gnu/services.scm (<service>)[parameters]: Rename to...
[value]: ... this.
Change calls to 'service-parameters' to 'service-value'.
* gnu/system.scm, gnu/tests/base.scm,
guix/scripts/system.scm, tests/services.scm: Likewise.
* doc/guix.texi (Service Reference): Adjust accordingly.
2017-04-16 00:48:07 +02:00
Leo Famulari c8a3dea847
packages: Enable threaded compression of source tarballs.
This provides a ~2x speedup when using 4 threads.

* guix/packages.scm (patch-and-repack)[build]: Invoke xz with
'--threads=0' when re-packing tarballs.
2017-04-15 18:34:59 -04:00
Danny Milosavljevic 958a1fda9e
system: Make grub use <menu-entry> instead of <boot-parameters> again.
* gnu/system/grub.scm: Remove boot-parameters->menu-entry.
(grub-configuration): Don't use boot-parameters->menu-entry.
* gnu/system.scm (operating-system-bootcfg): Use menu-entry.
* guix/scripts/system.scm (reinstall-grub): Use profile-grub-entries.
(perform-action): Use profile-grub-entries.
2017-04-15 22:02:38 +02:00
Danny Milosavljevic abae042ea4
scripts: system: Introduce profile-boot-parameters.
* guix/scripts/system.scm (profile-boot-parameters): New variable.
(reinstall-grub): Use profile-boot-parameters.
(perform-action): Use profile-boot-parameters.

Follow-up to 2e58e05bb6.
2017-04-15 19:34:00 +02:00
Mathieu Othacehe e61519ab9c
scripts: system: Rename grub? and install-grub? to bootloader? and install-bootloader?.
* guix/scripts/system.scm (perform-action): Rename grub? to bootloader,
(%options): rename install-grub? to install-bootloader?,
(%default-options): ditto,
(process-action): reindent and rename grub? to bootloader?.
2017-04-15 15:22:47 +02:00
Mathieu Othacehe c76b3046f6
system: Rename operating-system-grub.cfg to operating-system-bootcfg.
* gnu/system.scm (operating-system-grub.cfg): Rename to...
(operating-system-bootcfg): ... this.
* gnu/system/vm.scm (system-disk-image): Use operating-system-bootcfg.
(system-qemu-image): Use operating-system-bootcfg.
(system-qemu-image/shared-store): Use operating-system-bootcfg.
* guix/scripts/system.scm (perform-action): Use operating-system-bootcfg.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
2017-04-15 14:41:10 +02:00
Danny Milosavljevic 03daeaa70f
scripts: system: Back out operating-system-bootcfg change.
Follow-up to 475e2ce211.

* guix/scripts/system.scm (perform-action): Back out operating-system-bootcfg
change.
2017-04-15 14:41:10 +02:00
Danny Milosavljevic 475e2ce211
scripts: system: Move save-load-path-excursion and save-environment-excursion macros to the top.
* guix/scripts/system.scm (save-load-path-excursion,
save-environment-excursion): Move definitions to the top of the file.
It allows to use them in the whole file.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
2017-04-15 13:28:25 +02:00
Mathieu Othacehe a41134b442
scripts: system: Move save-load-path-excursion and save-environment-excursion macros to the top.
* guix/scripts/system.scm (save-load-path-excursion,
save-environment-excursion): Move definitions to the top of the file.
It allows to use them in the whole file.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
2017-04-15 12:33:56 +02:00
Mathieu Othacehe e60ee79040
build-system/cargo: Remove store reference.
* guix/build/cargo-build-system.scm (generate-checksums): Remove store
  reference from comment. This comment was matching
  assert-no-store-file-names regexp in Makefile.am.
  Also, edit procedure docstring to precise that DIR-NAME is a store
  directory.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-14 12:29:20 +02:00
Mathieu Othacehe 23e525e109
syscalls: Add load-linux-module.
* guix/build/syscalls.scm (load-linux-module): New procedure. Reimplemented
from guile-linux-syscalls.patch.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-11 11:13:26 +02:00
Mathieu Othacehe c5cd4fad09
syscalls: Use define-as-needed for network-interface syscalls.
* guix/build/syscalls.scm (network-interface-flags): Use define-as-needed macro
and remove from export list.
(set-network-interface-flags): Ditto.
(set-network-interface-address): Ditto.
(IFF_UP, IFF_BROADCAST and IFF_LOOPBACK): Ditto.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-11 11:13:25 +02:00
Mathieu Othacehe 7df4d3465d
syscalls: Use define-as-needed for mount and umount.
* guix/build/syscalls.scm (mount): Use define-as-needed macro
and remove from export list.
(umount): Ditto.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-11 11:13:25 +02:00
Mathieu Othacehe 8336df0668
syscalls: Add reboot.
* guix/build/syscalls.scm (define-as-needed): New macro.
(reboot): New procedure. Reimplemented from guile-linux-syscalls.patch.
(RB_AUTOBOOT, ..., RB_KEXEC): New flags copied from static Guile patch.

Co-Authored-By: Ludovic Courtès <ludo@gnu.org>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-11 11:13:25 +02:00
Chris Marusich 8bc2183fe5
monads: Improve mlet, mlet*, and mbegin documentation.
* doc/guix.texi (The Store Monad) <mlet, mlet*, mbegin>: Clarify
their intended usage.
* guix/monads.scm (mbegin): Update docstring accordingly.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-08 14:40:51 +02:00
Chris Marusich 60a9fcb137
monads, doc: Improve mwhen and munless documentation.
* doc/guix.texi (The Store Monad) <mwhen, munless>: Document them.
* guix/monads.scm (mwhen, munless): Clarify their intended use.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-08 14:40:51 +02:00
Chris Marusich d922c8e4b7
monads: Use intent-revealing parameter names.
* guix/monads.scm (mwhen, munless): Rename parameters from 'exp0' and 'exp' to
  'mexp0' and 'mexp', respectively.  This makes it more obvious that these
  expressions must be monadic expressions.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-08 14:40:50 +02:00
Mathieu Othacehe f91fcd9c42
syscalls: Allow mount and umount use from static Guile.
* guix/build/syscalls.scm (mount): Use Guile core mount if called from
  static Guile, otherwise use FFI based mount implementation.
  (umount): Ditto.
  This allows to use (guix build syscalls) from a module independently
  of calling context.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-07 23:30:39 +02:00
Ludovic Courtès 5537f2d279
profiles: Slightly improve the instructions in 'etc/profile'.
* guix/build/profiles.scm (build-etc/profile): Fix typo in comment.
Add backslash in the generated shell comment.
2017-04-07 23:30:38 +02:00
Ludovic Courtès 83cfa0247b
pack: Add '--expression'.
* guix/scripts/pack.scm (%options, show-help): Add '--expression'.
(guix-pack)[maybe-package-argument]: New procedure.
Use it, and remove variable 'specs'.
* doc/guix.texi (Invoking guix pack): Document '--expression'.
2017-04-07 23:30:38 +02:00
Ludovic Courtès 9a3762a768
size: Avoid '_' as a pattern variable in 'match'.
* guix/scripts/size.scm (display-profile, profile->page-map): Don't use
'_' as a 'match' pattern variable.
2017-04-07 00:17:16 +02:00
Chris Marusich 5ea69d9a56
system: Support the --root option in 'guix system'.
Fixes <https://bugs.gnu.org/26271>.

* guix/scripts/system.scm (perform-action): Add #:gc-root parameter and
honor it.
(show-help): Document the --root option.
(%options): Add 'root'.
(process-action): Pass 'root' option to perform-action as #:gc-root.
* doc/guix.texi (Invoking guix system): Document '--root'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-06 10:24:32 +02:00
Chris Marusich a09b45da6f
build: Add and export procedure 'register-root*'.
* guix/scripts/build.scm (register-root*): Add and export it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-06 10:11:26 +02:00
Ludovic Courtès 50f4ea18c4
environment: Deal with single-entry search paths.
This is a followup to fcd75bdbfa.

* guix/scripts/environment.scm (create-environment): Check whether
SEPARATOR is #f.
2017-04-05 22:50:21 +02:00
Maxim Cournoyer a0b87ef8ec
profiles: Generate database file for man pages.
The mandb database file (index.db) is used by the "apropos" (whatis) or
"man -k" commands.  This change introduces a profile hook to generate
such database file.

* guix/profiles.scm (manual-database): New procedure.
(%default-profile-hooks): Add it.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2017-04-05 22:45:41 +02:00
Ludovic Courtès 1618006d0b
build-system/python: 'package-with-explicit-python' uses 'package-mapping'.
* guix/build-system/python.scm (package-with-explicit-python)
[package-variant, cut?]: New procedures.
[transform]: Remove 'mlambdaq' form and input tuple handling.
Use 'package-mapping'.
2017-04-05 22:45:41 +02:00
Ludovic Courtès f37f2b83fa
packages: Add 'package-mapping' and base 'package-input-rewriting' on it.
* guix/packages.scm (package-mapping): New procedure.
(package-input-rewriting): Rewrite in terms of 'package-mapping'.
* tests/packages.scm ("package-mapping"): New test.
* doc/guix.texi (Defining Packages): Document it.
2017-04-05 22:45:41 +02:00
Ricardo Wurmus 5ae63362ae
import cran: Distinguish Bioconductor data packages.
* guix/import/cran.scm (bioconductor-package?): Exclude Bioconductor
data packages.
(bioconductor-data-package?): New procedure.
2017-04-05 18:38:51 +02:00
Leo Famulari b23c1a71be
download: Update the GnuPG mirror list.
* guix/download.scm (%mirrors) <gnupg>: Use HTTP for TU Wien mirror.
2017-04-05 07:07:35 -04:00
Chris Marusich 1c6b2d3f98
build: Export register-root procedure.
* guix/scripts/build.scm: Export register-root procedure.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-05 00:53:03 +02:00
Leo Famulari 6c17422eac
utils: Fix handling of shell arguments for xz compression.
Fixes test failures related to xz compression in tests/utils.scm.

This is a followup to commit 63102406f2.

* guix/utils.scm (decompressed-port, compressed-port, compressed-output-port):
Split each shell argument into its own list element.
2017-04-03 23:23:39 -04:00
Ludovic Courtès 76c486196f
packages: Catch invalid input errors for structs.
Reported by Thomas Sigurdsen <thomas.sigurdsen@gmail.com>
at <https://lists.gnu.org/archive/html/help-guix/2017-04/msg00007.html>.

* guix/packages.scm (expand-input): Add 'guard' form around call to
'package-source-derivation'.
* tests/packages.scm (dummy): New test.
2017-04-04 00:10:00 +02:00
Ludovic Courtès 3e43166ffc
gexp: 'lower-object' raises an exception when passed an invalid object.
* guix/gexp.scm (&gexp-error, &gexp-input-error): New error conditions.
(lower-object): Raise &gexp-input-error when 'lookup-compiler' returns #f.
* tests/gexp.scm ("lower-object & gexp-input-error?"): New test.
* guix/ui.scm (call-with-error-handling): Add case for 'gexp-input-error?'.
2017-04-04 00:10:00 +02:00
Ludovic Courtès 2a0d5de5a9
Merge branch 'core-updates' 2017-04-03 00:13:06 +02:00
Efraim Flashner 63102406f2
guix: Compress and decompress xz archives in parallel.
* guix/scripts/pack.scm (%compressors): Add flag '-T0' when calling "xz".
* guix/utils.scm (decompressed-port, compressed-port,
compressed-output-port): Same.
2017-04-02 14:42:20 +03:00
Tobias Geerinckx-Rice f264e838c0
substitute: Send ‘User-Agent’ header.
* guix/scripts/substitute.scm (narinfo-request): Pass ‘User-Agent’ #:headers
to ‘build-request’.
2017-03-31 15:33:16 +02:00
Marius Bakke 84157bb8bf
Merge branch 'master' into core-updates
Most conflicts are from 6fd52309b8.
2017-03-30 22:59:53 +02:00
Ludovic Courtès cdb3f734cf
packages: Remove "mips64el-linux" from '%hydra-supported-systems'.
* guix/packages.scm (%hydra-supported-systems): Remove "mips64el-linux".
2017-03-29 22:50:42 +02:00
Ludovic Courtès e1f02f92e9
Replace (compose not PROC) with simpler idioms.
* gnu/packages/bioinformatics.scm (python-pysam)[arguments] <check>:
Use (negate proc) instead of (compose not proc).
* guix/import/cran.scm (recursive-import): Likewise.
* guix/import/elpa.scm (filter-dependencies): Use 'remove' instead of
'(filter (compose not proc) ...)'.
2017-03-28 22:15:44 +02:00
Ricardo Wurmus 1a75083b0d
import cran: Print package stream in the expected order.
* guix/scripts/import/cran.scm (guix-import-cran): Reverse list of packages.
2017-03-28 15:54:10 +02:00
Ricardo Wurmus 2dca8b2d51
import cran: Automatically add gfortran and zlib when needed.
* guix/import/cran.scm (needs-fortran?, needs-zlib?): New procedures.
(description->package): Use them.
2017-03-28 15:37:47 +02:00
Ludovic Courtès 6dfd683dc7
download: Properly parse ftp:// URLs that lack user info.
Fixes a regression introduced in
a4f5423415.

Reported by Hartmut Goebel.

* guix/build/download.scm (ftp-fetch): Account for the case where
'uri-userinfo' returns #f.  Remove the case where it returns "" since
that cannot happen.
2017-03-28 13:30:09 +02:00
Ludovic Courtès bdb59b331b
derivations: Do not fetch narinfos for non-substitutable items.
This avoids connections to substitute servers for derivations that are
not substitutable anyway, such as profiles.

Reported by Andy Wingo.

* guix/derivations.scm (substitution-oracle): Skip derivations that do
not pass 'substitutable-derivation?'.
* tests/derivations.scm ("substitution-oracle and #:substitute? #f"):
New test.
2017-03-28 10:00:05 +02:00
Leo Famulari c17383f400
Merge branch 'master' into core-updates 2017-03-27 21:19:38 -04:00
Alex Kost 689db38e34
ui: Support Texinfo markup in package synopses.
* guix/ui.scm (package-field-string): New procedure.
(package-description-string): Use it.
(package-synopsis-string): New procedure.
(package->recutils): Use it.
* guix/scripts/lint.scm (check-synopsis-style)[check-texinfo-markup]:
New procedure.  Use it in checks.
* tests/lint.scm: Test it.
* gnu/packages/perl.scm (perl-try-tiny)[synopsis]: Adjust for the
Texinfo markup.
2017-03-27 10:55:16 +03:00
Huang Ying 0a5ce0d1df
profiles: Create fonts.dir/scale for all fonts directories.
* guix/profiles.scm (fonts-dir-file): Create fonts.dir/scale files for all
fonts directories.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-03-26 12:53:52 +02:00
Huang Ying addce19e2d
union: Add create-all-directories? parameter to 'union-build'.
* guix/build/union.scm (union-build): Add create-all-directories? keyword
parameter.
* tests/union.scm ("union-build #:create-all-directories? #t"): New test.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2017-03-26 12:53:48 +02:00
Efraim Flashner 0371b345e8
Merge remote-tracking branch 'origin/master' into core-updates 2017-03-23 14:53:33 +02:00
Ludovic Courtès 4bb5e0aeb3
publish: Add '--nar-path'.
* guix/scripts/publish.scm (show-help, %options): Add '--nar-path'.
(%default-options): Add 'nar-path'.
(guix-publish): Honor it.
2017-03-22 14:05:59 +01:00
Ludovic Courtès cdd7a7d210
publish: Make the nar URL prefix a parameter.
* guix/scripts/publish.scm (narinfo-string): Add #:nar-path and honor it.
(render-narinfo): Likewise.
(make-request-handler): Likewise.
(run-publish-server): Likewise.
* tests/publish.scm ("custom nar path"): New test.
2017-03-22 14:05:59 +01:00
Ludovic Courtès 46f58390cb
publish: Add '--public-key' and '--private-key'.
* guix/scripts/publish.scm (show-help, %options): Add --public-key and
--private-key.
* doc/guix.texi (Invoking guix publish): Document it.
2017-03-22 14:05:59 +01:00
Ludovic Courtès ab2a74e4db
publish: The public and private keys are now SRFI-39 parameters.
* guix/scripts/publish.scm (%default-options): Add 'public-key-file' and
'private-key-file'.
(lazy-read-file-sexp): Remove.
(%private-key, %public-key): Turn into SRFI-39 parameters.
(signed-string, render-narinfo): Adjust accordingly.
(guix-publish): Honor 'public-key-file' and 'private-key-file' from
OPTS.  Use 'parameterize'.
* guix/pk-crypto.scm (read-file-sexp): New procedure.
* tests/publish.scm: Initialize '%public-key' and '%private-key'.
2017-03-22 14:05:59 +01:00
Efraim Flashner 378de69c59
Merge remote-tracking branch 'origin/master' into core-updates 2017-03-22 12:57:37 +02:00
Roel Janssen a4f5423415
download: Handle username and password properties for FTP URIs.
* guix/build/download.scm (ftp-fetch): Process username and password from a URI.
2017-03-21 12:15:14 +01:00
Roel Janssen 193420a803
ftp-client: Allow custom username and password for FTP servers.
* guix/ftp-client.scm (ftp-open): Add username and password arguments.
2017-03-21 12:14:05 +01:00
Mark H Weaver d67f972bd7
download: Remove non-existent kernel mirror.
* guix/download.scm (%mirrors) <kernel.org>: Remove www.all.kernel.org.
2017-03-19 21:18:46 -04:00
Mark H Weaver f67337e23e
Merge branch 'master' into core-updates 2017-03-19 18:52:12 -04:00
Ludovic Courtès 4fd06a4dd1
http-client: Avoid name clash with 'open-connection-for-uri' in 2.2.0.
* guix/build/download.scm (open-connection-for-uri): Add note about
same-named binding in Guile 2.2.0.
* guix/http-client.scm: Use 'guix:open-connection-for-uri' for the
procedure coming from (guix build download).
* guix/scripts/lint.scm: Likewise.
* guix/scripts/substitute.scm: Likewise.
2017-03-18 00:39:50 +01:00
Ludovic Courtès 36626c556e
build: Require Guile >= 2.0.9.
* configure.ac: Bump requirement to 2.0.9.
* doc/guix.texi (Requirements): Adjust accordingly.
* README (Requirements): Likewise.
* build-aux/download.scm: Remove workaround for <http://bugs.gnu.org/13095>.
* guix/build/download.scm: Likewise.
(http-fetch)[post-2.0.7?]: Remove.  Remove conditional code for not
POST-2.0.7?.
* guix/http-client.scm:  Remove workaround for <http://bugs.gnu.org/13095>.
(http-fetch)[post-2.0.7?]: Remove.  Remove conditional code for not
POST-2.0.7?.
* guix/serialization.scm (read-latin1-string): Remove mention of 2.0.9.
* tests/nar.scm: Use (ice-9 control).
(let/ec): Remove.
2017-03-18 00:39:49 +01:00
Ludovic Courtès 5461115e8f
pack: Add '--target'.
* guix/scripts/pack.scm (self-contained-tarball): Add #:target.
(docker-image): Add #:target.
[build]: Pass it to 'build-docker-image'.
(%options, show-help): Add '--target'.
(guix-pack): Pass TARGET to 'profile-derivation' and to 'build-image'.
* guix/docker.scm (build-docker-image): Add #:system parameter and honor it.
* doc/guix.texi (Invoking guix pack): Document '--target'.
(Additional Build Options): Refer to the Autoconf manual instead of the
obsolete 'configure.info' for cross-compilation.
2017-03-18 00:38:41 +01:00
Ludovic Courtès 176febe377
profiles: Packages in a profile can be cross-compiled.
* guix/profiles.scm (profile-derivation): Add #:target parameter; pass
it to 'gexp->derivation'.
* tests/profiles.scm ("profile-derivation, cross-compilation"): New test.
2017-03-17 23:25:53 +01:00
Ludovic Courtès 48b444304e
pack: Move absolute file name to <compressor>.
* guix/scripts/pack.scm (<compressor>)[package]: Remove.
[command]: Document as being a gexp with an absolute file name.
(%compressors): Adjust accordingly.
(self-contained-tarball): Simplify PATH expression.  Move 'string-join'
for the compressor command on the build side.
(docker-image): Simplify PATH expression.
* tests/pack.scm (%gzip-compressor): Adjust accordingly.
2017-03-17 23:25:53 +01:00
Danny Milosavljevic 4ed64c534a
build/cargo-build-system: Make cargo-build-system install working packages.
* guix/build/cargo-build-system.scm (configure): Remove proprietary
dependencies. Add rust dependencies and configure Cargo to find them.
(build): Also build libraries, not just applications.
(file-sha256): New variable.
(generate-checksums): New variable. Export it.
(touch): New variable.
(install): Generate checksums so Cargo accepts the package.
2017-03-17 16:48:09 +01:00
Danny Milosavljevic 25fb58a3be
build-system/cargo (cargo-build): Add cargo-build-flags, remove configure-flags.
* guix/build-system/cargo.scm (cargo-build): Add cargo-build-flags,
remove configure-flags.
2017-03-17 16:48:08 +01:00
Ricardo Wurmus 2d7c4ae3ee
gnu: r: Rename to r-minimal.
* gnu/packages/statistics.scm (r): Rename to...
(r-minimal): ...this new variable.
(r-with-recommended-packages): Rename to...
(r): ...this.
* guix/build-system/r.scm (default-r): Reference r-minimal.
* gnu/packages/emacs.scm (emacs-ess)[inputs],
gnu/packages/machine-learning.scm (shogun)[inputs],
gnu/packages/python.scm (python-rpy2)[inputs],
gnu/packages/bioinformatics.scm (ribotaper)[inputs],
(couger)[propagated-inputs],
(roary)[inputs],
(rsem)[inputs],
(rcas-web)[inputs]: Change "r" to "r-minimal".
2017-03-17 10:14:02 +01:00
Ricardo Wurmus aeb64f3cb2
gnu: r: Do not build recommended packages.
* gnu/packages/statistics.scm (r)[arguments]: Rename phase
"build-recommended-packages-reproducibly" to "build-reproducibly"; add
configure flag "--without-recommended-packages".
* guix/import/cran.scm (default-r-packages): Remove recommended packages.
* gnu/packages/python.scm (python-rpy2)[inputs]: Add r-survival.
* gnu/packages/bioinformatics.scm (r-ape)[propagated-inputs]: Add r-lattice
and r-nlme.
(r-vegan)[propagated-inputs]: Add r-mass.
(r-genefilter)[propagated-inputs]: Add r-survival.
(r-grohmm)[propagated-inputs]: Add r-mass.
(r-bioccheck)[propagated-inputs]: Add r-codetools.
(r-summarizedexperiment)[propagated-inputs]: Add r-matrix.
(r-topgo)[propagated-inputs]: Add r-lattice.
(r-sva)[propagated-inputs]: Add r-mgcv.
(r-raremetals2)[propagated-inputs]: Add r-mass.
(r-vsn)[propagated-inputs]: Add r-lattice.
(r-pcamethods)[propagated-inputs]: Add r-mass.
* gnu/packages/bioinformatics.scm (r-ggplot2)[propagated-inputs]: Add r-mass.
(r-locfit)[propagated-inputs]: Add r-lattice.
(r-coda)[propagated-inputs]: Add r-lattice.
(r-irlba)[propagated-inputs]: Add r-matrix.
(r-glmnet)[propagated-inputs]: Add r-matrix.
(r-e1071)[propagated-inputs]: Add r-class.
(r-spams)[propagated-inputs]: Add r-lattice and r-matrix.
(r-hmisc)[propagated-inputs]: Add r-cluster, r-foreign, r-lattice, r-nnet, and
r-rpart.
(r-zoo)[propagated-inputs]: Add r-lattice.
(r-mixtools)[propagated-inputs]: Add r-boot and r-mass.
(r-flexmix)[propagated-inputs]: Add r-lattice and r-nnet.
(r-prabclus)[propagated-inputs]: Add r-mass.
(r-fpc)[propagated-inputs]: Add r-class, r-cluster, and r-mass.
(r-rcppeigen)[propagated-inputs]: Add r-matrix.
(r-matrixmodels)[propagated-inputs]: Add r-matrix.
(r-lme4)[propagated-inputs]: Add r-mass and r-nlme.
(r-pbkrtest)[propagated-inputs]: Add r-mass and r-matrix.
(r-car)[propagated-inputs]: Add r-mass, r-mgcv, and r-nnet.
(r-tclust)[propagated-inputs]: Add r-cluster.
2017-03-17 10:14:02 +01:00
Ludovic Courtès db3f2b61ad
pack: Allow for "-S /opt/foo=".
Reported by Andy Wingo.

* guix/scripts/pack.scm (%options): Use 'string-split' instead of
'string-tokenize'.
2017-03-16 22:50:15 +01:00
Ludovic Courtès 9e84ea3673
pack: Honor symlinks in the Docker back-end.
* guix/docker.scm (symlink-source, topmost-component): New procedures.
(build-docker-image): Add #:symlinks parameter and honor it.  Remove
hard-coded /bin symlink.
* guix/scripts/pack.scm (docker-image): Pass #:symlinks to
'build-docker-image'.
2017-03-16 22:50:15 +01:00
Ludovic Courtès 54241dc8e6
docker: Build images in a reproducible fashion.
* guix/docker.scm (%tar-determinism-options): New variable.
(build-docker-image): Use it on the two 'tar' invocations.
2017-03-16 22:50:15 +01:00
Ludovic Courtès 84dda5a9c0
pack: Use a fixed timestamp in Docker images.
* guix/docker.scm (build-docker-image): Add #:creation-time parameter.
Use SRFI-19 'date->string' instead of 'strftime' et al.
* guix/scripts/pack.scm (docker-image)[build]: Pass #:creation-time to
'build-docker-image'.
2017-03-16 22:50:15 +01:00
Ludovic Courtès b1edfbc37f
pack: Add '--format' option and Docker output support.
* guix/docker.scm: Remove dependency on (guix store) and (guix utils).
Use (guix build store-copy).  Load (json) lazily.
(build-docker-image): Remove #:system.  Add #:closure, #:compressor, and
'image' parameters.  Use 'uname' to determine the architecture.  Remove
use of 'call-with-temporary-directory'.  Use 'read-reference-graph' to
compute ITEMS.  Honor #:compressor.
* guix/scripts/pack.scm (docker-image): New procedure.
(%default-options): Add 'format'.
(%formats): New variable.
(%options, show-help): Add '--format'.
(guix-pack): Honor '--format'.
* guix/scripts/archive.scm: Remove '--format' option.  This reverts
commits 1545a012cb,
01445711db, and
03476a23ff.
* doc/guix.texi (Invoking guix pack): Document '--format'.
(Invoking guix archive): Remove documentation of '--format'.
2017-03-16 22:50:15 +01:00
Ludovic Courtès 2971f39c33
pack: Honor command-line options related to the store.
* guix/scripts/pack.scm (guix-pack): Call
'set-build-options-from-command-line'.
2017-03-16 22:50:15 +01:00
Ludovic Courtès 146db52a18
memoization: Micro-optimize code produced by 'define-cache-procedure'.
* guix/memoization.scm (%nothing): Remove.
(define-cache-procedure): Make '%nothing' a local variable, with a
literal list.
2017-03-16 22:50:15 +01:00
Ludovic Courtès d938a58bee
gexp: Add '=>' syntax to import computed modules.
* guix/gexp.scm (imported-files)[file-pair]: Add case for pairs where
the cdr is not a string.
(imported-modules): Support '=>' syntax in MODULES.
* tests/gexp.scm ("imported-files with file-like objects")
("gexp->derivation & with-imported-module & computed module"): New tests.
* doc/guix.texi (G-Expressions): Document '=>' syntax for
'with-imported-modules'.
2017-03-16 22:50:14 +01:00
Ludovic Courtès 4c0c4db070
utils: Move base16 procedures to (guix base16).
* guix/utils.scm (bytevector->base16-string, base16-string->bytevector):
Move to...
* guix/base16.scm: ... here.  New file.
* tests/utils.scm ("bytevector->base16-string->bytevector"): Move to...
* tests/base16.scm: ... here.  New file.
* Makefile.am (MODULES): Add guix/base16.scm.
(SCM_TESTS): Add tests/base16.scm.
* build-aux/download.scm, guix/derivations.scm,
guix/docker.scm, guix/import/snix.scm, guix/pk-crypto.scm,
guix/scripts/authenticate.scm, guix/scripts/download.scm,
guix/scripts/hash.scm, guix/store.scm, tests/hash.scm,
tests/pk-crypto.scm: Adjust imports accordingly.
2017-03-16 22:50:14 +01:00
Marius Bakke 4b7e5c1131
Merge branch 'master' into core-updates 2017-03-15 17:52:26 +01:00
Ludovic Courtès 70dfdd501a
syscalls: Adjust 'clone' to Guile 2.2.
Before that, something like:

  (call-with-container
    (lambda ()
      (match (primitive-fork)
        …)))

would hang in 'primitive-fork' as the child process (the one started in
the container) would try to pthread_join the finalization thread in
'stop_finalization_thread' in libguile, not knowing that this thread is
nonexistent.

* guix/build/syscalls.scm (%set-automatic-finalization-enabled?!): New
procedure.
(without-automatic-finalization): New macro.
(clone): Wrap PROC call in 'without-automatic-finalization'.
2017-03-15 15:19:53 +01:00
Ludovic Courtès 81a0f1cdf1
zlib: Don't rely on EBADF being ignored by 'fport_close'.
In 2.2, 'fport_close' no longer swallows EBADF and instead raises a
'system-error' for this.  This commit adjusts for 2.2.

* guix/zlib.scm (close-procedure): Remove.
(make-gzip-input-port): Use 'port->fdes' instead of 'fileno'.
Use 'gzclose' instead of 'close-procedure'.
(make-gzip-output-port): Likewise.
* tests/zlib.scm ("compression/decompression pipe"): Don't check whether
PARENT is closed using 'port-closed?'.  Instead, use 'seek' on the
underlying FD and check for EBADF.
2017-03-15 15:19:53 +01:00
Ludovic Courtès 850edd77f9
pack: Add unit test.
* guix/scripts/pack.scm (self-contained-tarball): Add #:tar option.
[build](tar-supports-sort?): New variable.  Use it.
* tests/pack.scm: New file.
* Makefile.am (SCM_TESTS): Add it.
2017-03-14 23:18:32 +01:00
Ludovic Courtès 36f213fb70
pack: Use maximum compression; use '-n' for gzip.
* guix/scripts/pack.scm (<compressor>)[tar-option]: Remove.
[command]: New field.
(%compressors): Provide complete commands.  Use '-9' or equivalent for
each compressor; use '-n' for gzip.
(self-contained-tarball)[build]: Adjust accordingly.
2017-03-14 23:18:32 +01:00
Ludovic Courtès 5895ec8aa2
pack: Add '--symlink'.
* guix/scripts/pack.scm (self-contained-tarball): Add #:symlinks
parameter.
[build](symlink->directives): New procedure
(directives): New variable.
Add call to 'evaluate-populate-directive'.  Pass the directories among
DIRECTIVES to 'tar'.
(%default-options): Add 'symlinks'.
(%options, show-help): Add '--symlink'.
(guix-pack): Honor it.
* gnu/build/install.scm (evaluate-populate-directive): Export.
* doc/guix.texi (Invoking guix pack): Document it.
2017-03-14 17:57:27 +01:00
Ludovic Courtès 6b63c43e06
pack: Add '--localstatedir' option.
* guix/scripts/pack.scm (self-contained-tarball): Add #:localstatedir?
parameter and honor it.
(%options, show-help): Add '--localstatedir'.
(guix-pack): Honor it.
* gnu/build/install.scm (populate-single-profile-directory): Add
 #:register? parameter and honor it.
* doc/guix.texi (Binary Installation): Use '--localstatedir' in
example.
(Invoking guix pack): Document it.
2017-03-14 17:57:27 +01:00
Ludovic Courtès 3b2dc9edcd
upstream: Avoid '_' as a pattern variable in 'match'.
* guix/upstream.scm (lookup-updater): Don't use '_' as a pattern
variable.
2017-03-14 11:19:21 +01:00
Efraim Flashner 3f9543aee1
Merge remote-tracking branch 'origin/master' into core-updates 2017-03-13 23:08:49 +02:00
Ludovic Courtès b111bceecc
download: Export '%x509-certificate-directory'.
* guix/build/download.scm (%x509-certificate-directory): Export, as
expected by (guix scripts pull) since commit
7e81d699de.
2017-03-13 21:52:38 +01:00
Marius Bakke 7e81d699de
pull: Default to HTTPS.
* guix/scripts/pull.scm (%snapshot-url): Use HTTPS.
(guix-pull): Authenticate against LE-CERTS when URL is from Savannah.
2017-03-12 19:39:32 +01:00
Ludovic Courtès 334c95306a
syscalls: Adjust 'define-bits' to macro literal semantics of 2.2.
* guix/build/syscalls.scm (define-bits): Do not define NAMES... as
top-level variables since that prevents literal matches in 2.2.
Instead, determine constant values at expansion time.
2017-03-12 17:47:25 +01:00
Ludovic Courtès 239c22663a
Add 'guix pack'.
* gnu/system/install.scm (self-contained-tarball): Move to...
* guix/scripts/pack.scm: ... here.  New file.
* doc/guix.texi (Binary Installation): Mention 'guix pack'.
(Invoking guix pack): New node.
* build-aux/make-binary-tarball.scm: Remove.
* Makefile.am (MODULES): Add guix/scripts/pack.scm.
(EXTRA_DIST): Remove build-aux/make-binary-tarball.scm.
(guix-binary.%.tar.xz): Rewrite using 'guix pack'.
* build-aux/hydra/gnu-system.scm (tarball-jobs): Adjust accordingly.
2017-03-12 17:47:25 +01:00
Ludovic Courtès e90e0fad1b
Merge branch 'master' into core-updates 2017-03-09 16:35:41 +01:00
Roel Janssen 64fc9f65f1
gexp: Expose functions to allow creating derivation builders.
* guix/gexp.scm: Add load-path-expression and gexp-modules to the public
  interface of the module.  See <http://bugs.gnu.org/26023>.
2017-03-09 12:39:05 +01:00
Ludovic Courtès 3104475148
utils: Use an idiom compatible with both 2.0 and 2.2.
Fixes a regression introduced in 7447aa36e1.
Reported by Ricardo Wurmus.

* guix/utils.scm: Revert 7447aa36e1.  Use
  #:prefix for (ice-9 iconv) to support both 2.0 and 2.2.
2017-03-09 09:48:33 +01:00
Ludovic Courtès 7447aa36e1
utils: Make sure to use the right 'bytevector->string'.
In Guile 2.2, (rnrs io ports) exports 'bytevector->string', which
conflicts with that of (ice-9 iconv).

* guix/utils.scm: Hide 'bytevector->string' from (rnrs io ports).
2017-03-08 23:42:53 +01:00
Ludovic Courtès 1062063a65
ui: Don't use '%default-port-encoding' to set the encoding of string ports.
* guix/ui.scm (right-arrow): Call 'set-port-encoding!' to set PORT's
encoding; remove use of 'with-fluids'.  This is for compatibility with
Guile 2.2 where the encoding of string ports is not influenced by
%DEFAULT-PORT-ENCODING.
* tests/ui.scm ("show-manifest-transaction"): Likewise.
2017-03-08 23:42:53 +01:00
Ludovic Courtès 30906825cb
ui: Avoid '_' as a pattern variable in 'match'.
* guix/ui.scm (fill-paragraph): Don't use '_' as a pattern variable
since that is shadowed by the top-level '_' binding on Guile 2.2.
(show-manifest-transaction): Likewise.
2017-03-08 23:42:53 +01:00
Ludovic Courtès 3f6d5b8a69
download: Update the Savannah mirror list.
* guix/download.scm (%mirrors) <savannah>: Remove centervenus.com, which
seems to be broken.  Add download-mirror.sv.gnu.org as a last resort.
2017-03-08 23:42:53 +01:00
Ludovic Courtès 6aa9d63c92
guix archive: Allow compilation with Guile 2.2.
* guix/scripts/archive.scm (export-from-store): Avoid shadowing the
top-level '_'.
2017-03-08 23:42:52 +01:00
Ludovic Courtès 6c5b56f9fa
gnu: bash: Use the bootstrap Guile in 'url-fetch/reset-patch-level'.
Fixes <http://bugs.gnu.org/25775>.
Reported by Sirgazil, Ricardo Wurmus, Andy Wingo, and others.

* guix/download.scm (in-band-download): Always use GUILE.  This reverts
9f05908fb1.
* gnu/packages/bash.scm (url-fetch/reset-patch-level): Remove #:guile.
Pass %BOOTSTRAP-GUILE as #:guile to 'url-fetch'.  Remove #:guile-for-build
argument in 'gexp->derivation' call.
2017-03-07 23:58:08 +01:00
Marius Bakke 3f98071ac5
Merge branch 'python-tests' 2017-03-03 16:55:43 +01:00
Danny Milosavljevic 7109e0fff8
build-system/cargo: Export %cargo-build-system-modules.
* guix/build-system/cargo.scm (%cargo-build-system-modules): Export.
2017-03-03 12:06:11 +01:00
Manolis Ragkousis 751702676e
guix: build: make-bootstrap: Copy "falloc.h" to the new system.
In glibc-2.25 a dependency on "linux/falloc.h" was added.
This also reverts commit 8f8f250bdc
which is no longer needed. This commit was not compatible with
the glibc version Hurd is using. See
<https://lists.gnu.org/archive/html/guix-devel/2017-02/msg01046.html>

* guix/build/make-bootstrap.scm (make-stripped-libc): Copy "falloc.h"
to the new system.
* gnu/packages/patches/glibc-bootstrap-system.patch: Remove part
that touches fcntl-linux.h.

Problem reported by Andreas Enge <andreas@enge.fr>.
2017-02-27 15:31:06 +02:00
Marius Bakke 8779987bba
Merge branch 'master' into python-tests 2017-02-27 12:42:22 +01:00
Leo Famulari 9f05908fb1
download: Provide a fall-back guile for older daemons.
Fixes <http://bugs.gnu.org/25775>.

* guix/download.scm (in-band-download): Use %bootstrap-guile as a
fall-back when using older daemons that do not have a built-in
downloader.

Written-by: Ricardo Wurmus <rekado@elephly.net>
2017-02-23 14:27:35 -05:00
Efraim Flashner d15432ca9e
Merge remote-tracking branch 'origin/master' into core-updates 2017-02-20 12:56:14 +02:00
Danny Milosavljevic 80345600fa
build: dub-build-system: Don't use "dub run" at all.
It doesn't make sense to run non-test executables (which is what "dub run"
would do).

The "check" function already invokes "dub test" and that's enough.

* guix/build/dub-build-system.scm (build): Remove "dub run" invocation.
2017-02-14 10:18:35 +01:00
Federico Beffa 57075ade97
import: stackage: Avoid using (guix ui) in importer code.
* guix/import/stackage.scm (stackage->guix-package, stackage-lts-info-fetch):
  Raise 'message' condition instead of using 'leave' from (guix ui).
* guix/scripts/import/stackage.scm (guix-import-stackage): Handle conditions.
2017-02-14 08:38:45 +01:00
Marius Bakke 424b1ae769
Merge branch 'master' into python-tests 2017-02-13 22:35:05 +01:00
Ludovic Courtès 768f0ac9dd
Merge branch 'master' into core-updates 2017-02-10 17:40:25 +01:00
Danny Milosavljevic 65e862d1a2
gnu: Add dub-build-system.
* guix/build-system/dub.scm: New file.
* guix/build/dub-build-system.scm: New file.
* Makefile.am (MODULES): Add them.
* doc/guix.texi: Add section for dub-build-system.
2017-02-10 16:21:50 +01:00
Mathieu Lirzin 6554be68b4
git-download: Add 'git-predicate'.
* guix/git-download.scm (git-predicate): New procedure.
* gnu/packages/package-management.scm (current-guix): Use it.
(make-git-predicate): Remove.
2017-02-09 13:56:54 -06:00
Federico Beffa a4824c60ef
import: hackage: Handle unknown packages gracefully.
* guix/import/hackage.scm (hackage-fetch): Add 'guard'.
2017-02-09 19:36:08 +01:00
Federico Beffa bc5844d149
import: Add stackage importer and updater.
* guix/import/stackage.scm: New file.
* guix/scripts/import/stackage.scm: New file.
* Makefile.am (MODULES): Add new files.
* guix/scripts/import.scm (importers): Add "stackage".
* guix/scripts/refresh.scm (%updaters): Add %stackage-updater.
* doc/guix.texi (Invoking 'guix import'): Document the importer.
  (Invoking 'guix refresh'): Add stackage to option --type valid values.
* guix/import/hackage.scm (guix-package->hackage-name, hackage-fetch,
  hackage-source-url, hackage-cabal-url, hackage-package?): Export them.
2017-02-09 19:36:08 +01:00
Federico Beffa 81e0bc1834
import: json: Explicitly ask for JSON data.
* guix/import/json.scm (json-fetch): Add #:headers to http-fetch call.
2017-02-09 19:36:04 +01:00
Ludovic Courtès 4eaac4b722
import: pypi: Correctly handle multiple-URL origins.
Fixes <https://bugs.gnu.org/25635>.
Reported by Sergei Trofimovich <slyfox@inbox.ru>.

* guix/import/pypi.scm (guix-package->pypi-name)[url->pypi-name]: New
procedure.
Rewrite body to match lists in addition to strings.
* tests/pypi.scm ("guix-package->pypi-name, several URLs"): New test.
2017-02-08 16:17:05 +01:00
Ying Huang 06d7d1190e
profiles: gtk-im-modules: Fix for gtk3.
Gtk+3 now have multiple outputs, so the gtk-query-immodules-3.0 should be find
in output "bin" instead of "out".

* guix/profiles.scm (gtk-im-modules): Pass the path of gtk-query-immodules-x.x
as 'query' argument to the 'build' procedure.

Signed-off-by: 宋文武 <iyzsong@member.fsf.org>
2017-02-08 20:12:20 +08:00
Ludovic Courtès 7597478e2e
file-systems: Add '%network-configuration-files' and '%network-file-mappings'.
* gnu/system/file-systems.scm (%network-configuration-files)
(%network-file-mappings): New variables.
* guix/scripts/environment.scm (%network-configuration-files): Remove.
(launch-environment/container): Refer to '%network-file-mappings'
instead of calling 'filter-map'.
2017-02-07 00:08:10 +01:00
Ludovic Courtès d2a5e6982d
file-systems: Add 'file-system-mapping->bind-mount'.
* gnu/system/file-systems.scm (file-system-mapping->bind-mount): New
procedure.
* gnu/system/linux-container.scm (mapping->file-system): Remove.
(containerized-operating-system)[mapping->fs]: Use
'file-system-mapping->bind-mount' instead of 'mapping->file-system'.
* guix/scripts/environment.scm (launch-environment/container): Likewise.
2017-02-03 00:23:28 +01:00
Leo Famulari e8c83d04e1
Merge branch 'master' into core-updates 2017-02-02 10:52:24 -05:00
Ricardo Wurmus de643f0c15
build: r-build-system: Use deterministic built date.
Fixes <http://bugs.gnu.org/25598>.

* guix/build/r-build-system.scm (install): Pass "--built-timestamp" option to
make build deterministic.
2017-02-02 15:20:50 +01:00
Ludovic Courtès 93897a4538
download: Add GNOME mirror.
* guix/download.scm (%mirrors): Add "https://download.gnome.org".
2017-02-01 23:53:35 +01:00
Tobias Geerinckx-Rice 814b099a20
download: Add ‘url-fetch/zipbomb’.
From this suggestion by Ludovic Courtès:
<http://lists.gnu.org/archive/html/guix-devel/2016-09/msg01983.html>

* guix/download.scm (url-fetch/zipbomb): New procedure.
2017-02-01 15:53:33 +01:00
Tobias Geerinckx-Rice 58f91e4d03
download: url-fetch/tarball: Make ‘name’ truly optional.
* guix/download.scm (url-fetch/tarbomb): Fall back to ‘file-name’ if
‘name’ is #f, like the regular ‘url-fetch’ does.
* gnu/packages/bioinformatics.scm (muscle)[source]: Remove ‘file-name’.
* gnu/packages/engineering.scm (fastcap)[source]: Likewise.
* gnu/packages/scheme.scm (scmutils)[source]: Likewise.
2017-02-01 15:53:32 +01:00
Ludovic Courtès f1a892c96f
lint: Use the "@" syntax for versioned packages in warnings.
* guix/scripts/lint.scm (emit-warning): Use the "@" syntax.
2017-01-31 23:51:09 +01:00
Christopher Baines c003546b0c
environment: Fix setting writable? on networking related files
* guix/scripts/environment.scm (launch-environment/container): Include the
  file name in the call to string=? when deciding if the file should be
  writable.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-01-30 10:52:45 +01:00
Ludovic Courtès 0d268c5d70
store: Add 'add-data-to-store'.
* guix/serialization.scm (write-bytevector): New procedure.
(write-string): Rewrite in terms of 'write-bytevector'.
* guix/store.scm (write-arg): Add 'bytevector' case.
(add-data-to-store): New procedure, from former 'add-text-to-store'.
(add-text-to-store): Rewrite in terms of 'add-data-to-store'.
* tests/store.scm ("add-data-to-store"): New test.
2017-01-30 10:52:45 +01:00
Ludovic Courtès 86a6ff4bb0
build-system/python: 'package-with-explicit-python' uses 'eq?' memoization.
* guix/build-system/python.scm (package-with-explicit-python): Use
'mlambdaq' instead of 'mlambda'.  This does not change the <package>
graph and has no visible impact on performance.
2017-01-28 18:55:20 +01:00
Ludovic Courtès 3d520b5428
gnu-maintenance: 'gnu-package?' uses 'eq?' memoization.
* guix/gnu-maintenance.scm (gnu-package?): Use 'mlambdaq' instead of
'mlambda'.
2017-01-28 18:55:20 +01:00
Ludovic Courtès c9134e82fe
packages: Remove 'define-memoized/v' and use 'mlambdaq' instead.
* guix/packages.scm (define-memoized/v): Remove.
(package-transitive-supported-systems): Use 'mlambdaq' instead of
'define-memoized/v'.
(package-input-rewriting)[replace]: Likewise.
2017-01-28 18:55:20 +01:00
Ludovic Courtès 55b2d92145
Use 'mlambda' instead of 'memoize'.
* gnu/packages.scm (find-newest-available-packages): Use 'mlambda'
instead of (memoize (lambda ...) ...).
* gnu/packages/bootstrap.scm (package-with-bootstrap-guile): Likewise.
* guix/build-system/gnu.scm (package-with-explicit-inputs)[rewritten-input]:
Likewise.
* guix/build-system/python.scm (package-with-explicit-python)[transform]:
Likewise.
* guix/derivations.scm (derivation->string): Likewise.
* guix/gnu-maintenance.scm (gnu-package?): Likewise.
* guix/modules.scm (module-file-dependencies): Likewise.
* guix/scripts/graph.scm (standard-package-set): Likewise.
* guix/scripts/lint.scm (official-gnu-packages*): Likewise.
* guix/store.scm (store-regexp*): Likewise.
* guix/utils.scm (location): Likewise.
2017-01-28 18:55:20 +01:00
Ludovic Courtès f9704f179a
Add (guix memoization).
* guix/combinators.scm (memoize): Remove.
* guix/memoization.scm: New file.
* Makefile.am (MODULES): Add it.
* gnu/packages.scm, gnu/packages/bootstrap.scm,
guix/build-system/gnu.scm, guix/build-system/python.scm,
guix/derivations.scm, guix/gnu-maintenance.scm,
guix/import/cran.scm, guix/import/elpa.scm,
guix/modules.scm, guix/scripts/build.scm,
guix/scripts/graph.scm, guix/scripts/lint.scm,
guix/store.scm, guix/utils.scm: Adjust imports accordingly.
2017-01-28 18:55:20 +01:00
Ludovic Courtès 3b0fcc672d
packages: Add 'package-upstream-name' and use it.
* guix/packages.scm (package-upstream-name): New procedure.
* guix/gnu-maintenance.scm (gnu-package?, ftp-server/directory)
(latest-release*, latest-gnome-release)
(latest-kde-release): Use it instead of the inline expression.
2017-01-28 00:38:20 +01:00
Ludovic Courtès 21f4a7c116
import: github: Better tolerate unexpected file extensions.
* guix/import/github.scm (find-extension): Add ".tbz".
(updated-github-url): When 'find-extension' returns #f, use "" for EXT.
2017-01-28 00:38:20 +01:00
Ludovic Courtès 6715e1ff2e
gnu-maintenance: 'gnu-package?' ignores invalid URLs.
* guix/gnu-maintenance.scm (gnu-package?)[gnu-home-page?]: Add '>>'
threading macro and use it.
2017-01-28 00:38:20 +01:00
Ludovic Courtès 2e2cf9a3bd
gnu-maintenance: GNU updater handles gnu.org-hosted Emacs packages.
* guix/gnu-maintenance.scm (pure-gnu-package?): If an "emacs-" package
matches 'gnu-hosted?', return true.
(gnu-hosted?): New procedure.
2017-01-28 00:38:20 +01:00
Ludovic Courtès b03218d532
gnu-maintenance: Honor 'upstream-name' property in GNU updater.
* guix/gnu-maintenance.scm (gnu-package?): Honor the 'usptream-name'
property of PACKAGE.
(ftp-server/directory): Likewise.
2017-01-28 00:38:19 +01:00
Marius Bakke 5a64a79131
utils: Add helper method to make files writable.
* gnu/build/activation.scm (make-file-writable): Move this to ...
* guix/build/utils.scm (make-file-writable): ... here. Export it.
* guix/build/gnu-build-system.scm (strip): Use it.
2017-01-26 22:19:16 +01:00
Ludovic Courtès 1d636d6319
build-system/gnu: Add 'reset-gzip-timestamps' phase.
* guix/build/gnu-build-system.scm (reset-gzip-timestamps): New
procedure.
(%standard-phases): Add it.
2017-01-26 22:05:49 +01:00
Ludovic Courtès 95e7be9728
utils: Add 'gzip-file?' and 'reset-gzip-timestamp'.
* guix/build/utils.scm (%gzip-magic-bytes): New variable.
(gzip-file?, reset-gzip-timestamp): New procedures.
2017-01-26 21:58:37 +01:00
Ricardo Wurmus 0db2ff65e7
bournish: Extend 'rm' command.
* guix/build/bournish.scm (rm-command): New procedure.
(%commands): Use it.
* tests/bournish.scm: Add tests for "rm" and "rm -r".
2017-01-26 13:49:56 +01:00
Carlo Zancanaro 2f977d92d3
import: pypi: Don't add setuptools to propagated-inputs.
* guix/import/pypi.scm (compute-inputs): Don't add setuptools to the imported
  package's propagated-inputs.
2017-01-26 13:44:31 +01:00
Ludovic Courtès 0363474a0b
build-system/gnu: 'strip' phase now skips symlinks.
This avoids a situation where the "debug" output would contain separate
(and different) .debug files for "libfoo.so" and "libfoo.so.0.0", even
though "libfoo.so" is actually a symlink to "libfoo.so.0.0".

* guix/build/gnu-build-system.scm (strip): Remove 'file-exists?' call in
'for-each' lambda.  Pass a predicate to 'find-files' to restrict the
result to regular files.
2017-01-26 11:29:38 +01:00
Mathieu Othacehe db6afe387a
copy: Use userauth-public-key/auto! for ssh authentification.
* guix/scripts/copy.scm (open-ssh-session): Replace userauth-agent! by
  userauth-public-key/auto!. This way, if ssh-agent is not run,
  default ssh key (~/.ssh/id_rsa) will be used as a fallback.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-01-26 11:26:24 +01:00
Leo Famulari d123f2f991
Merge branch 'master' into core-updates 2017-01-25 12:42:39 -05:00
Christopher Baines 0ca575f3bb
container: Pass through TERM when calling exec.
* guix/scripts/container/exec.scm (guix-container-exec): Capture the value of
  the TERM environment variable, and pass it through to the container.  This
  means some applications now work where they did not before (e.g. htop), and
  others have more functionality, providing that the terminal was capable of
  enabling that functionality in the first place.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2017-01-25 14:27:31 +01:00
Ludovic Courtès 482fda2729
grafts: Do not pull derivation outputs not depended on.
Fixes <http://bugs.gnu.org/24886>.

Previously, the grafting derivation of, say, brdf-explorer would pull in
qt:doc even though brdf-explorer depends only on qt:out, not qt:doc.

* guix/grafts.scm (with-cache): Use 'vhash-assoc' and 'vhash-cons'
instead of 'vhash-assq' and 'vhash-consq'.
(cumulative-grafts): Pass #:outputs to 'graft-derivation/shallow'.  Use
OUTPUTS instead of (derivation-output-names drv).
(graft-derivation): Add #:outputs parameter; pass it to
'cumulative-grafts'.
* tests/grafts.scm (make-derivation-input): New variable.
("graft-derivation, replaced derivation has multiple outputs"): Make
sure P2:zzz is not part of the outputs of P3D.
("graft-derivation with #:outputs")
("graft-derivation, unused outputs not depended on"): New tests.
2017-01-25 11:04:25 +01:00
Ludovic Courtès fd7d1235f1
grafts: Shallow grafting can be performed on a subset of the outputs.
* guix/grafts.scm (graft-derivation/shallow): Add #:outputs parameter.
[outputs]: Rename to...
[output-pairs]: ... this.  Adjust 'build-expression->derivation' call
accordingly.
2017-01-24 23:09:06 +01:00
Ludovic Courtès 3483f004a9
syscalls: Export 'read-utmpx'.
* guix/build/syscalls.scm (read-utmpx-from-port): New procedure.
* tests/syscalls.scm ("read-utmpx, EOF")
("read-utmpx"): New tests.
2017-01-24 00:46:37 +01:00
Ludovic Courtès 58ea4d407c
Merge branch 'master' into core-updates 2017-01-23 22:33:10 +01:00
Ludovic Courtès fcd75bdbfa
search-paths: Allow specs with #f as their separator.
This adds support for single-entry search paths.
Fixes <http://bugs.gnu.org/25422>.
Reported by Leo Famulari <leo@famulari.name>.

* guix/search-paths.scm (<search-path-specification>)[separator]:
Document as string or #f.
(evaluate-search-paths): Add case for SEPARATOR as #f.
(environment-variable-definition): Handle SEPARATOR being #f.
* guix/build/utils.scm (list->search-path-as-string): Add case for
SEPARATOR as #f.
(search-path-as-string->list): Likewise.
* guix/build/profiles.scm (abstract-profile): Likewise.
* tests/search-paths.scm: New file.
* Makefile.am (SCM_TESTS): Add it.
* tests/packages.scm ("--search-paths with single-item search path"):
New test.
* gnu/packages/version-control.scm (git)[native-search-paths](separator):
New field.
2017-01-23 22:23:41 +01:00
Ludovic Courtès c5746f2399
guix package: Honor the order of profiles when -p appears multiple times.
* guix/scripts/package.scm (process-query): Reverse the order of
PROFILES.
* tests/guix-package-net.sh: Test it with '--search-paths'.
2017-01-23 22:21:23 +01:00
Ludovic Courtès ac080e296e
lint: Display PACKAGE@VERSION.
* guix/scripts/lint.scm (run-checkers): Remove 'name' variable.  Display
PACKAGE@VERSION instead of PACKAGE-VERSION.
2017-01-21 16:43:26 +01:00
Ludovic Courtès 150309726f
syscalls: Add utmpx procedures and data structure.
* guix/build/syscalls.scm (<utmpx-entry>): New record type.
(%utmpx): New C struct.
(login-type): New bits.
(setutxent, endutxent, getutxent, utmpx-entries): New procedures.
2017-01-19 23:21:25 +01:00
Ludovic Courtès 57f068bec5
syscalls: Extract 'bytes->string'.
* guix/build/syscalls.scm (bytes->string): New procedure.
(bytevector->string-list): Use it.
2017-01-19 23:20:57 +01:00
Mathieu OTHACEHE d18b79fed8
import: github: Catch HTTP 403 error during fetch.
* guix/import/github.scm (json-fetch*): Catch 403 HTTP error that may be
  raised if a github token has not been set.

Signed-off-by: Mathieu OTHACEHE <m.othacehe@gmail.com>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-01-19 17:17:16 +01:00
Ludovic Courtès 840f38ba37
guix environment, build: Allow absolute file names with '--root'.
Reported by Chris Webber.

* guix/scripts/build.scm (register-root): If ROOT is absolute, keep it
as is.
* guix/scripts/environment.scm (register-gc-root): Likewise.
* tests/guix-environment.sh (expected): Add test.
2017-01-19 00:11:15 +01:00
Ludovic Courtès 0aeed5e310
grafts: Preserve the cache across recursive calls.
Before this commit, we'd lose the cache across recursive calls to
'cumulative-grafts', which isn't great performance-wise.

This bug was already present before
d38bc9a9f6.

* guix/grafts.scm (with-cache): In the miss case, call 'current-state'
after EXP has been evaluated.
2017-01-16 22:13:21 +01:00
Ludovic Courtès 90ad5c8836
grafts: Actually cache grafts during the derivation DAG traversal.
This fixes a regression introduced in
d38bc9a9f6 whereby the cache was
effectively disabled.

Reported by Thomas Danckaert <thomas.danckaert@gmail.com>.

* guix/grafts.scm (with-cache): In the cache miss case, wrap body in
'mbegin'.
2017-01-16 22:13:21 +01:00
Christopher Baines 849a1b8133
profiles: Export 'ca-certificate-bundle'.
* guix/profiles.scm: Export ca-certificate-bundle, such that it can be used in
other G-expressions.  This is useful where these G-expressions run programs
that require a ca-certificate-bundle, e.g. git.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-01-16 11:03:42 +01:00
Ludovic Courtès 6da5bb7b1b
guix build: Add '--repair'.
* guix/scripts/build.scm (show-help, %options): Add '--repair'.
* doc/guix.texi (Invoking guix gc): Mention 'guix build --repair'.
(Additional Build Options): Document it.
2017-01-15 22:47:25 +01:00
Ludovic Courtès d9da3a757d
guix build: Do not force 'build-cores', 'max-build-jobs', and 'max-silent-time'.
This lets the daemon use its own default settings unless otherwise
specified.

* guix/scripts/build.scm (set-build-options-from-command-line): Do not
provide default values for #:build-cores and #:max-build-jobs.
(%default-options): Remove 'max-silent-time'.
2017-01-15 15:43:22 +01:00
Ludovic Courtès deac976d3d
daemon: Client settings no longer override daemon settings.
Fixes <http://bugs.gnu.org/20217>.

* nix/libstore/worker-protocol.hh (PROTOCOL_VERSION): Bump to 0x161.
* nix/nix-daemon/nix-daemon.cc (performOp): "build-max-jobs",
"build-max-silent-time", and "build-cores" are no longer read upfront;
instead, read them from the key/value list at the end.
* nix/nix-daemon/guix-daemon.cc (main): Explicitly set
'settings.maxBuildJobs'.
* guix/store.scm (%protocol-version): Bump to #x161.
(set-build-options): #:max-build-jobs, #:max-silent-time, and
 #:build-cores now default to #f.  Adjust handshake to new protocol.
* tests/store.scm ("build-cores"): New test.
* tests/guix-daemon.sh: Add test for default "build-cores" value.
2017-01-15 15:43:22 +01:00
Ludovic Courtès 153b62957c
challenge: Add '--verbose'.
* guix/scripts/challenge.scm (summarize-report): Add #:verbose?
parameter.
[report-hashes]: New procedure.  Use it.
Honor VERBOSE? in the 'match case.
(show-help, %options): Add '--verbose'.
(guix-challenge): Honor it.
2017-01-14 00:57:51 +01:00
Ludovic Courtès 4d8e95097e
challenge: Return comparison reports instead of just discrepancies.
This makes it easier to distinguish between matches, mismatches, and the
various cases of inconclusive reports.

* guix/scripts/challenge.scm (<discrepancy>): Rename to...
(<comparison-report>): ... this.  Add 'result' field.
(comparison-report): New macro.
(comparison-report-predicate, comparison-report-mismatch?)
(comparison-report-match?)
(comparison-report-inconclusive?): New procedures.
(discrepancies): Rename to...
(compare-contents): ... this.  Change to return a list of
<comparison-report>.  Remove calls to 'warning'.
(summarize-discrepancy): Rename to...
(summarize-report): ... this.  Adjust to <comparison-report>.
(guix-challenge): Likewise.
* tests/challenge.scm ("no discrepancies")
("one discrepancy"): Adjust to new API.
("inconclusive: no substitutes")
("inconclusive: no local build"): New tests.
2017-01-14 00:57:51 +01:00
ng0 d8c8e423ed
licenses: Add wtfpl2.
* guix/licenses.scm (wtfpl2): New variable.

Signed-off-by: Leo Famulari <leo@famulari.name>
2017-01-13 14:13:01 -05:00
Ludovic Courtès 608a50b66c
http-client: Provide 'User-Agent' header by default.
* guix/http-client.scm (http-fetch): Add #:headers parameter and honor
it.  Rename 'auth-header' to 'headers'.
* guix/import/github.scm (json-fetch*): Add comment about required
User-Agent.
2017-01-13 18:24:19 +01:00
Ludovic Courtès 4cd5ec801b
import: github: Fix regression on the /releases retrieval.
Fixes a regression introduced in
62bd24db39, which introduced a call to
'hash-table->alist'.

* guix/import/github.scm (json-fetch*): New procedure.
(latest-released-version): Use it.
2017-01-13 18:24:19 +01:00
Ludovic Courtès 6d30b1b2ca
ui: Wrap 'canonicalize-path' for better error reporting.
Reported by Christopher Baines.

* guix/ui.scm (canonicalize-path): New procedure.
2017-01-13 18:24:19 +01:00
Ludovic Courtès e7ff05438f
ui: Factorize error-reporting wrapper code.
* guix/ui.scm (augmented-system-error-handler): New procedure.
(error-reporting-wrapper): New macro.
(symlink, copy-file): Define using 'error-reporting-wrapper'.
2017-01-13 18:24:19 +01:00
Leo Famulari cc0725914e
Merge branch 'master' into python-tests 2017-01-13 10:21:17 -05:00
Ludovic Courtès 4cdff6ae37
challenge: Use a warning when substitutes are lacking.
* guix/scripts/challenge.scm (discrepancies): Use 'warning' instead of
'leave'.
2017-01-12 23:28:45 +01:00
Ludovic Courtès 26ab00a0a9
perform-download: Add backward-compatible case.
This is meant to ease transition for people running an older guix-daemon
invoking a recent 'guix perform-download' with only one argument.

This is a followup to 9b5364a3af.

* guix/scripts/perform-download.scm (perform-download): Make 'output'
optional.  Bind 'output*' from DRV's "out" and honor it.
(guix-perform-download): Add clause with one argument.
2017-01-11 23:01:54 +01:00
Mathieu Lirzin dc673fa113
derivations: Make <derivation> record datatype immutable.
* guix/derivations.scm (<derivation>): Make it immutable.
(derivation): Use generic 'set-field' instead of ad-hoc functional setter.
2017-01-11 18:55:31 +01:00
Mathieu Lirzin 5c6a30c511
git download: Remove redundant argument in 'gexp->derivation' call.
* guix/git-download.scm (git-fetch): Call 'gexp->derivation' with only one
'#:local-build?' keyword argument.
2017-01-11 18:55:26 +01:00
Ludovic Courtès 9b5364a3af
daemon: Allow check builds of 'builtin:download' derivations.
Fixes <http://bugs.gnu.org/25089>.
Reported by Leo Famulari <leo@famulari.name>.

* nix/libstore/build.cc (DerivationGoal::runChild): In the 'isBuiltin'
case, check whether DRV's output is in 'redirectedOutputs', and pass an
'output' argument to the built-in builder.
(DerivationGoal::addHashRewrite): Add 'printMsg' call.
* nix/libstore/builtins.hh (derivationBuilder): Add 'output' parameter.
* nix/libstore/builtins.cc (builtinDownload): Likewise.
Add OUTPUT to ARGV.
* guix/scripts/perform-download.scm (perform-download): Add 'output'
parameter.
(guix-perform-download): Adjust 'match' clauses accordingly.
* tests/derivations.scm ("'download' built-in builder, check mode"): New
test.
2017-01-11 17:06:31 +01:00
Ludovic Courtès aa042770da
guix package: Fix version and output for 'guix package -i /gnu/store/…'.
* guix/utils.scm (package-name->name+version): Add optional 'delimiter'
parameter.
* guix/scripts/package.scm (store-item->manifest-entry): Pass #\- as the
delimiter for 'package-name->name+version'.  Use "out" instead of #f for
the 'output' field.
* tests/guix-package.sh: Add test.
2017-01-11 11:58:21 +01:00
Ludovic Courtès 1545a012cb
guix archive: Allow compilation in the absence of Guile-JSON.
Fixes <http://bugs.gnu.org/25409>.
Reported by Ben Woodcroft <b.woodcroft@uq.edu.au>.

* guix/scripts/archive.scm: Use 'module-autoload!' instead of #:use-module
to (guix docker).
2017-01-10 15:56:49 +01:00
Ludovic Courtès dd1141eba2
http-client: Improve error reporting.
* guix/http-client.scm (http-fetch): Change message in &message
condition to include URI, CODE, and the reason phrase.
2017-01-10 15:34:11 +01:00
Ludovic Courtès 01445711db
guix archive: '-f docker' supports package names as arguments.
This allows users to type:

  guix archive -f docker emacs

as was already the case for the 'nar' format.

Reported by David Thompson.

* guix/scripts/archive.scm (%default-options): Add 'format'.
(export-from-store): Dispatch based on the 'format' key in OPTS.
(guix-archive): Call 'export-from-store' in all cases when the 'export'
key is in OPTS.
2017-01-07 22:55:40 +01:00
Leo Famulari 74288230ea
Merge branch 'master' into core-updates 2017-01-06 17:14:41 -05:00
Ricardo Wurmus 03476a23ff
guix: Add Docker image export.
* guix/docker.scm: New file.
* Makefile.am (MODULES): Register it.
* guix/scripts/archive.scm (show-help, %options, guix-archive): Add
support for "--format".
* doc/guix.texi (Invoking guix archive): Document it.
2017-01-06 16:44:00 +01:00
Ludovic Courtès 76c31074c8
derivations: Share a cache between 'derivation' and 'read-derivation'.
This leads a 13% speedup on 'guix build libreoffice -d' and 18% on
'guix build gnome -d'.

* guix/derivations.scm (%derivation-cache): New variable.
(read-derivation): Use it instead of the private 'cache' variable.
(derivation): Populate %DERIVATION-CACHE before returning.
2017-01-05 23:45:39 +01:00
Ludovic Courtès 6d943e553d
derivations: Micro-optimize 'write-derivation'.
* guix/derivations.scm (write-derivation)[write-input]: Use 'display'
instead of 'write' for PATH.
Use 'simple-format' instead of 'format', and '~a' instead of '~s' for
SYSTEM and BUILDER.
2017-01-05 23:45:38 +01:00
Ludovic Courtès b96a0640a3
graph: Add '%reverse-package-node-type'.
* guix/scripts/graph.scm (%reverse-package-node-type): New variable.
(%node-types): Add it.
* tests/graph.scm ("reverse package DAG"): New test.
* doc/guix.texi (Invoking guix refresh): Add cross-reference to
"Invoking guix graph".
(Invoking guix graph): Document 'reverse-package'.
2017-01-04 16:18:53 +01:00
Ludovic Courtès d38bc9a9f6
grafts: Move caching to a new 'with-cache' macro.
* guix/grafts.scm (with-cache): New macro.
(cumulative-grafts)[return/cache]: Remove.
Use 'with-cache' instead.
2017-01-04 16:18:52 +01:00
Julien Lepiller e6876cb9dc
gnu: Add ocaml-build-system.
* guix/build/ocaml-build-system.scm: New file.
* guix/build-system/ocaml.scm: New file.
* Makefile.am (MODULES): Add them.
* gnu/packages/ocaml.scm (ocaml)[native-search-paths]: Adjuste OCAMLPATH.

Signed-off-by: David Craven <david@craven.ch>
2017-01-04 16:03:39 +01:00
David Craven ee17a9e06e
git-download: Add some helpers.
* guix/git-download.scm (git-version, git-file-name): New variables.
2017-01-04 11:44:07 +01:00
David Craven 3b7ccbe94c
build-system: cargo: Use correct cargo.
* gnu/packages/rust.scm (cargo-bootstrap): Make private.
* guix/build-system/cargo.scm (default-cargo): Use cargo.
2017-01-04 11:29:15 +01:00
Manolis Ragkousis 484437bd43
guix: build: make-bootstrap: Copy libpthread_nonshared.a to the new system.
* guix/build/make-bootstrap.scm (%libc-object-files-rx): Update regexp.
2017-01-03 16:00:43 +02:00
Ludovic Courtès d925cdc35f
ui: Keep the word "Copyright" untranslated.
Suggested by John Darrington <john@darrington.wattle.id.au>.

* guix/ui.scm (show-version-and-exit): Make "Copyright (C) 2017"
untranslatable, except "(C)" itself, like Gnulib's version-etc does.
2017-01-02 23:14:36 +01:00
Ludovic Courtès eeb05e87d3
guix hash: '-x' excludes '.git' even when it is a regular file.
* guix/scripts/hash.scm (guix-hash)[vcs-file?]: Add case for '.git'
regular files.
2017-01-02 15:23:21 +01:00
Ludovic Courtès 74d862e8a2
ui: It's 2017 now!
* guix/ui.scm (show-version-and-exit): Change year to 2017.
2017-01-01 23:38:52 +01:00
Ludovic Courtès a6e0ae4046
syscalls: 'terminal-columns' swallows ENOSYS.
* guix/build/syscalls.scm (terminal-columns): Catch ENOSYS.
2017-01-01 23:38:07 +01:00
Ludovic Courtès fef494d27d
gnu-maintenance: Update ViewVC URLs.
* guix/gnu-maintenance.scm (%gnumaint-base-url): Change "/gnumaint" to
"/womb/gnumaint".
(%package-list-url, %package-description-url): Adjust accordingly.
2017-01-01 23:30:30 +01:00
Ludovic Courtès 5e2e4a51f9
gexp: Support 'ungexp' forms in improper lists.
* guix/gexp.scm (gexp)[collect-escapes, substitute-references]: Replace
the (exp0 exp ...) patterns with (exp0 . exp) to match improper lists.
Adjust clause bodies accordingly.
* tests/gexp.scm ("one input package, dotted list"): New test.
2017-01-01 23:30:30 +01:00
Ludovic Courtès 4a6e889feb
gexp: Properly report substitution errors.
* guix/gexp.scm (gexp)[substitute-ungexp]: Wrap body in 'with-syntax'
and pass EXP as the last argument to 'syntax-error'.
[substitute-ungexp-splicing]: Pass EXP as the last argument to
'syntax-error'.
2017-01-01 23:30:30 +01:00
David Craven f1d136957d
build-system: cargo: Handle Cargo.lock file not present.
* guix/build-system/cargo.scm (cargo-build): Add src output.
  (private-keywords): Add #:outputs.
* guix/build/cargo-build-system.scm (configure): Use /share/rust-source
  when replacing inputs.
  (build, check): Don't do anything when there isn't a Cargo.lock file
  present.
  (install): Install sources to src output. When a Cargo.lock file is
  present use cargo install to install binaries to out.
* guix/import/crate.scm (make-crate-sexp): Importer uses the src output
  for crate inputs by default.
* guix/import/utils.scm (package-names->package-inputs, maybe-inputs,
  maybe-native-inputs): Take an optional output argument.
* tests/crate.scm (crate->guix-package test): Update.

Problem reported by Francisco Gómez García <espectalll@kydara.com>.
2017-01-01 18:20:52 +01:00
David Craven f53a5514e0
import: crate: Provide a default home-page value.
* guix/import/crate.scm (make-crate-sexp): Provide a default home-page
  value.
* tests/crate.scm (test-crate): Add repository field.

Problem reported by ng0 <ng0@libertad.pw>.
2017-01-01 18:12:06 +01:00
David Craven dc77498c1c
build-system: cargo: Make Cargo.toml writeable.
* guix/build/cargo-build-system.scm (configure): Make sure Cargo.toml
  is writeable before attempting modification.

Problem reported by Danny Milosavljevic <dannym@scratchpost.org>.
2017-01-01 18:11:57 +01:00
Ludovic Courtès f11c444d44
Add 'guix copy'.
* guix/scripts/copy.scm: New file.
* guix/scripts/archive.scm (options->derivations+files): Export.
* doc/guix.texi (Invoking guix copy): New node.
* Makefile.am (MODULES) [HAVE_GUILE_SSH]: Add guix/scripts/copy.scm.
* po/guix/POTFILES.in: Likewise.
2016-12-31 18:35:29 +01:00
Ludovic Courtès 13164a2102
ssh: 'retrieve-files' detects remote export failures.
* guix/ssh.scm (retrieve-files): Call 'lookahead-u8' and raise a
'&message' condition when it returns EOF.
2016-12-31 18:35:29 +01:00
Ludovic Courtès 23973e4fbf
ssh: 'send-files' returns the list of items sent.
* guix/ssh.scm (send-files): Return MISSING.
2016-12-31 18:35:29 +01:00
Ludovic Courtès e9629e8221
ssh: Allow transfers of complete closures.
* guix/ssh.scm (store-export-channel, send-files)
(file-retrieval-port, retrieve-files): Add #:recursive? parameter and
honor it.
2016-12-31 18:35:29 +01:00
Ludovic Courtès c0b2d08bf4
git-download: Use a single download script for all derivations.
That way, we have only one /gnu/store/…-git-download instead of one
/gnu/store/…-PACKAGE-checkout-builder for each package.

This is a followup to ced200328c.

* guix/git-download.scm (git-fetch)[build]: Get the URL, commit, and
recursive parameter using 'getenv'.  Pass #:script-name and #:env-vars
arguments to 'gexp->derivation'.
2016-12-31 18:35:29 +01:00
Ludovic Courtès 987a29ba43
Add (guix ssh) module.
* guix/scripts/offload.scm (connect-to-remote-daemon)
(store-import-channel, store-export-channel, send-files)
(retrieve-files): Move to (guix ssh).
(nonce): Add optional 'name' parameter and use it.
(retrieve-files*): New procedure.
(transfer-and-offload): Use it instead of 'retrieve-files', and add
first parameter to 'send-files'.
(assert-node-can-import): Likewise.
(assert-node-can-export): Use 'retrieve-files' instead of
'store-export-channel'.
* guix/ssh.scm: New file.
* configure.ac: Use 'GUIX_CHECK_GUILE_SSH' and define 'HAVE_GUILE_SSH'
Automake conditional.
* Makefile.am (MODULES) [HAVE_GUILE_SSH]: Add guix/ssh.scm.
2016-12-31 01:44:04 +01:00
Carlo Zancanaro 681a555b83
import: elpa: Import dependencies as propagated-inputs
* guix/import/elpa.scm (elpa-package->sexp): Import dependencies as
propagated-inputs.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2016-12-29 18:22:49 +01:00
Carlo Zancanaro 36225d4fef
import: elpa: Fix call-with-downloaded-file
* guix/import/elpa.scm (call-with-downloaded-file): Make function behaviour
match documentation string.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2016-12-29 18:22:49 +01:00
Ludovic Courtès 7c247809ef
guix build: '--with-source' overrides the 'replacement' of a package.
* guix/scripts/build.scm (package-with-source): Set 'replacement' to #f.
* tests/scripts-build.scm ("options->transformation, with-source,
replacement"): New test.
2016-12-21 23:48:14 +01:00
Ludovic Courtès 62bd24db39
import: github: Use 'json-fetch'.
* guix/import/github.scm (json-fetch*): Remove.
(latest-released-version): Adjust accordingly.
2016-12-20 19:14:41 +01:00
Ludovic Courtès f943c317fb
environment: Add '--root' option.
* guix/scripts/environment.scm (show-help, %options): Add --root.
(register-gc-root): New procedure.
(guix-environment): Call 'register-gc-root' when OPTS has a 'gc-root'
option.
* doc/guix.texi (Invoking guix environment): Document it.
* tests/guix-environment.sh: Add tests.
2016-12-20 19:14:41 +01:00
Marius Bakke 4cb7786eff
import: pypi: Match new 'pypi-uri' domain in updater.
* guix/import/pypi.scm (pypi-package?): Match pypi.io domain.
2016-12-20 12:57:26 +01:00
Ludovic Courtès d343a60f93
gexp: Slightly simplify 'gexp-inputs'.
* guix/gexp.scm (gexp-inputs)[add-reference-inputs]: Remove unneeded
'if' in the non-native nested gexp case.
2016-12-19 17:51:00 +01:00
Ludovic Courtès 5b14a7902c
gexp: Native inputs of nested gexps are properly accounted for.
Previously, 'gexp-native-inputs' would not return the native inputs of
nested gexps.  For example, this:

  (gexp-native-inputs #~(foo #$#~(bar #+coreutils)))

would return '().

* guix/gexp.scm (gexp-inputs)[add-reference-inputs]: In the
non-recursive cases, check whether N? and NATIVE? are the same, and act
accordingly.
[native-input?]: Remove.
Fold over all of (gexp-references exp).
* tests/gexp.scm ("ungexp + ungexp-native, nested, special mixture"):
New test.
* tests/gexp.scm ("input list splicing + ungexp-native-splicing"): Pass
 #:native? #t to 'gexp-input'.
2016-12-19 17:51:00 +01:00
Ricardo Wurmus fdbc84b056
import cran: Handle HTTP errors.
Fixes <http://bugs.gnu.org/23479>.

* guix/import/cran.scm (fetch-description): Return #f in case of HTTP
errors.
2016-12-17 19:13:42 +01:00
Ricardo Wurmus d68ba5f483
guix import: Print list of expressions.
* guix/scripts/import.scm (guix-import): Print list of expressions.
2016-12-17 19:13:41 +01:00
Ricardo Wurmus 64ce53eb5e
import cran: Add "recursive" option.
* guix/scripts/import/cran.scm: (%options): Add "recursive" option.
(guix-import-cran): Handle "recursive" option.
* doc/guix.texi (Invoking guix import): Document it.
2016-12-17 19:13:41 +01:00
Ricardo Wurmus 94e907b962
import cran: Add recursive importer.
* guix/import/cran.scm (recursive-import): New variable.
(cran->guix-package): Memoize the procedure.
2016-12-17 19:12:55 +01:00
Ricardo Wurmus b26abe4f14
import cran: Ignore default R packages.
* guix/import/cran.scm (default-r-packages): New variable.
(description->package): Drop default R packages from list of inputs.
2016-12-17 15:56:48 +01:00
Ricardo Wurmus ad68f7fa58
import cran: description->package: Also return package dependencies.
* guix/import/cran.scm (description->package): Return package
  dependencies in addition to generated package expression.
2016-12-17 15:56:48 +01:00
Ricardo Wurmus bfa0c752bc
import cran: Move guix-name to top-level.
* guix/import/cran.scm (guix-name): Move to top-level.
2016-12-17 15:56:48 +01:00
Ricardo Wurmus 2e5f32ce1b
import cran: Remove more invalid characters from package names.
* guix/import/cran.scm (guix-name): Replace period and underscore with
  dash; always prepend package names with "r-".
2016-12-17 15:56:47 +01:00
Ricardo Wurmus 576eda6d02
import cran: Handle BSD licenses with LICENSE file.
* guix/import/cran.scm (string->license): Add cases for BSD licenses
with LICENSE file.
2016-12-17 15:56:47 +01:00
Ricardo Wurmus 741d68c20d
import cran: Translate MIT to the Expat license.
* guix/import/cran.scm (string->license): Translate "MIT" license to
Expat license.
2016-12-17 15:56:47 +01:00
Ricardo Wurmus 13f54d081b
import cran: Do not use "or later" licenses by default.
* guix/import/cran.scm (string->license): Use exact license versions.
2016-12-17 15:56:39 +01:00
Ludovic Courtès a6562c7e20
profiles: Remove dependency on 'glibc-utf8-locales' for tests.
Commit 1af0860e8b added a mandatory
dependency on 'glibc-utf8-locales', which entails long rebuilds for
tests.

* guix/profiles.scm (profile-derivation): Add #:locales? parameter.
Add 'set-utf8-locale' variable.  Use it when LOCALES? is true.
(link-to-empty-profile): Pass #:locales? #f.
* guix/scripts/environment.scm (inputs->profile-derivation): Pass
  #:locales?.
* guix/scripts/package.scm (build-and-use-profile): Likewise.
* tests/packages.scm ("--search-paths with pattern"): Pass #:locales? #f.
* tests/profiles.scm ("profile-derivation")
("profile-derivation, inputs", "profile-manifest, search-paths")
("etc/profile", "etc/profile when etc/ already exists"):
("etc/profile when etc/ is a symlink"): Likewise.
2016-12-17 14:46:42 +01:00
Ludovic Courtès 1af0860e8b
profiles: Build profiles in a UTF-8 locale.
Fixes <http://bugs.gnu.org/25213>.
Reported by Christopher Baines <mail@cbaines.net>.

* guix/profiles.scm (profile-derivation)[glibc-utf8-locales]: New
variable.
[builder]: Use it to set 'LOCPATH'.
2016-12-16 18:01:08 +01:00
Ludovic Courtès 580deec5b4
download: Protect against dangling symlinks in $SSL_CERT_DIR.
Reported by Christopher Baines <mail@cbaines.net>
in <https://bugs.gnu.org/25213>.

* guix/build/download.scm (make-credendials-with-ca-trust-files): Check
whether FILE exists before calling
'set-certificate-credentials-x509-trust-file!'.
2016-12-16 18:00:01 +01:00
Ludovic Courtès 99ec0cb397
refresh: Make dependency on (guix import crates) weak.
Reported by Tobias Geerinckx-Rice <me@tobias.gr>.

* guix/scripts/refresh.scm: Do not explicitly import (guix import crates).
2016-12-16 17:38:39 +01:00
David Craven 6976c68158
upstream: Determine archive type correctly.
* guix/upstream.scm (package-update): Take the basename of the uri
  before trying to determine the extension.
2016-12-15 05:57:03 +01:00
Ricardo Wurmus 4d93f312f0
graph: Add d3js backend.
* d3.v3.js, graph.js: New files.
* Makefile.am (EXTRA_DIST): List them.
* guix/graph.scm (%d3js-backend): New variable.
(emit-d3js-prologue, emit-d3js-epilogue, emit-d3js-node,
emit-d3js-edge): New procedures.
(%graph-backends): Add %d3js-backend.
2016-12-14 21:58:32 +01:00
Ricardo Wurmus 642339dc3f
graph: Add "list-backend" and "backend" options.
* guix/graph.scm (%graph-backends): New variable.
* guix/scripts/graph.scm (lookup-backend, list-backends): New
procedures.
(%options): Add options for "backend" and "list-backends".
(show-help): Add help texts for "backend" and "list-backend" options.
(%default-options): Add "backend" default.
(guix-graph): Pass backend argument to "export-graph".
* doc/guix.texi (Invoking guix graph): Document the new options.
2016-12-14 21:57:37 +01:00
Ricardo Wurmus 51377437a1
graph: Backend must have name and description.
* guix/graph.scm (<graph-backend>): Add fields "name" and "description".
(%graphviz-backend): Provide values for name and description.
(export-graph): Ignore name and description when matching backends.
(graph-backend-name, graph-backend-description): New procedures.
* tests/graph.scm (make-recording-backend): Initialize name and
description fields of test graph-backend.
2016-12-14 21:43:06 +01:00
David Craven 8ac5298786
import: Add updater for rust crates.
* guix/import/crate.scm (crate-package?, latest-release,
  %crate-updater): New variables.
* guix/scripts/refresh.scm (%updaters): Add crate updater.
* doc/guix.texi: Add crate updater to table.
2016-12-14 16:30:42 +01:00
David Craven 3e0c036584
import: Add importer for rust crates.
* guix/import/crate.scm: New file.
* guix/scripts/import/crate.scm: New file.
* guix/scripts/import.scm (importers): Add crate importer.
* tests/crate.scm: New file.
* doc/guix.texi: Add crate importer to table.
* Makefile.am (MODULES, SCM_TESTS): Add files.
2016-12-14 16:30:42 +01:00
David Craven bb3f36ed4c
import: utils: Add some utilities.
* guix/import/utils.scm (maybe-inputs, maybe-native-inputs,
  package->definition): New variables.
2016-12-14 16:30:42 +01:00
David Craven 4b3cb7f4bc
build-system: Add cargo build system.
* guix/build-system/cargo.scm: New file.
* guix/build/cargo-build-system.scm: New file.
* Makefile.am (MODULES): Add files.
2016-12-14 16:30:42 +01:00
Ludovic Courtès af72a21a69
upstream: Use first url when it lacks an extension.
* guix/upstream.scm (package-update): Use a url from the list when it
  lacks an extension.
2016-12-14 14:20:50 +01:00
Marius Bakke e46a043ecd
build-system/python: Make sure 'check' returns failures.
* guix/build/python-build-system.scm (check): Wrap 'call-setuppy' in 'if' so
that it actually fails when the tests fail. Print informational message when
skipped.
2016-12-13 21:04:31 +01:00
Eric Bavier ff55fe5599
import: cpan: Add updater.
* guix/import/cpan.scm (module->dist-name): Fetch the field of interest.
(cpan-fetch): Accept release name rather than module name.
(fix-source-url): Rename to ...
(cpan-source-url): ... this.  Take metadata as parameter.
(package->upstream-name, cpan-version, cpan-package?, latest-release):
New procedures.
(cpan-module->sexp): Use cpan-version and cpan-source-url.
(%cpan-updater): New variable.
* guix/scripts/refresh.scm (%updaters): Add %CPAN-UPDATER.
2016-12-12 22:22:33 -06:00
Eric Bavier d391ad57d6
import: cpan: Move core-module? to top-level.
* guix/import/cpan.scm (cpan-module->sexp): Move local core-module?
procedure to ...
(core-module?): ... here.
2016-12-12 22:22:33 -06:00
Eric Bavier 63773200d7
import: json: Silence json-fetch output.
* guix/import/json.scm (json-fetch): Use http-fetch instead of url-fetch
to avoid writing to stdout and a temporary file for each invocation.
* guix/import/gem.scm (rubygems-fetch): Do not redirect json-fetch
output to /dev/null.
* guix/import/pypi.scm (pypi-fetch): Likewise.
2016-12-12 22:22:02 -06:00
Mark H Weaver d94691e0c2
Merge branch 'master' into staging 2016-12-10 23:03:57 -05:00
Ludovic Courtès 27991c97e6
offload: Allow testing machines that match a regexp.
* guix/scripts/offload.scm (check-machine-availability): Add 'pred'
parameter and honor it.
(guix-offload): for the "test" sub-command, accept an extra 'regexp'
parameter.  Pass a second argument to 'check-machine-availability'.
2016-12-09 23:12:06 +01:00
Ludovic Courtès 2b513387cd
offload: Test each machine only once.
* guix/scripts/offload.scm (check-machine-availability)[build-machine=?]:
New procedure.
Add call to 'delete-duplicates'.
2016-12-09 23:02:02 +01:00
Ludovic Courtès bd8345777f
offload: Do not read ~/.ssh/known_hosts.
* guix/scripts/offload.scm (open-ssh-session): Pass #:knownhosts to
'make-session'.
2016-12-09 23:02:01 +01:00
Ludovic Courtès f80b4d2ce0
Merge remote-tracking branch 'origin/master' into staging 2016-12-09 18:11:14 +01:00
Ludovic Courtès 13d5e8dae5
store: 'open-connection' no longer raises '&nar-error' for protocol errors.
* guix/store.scm (open-connection): Guard body against 'nar-error?' and
re-raise as '&nix-connection-error'.
* tests/store.scm ("connection handshake error"): New test.
2016-12-08 23:12:11 +01:00
Manolis Ragkousis f13f60cb26
gnu: make-bootstrap: Produce the correct %glibc-bootstrap-tarball for Hurd systems.
* gnu/packages/make-bootstrap.scm (%glibc-bootstrap-tarball): Make it a procedure.
  (%glibc-stripped): Make it a procedure and move the kernel specific part from
  here to ...
* guix/build/make-bootstrap.scm (make-stripped-libc): ... here. New file.
* Makefile.am (MODULES): Add it.
2016-12-07 12:59:02 +02:00
Jan Nieuwenhuizen cba36e6482
gnu: cross-base: Add i686-w64-mingw32 target.
* guix/utils.scm (mingw-target?): New function.
* gnu/packages/cross-base.scm (cross-gcc-snippet): New procedure
(cross-gcc): Use it.
(cross-gcc-arguments, cross-gcc-patches, cross-gcc): Support MinGW.
(native-libc, cross-newlib?): New functions.
(cross-libc): Use cross-newlib? to support MinGW.
(%gcc-include-paths, %gcc-cross-include-paths): New variables.
2016-12-07 10:23:16 +01:00
Ludovic Courtès 8d125cfc2e
offload: Increase the connection timeout.
* guix/scripts/offload.scm (open-ssh-session): Set #:timeout to 10.
2016-12-06 01:00:11 +01:00
Ludovic Courtès 0237d79717
offload: Send the build log to the right file descriptor.
This fixes a regression introduced in
21531add32 whereby the build log would no
longer be sent to FD 4, thereby leading the daemon to not see the build
log.

* guix/scripts/offload.scm (transfer-and-offload): Parameterize
CURRENT-BUILD-OUTPUT-PORT.
2016-12-06 00:50:08 +01:00
Ludovic Courtès e11c42f297
offload: Fix plural of some messages.
* guix/scripts/offload.scm (send-files): Use 'N_' for possibly plural
message.  Write "store item" instead of "store file".
(retrieve-files): Likewise.
2016-12-05 23:26:38 +01:00
Ludovic Courtès 1d48cf948c
offload: Make the compression methods configurable.
* guix/scripts/offload.scm (<build-machine>)[compression]
[compression-level]: New fields.
(open-ssh-session): Honor them.
* doc/guix.texi (Daemon Offload Setup): Document them.
2016-12-05 23:19:38 +01:00
Chris Marusich 067a2e2de9
guix system: If the new system generation already exists, overwrite it.
Fixes <http://bugs.gnu.org/25100>.

Before that, 'guix system reconfigure' would fail if the next generation
already existed.

* guix/scripts/system.scm (switch-to-system): Use 'switch-symlink'
instead of 'symlink'.
* doc/guix.texi (Using the Configuration System, Invoking guix system):
Document the behavior.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2016-12-05 23:19:37 +01:00
Tobias Geerinckx-Rice d8501b844b
refresh: Indicate that PACKAGE... is optional.
* guix/scripts/refresh.scm (show-help): Add brackets around PACKAGE.
2016-12-05 20:50:12 +01:00
Ludovic Courtès aebaee95cc
offload: Add "test" sub-command.
* guix/scripts/offload.scm (assert-node-repl, assert-node-has-guix)
(nonce, assert-node-can-import, assert-node-can-export)
(check-machine-availability): New procedures.
(%random-state): New variable.
(guix-offload): Add case for "test".
* doc/guix.texi (Daemon Offload Setup): Document it.  Remove obsolete
bit about remote invocation of 'guix build'.
2016-12-05 18:18:10 +01:00
Ludovic Courtès 42d07286f4
publish: Factorize 'content-length' addition.
* guix/scripts/publish.scm (with-content-length): New procedure.
(http-write) <application/octet-stream>: Use it.
2016-12-04 22:32:26 +01:00
Marius Bakke a351fc8369
Merge branch 'master' into staging 2016-12-04 17:41:36 +01:00
Ludovic Courtès 463fb7d0c8
offload: Do not abort when a machine is unreachable.
* guix/scripts/offload.scm (machine-load): Wrap 'open-ssh-session' call
in 'false-if-exception'; return +inf.0 if it returns #f.
2016-12-01 23:35:11 +01:00
Ludovic Courtès 74afca5dcf
offload: Gracefully report connection failures.
* guix/scripts/offload.scm (open-ssh-session): Check the return value of
'connect!'.  Call 'leave' when it's not 'ok.
2016-12-01 23:35:10 +01:00
Ludovic Courtès 6374633b92
store: Increase buffering for the '%stderr-write' upcall.
* guix/store.scm (process-stderr) <%stderr-write>: Pass #:buffer-size to
'dump-port'.
2016-12-01 23:35:10 +01:00
Ludovic Courtès 0b72475301
offload: Warn about the lack of zlib support.
* guix/scripts/offload.scm (guix-offload): Print a warning when
'zlib-support?' returns false.
2016-12-01 23:35:10 +01:00
Ludovic Courtès f3cf860635
offload: Remove redundant call to 'topologically-sorted' in 'send-file'.
* guix/scripts/offload.scm (send-files): Remove call to
'topologically-sorted'.
2016-12-01 23:35:10 +01:00
Marius Bakke 8a7cbc882a
Merge branch 'master' into staging 2016-11-30 18:24:32 +01:00
Ludovic Courtès 3676f89255
refresh: '--list-updaters' shows updater coverage.
* guix/scripts/refresh.scm (list-updaters-and-exit): Compute the
coverage ratio of each updater and print it.  Print the coverage ratio
for all the updaters.
* doc/guix.texi (Invoking guix refresh): Document it.
2016-11-30 17:35:21 +01:00
Ludovic Courtès 2fd370e816
gnu-maintenance: Add kernel.org updater.
* guix/gnu-maintenance.scm (latest-kernel.org-release): New procedure.
(%kernel.org-updater): New variable.
* guix/scripts/refresh.scm (%updaters): Add it.
2016-11-30 17:35:21 +01:00
Ludovic Courtès 8d5d06282e
upstream: Properly verify signatures of uncompressed tarballs.
* guix/upstream.scm (uncompressed-tarball): New procedure.
(download-tarball): Use it when the basename of SIGNATURE-URL doesn't
contain the basename of URL.
2016-11-30 17:35:21 +01:00
Ludovic Courtès 4e6230ec00
refresh: Honor the selected updaters when '-u' isn't given.
Fixes a regression introduced in
e9c72306fd.

* guix/scripts/refresh.scm (check-for-package-update): Add 'updaters'
parameter and honor it.
(guix-refresh): Pass UPDATERS to 'check-for-package-update'.
2016-11-30 17:35:21 +01:00
Ludovic Courtès 7632f7bc21
gnu-maintenance: Factorize URL prefix predicates.
* guix/gnu-maintenance.scm (url-prefix-predicate): New procedure.
(gnome-package?): Rewrite in terms of 'url-prefix-predicate'.
(kde-package?, xorg-package?): Remove.
(%kde-updater, %xorg-updater): Use 'url-prefix-predicate'.
2016-11-30 17:35:20 +01:00
Hartmut Goebel 3bf4280659
Merge branch 'master' into python-build-system 2016-11-29 18:47:16 +01:00
Ludovic Courtès 3e95d88d51
gnu-maintenance: 'latest-kde-release' honors 'upstream-name' properties.
* guix/gnu-maintenance.scm (latest-kde-release): Honor the
'upstream-name' property of PACKAGE.
2016-11-29 16:12:31 +01:00
Ludovic Courtès e9c72306fd
refresh: Warn about packages that lack an updater.
* guix/upstream.scm (package-update-path): Rename to...
(package-latest-release): ... this.  Remove 'version>?' check.
(package-latest-release*): New procedure.
(package-update): Use it.
* guix/scripts/refresh.scm (lookup-updater): Rename to...
(lookup-updater-by-name): ... this.
(warn-no-updater): New procedure.
(update-package): Add #:warn? parameter and honor it.
(check-for-package-update): New procedure.
(guix-refresh)[warn?]: New variable.
Replace inline code when UPDATE? is false with a call to
'check-for-package-update'.
Pass WARN? to 'check-for-package-update' and 'update-package'.
* doc/guix.texi (Invoking guix refresh): Document it.  Fix a couple of
typos.
2016-11-29 16:12:31 +01:00
Marius Bakke be12f4e275
build-system/perl: Don't create non-deterministic 'perllocal.pod' files.
* guix/build/perl-build-system.scm (configure): Add "NO_PERLLOCAL=1"
to Makefile.PL arguments.
2016-11-28 23:11:39 +01:00
Ludovic Courtès c062b1eb6c
pull: Set '%nix-instantiate' to a sensible value.
Reported by ng0 <ng0@libertad.pw>.
Fixes <http://bugs.gnu.org/25053>.

* guix/build/pull.scm (build-guix): Replace "@NIX_INSTANTIATE@" in
guix/config.scm with "nix-instantiate".
2016-11-28 22:58:18 +01:00
Ludovic Courtès 1cd1d8a7ea
offload: Call 'machine-load' only once per machine.
This fixes a longstanding issue where 'choose-build-machine' would make
on average O(N log(N)) calls to 'machine-load', plus an extra call for
the selected machine, instead of N calls.

* guix/scripts/offload.scm (machine-load): Add comment.
(machine-power-factor, machine-less-loaded-or-faster?): Remove.
(choose-build-machine)[machines+slots]: Rename to...
[machines+slots+loads]: ... this.
[undecorate]: Adjust accordingly.
[machine-less-loaded-or-faster?]: New procedure.
Remove extra 'machine-load' call in body.
2016-11-26 23:21:37 +01:00
Leo Famulari a282cdae10
Merge branch 'master' into core-updates 2016-11-26 16:21:47 -05:00
Marius Bakke c254ac3200
build-system/gnu: Make libraries writable before stripping.
* guix/build/gnu-build-system.scm (strip)[strip-dir]: Change mode of
files before running strip-command.
2016-11-26 09:07:07 +01:00
Ludovic Courtès bc1ad4e334
offload: Drop 'remote-pipe'.
* guix/scripts/offload.scm (remote-pipe): Remove.
(machine-load): Use 'open-remote-pipe*' instead of 'remote-pipe'.
2016-11-25 23:44:21 +01:00
Ludovic Courtès cf283dd92e
offload: Rewrite to make direct RPCs to the remote daemon.
* guix/scripts/offload.scm (<build-machine>)[daemon-socket]: New field.
(connect-to-remote-daemon): New procedure.
(%gc-root-file, register-gc-root, remove-gc-roots, offload): Remove.
(transfer-and-offload): Rewrite using 'connect-to-remote-daemon' and
RPCs over SSH.
(store-import-channel, store-export-channel): New procedures.
(send-files, retrieve-files): Rewrite using these.
2016-11-25 23:44:20 +01:00
Ludovic Courtès e8a5db80d5
offload: Remove 'with-nar-error-handling' macro.
* guix/scripts/offload.scm (with-nar-error-handling): Remove.
(guix-offload): Use 'with-error-handling' instead.
2016-11-25 23:44:20 +01:00
Ludovic Courtès 6230d6f04f
store: 'open-connection' can taken an open port.
* guix/store.scm (open-unix-domain-socket): New procedure.
(open-connection): Add #:port parameter and honor it.
2016-11-25 23:44:20 +01:00
Ludovic Courtès 9e76eed37f
offload: Reuse SSH session during 'transfer-and-offload'.
* guix/scripts/offload.scm (remote-pipe): Replace 'machine' parameter
with 'session'.  Remove 'open-ssh-session' call.
(register-gc-root): Replace 'machine' with 'session'.  Use '
session-get' instead of 'build-machine-name'.
(remove-gc-roots, offload, send-files, retrieve-files): Likewise.
(transfer-and-offload): Add 'open-ssh-session' call.  Handle 'offload'
errors here.
(machine-load): Add call to 'open-ssh-session'.
2016-11-25 23:44:20 +01:00
Ludovic Courtès 21531add32
offload: Use Guile-SSH instead of GNU lsh.
* guix/scripts/offload.scm (<build-machine>)[ssh-options]: Remove.
[host-key, host-key-type]: New fields.
(%lsh-command, %lshg-command, user-lsh-private-key): Remove.
(user-openssh-private-key, private-key-from-file*): New procedures.
(host-key->type+key, open-ssh-session): New procedures.
(remote-pipe): Remove 'mode' parameter.  Rewrite in terms of
'open-ssh-session' etc.  Update users.
(send-files)[missing-files]: Rewrite using the bidirectional channel
port.
Remove call to 'call-with-compressed-output-port'.
(retrieve-files): Remove call to 'call-with-decompressed-port'.
(machine-load): Remove exit status logic.
* doc/guix.texi (Requirements): Mention Guile-SSH.
(Daemon Offload Setup): Document 'host-key' and 'private-key'.  Show the
default value on each @item line.
* m4/guix.m4 (GUIX_CHECK_GUILE_SSH): New macro.
* config-daemon.ac: Use 'GUIX_CHECK_GUILE_SSH'.  Set
'HAVE_DAEMON_OFFLOAD_HOOK' as a function of that.
2016-11-25 23:44:20 +01:00
Leo Famulari de32aa74b4
Merge branch 'master' into python-build-system 2016-11-25 11:20:21 -05:00
Leo Famulari 2ac7d54616
Merge branch 'master' into staging 2016-11-23 22:24:52 -05:00
Ludovic Courtès 9e38e3cf52
syscalls: Add 'add-network-route/gateway' and 'delete-network-route'.
* guix/build/syscalls.scm (SIOCADDRT, SIOCDELRT): New variables.
(%rtentry): New C struct.
(RTF_UP, RTF_GATEWAY, %sockaddr-any): New variables.
(add-network-route/gateway, delete-network-route): New procedures.
* tests/syscalls.scm ("add-network-route/gateway")
("delete-network-route"): New tests.
2016-11-21 00:34:48 +01:00
Ludovic Courtès 8eb790f368
syscalls: Add 'c-struct-field-offset'.
* guix/build/syscalls.scm (define-c-struct-macro): New macro.
(define-c-struct): Use it.
(c-struct-field-offset): New macro.
2016-11-21 00:34:48 +01:00
Ludovic Courtès fac46e3f5e
lint: Add 'mirror-url' checker.
* guix/scripts/lint.scm (origin-uris): New procedure.
(check-source): Use it.
(check-mirror-url): New procedure.
(%checkers): Add 'mirror-url' checker.
* tests/lint.scm ("mirror-url")
("mirror-url: one suggestion"): New tests.
* doc/guix.texi (Invoking guix lint): Document it.
2016-11-19 18:44:53 +01:00
Ludovic Courtès e74f64b9e5
store: Add 'references*'.
* guix/store.scm (references*): New procedure.
* guix/profiles.scm (manifest-lookup-package)[references*]: Remove.
* guix/scripts/system.scm (references*): Remove.
* tests/gexp.scm ("gexp->file", "gexp->file + file-append")
("gexp->derivation", "gexp->derivation, cross-compilation")
("gexp->derivation, ungexp + ungexp-native")
("scheme-file", "text-file*", "mixed-text-file"): Remove 'references*'
instead of (store-lift references).
2016-11-19 18:44:53 +01:00
Ludovic Courtès 713335fa61
derivations: Add 'raw-derivation'.
* guix/derivations.scm (raw-derivation): New procedure.
* guix/download.scm (raw-derivation): Remove.
* guix/gexp.scm (raw-derivation): Remove.
2016-11-19 18:44:53 +01:00
Ludovic Courtès 4c80d4c481
download: Do not offload 'builtin:download' derivations.
* guix/download.scm (built-in-download): Pass #:local-build? #t.
2016-11-18 18:28:02 +01:00
Roel Janssen 88bdbb2a0f
guix package: Display newline after generation diffs.
* guix/ui.scm (display-profile-content-diff): Display an extra newline.
2016-11-17 23:49:29 +01:00
Ludovic Courtès e9ff8d9ff1
syscalls: 'configure-network-interface' has a #:netmask parameter.
* guix/build/syscalls.scm (configure-network-interface): Add #:netmask
keyword parameter and honor it.
2016-11-17 23:21:47 +01:00
Ludovic Courtès 67e5f3b71d
syscalls: Add bindings for SIOCGIFNETMASK and SIOCSIFNETMASK.
* guix/build/syscalls.scm (SIOCGIFNETMASK, SIOCSIFNETMASK): New
variables.
(set-network-interface-netmask, network-interface-netmask): New
procedures.
* tests/syscalls.scm ("network-interface-netmask lo")
("set-network-interface-netmask"): New tests.
2016-11-16 23:38:06 +01:00
Ludovic Courtès 9d9d0c9c98
syscalls: Use 'define-c-struct' for 'struct ifconf'.
* guix/build/syscalls.scm (ifconf-struct): Remove.
(%ifconf-struct): New C struct.
(network-interface-names): Use 'make-bytevector' and 'write-ifconf!'
instead of 'make-c-struct', and 'read-ifconf' instead of
'parse-c-struct'.
2016-11-16 23:38:05 +01:00
Ludovic Courtès f43714e620
syscalls: C struct writer correctly handles pointer fields.
* guix/build/syscalls.scm (write-type): Add case for '*.
2016-11-16 23:38:05 +01:00
Ludovic Courtès 05ceb8dcaf
download: Use the built-in 'download' builder when available.
Fixes <http://bugs.gnu.org/22774>.
Reported by Christopher W Carpenter.

* guix/download.scm (built-in-builders*, raw-derivation)
(built-in-download): New procedures.
(in-band-download): New procedure, with code formerly in 'url-fetch'.
(url-fetch): Call 'built-in-builders*' and dispatch between
'built-in-download' and 'in-band-download'.
2016-11-16 18:19:55 +01:00
Ludovic Courtès f9aefa2d5f
daemon: Add 'built-in-builders' RPC.
* nix/libstore/builtins.cc (builtinBuilderNames): New function.
* nix/libstore/builtins.hh (builtinBuilderNames): New declaration.
* nix/libstore/worker-protocol.hh (PROTOCOL_VERSION): Bump to 0x160.
(WorkerOp)[wopBuiltinBuilders]: New value.
* nix/nix-daemon/nix-daemon.cc (performOp): Handle it.
* guix/store.scm (operation-id)[built-in-builders]: New value.
* guix/store.scm (read-arg): Add 'string-list'.
(built-in-builders): New procedure.
* tests/derivations.scm ("built-in-builders"): New test.
2016-11-16 18:19:54 +01:00
Ludovic Courtès 94d92c7796
daemon: Add "builtin:download" derivation builder.
This ensures that 1) the derivation doesn't change when Guix changes;
2) the derivation closure doesn't contain Guix and its dependencies; 3)
we don't have to rely on ugly chroot hacks.

Adapted from Nix commit 0a2bee307b20411f5b0dda0c662b1f9bb9e0e131.

* nix/libstore/build.cc (DerivationGoal::runChild): Add special case for
'isBuiltin(drv)'.  Disable chroot when 'isBuiltin(drv)'.
* nix/libstore/builtins.cc, nix/libstore/builtins.hh,
nix/scripts/download.in, guix/scripts/perform-download.scm: New files.
* guix/ui.scm (show-guix-help)[internal?]: Add 'perform-download'.
* nix/local.mk (libstore_a_SOURCES): Add builtins.cc.
(libstore_headers): Add builtins.hh.
(nodist_pkglibexec_SCRIPTS): Add 'scripts/download'.
* config-daemon.ac: Emit 'scripts/download'.
* Makefile.am (MODULES): Add 'guix/scripts/perform-download.scm'.
* tests/derivations.scm ("unknown built-in builder")
("'download' built-in builder")
("'download' built-in builder, invalid hash")
("'download' built-in builder, not found")
("'download' built-in builder, not fixed-output"): New tests.

Co-authored-by: Eelco Dolstra <eelco.dolstra@logicblox.com>
2016-11-16 18:19:47 +01:00
Ludovic Courtès 17ab08bcf0
tests: Move HTTP server to (guix tests http).
* tests/lint.scm (%http-server-port, %local-url)
(%http-server-socket, http-write, %http-server-lock)
(%http-server-ready, http-open, stub-http-server)
(call-with-http-server, with-http-server): Move to (guix tests http).
Adjust tests for %HTTP-SERVER-SOCKET as a promise and %LOCAL-URL as a
parameter.
* guix/tests/http.scm: New file.
* Makefile.am (dist_noinst_DATA): Add it.
(GOBJECTS): Add .go files for all of $(dist_noinst_DATA).
(make-go): Depend on $(dist_noinst_DATA).
2016-11-16 18:00:41 +01:00
Ludovic Courtès 1bcc87bb68
guix download: Add '-o' option.
* guix/scripts/download.scm (download-to-file, download-to-store*): New
procedures.
(%default-options): Add 'download-proc'.
(show-help): Adjust description and document '-o'.
(%options): Add '-o'.
(guix-download): Remove 'store' variable.  Add 'fetch' and define 'path'
to as its result.
* tests/guix-download.sh: Add test.
2016-11-16 18:00:41 +01:00
Hartmut Goebel caa9b834e7
guxi: cmake-build-system: Enable output for failing test-cases.
* guix/build/cmake-build-system.scm (cmake-build-system): Set
  environment variable CTEST_OUTPUT_ON_FAILURE to an non-empty value.
2016-11-15 22:40:25 +01:00
Hartmut Goebel e442246a2f
lint: more packages to probably be a native input.
* guix/scripts/lint.scm (check-inputs-should-be-native package): Add python
  packages which are typically used for testing or for building the
  documentation.
2016-11-15 17:37:50 +01:00
Hartmut Goebel 891a843d51
guix: Add lint-checker for packages which should be no inputs at all.
Also refactor some common code into a new function.

Examples for these pacakges are python(2)-setuptools and python(2)-pip, which
are installed together with python itself.

* guix/scripts/lint.scm (warn-if-package-has-input): New procedure.
  (check-inputs-should-be-native package): Use it; rename and clean-up
  variables. (check-inputs-should-not-be-an-input-at-all): New procedure.
  (%checkers) Add it.
* doc/guix.texi (Python Modules): Document it.
* tests/lint.scm: ("inputs: python-setuptools should not be an input at all
  (input)", "inputs: python-setuptools should not be an input at all
  (native-input)" "inputs: python-setuptools should not be an input at all
  (propagated-input)"): Add tests.
2016-11-15 17:37:49 +01:00
Hartmut Goebel c1019287a4
guix: python-build-system: Add background about Python installation methods. 2016-11-15 17:37:47 +01:00
Hartmut Goebel b002f964bb
guix: python-build-system: Delete .egg-info file created in phase check.
* guix/build/python-build-system.scm (check): Delete .egg-info dirs
  which did not exist prior to calling setup.py but afterwards.
2016-11-15 17:37:46 +01:00
Hartmut Goebel a2ff4f0240
guix: python-build-system: Add helpers for getting and setting PYTHONPATH.
* guix/build/python-build-system.scm (add-installed-pythonpath,
  site-packages): New exported procedures.
2016-11-15 17:37:45 +01:00
Hartmut Goebel 5f7565d190
guix: python-build-system: Add option "#:use-setuptools?" (default true).
* guix/build-system/python.scm (python-build): New keyword argument
  "#:use-setuptools?", defaulting to #t.
* guix/build/python-build-system.scm (call-setup-py): New positional
  parameter "use-setuptools?". If false, do not use the shim-wrapper
  for addin setuptools. (build, check): accept keyword-
  parameter, and pass to call-setuppy. (install): same; if
  "use-setuptools?" is false, do not use options "--root" and
  "--single-version-externally-managed" for setup.py.
* doc/guix.texi (Build Systems): Document it.
2016-11-15 17:37:44 +01:00
Marius Bakke 46bcdcc287
guix: python-build-system: Import setuptools before calling `setup.py'.
This is needed for packages using "distutils" instead of "setuptools" since
the former does not understand the "--single-version-externally-managed"
flag. Also export __file__ since it will be unset when setup.py is called from
python "exec".

* guix/build/python-build-system.scm (call-setuppy): extend "python setup.py"
  call to import setuptools, export __file__, and call setup.py from
  setuptools python environment.

Co-Authored-By: Hartmut Goebel <h.goebel@crazy-compilers.com>
2016-11-15 17:37:43 +01:00
Hartmut Goebel 7db40bce58
guix: build all Python packages with --single-version-externally-managed.
This requires setuptools to be installed together with python, which is
the case for Python 3 anyway and which we do for our build of Python 2
(see last commit).

* guix/build/python-build-system.scm (install): Add
  "--single-version-externally-managed" and "--root=/" to params to be
  passed to call-setuppy. Remove thus needless manipulation of
  PYTHONPATH. Remove now unused argument "inputs".
2016-11-15 17:37:41 +01:00
Hartmut Goebel 043a51c0c2
guix: python-build-system: Fix an outdated comment. 2016-11-15 17:37:39 +01:00
Alex Sassmannshausen c91b368e96
import/cpan: Maybe coerce version to string.
* guix/import/cpan.scm (cpan-module->sexp) <version>: Test if version in
  meta is string or number.  If it is number, coerce to string.
2016-11-14 00:06:09 +01:00
Ludovic Courtès 2cab1dd58b
Merge branch 'core-updates' 2016-11-13 00:34:16 +01:00
Ludovic Courtès 166ba5b102
substitute: Disable HTTPS certificate verification.
Fixes a regression introduced in
9e4e431e04 as a consequence of
bc3c41ce36.
Reported by Marius Bakke <mbakke@fastmail.com>.

* guix/scripts/substitute.scm (fetch): Pass #:verify-certificate? #f to
'open-connection-for-uri' and 'http-fetch'.
(download-cache-info): Likewise.
(http-multiple-get): Add #:verify-certificate? and honor it.
(fetch-narinfos): Pass #:verify-certificate? #f.
2016-11-12 13:04:45 +01:00
Ludovic Courtès 17cff9c662
http-client: Add #:verify-certificate? to 'http-fetch'.
* guix/http-client.scm (http-fetch): Add #:verify-certificate? parameter
and pass it to 'open-connection-for-uri'.
2016-11-12 13:04:45 +01:00
Ludovic Courtès 5970e8e248
container: Pass a list of <file-system> objects as things to mount.
* gnu/build/linux-container.scm (mount-file-systems): 'mounts' is now a
list of <file-system> objects instead of a list of lists ("specs").
Add call to 'file-system->spec' as the argument to 'mount-file-system'.
(run-container, call-with-container): Adjust docstring accordingly.
* gnu/system/file-systems.scm (spec->file-system): New procedure.
* gnu/system/linux-container.scm (container-script)[script]: Call
'spec->file-system' inside gexp.
* guix/scripts/environment.scm (launch-environment/container): Remove
call to 'file-system->spec'.
* tests/containers.scm ("call-with-container, mnt namespace")
("call-with-container, mnt namespace, wrong bind mount"): Pass a list of
<file-system> objects.
2016-11-10 18:01:44 +01:00
Ludovic Courtès c169d91e5a
lint: 'cve' checker catches 'tls-certificate-error'.
Reported by Frederick Muriithi <fredmanglis@gmail.com>.

* guix/scripts/lint.scm (tls-certificate-error-string): New procedure.
(validate-uri): Use it.
(current-vulnerabilities*): Catch 'tls-certificate-error' and print a
warning.
2016-11-09 21:24:44 +01:00
Marius Bakke 81bf2ccbc4
system: Use grub from bootloader configuration.
* gnu/system/grub.scm (gnu): Export grub-configuration-grub.
* guix/scripts/system.scm (perform-action): Use it.
(define-module): Don't import (gnu packages grub).

Co-authored-by: Danny Milosavljevic <dannym@scratchpost.org>
2016-11-08 14:35:05 +00:00
Ludovic Courtès 64b8695cd8
guix download: Add '--no-check-certificate' option.
* guix/download.scm (download-to-store): Add #:verify-certificate?
parameter and honor it.
* guix/scripts/download.scm (%default-options): Add
'verify-certificate?' key.
(show-help, %options): Add '--no-check-certificate'.
(guix-download): Pass #:verify-certificate to 'download-to-store'.
* doc/guix.texi (Invoking guix download): Document it.
2016-11-07 23:39:01 +01:00
Ludovic Courtès bc3c41ce36
download: Verify TLS certificates unless asked not to.
Fixes <http://bugs.gnu.org/24466>.
Reported by Leo Famulari <leo@famulari.name>.

* guix/build/download.scm (%x509-certificate-directory): New variable.
(make-credendials-with-ca-trust-files, peer-certificate)
(assert-valid-server-certificate, print-tls-certificate-error): New
procedures.  Add 'print-tls-certificate-error' as an exception printer
for 'tls-certificate-error'.
(tls-wrap): Add #:verify-certificate? parameter and honor it.
(open-connection-for-uri): Likewise.
(http-fetch): Likewise.
(url-fetch): Likewise.
* guix/download.scm (url-fetch)[builder]: Pass #:verify-certificate? #f.
* guix/scripts/lint.scm (probe-uri): Add case for 'tls-certificate-error'.
(validate-uri): Likewise.
* doc/guix.texi (Invoking guix download): Mention 'SSL_CERT_DIR'.
2016-11-07 23:39:01 +01:00
Mark H Weaver 71e21fb26d
Merge branch 'master' into core-updates 2016-11-07 00:33:16 -05:00
Chris Marusich 8074b33077
system: Add 'guix system' actions: switch-generation and roll-back.
* guix/scripts/system.scm (roll-back-system, switch-to-system-generation): new
actions.
(reinstall-grub): New procedure, used by switch-to-system-generation.
(show-help, process-command, guix-system): Honor the new actions.
* doc/guix.texi (Invoking guix system) <switch-generation, roll-back>: Add the
new actions.
<reconfigure>: In the footnote, mention that the new actions also only work on
GuixSD.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2016-11-06 18:08:53 +01:00
Chris Marusich aff7280a0b
system: Optionally limit the entries returned by profile-grub-entries.
* guix/scripts/system.scm (profile-grub-entries): Add an optional parameter
which allows the caller to limit the number of returned grub entries.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2016-11-06 18:08:53 +01:00
Chris Marusich 45e39eee21
system: Rename previous-grub-entries to profile-grub-entries.
* guix/scripts/system.scm (previous-grub-entries, profile-grub-entries):
Rename previous-grub-entries to profile-grub-entries to indicate that it is
stateful and returns the entries for all profile generations, not just the
previous ones.  Update all callers.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2016-11-06 18:08:53 +01:00
Chris Marusich 9008debc54
profiles: Extract a procedure for getting relative generation numbers.
* guix/profiles.scm (relative-generation-spec->number): New procedure.
* guix/scripts/package.scm (switch-generation-action): Use it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2016-11-06 18:08:53 +01:00
Mark H Weaver 8b6ad165d1
Merge branch 'master' into core-updates 2016-11-06 03:29:06 -05:00
Ricardo Wurmus e3100110ce
import: cran: Fix off-by-one error.
* guix/import/cran.scm (package->upstream-name): Do not include leading
slash in upstream name URL.
2016-11-03 16:03:28 +01:00
Leo Famulari b3cc0dce08
Merge branch 'master' into core-updates 2016-11-02 20:03:35 -04:00
Efraim Flashner 4c13aad0bc
guix: Update hackage mirror.
* guix/download.scm (%mirrors)[hackage]: Don't use https.
2016-11-01 10:28:24 +02:00
Marius Bakke b58691fa73
licenses: Export fdl1.2+.
This is a follow-up to 59b2034787.

* guix/licenses.scm (define-module): Export fdl1.2+.
2016-11-01 00:05:22 +00:00
Federico Beffa 442c2c99a5
download: Add Hackage mirrors.
* guix/download.scm [%mirrors]: Add Hackage mirrors.
2016-10-31 16:13:29 +01:00
Leo Famulari 205f0107bb
Merge branch 'master' into core-updates 2016-10-30 19:19:21 -04:00
Chris Marusich 1ef8b72a7f
system: Record store file system info in each generation.
* gnu/system.scm (<boot-parameters>)[store-device, store-mount-point]:
New fields.
(read-boot-parameters): Initialize them.
(operating-system-grub.cfg): Likewise.  Remove STORE-FS argument from
call to 'grub-configuration-file'.
(operating-system-parameters-file): Add 'store' element in
'boot-parameters'.
* gnu/system/grub.scm (strip-mount-point): Replace 'store-fs' parameter
by 'mount-point'; adjust accordingly.  Adjust callers.
(<menu-entry>)[device, device-mount-point]: New fields.
(eye-candy): Replace 'root-fs' parameter by 'store-device'; add
'store-mount-point'.  Use keyword arguments for 'system' and 'port'.
(grub-root-search): Remove 'root-fs' by 'device' and adjust
accordingly.
(grub-configuration-file): Remove 'store-fs' parameter.  Adjust
accordingly.
* guix/scripts/system.scm (previous-grub-entries): Initialize 'device'
and 'device-mount-point' fields from PARAMS.
* doc/guix.texi (GRUB Configuration): Document 'device' and
'device-mount-point'.  Explain that 'linux' can be prefixed by a GRUB
device name.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2016-10-30 22:59:46 +01:00
Ricardo Wurmus 054f60cd31
profiles: manifest-lookup-package: Cosmetic changes.
* guix/profiles.scm (manifest-lookup-package): Rename variables; use
"string=?" instead of "equal?".
2016-10-30 07:21:15 +01:00
Leo Famulari 062c7e43ed
Merge branch 'master' into core-updates 2016-10-29 21:44:44 -04:00
Ludovic Courtès 343dc11702
guix hash: Interpret '-' as standard input.
* guix/scripts/hash.scm (guix-hash)[file-hash]: Special-case "-".
* tests/guix-hash.sh: Add test.
* doc/guix.texi (Invoking guix hash): Document it.
2016-10-28 22:30:17 +02:00
Leo Famulari 02c73adcdf
Merge branch 'master' into core-updates 2016-10-26 19:00:06 -04:00
Roel Janssen e95ae7c223
guix package: Display generation diffs.
* guix/ui.scm (display-profile-content-diff): New variable.
* guix/scripts/package.scm (process-query): Use display-profile-content-diff.

In collaboration with Benz Schenk.
2016-10-26 14:53:29 +02:00
Ricardo Wurmus a98470b5be
import cran: Use URL for Bioconductor 3.4.
* guix/import/cran.scm (%bioconductor-svn-url): Update to release URL
for version 3.4.
2016-10-26 09:28:06 +02:00
Mark H Weaver ca0635b4ba
Merge branch 'master' into core-updates 2016-10-23 14:16:39 -04:00
Hartmut Goebel b5c347ad3d
import: pypi: All inputs are propagated-inputs by default.
* guix/import/pypi.scm (maybe-inputs): Return inputs as
  "propagated-inputs".
2016-10-23 19:23:14 +02:00
Ludovic Courtès 29d2f451a6
gnu-maintenance: GNOME updater honors 'upstream-name' package property.
* guix/gnu-maintenance.scm (latest-gnome-release)[upstream-name]: New
variable.  Use it as the first argument to 'latest-ftp-release' and when
constructing #:directory.
* gnu/packages/gnome.scm (gconf)[properties]: New field.
(network-manager)[properties]: New field.
2016-10-20 22:18:59 +02:00
Mark H Weaver d2478b4cdd
Merge branch 'master' into core-updates 2016-10-19 10:54:36 -04:00
Ludovic Courtès 2535635f18
Use (ice-9 binary-ports) instead of (rnrs io ports).
This reduces the closure of (guix ui) from 123 to 106 modules.

* guix/derivations.scm: Use (ice-9 binary-ports) instead of (rnrs io
ports).
(map-derivation)[substitute-file]: Use 'read-string' instead of
'get-string-all'.
* guix/ftp-client.scm: Likewise.
* guix/hash.scm: Likewise.
* guix/http-client.scm: Likewise.
* guix/pki.scm (ensure-acl, current-acl): Likewise.
* guix/scripts/archive.scm (authorize-key)[read-key]: Likewise.
* guix/scripts/authenticate.scm (read-canonical-sexp)
(read-hash-data): Likewise.
* guix/scripts/download.scm: Likewise.
* guix/scripts/offload.scm (register-gc-root, remove-gc-roots)
(send-files): Likewise.
* guix/scripts/publish.scm (lazy-read-file-sexp): Likewise.
* guix/scripts/refresh.scm: Likewise.
* guix/scripts/substitute.scm (check-acl-initialized): Likewise.
* guix/serialization.scm (read-maybe-utf8-string): Likewise.
* guix/scripts/hash.scm (guix-hash): Use 'force-output' instead of
'flush-output-port'.
* guix/store.scm (process-stderr): Likewise.
* guix/tests.scm: Likewise.
* guix/utils.scm: Use (ice-9 binary-ports) and autoload (rnrs io ports)
for 'make-custom-binary-input-port'.
2016-10-19 15:54:10 +02:00
Ludovic Courtès 4bb54cc42f
lint: Suggest @code instead of quotes.
* guix/scripts/lint.scm (%quoted-identifier-rx): New variable.
(check-description-style)[check-quotes]: New procedure.
Use it.
* tests/lint.scm ("description: suggest ornament instead of quotes"):
New test.
2016-10-19 15:54:10 +02:00
Ludovic Courtès fb3af759ee
grafts: Remove unnecessary 'umask' call.
This is a followup to d722678633.

* guix/build/graft.scm (rewrite-directory): Remove 'umask' call.
2016-10-17 23:59:03 +02:00
Ludovic Courtès 3d47aa81ba
grafts: Apply the right grafts in the presence of multiple outputs.
Fixes <http://bugs.gnu.org/24712>.

* guix/grafts.scm (cumulative-grafts): Add grafts for all the outputs of
DRV.
* tests/grafts.scm ("graft-derivation, replaced derivation has multiple
outputs"): New test.
2016-10-17 23:59:03 +02:00
Ludovic Courtès 645b9df858
guix build: Add '--with-graft'.
* guix/scripts/build.scm (transform-package-inputs/graft): New procedure.
(%transformations): Add 'with-graft'.
(%transformation-options): Likewise.
(show-transformation-options-help): Document it.
* tests/scripts-build.scm ("options->transformation, with-graft"): New
test.
* doc/guix.texi (Package Transformation Options): Document it.
2016-10-17 23:59:02 +02:00
Ludovic Courtès 31c2fd1e01
guix build: Factorize transformation option parsing.
* guix/scripts/build.scm (%transformation-options): Introduce 'parser'
procedure and use it.
2016-10-17 23:59:02 +02:00
Ludovic Courtès 5cf01aa53f
guix build: Extract '--with-input' replacement spec parsing.
* guix/scripts/build.scm (evaluate-replacement-specs): New procedure.
(transform-package-inputs)[not-equal]: Remove.
[replacements]: Define in terms of 'evaluate-replacement-specs'.
2016-10-17 23:59:02 +02:00
Mark H Weaver dcaf70897a
Merge branch 'master' into core-updates 2016-10-17 16:47:12 -04:00
Alex Kost b37e1e6428
import: utils: Remove dependency on (json) module.
This fixes a regression introduced by commit
fbe9c10128.

* guix/import/utils.scm: Remove unused (json) module.
2016-10-16 19:19:31 +03:00
Ludovic Courtès 7f8fec0fa4
graph: Add '%referrer-node-type'.
* guix/scripts/graph.scm (ensure-store-items): New procedure.
(%reference-node-type)[convert]: Use it.
(non-derivation-referrers): New procedure.
(%referrer-node-type): New variable.
(%node-types): Add it.
* tests/graph.scm ("referrer DAG"): New test.
* doc/guix.texi (Invoking guix graph): Document it.
2016-10-15 23:46:39 +02:00
Ludovic Courtès 783ae212c2
grafts: Remove unused variables and confusing monad use.
* guix/grafts.scm (cumulative-grafts)[return/cache]: Use %STATE-MONAD,
not %STORE-MONAD.
Remove unused 'origins' variable and unnecessary inner 'cache'
variable.
2016-10-15 23:46:39 +02:00
Ludovic Courtès b013c33f6f
grafts: 'graft-derivation' does now introduce grafts that shadow other grafts.
Partly fixes <http://bugs.gnu.org/24418>.

* guix/grafts.scm (cumulative-grafts)[graft-origin?]: New procedure.
[dependency-grafts]: Use it in new 'if' around recursive call.
* tests/grafts.scm ("graft-derivation, grafts are not shadowed"): New test.
2016-10-14 23:31:50 +02:00
Ludovic Courtès d0025d0144
packages: 'package-grafts' applies grafts on replacement.
Partly fixes <http://bugs.gnu.org/24418>.

* guix/packages.scm (input-graft): Compute 'new' with #:graft? #t.
(input-cross-graft): Likewise.
* tests/packages.scm ("package-grafts, indirect grafts, cross"): Comment
out.
("replacement also grafted"): New test.
2016-10-14 23:05:41 +02:00
Mark H Weaver 4193567325
Revert "guix: python-build-system: Fix an outdated comment."
This reverts commit 635a7af45d.
2016-10-13 15:27:16 -04:00
Hartmut Goebel 635a7af45d
guix: python-build-system: Fix an outdated comment.
The python-build-system uses phases the build and install, but not
configure. So the old comment was plain wrong since Sept. 2013, when the build
phase has been added.
2016-10-13 17:22:42 +02:00
Mark H Weaver abcf4858cd
Merge branch 'master' into core-updates 2016-10-12 09:28:14 -04:00
Ludovic Courtès d722678633
grafts: Always make directories #o755.
Fixes <http://bugs.gnu.org/22954>.
Reported by Albin <albin@fripost.org>
and Jeffrey Serio <serio.jeffrey@gmail.com>.

* guix/build/graft.scm (mkdir-p*): New procedure.
(rewrite-directory): Use it instead of 'mkdir-p'.
2016-10-10 21:40:23 +02:00
Ludovic Courtès 813bcbc4ea
bournish: Add 'reboot' command.
Suggested by Ricardo Wurmus.

* guix/build/bournish.scm (reboot-command): New procedure.
(%commands): Add it.
2016-10-10 21:40:23 +02:00
Ludovic Courtès 7c515a43b0
substitute: Make download messages more concise.
'guix substitute' now displays 2 lines per download instead of 4.
Suggested by Ricardo Wurmus.

* guix/scripts/substitute.scm (assert-valid-narinfo): Have #:verbose?
default to #f.  Remove leading newline in message.
(process-substitution): Display the URI rather than the store file name.
Display two newlines after the substitution.
2016-10-10 21:40:23 +02:00
Efraim Flashner 523b77faef
import: github: Add .love extension.
* guix/import/github.scm (find-extension): Add '.love' extension to the
list of extensions checked.
2016-10-10 11:52:03 +03:00
ng0 7e67fdd1f3
license: Add freebsd-doc.
* guix/licenses.scm (freebsd-doc): New variable.

Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
2016-10-09 13:09:47 +03:00
Andy Patterson a1b30f99a8
build-system: Add asdf-build-system.
* guix/build-system/asdf.scm: New file.
* guix/build/asdf-build-system.scm: New file.
* guix/build/lisp-utils.scm: New file.
* Makefile.am (MODULES): Add them.
* doc/guix.texi (Build Systems): Document 'asdf-build-system'.

Signed-off-by: 宋文武 <iyzsong@gmail.com>
2016-10-08 21:20:35 +08:00
Eric Bavier b8b129ebd8
utils: Support defaults in substitute-keyword-arguments.
* guix/utils.scm (collect-default-args, expand-default-args): New
syntax.
(substitute-keyword-arguments): Allow default value declarations.
* tests/utils.scm (substitute-keyword-arguments): New test.
2016-10-07 07:42:05 -05:00
Eric Bavier 347df60158
utils: Fix default-keyword-arguments.
* guix/utils.scm (default-keyword-arguments): Properly test for present
keywords.
* tests/utils.scm (default-keyword-arguments): New test.
2016-10-07 07:41:57 -05:00
Ludovic Courtès af0ba93825
guix system: Return two values when failing to talk to shepherd.
Before that, when 'guix system reconfigure' failed to talk to shepherd
and a 'system-error' was raised, we would get a "too few values returned
to continuation" error, which would prevent GRUB from being installed.

Reported by fps on #guix.

* guix/scripts/system.scm (warn-on-system-error): Remove.
(with-shepherd-error-handling): Inline former 'warn-on-system-error'.
Return two values when 'system-error' is raised.
2016-10-06 22:59:47 +02:00
Leo Famulari b19c7989b7
Merge branch 'master' into core-updates 2016-10-05 19:15:25 -04:00
Ludovic Courtès 9bee2bd1b0
lint: 'cve' checker reports the replacement's vulnerabilities.
Before, 'guix lint -c cve' would report the vulnerabilities of the
original package while pretending they are the vulnerabilities of the
replacement.

* guix/scripts/lint.scm (check-vulnerabilities): Consider the package
replacement before calling 'package-vulnerabilities'.
* tests/lint.scm ("cve: vulnerability fixed in replacement version"):
New test.
2016-10-03 23:30:49 +02:00
Ludovic Courtès 57bdd79e48
grafts: Allow the replacement to have a different name.
* guix/build/graft.scm (replace-store-references): REPLACEMENT is now
the full string, not just the hash.
(rewrite-directory)[hash-mapping](valid-suffix?): Remove.
(hash+suffix): Rename to...
(hash+rest): ... this.  Change to return the whole string as the second
element of the list.  Adjust 'match-lambda' expression accordingly;
check whether the string length of the origin and replacement match.
* tests/grafts.scm ("graft-derivation, grafted item uses a different
name"): New test.
* doc/guix.texi (Security Updates): Update sentence on the name/version
restriction.
2016-10-03 23:16:48 +02:00
Leo Famulari 9c2130757c
Merge branch 'master' into core-updates 2016-10-03 17:08:05 -04:00
John Darrington d31860b9de
build-system/gnu: Add 'patch-dot-desktop-files' phase.
* guix/build/gnu-build-system.scm (patch-dot-desktop-files): New
procedure.
(%standard-phases): Add it.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2016-10-01 11:55:06 +02:00
Ludovic Courtès 79355ae3e8
Merge branch 'master' into core-updates 2016-09-30 12:05:27 +02:00
Taylan Ulrich Bayırlı/Kammer 5a88b2d130
build: Improve Guile 2.2 compatibility.
* build-aux/compile-all.scm (compile-file*): Ensure loading of
  compilation related modules before going parallel.
* guix/build/pull.scm (build-guix): Ditto.
2016-09-29 23:59:06 +02:00
David Craven 11e296ef30
import: utils: Refactor license->symbol.
* guix/import/utils.scm (license->symbol): Work for all licenses.
* tests/import-utils.scm (license->symbol): Add test.
2016-09-28 13:17:15 +02:00
David Craven 59b2034787
import: utils: Add spdx-string->license.
* guix/import/utils.scm (spdx-string->license): New variable.
* guix/licenses.scm (agpl1, fdl1.2+): New variables.
2016-09-28 13:15:31 +02:00
David Craven 263ac57fc2
import: Move string->license to importers.
* guix/import/gem.scm (string->license): Move from (guix import utils).
* guix/import/pypi.scm (string->license): Move from (guix import utils).
2016-09-28 12:47:29 +02:00
David Craven fbe9c10128
import: Reorder imports in (guix import utils).
* guix/import/utils.scm (define-module): Reorder imports alphabetically.
2016-09-28 12:47:10 +02:00
Ludovic Courtès 8a54c0ec69
guix build: Gracefully handle packages without source for '-S'.
Fixes <http://bugs.gnu.org/22836>.
Reported by Ricardo Wurmus <rekado@elephly.net>.

* guix/scripts/build.scm (options->derivations): Gracefully
handle (package-source p) = #f.
2016-09-27 11:44:56 +02:00
Ludovic Courtès 3c185b24f5
Add missing exports.
Reported by Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
at <https://lists.gnu.org/archive/html/guix-devel/2016-09/msg01686.html>.

* gnu/system/file-systems.scm (%tty-gid): Export.
* guix/build-system/python.scm (default-python, default-python2):
Export.
2016-09-27 11:22:56 +02:00
Ricardo Wurmus 7ddc178093
profiles: Build GTK+ input module cache.
* guix/profiles.scm (gtk-im-modules): New procedure.
(%default-profile-hooks): Add it.
2016-09-26 07:58:17 +02:00
Ricardo Wurmus 2c9f4786c9
profiles: manifest-lookup-package: Optionally match version prefix.
* guix/profiles.scm (manifest-lookup-package): Optionally filter store
item matches by version prefix.
2016-09-26 07:58:17 +02:00
Carlos Sánchez de La Lama 0f65f54ebd
system: grub.cfg uses correct file names when store is not in root partition.
Fixes <http://bugs.gnu.org/24346>.
Reported by csanchezdll@gmail.com (Carlos Sánchez de La Lama).

* guix/scripts/system.scm (previous-grub-entries): Get the initrd file
name from PARAMS.
* gnu/system.scm (operating-system-grub.cfg): Use
'operating-system-initrd-file' to retrieve the initrd file name.
* gnu/system/grub.scm (strip-mount-point): New procedure.
(grub-configuration-file)[entry->gexp]: Call 'strip-mount-point' for
LINUX and INITRD.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2016-09-24 17:48:13 +09:00
Ludovic Courtès e465d9e190
ui: Do not shadow '_' where it's used as a literal syntax match.
Fixes compilation with Guile 2.1.
Reported by Mu Lei.

* guix/ui.scm (report-load-error)
(warn-about-load-error, read/eval-package-expression): Use 'rest'
instead of '_' as the pattern variable name.
* gnu/packages.scm (%find-package): Likewise.
* guix/scripts/build.scm (transform-package-inputs): Likewise.
* guix/scripts/hash.scm (guix-hash): Likewise.
* guix/scripts/import/gnu.scm (%options, guix-import-gnu): Likewise.
* guix/scripts/import/nix.scm (guix-import-nix): Likewise.
* guix/scripts/offload.scm (build-machines): Likewise.
* guix/scripts/refresh.scm (%options): Likewise.
* guix/scripts/substitute.scm (narinfo-signature->canonical-sexp):
Likewise.
2016-09-20 23:22:42 +09:00
Ludovic Courtès 5c9632c75a
build-system/gnu: Do not patch symlinks in the source.
This is a followup to 13a9feb5b64fd819eaed38a17da0284bbe2b8d9.

* guix/build/gnu-build-system.scm (patch-source-shebangs): Remove call
to 'remove'.  Pass a second argument to 'find-files' to filter out
symlinks; pass #:stat lstat.
(patch-generated-file-shebangs): Likewise, and also filter out
non-executable files.
2016-09-12 21:51:25 +02:00
Ludovic Courtès 1cdecf24f5
gexp: Store compilers in a hash table for O(1) lookup.
* guix/gexp.scm (<gexp-compiler>)[predicate]: Remove.
[type]: New field.
(%gexp-compilers): Turn into a hash table.
(register-compiler!, lookup-compiler, lookup-expander): Adjust
accordingly.
(define-gexp-compiler): Replace 'predicate' by 'record-type'.
(derivation-compiler, local-file-compiler, plain-file-compiler)
(computed-file-compiler, program-file-compiler, scheme-file-compiler)
(file-append-compiler): Adjust accordingly.
* guix/packages.scm (package-compiler, origin-compiler): Likewise.
2016-09-10 13:10:06 +02:00
Ludovic Courtès a9e5e92f94
gexp: Add 'file-append'.
* guix/gexp.scm (<file-append>): New record type.
(file-append): New procedure.
(file-append-compiler): New gexp compiler.
* tests/gexp.scm ("file-append", "file-append, output")
("file-append, nested", "gexp->file + file-append"): New tests.
* doc/guix.texi (G-Expressions): Use it in 'nscd' and 'list-files'
examples.  Document 'file-append'.
2016-09-09 23:54:43 +02:00
Ludovic Courtès ebdfd776f4
gexp: Compilers can now provide an "expander".
* guix/gexp.scm (<gexp-compiler>)[expand]: New field.
(default-expander, lookup-expander): New procedures.
(define-gexp-compiler): Add second pattern to allow for the definition
of both a compiler and an expander.
(gexp->sexp)[reference->sexp]: Call 'lookup-expander' and use its
result.
2016-09-09 23:54:43 +02:00
Ludovic Courtès b5fed903c4
gexp: Remove outdated comment.
* guix/gexp.scm (lower-references): Remove outdated "XXX" comment.
2016-09-09 23:54:43 +02:00
Ludovic Courtès b14a838509
utils: 'wrap-program' produces only one wrapper file.
* guix/build/utils.scm (wrap-program)[wrapper-file-name]
[next-wrapper-number, wrapper-target]: Remove.
[wrapped-file, already-wrapped?]: New variables.
[last-line]: New procedure.
Use it to append to PROG when a wrapper already exists.
* tests/build-utils.scm ("wrap-program, one input, multiple calls"):
Adjust the list of files to delete.
2016-09-07 23:59:02 +02:00
Jan Nieuwenhuizen 392a4e1223
guix hash: Add --exclude-vcs option.
* guix/scripts/hash.scm (show-help): Add help text for --exclude-vcs option.
(%options): Add --exclude-vcs option.
(guix-hash): Handle exclude-vcs option.
* doc/guix.texi ("Invoking guix hash"): Update doc.
* tests/guix-hash.sh: Add test.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2016-09-07 12:00:35 +02:00
Ludovic Courtès 01afdab89c
packages: Add 'package-superseded' and associated support.
This provides a way to mark a package as superseded by another one.
Upgrades replace superseded packages with their replacement.

* guix/packages.scm (package-superseded, deprecated-package): New
procedures.
* gnu/packages.scm (%find-package): Check for 'package-superseded'.
* guix/scripts/package.scm (transaction-upgrade-entry)[supersede]: New
procedure.  Call it when 'package-superseded' is true.
* tests/guix-build.sh: Add test for a superseded package.
* tests/packages.scm ("package-superseded")
("transaction-upgrade-entry, superseded package"): New tests.
2016-09-06 23:22:10 +02:00
Ludovic Courtès 03763d6473
profiles: Export <manifest-pattern> accessors.
* guix/profiles.scm (manifest-pattern-name, manifest-pattern-version)
(manifest-pattern-output): Export.
2016-09-06 23:22:10 +02:00
Ludovic Courtès 5239f3d908
guix package: Build up the transaction incrementally.
* guix/scripts/package.scm (upgraded-manifest-entry): Rename to...
(transaction-upgrade-entry): ... this.  Add 'transaction' parameter and
return a transaction.
(options->installable): Likewise.
[to-upgrade]: Rename to...
[upgraded]: ... this, and change to be a transaction.  Return a
transaction.
(options->removable): Likewise.
(process-actions): Adjust accordingly.
* tests/packages.scm ("transaction-upgrade-entry, zero upgrades")
("transaction-upgrade-entry, one upgrade"): New tests.
2016-09-06 23:22:10 +02:00
Ludovic Courtès c8c25704ae
profiles: Add manifest-transaction helper procedures.
* guix/profiles.scm (manifest-transaction-install-entry)
(manifest-transaction-remove-pattern)
(manifest-transaction-null?): New procedures.
* tests/profiles.scm ("manifest-transaction-null?"): New test.
2016-09-06 23:22:10 +02:00
Ludovic Courtès dd72173455
guix package: Clarify upgrade code.
* guix/scripts/package.scm (upgradeable?): Rename to...
(upgraded-manifest-entry): ... this.  Change to take a <manifest-entry>
and to return a <manifest-entry>.
(options->installable)[to-upgrade]: Adjust accordingly.
2016-09-06 23:22:10 +02:00
Ludovic Courtès 0c90ed5505
gnupg: Honor $GUIX_GPG_COMMAND and default to 'gpg'.
* guix/gnupg.scm (%gpg-command): Change to "gpg" or $GUIX_GPG_COMMAND.
2016-09-06 11:12:11 +02:00
Ludovic Courtès 26ffb69399
syscalls: Use #:return-errno? when it is available.
* guix/build/syscalls.scm (errno): Do not export.
(syscall->procedure): Change to return a procedure that returns both the
value and errno.  Use #:return-errno? where available.
(mount, umount, swapon, swapoff, mkdtemp!, fdatasync, statfs)
(clone, setns, pivot-root, fcntl-flock, network-interface-names)
(network-interface-flags, set-network-interface-flags)
(set-network-interface-address, network-interface-address):
(network-interfaces, tcgetattr, tcsetattr, terminal-window-size): Adjust
accordingly using 'let-values'.
2016-09-06 11:12:11 +02:00
Ludovic Courtès 7ca87354db
Add (guix modules).
* guix/modules.scm, tests/modules.scm: New files.
* Makefile.am (MODULES, SCM_TESTS): Add them.
* doc/guix.texi (G-Expressions): Add an example of
'source-module-closure'.
2016-09-05 00:06:47 +02:00
Ludovic Courtès 2ff0da0257
file-systems: Always use (guix build syscalls).
* gnu/build/file-systems.scm: Use (guix build syscalls)
unconditionally.  Override the 'mount' and 'umount' bindings
when (guile) provides them.
(MS_RDONLY, MS_NOSUID, MS_NODEV, MS_NOEXEC, MS_REMOUNT)
(MS_BIND, MS_MOVE): Remove.
* guix/build/syscalls.scm (%libc-errno-pointer): Add
'false-if-exception' around 'dynamic-func'.
2016-09-05 00:06:47 +02:00
Ludovic Courtès 14d5ca2e2e
ui: Initialize %FILE-PORT-NAME-CANONICALIZATION to #f.
This avoids loads of needless 'stat' calls due to the default 'relative
setting and the 'canonicalize-path' calls it leads to.  This was
especially visible when 'guix substitute' access files in
/var/guix/substitute/cache.

* guix/ui.scm (run-guix-command): Set %FILE-PORT-NAME-CANONICALIZATION
to #f.
2016-09-05 00:06:47 +02:00