Commit Graph

1505 Commits

Author SHA1 Message Date
Ludovic Courtès
d838e70298 search-paths: Export 'string-tokenize*'.
* guix/search-paths.scm (string-tokenize*): Export.
* tests/utils.scm ("string-tokenize*"): Adjust accordingly.
2015-05-06 18:26:53 +02:00
Ludovic Courtès
7623848343 download: Work around Guile small-receive-buffer bug.
Previously, code using directly (guix build download) was still affected
by <http://bugs.gnu.org/15368>.  This includes source derivations, the
'guix download' command, and (guix gnu-maintenance).

'guix substitute' was unaffected since it used (guix http-client), which
already had the fix.

* guix/http-client.scm (open-socket-for-uri): Remove.
  (http-fetch): Remove #:buffered? argument to 'open-socket-for-uri';
  use 'setvbuf' instead.
* guix/scripts/substitute.scm (fetch): Likewise.
* guix/build/download.scm (open-socket-for-uri): New procedure, taken
  from guix/http-client.scm, but without the #:buffered? parameter.
2015-05-06 10:31:11 +02:00
Ludovic Courtès
c822fb8e34 download: Reinstate buffering on connection sockets.
* guix/build/download.scm (open-connection-for-uri): Reinstate call to
  'setvbuf' inadvertently removed in d17551d9.
2015-05-06 09:50:15 +02:00
Ludovic Courtès
8e3a3bc290 environment: Move iteration outside of 'for-each-search-path'.
* guix/search-paths.scm (search-path-definition): New procedure.
* guix/scripts/environment.scm (for-each-search-path): Rename to...
  (evaluate-input-search-paths): ... this.  Remove 'proc' and 'pure?'
  parameters, and return directly the list of search-path/value pairs.
  (create-environment): Use 'for-each' and 'evaluate-input-search-paths'
  instead of 'for-each-search-path'.
  (show-search-paths): Use 'for-each', 'search-path-definition', and
  'evaluate-search-paths' instead of 'for-each-search-path'.
2015-05-05 15:13:59 +02:00
Ludovic Courtès
b9ea6c6bf4 environment: Use 'evaluate-search-paths'.
This allows 'guix environment' to correctly handle non-directory
and/or pattern search-path specifications, such as that for
'XML_CATALOG_FILES'.

* guix/scripts/environment.scm (for-each-search-path): Use
  'evaluate-search-paths' instead of 'search-path-as-list' & co.
2015-05-05 15:13:59 +02:00
Ludovic Courtès
fdfa753c69 search-paths: Define the 'PATH' environment variable.
* guix/search-paths.scm ($PATH): New variable.
* guix/scripts/environment.scm (for-each-search-path): Use it.
2015-05-05 15:13:58 +02:00
Ludovic Courtès
369149995c search-paths: 'evaluate-search-paths' can be passed a list of directories.
* guix/search-paths.scm (evaluate-search-paths): Change 'directory' to
  'directories', and adjust 'search-path-as-list' accordingly.
* guix/scripts/package.scm (search-path-environment-variables): Adjust
  call accordingly.
2015-05-05 15:13:58 +02:00
Ludovic Courtès
c4e8d513f2 gnu-maintenance: 'gnu-package?' returns #t for R and for GNOME packages.
Reported by John Darrington.

* guix/gnu-maintenance.scm (gnu-package?)[mirror-type]: Add "gnome" to
  the list of GNU mirrors.  Return #f for "cran".
2015-05-05 15:13:57 +02:00
Ludovic Courtès
099a2c7055 environment: Use (guix search-paths).
* guix/scripts/environment.scm: Use (guix search-paths).  Fixes a
  regression introduced in e89431b.
2015-05-05 11:01:08 +02:00
Ludovic Courtès
954cea3ae6 records: Make 'make-syntactic-constructor' available at load/eval/expand.
* guix/records.scm (make-syntactic-constructor): Wrap in 'eval-when'.
2015-05-04 23:30:52 +02:00
Ludovic Courtès
88aab8e349 profiles: Use a &message error condition instead of 'error'.
* guix/profiles.scm (sexp->manifest): Use 'raise' instead of 'error'.
2015-05-04 23:30:52 +02:00
Ludovic Courtès
441cfb420a search-paths: 'evaluate-search-paths' now returns spec/value pairs.
* guix/search-paths.scm (evaluate-search-paths): Return
  specification/value pairs instead of variable/value pairs.
* guix/scripts/package.scm (search-path-environment-variables): Adjust
  accordingly.  Pass #:separator to 'environment-variable-definition'.
2015-05-04 23:30:52 +02:00
Ludovic Courtès
b07901c0cc search-paths: Add 'environment-variable-definition'.
* guix/search-paths.scm (environment-variable-definition): New variable.
* guix/scripts/package.scm (search-path-environment-variables): Use it.
2015-05-04 23:30:52 +02:00
Ludovic Courtès
6568d2bd6e search-paths: Add 'evaluate-search-paths', from (guix scripts package).
* guix/scripts/package.scm (with-null-error-port,
  evaluate-search-paths): Move to...
