summaryrefslogtreecommitdiff
path: root/guix/utils.scm
Commit message (Collapse)AuthorAge
* Update license headers.Ludovic Courtès2013-01-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change all license headers, except guix/build/* and ld-wrapper.scm, with this code: (use-modules (guix build utils) (srfi srfi-1)) (fluid-set! %default-port-encoding "UTF-8") (substitute* (remove (lambda (f) (or (string-contains f ".tar.") (string-contains f ".git/") (string-contains f ".so") (string-suffix? ".o" f) (string-suffix? ".a" f) (string-suffix? ".go" f) (string-suffix? ".pdf" f) (string-suffix? ".png" f) (string-suffix? ".info" f) (equal? (basename f) "guix-daemon") (equal? (basename f) "nix-setuid-helper") (string-contains f "nix-upstream/") (string-contains f "distro/packages/bootstrap/"))) (find-files "." "\\.[a-z]+$")) (("^([[:graph:]]+) This file is part of Guix." _ comment-start) (string-append comment-start " This file is part of GNU Guix.")) (("^([[:graph:]]+) Guix --- Nix package management.*" _ comment-start) (string-append comment-start " GNU Guix --- Functional package management for GNU\n")) (("^([[:graph:]]+) Guix is " _ comment-start) (string-append comment-start " GNU Guix is ")) (("^([[:graph:]]+) along with Guix." _ comment-start) (string-append comment-start " along with GNU Guix.")) (("^([[:graph:]]+) Copyright \\(C\\)" _ comment-start) (string-append comment-start " Copyright ©"))) Change headers using C-style comments manually.
* Merge branch 'nix-integration'Ludovic Courtès2012-12-13
|\ | | | | | | | | Conflicts: tests/guix-package.sh
| * build: Capture configure-time settings in (guix config).Ludovic Courtès2012-12-06
| | | | | | | | | | | | | | | | | | | | | | * configure.ac: Compute and substitute `guix_localstatedir'. * m4/guix.m4: Substitute `guix_system'. * guix/config.scm.in (%store-directory, %store-directory, %system): New variables. * guix/store.scm (%nix-state-dir): Remove. (%default-socket-path): Use %STATE-DIRECTORY as the default. (%store-prefix): Use %STORE-DIRECTORY as the default. * guix/utils.scm (%current-system): Default to %SYSTEM.
* | Have `%nixpkgs-directory' default to #f when $NIXPKGS is the empty string.Ludovic Courtès2012-12-10
|/ | | | | | * guix/utils.scm (%nixpkgs-directory): Set to #f when the `NIXPKGS' environment variable is set but empty. Reported by Andreas Enge <andreas@enge.fr>.
* guix-package: Add `--list-available'.Ludovic Courtès2012-11-19
| | | | | | | | | | * guix-package.in (show-help, %options): Add `--list-available'. (guix-package)[process-query]: Add support for `--list-available'. * doc/guix.texi (Invoking guix-package): Document it. * tests/guix-package.sh: Add test. * guix/ui.scm (location->string): New procedure. * guix/utils.scm: Export <location>.
* Move base32 code to (guix base32).Ludovic Courtès2012-11-11
| | | | | | | | | | | | | | | | | | | | | | * guix/utils.scm (bytevector-quintet-ref, bytevector-quintet-ref-right, bytevector-quintet-length, bytevector-quintet-fold, bytevector-quintet-fold-right, make-bytevector->base32-string, %nix-base32-chars, %rfc4648-base32-chars, bytevector->base32-string, bytevector->nix-base32-string, bytevector-quintet-set!, bytevector-quintet-set-right!, base32-string-unfold, base32-string-unfold-right, make-base32-string->bytevector, base32-string->bytevector, nix-base32-string->bytevector): Move to... * guix/base32.scm: ... here. New file. * tests/utils.scm (%nix-hash, "bytevector->base32-string", "base32-string->bytevector", "nix-base32-string->bytevector", "sha256 & bytevector->base32-string"): Move to... * tests/base32.scm: ... here. New file * guix-download.in, guix/derivations.scm, guix/packages.scm, guix/snix.scm, tests/builders.scm, tests/derivations.scm: Adjust accordingly. * guix.scm (%public-modules): Add `base32'.
* utils: Add `default-keyword-arguments' and `substitute-keyword-arguments'.Ludovic Courtès2012-11-05
| | | | | | * distro/packages/base.scm (default-keyword-arguments, substitute-keyword-arguments): Move to... * guix/utils.scm: ... here.
* utils: Add `package-name->name+version'.Ludovic Courtès2012-11-04
| | | | | | * guix/utils.scm (package-name->name+version): New procedure. * guix-package.in (guix-package)[find-package]: Use it. * tests/utils.scm ("package-name->name+version"): New test.
* build: Require GNU libgcrypt.Ludovic Courtès2012-11-03
| | | | | | | | | | | | * guix/utils.scm (sha256): Remove Coreutils- and libchop-based implementations. * README: Update accordingly. * m4/guix.m4: New file. * configure.ac: Use `GUIX_ASSERT_LIBGCRYPT_USABLE'. Set and substitute `LIBGCRYPT_PREFIX'. * Makefile.am (AM_DISTCHECK_CONFIGURE_FLAGS): Pass `--with-libgcrypt-prefix=$(LIBGCRYPT_PREFIX)'.
* build: Produce (guix config) instead of using compile-time tricks.Ludovic Courtès2012-11-03
| | | | | | | | | | | | | | * guix/config.scm.in: New file. * guix/utils.scm: Use it. (%libgcrypt): Remove. (%nixpkgs-directory): Don't capture the compile-time $NIXPKGS; use %NIXPKGS instead. (nixpkgs-derivation): Use %NIX-INSTANTIATE. * pre-inst-env.in (NIX_INSTANTIATE, NIXPKGS, LIBGCRYPT): Remove. * configure.ac: Emit `guix/config.scm'. * Makefile.am (GOBJECTS): Add `guix/config.go'. (nobase_nodist_guilemodule_DATA): Add `guix/config.scm'.
* build: Clearly mark Nixpkgs as optional.Ludovic Courtès2012-11-03
| | | | | | | | | | | | | | | | * configure.ac: Always show the result of checking for Nixpkgs. Don't warn when Nixpkgs is not found. * Makefile.am (AM_DISTCHECK_CONFIGURE_FLAGS): Remove `--with-nixpkgs' flag. * guix/utils.scm (%nixpkgs-directory): Use either the compile-time or the run-time `NIXPKGS' environment variable. * release.nix (jobs.tarball, jobs.build): Remove `--with-nixpkgs' configure flag. * README: Mark Nixpkgs as optional. * distro/packages/databases.scm, distro/packages/guile.scm, distro/packages/typesetting.scm: Change uses of `nixpkgs-derivation*' to `nixpkgs-derivation', to avoid failing at compile-time.
* utils: Remove stuff committed by error.Ludovic Courtès2012-11-01
| | | | | | This was wrongfully committed in df1fab58. * guix/utils.scm (hash-set-proc, hash-ref*, memoizing-lambda): Remove.
* location: Start column numbers at 1.Ludovic Courtès2012-10-27
| | | | * guix/utils.scm (source-properties->location): Use COL + 1.
* Add a `system' parameter to `nixpkgs-derivation'.Ludovic Courtès2012-10-25
| | | | | * guix/utils.scm (nixpkgs-derivation): Add a `system' parameter. Pass it in the `nix-instantiate' invocation.
* distro: Add a statically-linked, relocatable Guile 2.0 package.Ludovic Courtès2012-10-13
| | | | | | | | * distro/packages/base.scm (%guile-static, %guile-static-stripped): New variables. * distro/patches/guile-relocatable.patch: New file. * Makefile.am (dist_patch_DATA): Add it.
* Move <location> to (guix utils).Ludovic Courtès2012-09-03
| | | | | * guix/packages.scm (<location>, location): Move to... * guix/utils.scm: ... here.
* define-record-type*: Add the `inherit' syntactic constructor keyword.Ludovic Courtès2012-08-30
| | | | | | | | | * guix/utils.scm (define-record-type*)[make-syntactic-constructor]: New `type' parameter. Add the `inherit' keyword and corresponding support code. * tests/utils.scm ("define-record-type* & inherit", "define-record-type* & inherit & letrec* behavior"): New tests.
* build: Add `--with-libgcrypt-prefix'; capture the path to libgcrypt.Ludovic Courtès2012-08-17
| | | | | | | | | * configure.ac: Add `--with-libgcrypt-prefix'. Substitute `LIBGCRYPT'. * Makefile.am (.scm.go): Pass $(LIBGCRYPT). * guix/utils.scm (%libgcrypt): New variable. (sha256): Use it.
* build: Pass $(NIX_INSTANTIATE) to the build and test environments.Ludovic Courtès2012-08-14
| | | | | | | | | | * Makefile.am (.scm.go): Define $NIX_INSTANTIATE. (TESTS_ENVIRONMENT): Likewise, and define $NIX_HASH. * guix/utils.scm (nixpkgs-derivation): Use $NIX_INSTANTIATE when defined. * tests/utils.scm (%nix-hash): New variable. ("sha256 & bytevector->nix-base32-string"): Use it.
* Add `nixpkgs-derivation*'; use it in the distro.Ludovic Courtès2012-07-11
| | | | | | * guix/utils.scm (nixpkgs-derivation*): New macro. * distro/base.scm: Use it instead of `nixpkgs-derivation'.
* define-record-type*: Add `letrec*' behavior.Ludovic Courtès2012-07-03
| | | | | | | | | * guix/utils.scm (define-record-type*)[make-syntactic-constructor]: Bind all the ((FIELD VALUE) ...) in a `letrec*'. Adjust `field-value' accordingly. * tests/utils.scm ("define-record-type* with letrec* behavior"): New test.
* Make `define-record-type*' error messages more informative.Ludovic Courtès2012-07-02
| | | | | * guix/utils.scm (define-record-type*): In case of missing or extra field initializers, raise a descriptive `syntax-error'.
* Add a libgcrypt-based implementation of `sha256'.Ludovic Courtès2012-06-29
| | | | | * guix/utils.scm (sha256): Add a libgcrypt-based implementation using the FFI.
* Add a sha256 fallback that uses Coreutils instead of libchop.Ludovic Courtès2012-06-28
| | | | | | * guix/utils.scm (compile-time-value): Move to the top. (sha256): Add an implementation that uses Coreutils, for when libchop is unavailable.
* Introduce `compile-time-value' and use it.Ludovic Courtès2012-06-28
| | | | | | | * guix/utils.scm (compile-time-value): New macro. (%nixpkgs-directory): Use it. * guix/build-system/gnu.scm (%standard-inputs): Likewise.
* Add `define-record-type*'.Ludovic Courtès2012-06-27
| | | | | | * guix/utils.scm (define-record-type*): New macro. * tests/utils.scm ("define-record-type*"): New test.
* Add a `%current-system' fluid.Ludovic Courtès2012-06-11
| | | | | | | | | | * guix/utils.scm (gnu-triplet->nix-system): New procedure. (%current-system): New variable. * tests/utils.scm ("gnu-triplet->nix-system"): New test. * tests/derivations.scm (%current-system): Remove. Update users to use (%current-system) instead.
* Add `base16-string->bytevector'.Ludovic Courtès2012-06-09
| | | | | | * guix/utils.scm (base16-string->bytevector): New procedure. * tests/utils.scm ("bytevector->base16-string->bytevector"): New test.
* Add `base32-string->bytevector' and `nix-base32-string->bytevector'.Ludovic Courtès2012-06-09
| | | | | | | | | | | * guix/utils.scm (bytevector-quintet-set!, bytevector-quintet-set-right!, base32-string-unfold, base32-string-unfold-right, make-base32-string->bytevector, base32-string->bytevector, nix-base32-string->bytevector): New procedures. * tests/utils.scm ("base32-string->bytevector", "nix-base32-string->bytevector"): New tests.
* Allow derivations with input derivations.Ludovic Courtès2012-06-07
| | | | | | | | | | | | | | | | * guix/derivations.scm (derivation-path->output-path): New procedure. (derivation-hash): Call `memoize'. In the fixed-output case, convert HASH-ALGO to a string. In the other case, sort inputs in the alphabetical order of their hex hash. For inputs with no sub-drvs, add "out" as the sub-drv. * guix/utils.scm (%nixpkgs-directory): New parameter. (nixpkgs-derivation, memoize): New procedures. * tests/derivations.scm ("build derivation with 1 source"): Remove useless shebang. (%coreutils): New variable. ("build derivation with coreutils"): New test.
* Add `bytevector->base16-string'.Ludovic Courtès2012-06-03
| | | | * guix/utils.scm (bytevector->base16-string): New procedure.
* Fix `bytevector->nix-base32-string'.Ludovic Courtès2012-06-03
| | | | | | | | | | | | | * guix/utils.scm (bytevector-quintet-ref-right, bytevector-quintet-fold): New procedures. (bytevector-quintet-fold-right): Add `quintet-fold' parameter; use it instead of `bytevector-quintet-fold'. (bytevector->base32-string): Pass BYTEVECTOR-QUINTET-FOLD as the first parameter. (bytevector->nix-base32-string): Pass BYTEVECTOR-QUINTET-FOLD-RIGHT as the first parameter. * tests/utils.scm ("sha256 & bytevector->nix-base32-string"): New test.
* Move `sha256' to (guix utils).Ludovic Courtès2012-06-03
| | | | | * guix/derivations.scm (sha256): Move to... * guix/utils.scm (sha256): ... here.
* Add (guix utils), with `bytevector->base32-string'.Ludovic Courtès2012-06-01
* guix/utils.scm, tests/utils.scm: New files.