Commit Graph

534 Commits (4d497632ce56287cc56cfb73abad7e562129b43e)

Author SHA1 Message Date
Ludovic Courtès 4d497632ce guix package: Internationalize "Generation" string.
* guix/scripts/package.scm (guix-package): Internationalize generation
  listing.
2013-09-21 22:32:20 +02:00
Ludovic Courtès 3b627eac48 pull: Adjust to 'derivation' API change.
Fixes <http://bugs.gnu.org/15428>.
Reported by Cyrill Schenkel <cyrill.schenkel@gmail.com>.

* guix/scripts/pull.scm (guix-pull): 'unpack' returns a single value.
2013-09-21 22:16:26 +02:00
Nikita Karetnikov 2cd09108c9 guix package: Add '--list-generations'.
* guix/scripts/package.scm: Import (srfi srfi-19).
  (generation-time, matching-generations): New functions.
  (show-help): Add '--list-generations'.
  (%options): Likewise.
  (guix-package)[process-query]: Add support for '--list-generations'.
* guix/ui.scm: Import (srfi srfi-19) and (ice-9 regex).
  (string->generations, string->duration): New functions.
* tests/guix-package.sh: Test '--list-generations'.
* tests/ui.scm: Import (srfi srfi-19).
  Test 'string->generations' and 'string->duration'.
* doc/guix.texi (Invoking guix-package): Document '--list-generations'.
2013-09-19 11:22:31 +00:00
Ludovic Courtès 59688fc4b5 derivations: 'derivation' and related procedures return a single value.
* guix/derivations.scm (derivation->output-path,
  derivation->output-paths): New procedures.
  (derivation-path->output-path): Use 'derivation->output-path'.
  (derivation-path->output-paths): Use 'derivation->output-paths'.
  (derivation): Accept 'derivation?' objects as inputs.  Return a single
  value.
  (build-derivations): New procedure.
  (compiled-modules): Use 'derivation->output-paths'.
  (build-expression->derivation)[source-path]: Add case for when the
  input matches 'derivation?'.
  [prologue]: Accept 'derivation?' objects in INPUTS.
  [mod-dir, go-dir]: Use 'derivation->output-path'.
* guix/download.scm (url-fetch): Adjust to the single-value return.
* guix/packages.scm (package-output): Use 'derivation->output-path'.
* guix/scripts/build.scm (guix-build): When the argument is
  'derivation-path?', pass it through 'read-derivation'.
  Use 'derivation-file-name' to print out the .drv file names, and to
  register them.  Use 'derivation->output-path' instead of
  'derivation-path->output-path'.
* guix/scripts/package.scm (roll-back): Adjust to the single-value
  return.
  (guix-package): Use 'derivation->output-path'.
* guix/ui.scm (show-what-to-build): Adjust to deal with 'derivation?'
  objects instead of .drv file names.
* gnu/system/grub.scm (grub-configuration-file): Use
  'derivation->output-path' instead of 'derivation-path->output-path'.
* gnu/system/vm.scm (qemu-image, system-qemu-image): Likewise.
* tests/builders.scm, tests/derivations.scm, tests/packages.scm,
  tests/store.scm, tests/union.scm: Adjust to the new calling
  convention.
* doc/guix.texi (Defining Packages, The Store, Derivations): Adjust
  accordingly.
2013-09-18 18:49:53 +02:00
Ludovic Courtès 07c86312ca derivations: Add a nicer printer.
* guix/derivations.scm (<derivation>): Add a printer.
2013-09-18 11:10:02 +02:00
Ludovic Courtès 6a446d5680 derivations: Keep the .drv file name in <derivation> objects.
* guix/derivations.scm (<derivation>): Add 'file-name' field.
  (%read-derivation): Use (port-filename DRV-PORT) as the file name for
  the result.
  (derivation): Set the 'file-name' field in the result.
* tests/derivations.scm ("build derivation with 1 source"): Assert that
  'derivation-file-name' returns the right thing.