* guix/search-paths.scm: ... here.
* guix/utils.scm (string-tokenize*): Move to...
* guix/search-paths.scm: ... here.
* tests/utils.scm ("string-tokenize*"): Adjust accordingly.
2015-05-04 23:30:51 +02:00
Ludovic Courtès
e89431bf01 Move search path specifications to (guix search-paths).
* guix/packages.scm (<search-path-specification>,
  search-path-specification->sexp, sexp->search-path-specification):
  Move to...
* guix/search-paths.scm: ... here.  New file.
* Makefile.am (MODULES): Add it.
* guix/build-system/cmake.scm, guix/build-system/glib-or-gtk.scm,
  guix/build-system/gnu.scm, guix/build-system/haskell.scm,
  guix/build-system/perl.scm, guix/build-system/python.scm,
  guix/build-system/ruby.scm, guix/build-system/waf.scm,
  guix/profiles.scm, guix/scripts/package.scm: Use it.
2015-05-04 23:30:51 +02:00
Ludovic Courtès
5e6039a48b substitute: Increase TTL from 24h to 36h.
* guix/scripts/substitute.scm (%narinfo-ttl): Increase to 36h.
2015-05-04 23:30:51 +02:00
Eric Bavier
2087023dd4 guix: build: Fix indentation for --sources in help output.
* guix/scripts/build.scm (show-help)[--sources]: Make indentation
  consistent with other long options.
2015-05-04 14:16:39 -05:00
Ludovic Courtès
4e9f592058 guix package: Introduce 'evaluate-search-paths'.
* guix/scripts/package.scm (evaluate-search-paths): New procedure, with
  most of the code formerly in 'search-path-environment-variables'.
  (search-path-environment-variables): Use it.
2015-05-04 00:24:21 +02:00
Ludovic Courtès
3badccaa73 guix package: Move profile cleaning out of 'search-path-environment-variables'.
* guix/scripts/package.scm (user-friendly-profile): New procedure.
  (search-path-environment-variables): Remove 'profile' local variable.
  (display-search-paths): Explicitly call 'user-friendly-profile' for
  the argument to 'search-path-environment-variables'.
  (guix-package)[process-query]: Likewise.
2015-05-04 00:24:21 +02:00
Eric Bavier
2cdfe13dea guix: build: Add transitive source building.
* guix/scripts/build.scm (%options, options->derivations): Add --sources
  option.
* doc/guix.texi (Invoking guix build): Document --sources option.
* tests/guix-build.sh: Add tests.
2015-05-02 23:15:40 -05:00
Eric Bavier
f77bcbc374 guix: packages: Add package-direct-sources and package-transitive-sources.
* guix/tests.scm (dummy-origin): New syntax.
* guix/packages.scm (package-direct-sources)
  (package-transitive-sources): New procedures.
* tests/packages.scm ("package-direct-sources, no source")
  ("package-direct-sources, #f source")
  ("package-direct-sources, not input source", "package-direct-sources")
  ("package-transitive-sources"): Test them.
2015-05-02 23:15:40 -05:00
Ludovic Courtès
dedb17ad01 profiles: Store search paths in manifests.
Discussed in <http://bugs.gnu.org/20255>.

* guix/packages.scm (sexp->search-path-specification): New variable.
* guix/profiles.scm (<manifest-entry>)[search-paths]: New field.
  (package->manifest-entry): Initialize it.
  (manifest->gexp): Match it.  Wrap #$deps in (propagated-inputs ...).
  Emit (search-paths ...).  Increment version.
  (find-package): New procedure.
  (sexp->manifest)[infer-search-paths]: New procedure.
  Use it to initialize the 'search-paths' field for versions 0 and 1.
  Add case for version 2.
* guix/scripts/package.scm (search-path-environment-variables)[manifest-entry->package]:
  Remove.
  Use 'manifest-entry-search-paths' instead of 'manifest-entry->package'
  plus 'package-native-search-paths'.
* tests/profiles.scm ("profile-manifest, search-paths"): New test.
2015-05-02 23:57:11 +02:00
Ludovic Courtès
b9212a5455 Merge branch 'core-updates' 2015-05-02 22:42:53 +02:00
Ludovic Courtès
2d51666bd0 build-system/gnu: 'dist-package' preserves the package's native inputs.
* guix/build-system/gnu.scm (dist-package)[native-inputs]: Preserve P's
  native-inputs.
2015-05-02 22:16:06 +02:00
Ludovic Courtès
16142b3c14 build-system/gnu: Adjust to removal of a "bin" output for Libtool.
* guix/build-system/gnu.scm (dist-package): Change libtool:bin input to
  just libtool.
