aboutsummaryrefslogtreecommitdiff
path: root/guix/utils.scm
Commit message (Collapse)AuthorAge
* utils: Don’t re-export ‘call-with-temporary-output-file’.Ludovic Courtès2024-04-15
| | | | | | | | | | | | * guix/utils.scm: Remove re-export of ‘call-with-temporary-output-file’. Autoload a number of modules. * guix/download.scm, guix/import/hackage.scm, guix/import/hexpm.scm, guix/import/opam.scm, guix/import/pypi.scm, tests/cpio.scm, tests/egg.scm, tests/opam.scm, tests/publish.scm, tests/store-database.scm, tests/utils.scm: Adjust imports accordingly. Change-Id: I3f5e94631397996a30be2ea4ff8b50a3371e8ee7
* utils: Add find-definition-insertion-location procedure.Herman Rimm2024-02-23
| | | | | | | | | * guix/utils.scm (find-definition-insertion-location): Add and export procedure. * tests/utils.scm ("find-definition-insertion-location"): Add test. Change-Id: Ie17e1b4a94790f58518ce121411a38d357f49feb Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* utils: Add insert-expression procedure.Herman Rimm2024-02-23
| | | | | | | | | | * guix/utils.scm (define-module): Use (guix read-print) and export (insert-expression). (insert-expression): Add procedure. * tests/utils.scm ("insert-expression"): Add test. Change-Id: I971a43a78aa6ecaaef33c1a7a0db4b287eb85036 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* gnu: Add target-x32?.Efraim Flashner2024-01-04
| | | | | | | * guix/utils.scm (target-x32?): New procedure. Change-Id: Ia16c7edce64de01d5ccb126c7bd9a6736f327b5f Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
* gnu: Add support for x86_64-linux-gnux32.Efraim Flashner2024-01-04
| | | | | | | | | | | | | * gnu/packages/bootstrap.scm (glibc-dynamic-linker): Add entry for x86_64-linux-gnux32. * gnu/packages/gcc.scm (gcc-configure-flags-for-triplet): Add configure-flag for x86_64-linux-gnux32. * guix/platforms/x86.scm (x86_64-linux-gnux32): New variable. * guix/utils.scm (gnu-triplet->nix-system): Force x86_64-linux-gnux32 to output a different nix-system than x86_64-linux-gnu. Change-Id: I519fea2f8357e4b9895ede05fe8a5e373e9b034a Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
* guix: Add target-avr?.Jean-Pierre De Jesus DIAZ2023-12-11
| | | | | | | | * guix/utils.scm (target-avr?): New procedure. * tests/utils.scm: Add tests for target-avr? procedure. Change-Id: Iaa0fa97a2b6bc45d45f907f43157f1548a0ba3fa Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
* utils: Add 'strip-for-target'.Zheng Junjie2023-10-26
| | | | | | * guix/utils.scm (strip-for-target): New procedure. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
* gnu: Use target-hurd?, system-hurd? instead of hurd-target?, hurd-system?.Janneke Nieuwenhuizen2023-06-17
| | | | | | | | * gnu/packages/hurd.scm (hurd-target?): Remove. (hurd-system?): Move to... * guix/utils.scm (system-hurd?): ...here. * gnu/packages/*: Update all users, removing (gnu packages hurd) include where now unused.
* Merge remote-tracking branch 'origin/master' into core-updatesAndreas Enge2023-03-20
|\
| * guix: Strip #:use-module lists.Ludovic Courtès2023-03-13
| | | | | | | | | | | | | | | | | | | | | | | | This was obtained by setting up this environment: guix shell -D guix --with-input=guile@3.0.9=guile-next \ --with-commit=guile-next=e2ed33ef0445c867fe56c247054aa67e834861f2 -- make -j5 then adding 'unused-module' to (@@ (guix build compiler) %warnings), building, and checking all the "unused module" warnings and removing those that were definitely unused.
* | Merge remote-tracking branch 'savannah/master' into core-updatesChristopher Baines2023-03-02
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: gnu/local.mk gnu/packages/autotools.scm gnu/packages/cmake.scm gnu/packages/gnuzilla.scm gnu/packages/haskell.scm gnu/packages/pdf.scm gnu/packages/python-xyz.scm gnu/packages/samba.scm gnu/packages/tex.scm gnu/packages/tls.scm gnu/packages/wxwidgets.scm
| * utils: Add target-little-endian?.Philip McGrath2023-02-11
| | | | | | | | | | | | | | | | * guix/utils.scm (target-little-endian?): New function. * guix/build-system/meson.scm (make-machine-alist): Use it. * gnu/packages/chez.scm (nix-system->pbarch-machine-type): Likewise. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* | Merge branch 'staging' into core-updatesMarius Bakke2022-08-11
|\|
| * utils: Add target-mips64el?.Vivien Kraus2022-08-05
| | | | | | | | | | | | | | * guix/utils.scm (target-mips64el?): New function. It detects whether the target system is mips64el. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
| * utils: Add as-for-target.Antero Mejr2022-08-05
| | | | | | | | | | | | * guix/utils.scm (as-for-target): New function. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* | Merge branch 'staging' into core-updatesMarius Bakke2022-07-22
|\|
| * home: Add -I, --list-installed option.Antero Mejr2022-07-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * guix/scripts/package.scm (list-installed): New procedure. * guix/scripts/home.scm (%options, show-help): Add '--list-installed'. (process-command): For 'describe' and 'list-generations', honor the 'list-installed option. (display-home-environment-generation): Add #:list-installed-regex and honor it. (list-generations): Likewise. * guix/scripts/utils.scm (pretty-print-table): New argument "left-pad". * doc/guix.texi (Invoking Guix Home): Add information and example for --list-installed flag. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* | Merge branch 'master' into core-updatesMarius Bakke2022-06-27
|\|
| * utils: Define 'target-x86?' predicate.Denis 'GNUtoo' Carikli2022-06-24
| | | | | | | | | | | | * guix/utils.scm (target-x86?): New predicate. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
* | utils: Move switch-symlinks to (guix build utils).Arun Isaac2022-06-25
|/ | | | | | | | | * guix/utils.scm (switch-symlinks): Move to ... * guix/build/utils.scm (switch-symlinks): ... here. * guix/profiles.scm, guix/scripts/home.scm, guix/scripts/package.scm: Import switch-symlinks from (guix build utils). * guix/scripts/system/reconfigure.scm (switch-system-program): Import (guix build utils) in G-expression.
* ui: Improve pager selection logic when less is not installed.Taiju HIGASHI2022-06-16
| | | | | | | | | | | | | | | | * guix/ui.scm (find-available-pager): New procedure. (call-with-paginated-output-port): Use it. * guix/utils.scm (call-with-environment-variables): Allow clearing of specified environment variables. * tests/ui.scm (make-empty-file, assert-equals-find-available-pager): New procedures. ("find-available-pager, GUIX_PAGER takes precedence") ("find-available-pager, PAGER takes precedence") ("find-available-pager, 'less' takes precedence") ("find-available-pager, 'more' takes precedence") ("find-available-pager, no pager"): New tests. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* utils: Add a %guix-source-root-directory procedure.Maxim Cournoyer2022-05-31
| | | | * guix/utils.scm (%guix-source-root-directory): New procedure.
* utils: Add a 'delete-expression' procedure.Maxim Cournoyer2022-05-31
| | | | | | | * guix/utils.scm: Fix copyright lines and order imports. (edit-expression): Fix typo in doc. Add a new 'include-trailing-newline?' keyword argument. Update doc. (delete-expression): New procedure.
* utils: Add ar-for-target and ld-for-target procedures.Maxim Cournoyer2022-03-18
| | | | * guix/utils.scm (ar-for-target, ld-for-target): New procedures.
* utils: 'edit-expression' reads and conses less when not modifying.Ludovic Courtès2022-01-26
| | | | | * guix/utils.scm (edit-expression): Delay call to 'get-bytevector-all' until after (string=? str* str).
* gnu: bootstrap: Add support for riscv64-linux.Efraim Flashner2022-01-14
| | | | | | | | | | | | | | | | | | | | | | | | | | On 7d93b21ab1c132990054372a9677c1639d54e631 gnu: glibc-for-bootstrap: Update patch. Run ./pre-inst-env guix build --target=riscv64-linux-gnu bootstrap-tarballs Producing /gnu/store/4hdzva9i0wyyfbgj1lmqc1wkk644pv07-bootstrap-tarballs-0 With guix hash -rx 1nj0fdgj08bbmfny01mp2blv7c3p2iciqh31zmf04ap5s7ygsqlp * gnu/packages/bootstrap.scm (%bootstrap-executables): Add entries for riscv64-linux. (%bootstrap-guile-hash, %bootstrap-coreutils&co, %bootstrap-binutils, %bootstrap-glibc, %bootstrap-gcc): Add entry for riscv64-linux. (raw-build-guile3): New procedure. (make-raw-bag): Use raw-build-guile3 for riscv64-linux. * guix/packages.scm (%supported-systems): Add riscv64-linux. (%cuirass-supported-systems): Remove riscv64-linux. * guix/utils.scm (target-64bit?): Add riscv64-linux. * m4/guix.m4: Add riscv64-linux as a supported system. * doc/guix.texi (GNU Distribution): Add riscv64-linux.
* utils: Fix URL in comment.Tobias Geerinckx-Rice2021-12-30
| | | | * guix/utils.scm (target-x86-32?): Fix Wikipedia URL.
* utils: Define 'target-riscv64?' predicate.Efraim Flashner2021-10-10
| | | | * guix/utils.scm (target-riscv64?): New predicate.
* utils: Define target-ppc64le? predicate.Efraim Flashner2021-08-17
| | | | * guix/utils.scm (target-ppc64le?): New predicate.
* utils: Define 'target-ppc32?' predicate.Efraim Flashner2021-08-17
| | | | * guix/utils.scm (target-ppc32?): New predicate.
* Merge branch 'master' into core-updates-frozenMarius Bakke2021-07-29
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: gnu/packages/bioinformatics.scm gnu/packages/cmake.scm gnu/packages/curl.scm gnu/packages/emacs-xyz.scm gnu/packages/gpodder.scm gnu/packages/music.scm gnu/packages/patches/glibc-bootstrap-system.patch gnu/packages/python-xyz.scm gnu/packages/shells.scm gnu/packages/statistics.scm
| * utils: Do not request block buffering in pretty-print-table.Maxim Cournoyer2021-07-21
| | | | | | | | | | | | | | | | | | | | Re-testing 'guix package -A' using the default line buffering set in (guix ui), there doesn't seem to be a performance gain to use block buffering, so remove this extraneous side effect. * guix/utils.scm (pretty-print-table): Do not set buffering mode to block. Reported-by: Ludovic Courtès <ludo@gnu.org>
* | Merge branch 'master' into core-updatesLudovic Courtès2021-07-18
|\|
| * utils: Add a procedure for pretty printing tabular data.Steve Sprang2021-07-15
| | | | | | | | | | | | | | * guix/utils.scm (pretty-print-table): New procedure. Co-authored-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
* | utils: Define a target-x86-32? and target-x86-64? predicate.Maxime Devos2021-07-14
| | | | | | | | | | | | | | * guix/utils.scm (target-x86-32?, target-x86-64?): New predicates. * tests/utils.scm ("target-x86-32?", "target-x86-64?"): New tests. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
* | utils: Give 'target-mingw?' a docstring.Maxime Devos2021-07-14
| | | | | | | | | | | | | | | | | | | | target-hurd? and target-linux? have docstrings, but target-mingw? doesn't. * guix/utils.scm (target-mingw?): Add a docstring. Reported-By: Mathieu Othacehe <othacehe@gnu.org> Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
* | utils: Define 'target-hurd?' predicate.Maxime Devos2021-07-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It behaves similarily to the other target-...? procedures. The usage of hurd-triplet? / target-hurd? in libgc appears incorrect to me, as (%current-system) is normally never false. * gnu/packages/hurd.scm (hurd-triplet?): Move to ... * guix/util.scm (target-hurd?): ... here, let its argument default to (%current-target-system) or (%current-system), and write a docstring. * gnu/packages/hurd.scm (hurd-target?, hurd-system?): Use target-hurd? instead of hurd-triplet?. * gnu/packages/bdw-gc.scm (libgc): Likewise. * gnu/packages/cross-base.scm (cross-libc)[arguments]<#:configure-flags>: Likewise. (cross-libc)[arguments]<#:phases>: Likewise. (cross-libc)[arguments]<#:native-inputs>: Likewise. * gnu/packages/make-boostrap.scm (%glibc-stripped)[inputs]: Likewise. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
* | utils: Define 'target-linux?' predicate.Maxime Devos2021-07-14
| | | | | | | | | | | | | | | | | | * guix/utils.scm (target-linux?): New predicate. * tests/utils.scm ("target-linux?"): Test it. ("target-mingw?"): Also test ‘target-mingw?’. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
* | utils: 'edit-expression' copies part of the original source map.Ludovic Courtès2021-07-11
| | | | | | | | | | | | | | * guix/utils.scm (source-location-key/stamp): New procedure. (go-to-location): Use it. (move-source-location-map!): New procedure. (edit-expression): Call it.
* | utils: 'edit-expression' modifies the file only if necessary.Ludovic Courtès2021-07-11
| | | | | | | | * guix/utils.scm (edit-expression): Check whether STR* equals STR.
* | utils: Add 'go-to-location' with source location caching.Ludovic Courtès2021-07-11
| | | | | | | | | | | | | | | | * guix/utils.scm (%source-location-map): New variable. (go-to-location): New procedure. (edit-expression): Use it instead of custom loop. * guix/packages.scm (package-field-location)[goto]: Remove. Use 'go-to-location' instead of 'goto'.
* | utils: 'edit-expression' no longer leaks file ports.Ludovic Courtès2021-07-11
| | | | | | | | | | * guix/utils.scm (edit-expression): Use 'call-with-input-file' to make sure IN gets closed.
* | Merge remote-tracking branch 'origin/master' into core-updatesEfraim Flashner2021-04-16
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: gnu/local.mk gnu/packages/boost.scm gnu/packages/chez.scm gnu/packages/compression.scm gnu/packages/crates-io.scm gnu/packages/docbook.scm gnu/packages/engineering.scm gnu/packages/gcc.scm gnu/packages/gl.scm gnu/packages/gtk.scm gnu/packages/nettle.scm gnu/packages/python-check.scm gnu/packages/python-xyz.scm gnu/packages/radio.scm gnu/packages/rust.scm gnu/packages/sqlite.scm guix/build-system/node.scm
| * utils: 'tarball-sans-extension' recognizes ".tgz".Ludovic Courtès2021-04-05
| | | | | | | | * guix/utils.scm (tarball-sans-extension): Add ".tgz".
* | Merge remote-tracking branch 'origin/master' into core-updatesEfraim Flashner2021-03-24
|\|
| * utils: Fix target-64bit? on powerpc64le-linux.Chris Marusich2021-03-23
| | | | | | | | | | * guix/utils.scm (target-64bit?): Change the string from "ppc64" to "powerpc64", which matches Guix system names like "powerpc64le-linux".
| * utils: Add target-powerpc? procedure.Chris Marusich2021-03-23
| | | | | | | | * guix/utils.scm (target-powerpc?): New exported procedure.
| * utils: Use Guile-zlib for gzip compression and decompression.Ludovic Courtès2021-03-12
| | | | | | | | | | | | | | | | | | | | Fixes <https://bugs.gnu.org/46967>. * guix/utils.scm (decompressed-port): Call 'make-zlib-input-port' instead of invoking %GZIP. (compressed-output-port): Call 'make-zlib-output-port' instead of invoking %GZIP. * doc/guix.texi (Requirements): Require Guile-zlib >= 0.1.0.
* | Merge branch 'master' into core-updatesDanny Milosavljevic2021-02-11
|\|
| * utils: Add string distance.zimoun2021-02-03
| | | | | | | | | | | | | | | | * guix/utils.scm (string-distance): New procedure. (string-closest): New procedure. * tests/utils.scm ("string-distance", "string-closest"): New tests. Signed-off-by: Ludovic Courtès <ludo@gnu.org>