2013-09-17 23:02:13 +02:00
Andreas Enge aae4ead814 Merge branch 'python' 2013-09-14 10:45:01 +02:00
Ludovic Courtès 29479de565 substitute-binary: Add '--help'.
Reported by Nikita Karetnikov <nikita@karetnikov.org>.

* guix/scripts/substitute-binary.scm (show-help): New procedure.
  (guix-substitute-binary): Add '--help'.
2013-09-13 23:42:36 +02:00
Nikita Karetnikov 1b0a8212d1 guix package: Rename generation-related procedures.
* guix/scripts/package.scm (profile-numbers): Rename to 'generation-numbers'.
  (previous-profile-number): Rename to 'previous-generation-number'.
  (profile-number): Rename to 'generation-number'.
  (roll-back): Rename 'previous-profile' to 'previous-generation'.
2013-09-13 07:07:01 +00:00
Andreas Enge 824af8cadc guix: python: Create module installation path and add it to PYTHONPATH during
the installation phase.

* guix/build/python-build-system.scm (get-python-version): New procedure.
* guix/build/python-build-system.scm (install): Create and add path.
* gnu/packages/python.scm (python-setuptools): Drop path creation code.
2013-09-11 15:47:34 +02:00
Ludovic Courtès 37c825eb79 linux-initrd: Create /dev/klog and /dev/kmsg.
* guix/build/linux-initrd.scm (make-essential-device-nodes): Make
  /dev/klog and /dev/kmsg.
2013-09-11 01:07:50 +02:00
Ludovic Courtès cfbf916045 store: The 'references' parameter of 'add-text-to-store' is now optional.
* guix/store.scm (add-text-to-store): Make 'references' optional.
* tests/store.scm ("dead-paths", "references"): Use 'add-text-to-store'
  with no optional argument.
* doc/guix.texi (The Store): Adjust accordingly.
2013-09-11 01:07:49 +02:00
Andreas Enge e1a264f6fa guix: python: Do not import %standard-phases from gnu-build-system.
* guix/build-system/python.scm (python-build): Drop module gnu-build-system.
    Thanks to Ludovic Courtès <ludo@gnu.org>.
2013-09-10 20:32:50 +02:00
Andreas Enge 1d1f939798 guix: python: Add parameter #:phases to build system.
* guix/build-system/python.scm (python-build): Use parameter #:phases.
2013-09-10 11:58:02 +02:00
Andreas Enge 11bb85a10d guix: python: Add package-with-python2, a procedure rewriting a package
to compile with Python 2 instead of the default Python 3.

* guix/build-system/python.scm (default-python2, package-with-explicit-python,
    package-with-python2): New procedures.
* guix/build-system/python.scm (python2-pytz, python2-babel): Use
    package-with-python2.
2013-09-08 16:57:37 +02:00
Andreas Enge b191f88ee3 guix: python: Add build phase and factor out calls to setup.py.
* guix/build/python-build-system.scm (call-setuppy): New procedure.
* guix/build/python-build-system.scm (build): New procedure.
* guix/build/python-build-system.scm (check, install): Use call-setuppy.
* guix/build/python-build-system.scm (%standard-phases): Add call to build.
2013-09-05 20:25:08 +02:00
Andreas Enge 7b96bf82da gnu: python: Honour #:tests? and #:test-target in build system.
* guix/build/python-build-system.scm (check): Use named parameters tests?
    and test-target (default now: "test" instead of "check").
2013-09-05 18:43:18 +02:00
Ludovic Courtès 29804e6eb2 gnu: linux-initrd: Fix creation of /dev/tty nodes.
* guix/build/linux-initrd.scm (make-essential-device-nodes): Make
  /dev/tty.  Change from 'block-special' to 'char-special' for /dev/tty*
  nodes.
2013-09-05 00:46:09 +02:00
Andreas Enge 3df47231e6 guix: python: Switch to python-wrapper as the default version for the python
build system (switches to Python 3) and compute python-version instead of
  passing it as a parameter.