2015-05-02 22:16:06 +02:00
Ludovic Courtès
abcbda48c2 packages: Add '%hydra-supported-systems'.
* build-aux/hydra/gnu-system.scm (%hydra-supported-systems): Remove.
* guix/packages.scm (%hydra-supported-systems): New variable.
2015-05-01 16:05:40 +02:00
Ludovic Courtès
bf4af30bb2 Merge branch 'master' into core-updates 2015-05-01 15:03:30 +02:00
Ludovic Courtès
bc7d089a9c serialization: Adjust the permissive UTF-8 decoder to Guile 2.0.12ish.
* guix/serialization.scm (read-maybe-utf8-string): Use
  'set-port-encoding!' and 'set-port-conversion-strategy!' instead of
  setting '%default-port-encoding' and
  '%default-port-conversion-strategy'.  This accounts for Guile commit
  d574d96, which changes bytevector input ports to use ISO-8859-1.
2015-05-01 13:10:18 +02:00
Ludovic Courtès
310709ae58 substitute: Fix file descriptor leak in 'http-multiple-get'.
In practice we would not leak much since we reconnect after ~100
requests (with nginx running on hydra.gnu.org.)

* guix/scripts/substitute.scm (http-multiple-get): Call 'close-port'
  before 'connect'.
2015-05-01 12:50:27 +02:00
Ludovic Courtès
0d8831370f download: Honor the 'http_proxy' and 'https_proxy' env. vars.
Fixes <http://bugs.gnu.org/20402>.
Reported by Joshua Randall <jcrandall@alum.mit.edu>.

* guix/download.scm (url-fetch): Pass #:leaked-env-vars to
  'gexp->derivation'.
2015-05-01 00:06:18 +02:00
Ludovic Courtès
c04681554d derivations: Add #:leaked-env-vars parameter.
Suggested by Joshua Randall <jcrandall@alum.mit.edu>
in <http://bugs.gnu.org/20402>.

* guix/derivations.scm (derivation): Add #:leaked-env-vars parameter.
  [user+system-env-vars]: Honor it.
* guix/gexp.scm (gexp->derivation): Add #:leaked-env-vars and pass it to
  'raw-derivation'.
* doc/guix.texi (Derivations, G-Expressions): Adjust accordingly.
2015-05-01 00:06:17 +02:00
Ludovic Courtès
d17551d943 download: Simplify 'open-connection-for-uri' to support HTTP proxies.
Partly fixes <http://bugs.gnu.org/20402>.
Reported by Joshua Randall <jcrandall@alum.mit.edu>.

* guix/build/download.scm (open-connection-for-uri): Rewrite to be a
  small wrapper around 'open-socket-for-uri'.  This procedure was
  initially introduced in d14ecda to work around the lack of NSS modules
  during bootstrap but that has become unnecessary since 0621349, which
  introduced a bootstrap Guile that uses static NSS modules (from commit
  d3b5972.)
  On Guile >= 2.0.10, this allows the 'http_proxy' environment variable
  to be used.
2015-05-01 00:06:17 +02:00
Andreas Enge
4ac0d6444d Merge branch 'master' into core-updates. 2015-04-26 20:08:49 +02:00
Ludovic Courtès
d074e2f991 build-system/{cmake,glib-or-gtk}: Add #:validate-runpath? parameter.
* guix/build-system/cmake.scm (cmake-build): Add #:validate-runpath?
  parameter and pass it to BUILDER.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build): Likewise.
2015-04-23 18:52:40 +02:00
Ludovic Courtès
0bd4377566 build-system/gnu: #:validate-runpath? now defaults to #t.
* guix/build/gnu-build-system.scm (validate-runpath): Change default
  value of VALIDATE-RUNPATH? to #t.
2015-04-23 18:52:40 +02:00
Ludovic Courtès
cb85eb5e65 build-system/gnu: Gracefully handle dangling symlinks.
Fixes <http://bugs.gnu.org/20081>.
Reported by Tomáš Čech <tcech@suse.cz>.

* guix/build/gnu-build-system.scm (patch-source-shebangs): Remove files
  that don't pass 'file-exists?'.
  (patch-generated-file-shebangs): Likewise.
2015-04-23 18:52:40 +02:00
Ludovic Courtès
cd91504df2 gremlin: Add support for the expansion of $ORIGIN in RUNPATH.
* guix/build/gremlin.scm (expand-variable, expand-origin): New
  procedures.
  (validate-needed-in-runpath): Map 'expand-origin' to the RUNPATH field
  of DYNINFO.
* tests/gremlin.scm ("expand-origin"): New test.
2015-04-23 18:52:40 +02:00
Mark H Weaver
fc34deea24 packages: Add armhf-linux to %supported-systems.
* guix/packages.scm (%supported-systems): Add "armhf-linux".
2015-04-22 17:25:28 -04:00
Ludovic Courtès
44fd6ef137 ui: Add 'symlink' replacement with better error reporting.
* guix/ui.scm (symlink): New procedure.
2015-04-20 22:37:20 +02:00
Ludovic Courtès
f73286345e gexp: Add printers for <gexp-input> and <gexp-output>.
* guix/gexp.scm (write-gexp-input, write-gexp-output): New procedures.
  (<gexp-input>, <gexp-output>): Use them as printers.
2015-04-20 15:41:41 +02:00
Ludovic Courtès
c568191a93 profiles: Create a CA certificate bundle only when it would be non-empty.
* guix/profiles.scm (ca-certificate-bundle): Create
  $output/etc/ssl/certs if and only if CA-FILES is non-empty.
2015-04-20 15:41:41 +02:00
Eric Bavier
47945cf353 import: cpan: Fix license string for Artistic license.
* guix/import/cpan.scm (string->license): Remove extraneous "_0"
  suffix for Artistics licenses.
2015-04-19 19:48:52 -05:00
Ludovic Courtès
ee8591990f guix package: Fix 'readlink*' implementation.
* guix/scripts/package.scm (readlink*): Fix to handle symlinks with
  relative targets.  Taken from ld-wrapper2.in.
2015-04-19 23:34:53 +02:00
Ludovic Courtès
5763ad9266 guix package: -A and -s take supported systems into account.
* guix/scripts/package.scm (guix-package)[process-query]
  <list-available>: Restrict results to packages matching
  'supported-package?".
* guix/ui.scm (package->recutils): Print "systems:".
* tests/guix-package.sh: Add tests.
* doc/guix.texi (Invoking guix package): Adjust description of
  '--list-available' accordingly.
2015-04-19 23:34:53 +02:00
Ludovic Courtès
bbceb0ef8a packages: Add 'supported-package?'.
* guix/packages.scm (supported-package?): New procedure.
* tests/packages.scm ("supported-package?"): New test.
* build-aux/hydra/gnu-system.scm (package->job): Use it instead of
  'package-transitive-supported-systems'.
2015-04-19 23:34:53 +02:00
Mark H Weaver
334345d9db Merge branch 'core-updates' 2015-04-17 22:06:05 -04:00
Ludovic Courtès
8d7dc5d9db monads: Optimize 'sequence'.
* guix/monads.scm (sequence): Rewrite as a macro.  This yields a 10%
  improvement in wall-clock time for 'guix system build'.
2015-04-17 18:15:38 +02:00
Mark H Weaver
933204e5b1 Merge branch 'master' into core-updates
Conflicts:
	gnu-system.am
	gnu/packages/gstreamer.scm
2015-04-17 09:54:11 -04:00
Ludovic Courtès
4b9b3cbbc4 refresh: Allow users to refer to specific package versions.
* guix/scripts/refresh.scm (guix-refresh): Use 'specification->package'
  instead of 'find-packages-by-name'.  This allows users to specify
  things like "qt-4.8.6".
* doc/guix.texi (Invoking guix refresh): Add an example.
2015-04-16 23:15:06 +02:00
Ludovic Courtès
b7615c56a7 build-system/haskell: Adjust to new 'modify-phases' syntax.
* guix/build/haskell-build-system.scm (%standard-phases): Add missing
  quotes, as needed since commit f8503e2.
2015-04-16 09:51:38 +02:00
Ludovic Courtès
aa46a028c4 profiles: Generalize "hooks" for 'profile-derivation'.
* guix/profiles.scm (info-dir-file): Remove (null? (manifest-entries
  manifest)) test.
  (ca-certificate-bundle): Likewise.
  (ghc-package-cache-file): Turn 'if' into 'and', and remove second
  arm.
  (%default-profile-hooks): New variable.
  (profile-derivation): Remove #:info-dir?, #:ghc-package-cache?, and
  #:ca-certificate-bundle?.  Add #:hooks.  Iterate over HOOKS.  Adjust
  'inputs' accordingly.
* guix/scripts/package.scm (guix-package): Adjust 'profile-derivation'
  call accordingly.
* tests/packages.scm ("--search-paths with pattern"): Likewise.
* tests/profiles.scm ("profile-derivation",
  "profile-derivation, inputs"): Likewise.
2015-04-15 22:44:51 +02:00
Ludovic Courtès
cd6c6d60a8 build-system/haskell: Refer to %GNU-BUILD-SYSTEM-MODULES.
Fixes a regression whereby haskell-build-system was using an incomplete
module list.

* guix/build-system/haskell.scm (%haskell-build-system-modules): New
  variable.
  (haskell-build): Use it as the default value of #:imported-modules.