* guix/build-system/python.scm (default-python): Switch to python-wrapper.
* guix/build-system/python.scm (python-build): Drop parameter #:python-version.
* guix/build/python-build-system.scm (wrap): Compute python version from input.
2013-09-04 18:07:55 +02:00
Ludovic Courtès bda44eed93 pull: Compile files in the lexicographic order.
* guix/scripts/pull.scm (unpack): Print the name of the file being
  compiled.  Sort the names of files to compile.
2013-09-03 10:48:52 +02:00
Ludovic Courtès 8badfc5558 build-system/cmake: Fix typo.
* guix/build-system/cmake.scm (default-cmake): Add missing quote.
2013-09-03 10:20:59 +02:00
Ludovic Courtès 0a2873e515 build-system/gnu: Delay resolution of (@ (gnu packages cmake) cmake).
* guix/build-system/cmake.scm (default-cmake): New procedure.
  (cmake-build): Use it.
2013-09-03 10:18:38 +02:00
Ludovic Courtès 00554b2a0f substitute-binary: Show the Nar size, when available.
* guix/scripts/substitute-binary.scm (guix-substitute-binary)["--substitute"]:
  Show the Nar size, when available.
* guix/ui.scm (show-what-to-build): Add 'TODO'.
2013-09-02 23:33:13 +02:00
Ludovic Courtès 43dd92024a union: Don't traverse sub-directories only found in one element of the union.
This significantly reduces I/O when building profiles, especially with
lots of package-specific sub-directories (such as 'share/emacs/24.3',
'texmf', etc.)

* guix/build/union.scm (union-build)[file-tree](others-have-it?): New
  procedure.  Use it in the 'enter?' parameter of 'file-system-fold';
  change 'skip' parameter accordingly.
* tests/union.scm ("union-build"): Ensure that 'include' is a symlink
  and 'bin' is a directory.
2013-09-02 23:04:25 +02:00
Ludovic Courtès bf8e7fc502 store: Add a printer for <nix-server>.
* guix/store.scm (<nix-server>): Set a printer.
2013-09-02 00:20:14 +02:00
Ludovic Courtès d91712ee89 gnu: linux-initrd: Factorize device node creation.
* guix/build/linux-initrd.scm (make-essential-device-nodes): New
  procedure.
* gnu/packages/linux-initrd.scm (qemu-initrd): Use it.
2013-09-02 00:20:14 +02:00
Ludovic Courtès 89bf140b10 gnu: linux-initrd: Make Guile modules accessible in the chroot.
* gnu/packages/linux-initrd.scm (qemu-initrd): Add (guix build utils) to
  #:modules, and use it.  Copy .scm and .go files to /root.
* guix/build/linux-initrd.scm (bind-mount): New procedure.
2013-08-31 23:02:18 +02:00
Ludovic Courtès 88840f0246 gnu: linux-initrd: Add (guix build linux-initrd) and use it.
* gnu/packages/linux-initrd.scm (qemu-initrd): Add #:modules argument.
  Factorize and move some of the code to...
* guix/build/linux-initrd.scm: ... here.  New file.
* Makefile.am (MODULES): Add it.
2013-08-29 00:05:03 +02:00
Ludovic Courtès f989fa392f gnu: linux-initrd: Allow Guile modules to be embedded in the initrd.
* gnu/packages/linux-initrd.scm (raw-build-system): New macro.
  (module-package, compiled-module-package): New procedures.
  (expression->initrd): Add `modules' keyword parameter.
  Add "modules" and "modules/compiled" inputs; copy them onto the
  initrd.
* guix/derivations.scm (imported-modules, compiled-modules): Publicize.
2013-08-29 00:05:03 +02:00
Ludovic Courtès 858e92823f derivations: Rename #:dependency-graphs to #:references-graphs.
* guix/derivations.scm (derivation, build-expression->derivation):
  Rename #:dependency-graphs to #:references-graphs, for consistency in
  the terminology.
* tests/derivations.scm: Adjust accordingly.
2013-08-28 00:55:40 +02:00
Ludovic Courtès 9c629a27a4 derivations: Add #:dependency-graphs to `build-expression->derivation'.
* guix/derivations.scm (build-expression->derivation): Add
  #:dependency-graphs keyword argument.  Pass it to `derivation'.