2015-04-15 10:27:19 +02:00
Ludovic Courtès
1590e8a1dd packages: Refer to the native tools when handling sources and downloads.
* guix/packages.scm (patch-and-repack)[build]: Change most #$ to #+.
* guix/cvs-download.scm (cvs-fetch)[build]: Likewise.
* guix/download.scm (url-fetch)[builder]: Likewise.
* guix/git-download.scm (git-fetch)[build]: Likewise.
* guix/svn-download.scm (svn-fetch)[build]: Likewise.
2015-04-15 10:19:47 +02:00
Mark H Weaver
d5f01e48e0 guix package: Add '--do-not-upgrade' option.
* guix/scripts/package.scm (%options): Add the '--do-not-upgrade' option.
  (show-help): Document it.
  (options->installable): Add 'do-not-upgrade-regexps' variable.
  Use it in 'packages-to-upgrade'.
* doc/guix.texi (Invoking guix package): Document the '--do-not-upgrade'
  option.
2015-04-14 10:44:19 -04:00
Ludovic Courtès
002c57c6f7 lint: Add a 'derivation' checker.
* guix/scripts/lint.scm (check-derivation): New procedure.
  (%checkers): Add 'derivation' checker.
* tests/lint.scm ("derivation: invalid arguments"): New test.
2015-04-13 00:02:59 +02:00
Ludovic Courtès
9bf3ced06c packages: 'package-transitive-supported-systems' accounts for implicit inputs.
Reported by Federico Beffa.

* guix/packages.scm (package-transitive-supported-systems): Use
  bag-direct-inputs + package->bag rather than package-direct-inputs.
* tests/packages.scm ("package-transitive-supported-systems"): Add
  explicit 'build-system' field to each 'dummy-package' form.
  ("package-transitive-supported-systems, implicit inputs"): New test.
2015-04-11 13:06:23 +02:00
Ludovic Courtès
cceab87536 packages: Add 'bag-direct-inputs'.
* guix/packages.scm (bag-direct-inputs): New procedure.
  (bag-transitive-inputs): Use it.
2015-04-11 13:06:23 +02:00
Ludovic Courtès
b210b35d61 lint: Report patches that cannot be found.
* guix/scripts/lint.scm (check-patch-file-names): Wrap body in 'guard'.
* tests/lint.scm ("patches: not found"): New test.
2015-04-10 10:27:46 +02:00
Ludovic Courtès
56b1b74c90 lint: Rename 'check-patches' to 'check-patch-file-names'.
* guix/scripts/lint.scm (check-patches): Rename to...
  (check-patch-file-names): ... this.  Rename 'filename' to 'file'.
  (%checkers): Adjust accordingly.
* tests/lint.scm ("patches: file names"): Likewise.
2015-04-10 10:11:59 +02:00
Ludovic Courtès
ee5408576d Merge branch 'master' into core-updates 2015-04-09 21:10:46 +02:00
Ludovic Courtès
0cc0095f3c http-client: Add workaround for HTTP pipelining on Guile <= 2.0.9.
Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.

* guix/http-client.scm (make-delimited-input-port): New procedure.
  Install it in (web response) for Guile <= 2.0.9.
2015-04-08 21:41:04 +02:00
Federico Beffa
042bc828fc profiles: Generate GHC's package database cache.
* guix/profiles.scm (ghc-package-cache-file): New procedure.
  (profile-derivation): Add 'ghc-package-cache?' keyword argument.  If true
  (the default), add the result of 'ghc-package-cache-file' to 'inputs'.
* guix/scripts/package.scm (guix-package)[process-actions]: Pass
  #:ghc-package-cache? to 'profile-generation'.
* tests/packages.scm ("--search-paths with pattern"): Likewise.
* tests/profiles.scm ("profile-derivation"): Likewise.
2015-04-08 17:31:12 +02:00
Federico Beffa
283cce508a build-system/haskell: Update configure flags, 'haddock' and %standard-phases.
* guix/build/haskell-build-system.scm (%standard-phases): move 'haddock phase
  before 'install phase.
* guix/build/haskell-build-system.scm (haddock): Simplify it as the 'install
  phase takes care of copying files.
* guix/build/haskell-build-system.scm (configure): Add '--libsubdir' flag.
  Fix use of '--extra-include-dirs' and '--extra-lib-dirs' flags.  Use 'doc',
  'bin' and 'lib' outputs if they are defined.
* guix/build/haskell-build-system.scm (make-ghc-package-database, register):
  Aligh location of 'package.conf.d' directory with '--libsubdir' flag.
2015-04-08 17:31:11 +02:00
Federico Beffa
b29455cfe7 import: Add hackage importer.
* guix/import/hackage.scm: New file.
* tests/hackage.scm: New file.
2015-04-08 17:31:11 +02:00
Federico Beffa
863af4e121 import: Add hackage importer.
* guix/scripts/import.scm (importers): Add hackage.
* guix/scripts/import/hackage.scm: New file.
* po/guix/POTFILES.in: Add guix/scripts/import.scm.
* doc/guix.texi: Add section on 'hackage' importer.
2015-04-08 17:31:11 +02:00
宋文武
cf3e3e374c Merge branch 'master' into core-updates 2015-04-08 16:04:37 +08:00
Ludovic Courtès
4ae7559fd6 gnu: Emit a warning when a package module cannot be loaded.
* guix/ui.scm (warn-about-load-error): New procedure.
* gnu/packages.scm (package-modules): Wrap 'resolve-interface' call in
  'catch #t', and call 'warn-about-load-error' in handler.
2015-04-07 22:28:36 +02:00
Ludovic Courtès
1151f6aeae ui: Add 'report-load-error'.
* guix/scripts/system.scm (read-operating-system): Replace error
  handling code by a call to 'report-load-error'.
* guix/ui.scm (report-load-error): New procedure.
2015-04-07 22:28:36 +02:00
Ludovic Courtès
347f54ed33 utils: 'find-files' does not follow symlinks by default.
Fixes <http://bugs.gnu.org/20081>.
Reported by Tomáš Čech <sleep_walker@suse.cz>.

* guix/build/utils.scm (find-files): Add #:stat parameter.  Pass it as
  last argument to 'file-system-fold'.
2015-04-06 23:09:54 +02:00
Ludovic Courtès
250bc998ac guix package: Avoid 'exit' calls in 'delete-matching-generations'.
* guix/scripts/package.scm (delete-matching-generations): Remove call to
  'exit' when PATTERN is "0".  Call 'leave' instead of 'exit'
  when (null-list? number).
2015-04-06 21:27:35 +02:00
Ludovic Courtès
d26eb84d14 guix package: Never remove the current generation and warn about it.
Fixes <http://bugs.gnu.org/19978>.
Reported by taylanbayirli@gmail.com (Taylan Ulrich Bayırlı/Kammer).

* guix/scripts/package.scm (delete-matching-generations): Warn when
  CURRENT is in NUMBERS, and always remove it before calling
  'delete-generations'.
* tests/guix-package.sh: Add --switch-generation=2 invocation before
  --delete-generations=3 invocation.
  Add --delete-generations=1.. test case.
2015-04-06 21:27:32 +02:00
Ludovic Courtès
65d428d8f4 guix package: Move generation deletion to its own procedure.
* guix/scripts/package.scm (delete-matching-generations): New procedure,
  with code formerly found...
  (guix-package)[process-actions]: ... here.  Use it.
  Remove 'current-generation-number'.
2015-04-06 20:02:29 +02:00
Federico Beffa
b198545df6 build-system/gnu: Add docstring to 'delete-info-dir-file'.
* guix/build/gnu-build-system.scm (delete-info-dir-file): Add docstring.
2015-04-06 10:47:31 +02:00
Federico Beffa
26b261ecfe build-system/gnu: Add 'delete-info-dir-file' phase.
* guix/build/gnu-build-system.scm (delete-info-dir-file): New procedure.
  (%standard-phases): Use it.
2015-04-06 10:22:21 +02:00
Ludovic Courtès
dacd5d2ca7 gremlin: Ignore non-store file names in RUNPATH and warn about them.
* guix/build/gremlin.scm (validate-needed-in-runpath)[runpath]:
  Add (filter absolute-file-name? ...).
  Emit a warning when RUNPATH file names that do not match
  'store-file-name?'.  Change format of error message to begin with file
  name.
* guix/build/utils.scm (store-file-name?): New procedure.
2015-04-05 15:40:48 +02:00
David Thompson
aff8ce7c74 scripts: Add 'publish' command.
* guix/scripts/publish.scm: New file.
* po/guix/POTFILES.in: Add it.
* tests/publish.scm: New file.
* Makefile.am (MODULES): Add script module.
  (SCM_TESTS): Add test module.
* doc/guix.texi ("Invoking guix publish"): New node.
2015-04-04 14:16:43 -04:00
David Thompson
533d1768f4 store: Add query-path-info operation.
* guix/store.scm (<path-info>): New record type.
  (read-path-info): New procedure.
  (read-arg): Add 'path-info' syntax.
  (query-path-info): New variable.
* tests/store.scm ("query-path-info"): New test.
2015-04-04 13:50:52 -04:00
Federico Beffa
14dfdf2e0e build-system: Add haskell-build-system.
* guix/build-system/haskell.scm: New file.
* guix/build/haskell-build-system.scm: New file.
* doc/guix.texi: Add section on 'haskell-build-system'.
2015-04-04 09:11:31 +02:00
Andy Wingo
8b43df2b30 build-system/glib-or-gtk: Wrap libexec programs.
* guix/build/glib-or-gtk-build-system.scm (wrap-all-programs): Also
  wrap binaries in libexec/, such as those launched by dbus services.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2015-04-03 23:24:01 +02:00