* tests/derivations.scm ("build-expression->derivation with
  #:dependency-graphs"): New test.
* doc/guix.texi (Derivations): Update `build-expression->derivation'
  description.
2013-08-26 22:20:58 +02:00
Ludovic Courtès 5b0c9d1635 derivations: Add #:dependency-graphs `derivation' parameter.
* guix/derivations.scm (derivation): Add `dependency-graphs' keyword
  parameter; honor it.
* tests/derivations.scm (bootstrap-binary): New procedure.
  (%bash): Use it.
  (%mkdir): New variable.
  (directory-contents): Add `slurp' optional parameter.
  ("derivation with #:dependency-graphs"): New test.
* doc/guix.texi (Derivations): Update accordingly.
2013-08-26 22:20:53 +02:00
Ludovic Courtès a987d2c025 derivations: Move 3 positional parameters into keyword parameters.
* guix/derivations.scm (derivation): Turn `system', `env-vars', and
  `inputs' into keyword parameters.
  (build-expression->derivation): Adjust accordingly.
* gnu/packages/bootstrap.scm (%bootstrap-guile): Likewise.
* tests/derivations.scm, tests/store.scm: Likewise.
* doc/guix.texi (Derivations): Likewise.
2013-08-26 22:20:27 +02:00
Ludovic Courtès 5d9cd70721 download: Add kernel.org mirrors.
Fixes <http://bugs.gnu.org/15182>.
Reported by Mark H Weaver <mhw@netris.org>.

* guix/download.scm (%mirrors)[kernel.org]: Add ftp.be.debian.org and
  mirror.linux.org.au.
2013-08-25 20:49:03 +02:00
Ludovic Courtès fe12c3458c build-system/gnu: Add `dist-package'.
* guix/build/gnu-dist.scm: New file.
* Makefile.am (MODULES): Add it.
* guix/build-system/gnu.scm (%default-modules): New variable.
  (gnu-build): Use it.
  (dist-package): New procedure.
2013-08-24 17:30:31 +02:00
Ludovic Courtès 7357138bba packages: Allow file names as package sources.
* guix/packages.scm (package-source-derivation): Add cases for SOURCE as
  a store path or user file.
* tests/packages.scm ("package-source-derivation, file",
  "package-source-derivation, store path"): New tests.
2013-08-24 17:30:31 +02:00
Ludovic Courtès 7db3ff4a29 utils: Add `guile-version>?', and use it.
This fixes Guile version comparisons when (version) has a
vendor-specific suffix.

Reported by Andreas Enge <andreas@enge.fr>.

* guix/utils.scm (guile-version>?): New procedure.
* tests/utils.scm ("guile-version>? 1.8", "guile-version>? 10.5"): New
  tests.
* guix/scripts/substitute-binary.scm (fetch, progress-report-port): Use
  `guile-version>?' instead of `version>?'.
* guix/http-client.scm (when-guile<=2.0.5, http-fetch): Likewise.
2013-08-23 15:51:36 +02:00
Ludovic Courtès b6952cad8d substitute-binary: Try hard to avoid port buffering.
* guix/scripts/substitute-binary.scm (fetch): In the `file' case, open
  with the `b' flag, so that the coding cookie reading thing doesn't
  lead to buffering some of the data (on 2.0.5).
* tests/utils.scm ("filtered-port, file"): Open with `r0b'.  Fixes a
  test failure with Guile 2.0.5 whereby the first byte of FILE would be
  missing from DECOMPRESSED.
2013-08-22 17:14:20 +02:00
Ludovic Courtès db90b40dfd substitute-binary: Don't pretend to report download progress on Guile 2.0.5.
* guix/scripts/substitute-binary.scm (progress-report-port): On Guile
  2.0.5, return PORT directly and emit a warning.
2013-08-21 02:19:36 +02:00
Cyril Roelandt e12b3eb93e Make "guix -h" work as "guix --help".
* guix/ui.scm (guix-main): have the same behaviour for the "-h" and "--help"
  options.
2013-08-15 21:03:32 +02:00
Ludovic Courtès 079d127391 guix package: Allow separate install of several outputs of the same package.
* guix/scripts/package.scm (guix-package)[process-actions](same-package?):
  New procedure.  Use it instead of `alist-delete' when filtering out
  duplicate packages from the profile.
2013-07-15 23:51:28 +02:00
Ludovic Courtès 3b8258c569 Rename (guix web) to (guix http-client).
* guix/web.scm: Rename to...
* guix/http-client.scm: ... this.
* guix/gnu-maintenance.scm, guix/scripts/substitute-binary.scm,
  Makefile.am, po/POTFILES.in: Update accordingly.
2013-07-14 16:44:15 +02:00
Ludovic Courtès 2096b516e0 guix package: Fix handling of `-e'.
This fixes a bug whereby a command like

  guix package -e '(@@ (gnu packages base) gnu-make-boot0)'

would only succeed when the outputs of that package are available, and
otherwise fail with "/nix/store/... is not valid".

* guix/scripts/package.scm (guix-package)[process-action](package->tuple):
  Leave P as is in the result.  Move `package->tuple' call from INSTALL*
  to INSTALL.
2013-07-12 23:27:35 +02:00
Ludovic Courtès e14c39291b ui: Ignore SIGPIPE and catch `system-error' exceptions.
* guix/ui.scm (initialize-guix): Call `sigaction'.
  (call-with-error-handling): Wrap `thunk' in a (catch 'system-error ...).
2013-07-12 23:01:18 +02:00
Ludovic Courtès e3ccdf9e96 guix package: Reuse FTP connections for subsequent `latest-release' calls.
* guix/gnu-maintenance.scm (latest-release): Add `ftp-close' and
  `ftp-open' keyword parameters.
* guix/scripts/package.scm (ftp-open*): New variable.
  (check-package-freshness): Call `latest-release' with `ftp-open*' and
  a no-op procedure.
2013-07-12 22:59:33 +02:00
Ludovic Courtès 1f495e04c1 gnu-maintenance: `latest-release' closes its connection.
* guix/gnu-maintenance.scm (latest-release): Close CONN before
  returning.
2013-07-12 22:26:24 +02:00
Ludovic Courtès ce689ccf18 substitute-binary: Directly replace the global `regexp-exec'.
* guix/scripts/substitute-binary.scm (%regexp-exec-mutex, string->uri):
  Remove.
  (regexp-exec): Replace this global binding by a thread-safety wrapper.
  (fields->alist): Remove `with-mutex', and directly alias `recutils->alist'.
2013-07-11 22:42:41 +02:00
Ludovic Courtès 8b79e2e641 substitute-binary: Increase the default timeout.
* guix/scripts/substitute-binary.scm (%fetch-timeout): Set to 5 seconds.
2013-07-11 22:22:22 +02:00
Ludovic Courtès 560d4787f4 guix refresh: Keep only the newest versions of packages as upgrade candidates.
* guix/scripts/refresh.scm (guix-refresh)[keep-newest]: New procedure.
  Use it to keep only once copy of each package.
2013-07-11 19:56:30 +02:00
Ludovic Courtès c4ca9411f9 gnu-maintenance: Add `doc-description' field to <gnu-package-descriptor>.
* guix/gnu-maintenance.scm (%gsrc-package-list-url): New variable.
  (<gnu-package-descriptor>): Add `doc-description' field.
  (official-gnu-packages)[group-package-fields]: Rename to...
  [read-records]: ... this.  Reverse the result.
  [gsrc-description]: New procedure.
  Add the "description" field to the alist passed to `alist->record'.
2013-07-10 22:34:03 +02:00