Ludovic Courtès
849eebbb38 ui: Recognize 'guix help'.
Suggested by Andy Wingo.

* guix/ui.scm (guix-main): Add "help" case.
2015-04-03 22:58:49 +02:00
Ludovic Courtès
112da58875 build-system/gnu: Add 'validate-runpath' phase.
* guix/build/gnu-build-system.scm (every*, validate-runpath): New
  procedures.
  (%standard-phases): Add 'validate-runpath'.
* guix/build-system/gnu.scm (%gnu-build-system-modules): Add (guix build
  gremlin) and (guix elf).
  (gnu-build): Add #:validate-runpath?.
  [builder]: Pass it.
  (gnu-cross-build): Likewise.
* gnu/packages/base.scm (glibc)[arguments]: Add #:validate-runpath? #f.
2015-04-01 16:47:49 +02:00
Ludovic Courtès
4ba3a84d07 utils: Make the second 'find-files' argument optional.
* guix/build/utils.scm (find-files): Make 'pred' optional.
2015-04-01 15:43:54 +02:00
Ludovic Courtès
bb42c78a23 build-system: Factorize the list of modules imported on the build side.
* guix/build-system/gnu.scm (%default-modules): Rename to...
  (%gnu-build-system-modules): ... this.
  (%default-modules): New variable.
  (dist-package, gnu-build): Use %GNU-BUILD-SYSTEM-MODULES for
  #:imported-modules.
  (gnu-cross-build): Likewise, and use %DEFAULT-MODULES for #:modules.
* guix/build-system/cmake.scm (%cmake-build-system-modules): New
  variable.
  (cmake-build): Use it for #:imported-modules.
* guix/build-system/glib-or-gtk.scm (%default-imported-modules): Rename
  to...
  (%glib-or-gtk-build-system-modules): ... this.  Refer to
  %GNU-BUILD-SYSTEM-MODULES.  Adjust uses.
* guix/build-system/perl.scm (%perl-build-system-modules): New
  variable.
  (perl-build): Use it for #:imported-modules.
* guix/build-system/python.scm (%python-build-system-modules): New
  variable.
  (python-build): Use it for #:imported-modules.
* guix/build-system/ruby.scm (%ruby-build-system-modules): New variable.
  (ruby-build): Use it for #:imported-modules.
* guix/build-system/waf.scm (%waf-build-system-modules): New variable.
  (waf-build): Use it for #:imported-modules.
2015-04-01 15:34:19 +02:00
Ludovic Courtès
7be8c63e0d gremlin: Guard against invalid ELF segments.
* guix/build/gremlin.scm (&elf-error, &invalid-segment-size): New error
  condition types.
  (dynamic-link-segment): Compare SEGMENT's offset + size to ELF's total
  size.
  (validate-needed-in-runpath): Wrap body in 'guard' form.
2015-04-01 14:17:39 +02:00
Ludovic Courtès
d83ccc9b42 gremlin: Add libnsl to libc's library list.
* guix/build/gremlin.scm (%libc-libraries): Add "libnsl.so".
2015-04-01 13:46:01 +02:00
Ludovic Courtès
1968262a23 utils: 'find-files' takes an arbitrary predicate as its second argument.
* guix/build/utils.scm (file-name-predicate): New procedure.
  (find-files): Rename second parameter to 'pred'.  When 'pred' is not a
  procedure, call 'file-name-predicate'.  Use PRED instead of
  'regexp-exec' in the leaf procedure.
2015-03-31 22:55:41 +02:00
Ludovic Courtès
f8503e2b25 utils: 'modify-phases' no longer introduces quotes.
Suggested by Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>.

* guix/build/utils.scm (%modify-phases): Remove quotes.
* guix/build/cmake-build-system.scm (%standard-phases): Adjust
  accordingly.
* guix/build/glib-or-gtk-build-system.scm (%standard-phases): Likewise.
* guix/build/gnu-dist.scm (%dist-phases): Likewise.
* guix/build/perl-build-system.scm (%standard-phases): Likewise.
* guix/build/python-build-system.scm (%standard-phases): Likewise.
* guix/build/ruby-build-system.scm (%standard-phases): Likewise.
* guix/build/waf-build-system.scm (%standard-phases): Likewise.
* gnu/packages/bash.scm, gnu/packages/code.scm, gnu/packages/gl.scm,
  gnu/packages/gnome.scm, gnu/packages/graphics.scm,
  gnu/packages/image.scm, gnu/packages/key-mon.scm,
  gnu/packages/ocr.scm, gnu/packages/plotutils.scm,
  gnu/packages/search.scm, gnu/packages/video.scm: Likewise.
2015-03-31 22:43:01 +02:00
Ludovic Courtès
023dd28a30 Merge branch 'master' into core-updates 2015-03-31 22:41:54 +02:00
Ludovic Courtès
15aa2c3842 Add (guix build gremlin).
* guix/build/gremlin.scm, tests/gremlin.scm: New files.
* Makefile.am (MODULES): Add guix/build/gremlin.scm.
  (SCM_TESTS): Add tests/gremlin.scm.
2015-03-31 22:23:57 +02:00
Ludovic Courtès
96af558907 elf: Add missing argument in 'elf-segment'.
* guix/elf.scm (elf-segment): Add missing argument N.
2015-03-30 15:21:11 +02:00
Ludovic Courtès
2242ff45fa gexp: Slightly simplify 'lower-inputs'.
* guix/gexp.scm (lower-inputs): Simplify first case by removing the
  'input' binding.
2015-03-29 22:23:33 +02:00
Ludovic Courtès
d9ae938f2c gexp: Add 'local-file'.
* guix/gexp.scm (<local-file>): New record type.
  (local-file): New procedure.
  (local-file-compiler): New compiler.
  (gexp->sexp) <struct? thing>: Handle the case where 'lower' returns a
  file name.
  (text-file*): Update docstring.local-file doc
* tests/gexp.scm ("one local file", "gexp->derivation, local-file"): New
  tests.
* doc/guix.texi (G-Expressions): Mention local files early.  Document
  'local-file'.  Update 'text-file*' documentation.
2015-03-29 22:23:33 +02:00
Ludovic Courtès
25d5b708a6 Merge branch 'master' into core-updates 2015-03-25 10:52:52 +01:00
Ludovic Courtès
614c218842 substitute: Rename cache directory from "substitute-binary" to "substitute".
* guix/scripts/substitute.scm (%narinfo-cache-directory): Change
  "substitute-binary" to "substitute".
* tests/store.scm ("substitute query"): Likewise.
* tests/substitute.scm (call-with-narinfo): Likewise.
2015-03-25 10:46:22 +01:00
Ludovic Courtès
2c74fde00e Rename 'guix substitute-binary' to 'guix substitute'.
* guix/scripts/substitute-binary.scm: Rename to...
* guix/scripts/substitute.scm: ... this.  Adjust module name, entry
  point, comments, and help string accordingly.
* nix/scripts/substitute-binary.in: Rename to...
* nix/scripts/substitute.in: ... this.
* pre-inst-env.in (NIX_SUBSTITUTERS): Adjust accordingly.
* tests/substitute-binary.scm: Rename to...
* tests/substitute.scm: ... this.  Adjust references to (guix scripts
  substitute) accordingly.
* guix/ui.scm (show-guix-help)[internal?]: Change "substitute-binary" to
  "substitute".
* Makefile.am (MODULES, SCM_TESTS): Adjust to file renames.
* daemon.am (nodist_pkglibexec_SCRIPTS): Likewise.
* config-daemon.ac: Likewise.
* guix/tests.scm (call-with-derivation-narinfo): Adjust comments and
  docstring.
2015-03-25 10:46:22 +01:00
Ludovic Courtès
c3a450fb49 derivations: 'substitution-oracle' now ignores sub-trees that are valid.
Before that, "guix build qt", when only qt itself is missing, would lead
'substitution-oracle' to call 'substitutable-paths' with 318 items.
Now, this is down to 6 items, because it doesn't ask about prerequisites
that are already valid.

* guix/derivations.scm (substitution-oracle)[valid-input?,
  dependencies]: New procedures.
  Use 'dependencies' and remove call to 'remove'.
2015-03-25 10:46:22 +01:00
Ludovic Courtès
3681db5d2c derivations: Add a 'cut?' parameter to 'derivation-prerequisites'.
* guix/derivations.scm (valid-derivation-input?): New procedure.
  (derivation-prerequisites): Add 'cut?' parameter and honor it.
* tests/derivations.scm ("derivation-prerequisites and
  derivation-input-is-valid?"): New test.
2015-03-25 10:46:22 +01:00
Ludovic Courtès
c7d1d88f6c derivations: Don't invoke the substituter when an item is already in store.
Fixes <http://bugs.gnu.org/20188>.
Reported by Mark H Weaver <mhw@netris.org>.

* guix/derivations.scm (substitution-oracle): Add 'valid?' procedure.
  Remove 'valid?' items from PATHS.
2015-03-24 23:22:23 +01:00
Eric Bavier
17287d7d47 packages: Add zip archive support to 'patch-and-repack'.
Fixes <http://bugs.gnu.org/19830>.

* guix/packages.scm (%standard-patch-inputs): Add "unzip".
  (patch-and-repack)[decompression-type]: Detect zip archive.
  [build]: Invoke "unzip" when appropriate.
2015-03-24 15:59:30 -05:00
Ludovic Courtès
cb043c2b13 substitute-binary: Remove thread-safe 'regexp-exec' wrapper.
* guix/scripts/substitute-binary.scm: Remove 'regexp-exec' setting.
2015-03-23 22:28:49 +01:00