/* GNU Guix --- Functional package management for GNU Copyright 1996-1997,2000-2001,2006,2008,2011,2013,2018,2020,2021 Free Software Foundation, Inc. Copyright (C) 2020 Ludovic Courtès This file is part of GNU Guix. GNU Guix is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. GNU Guix is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Guix. If not, see . */ /* This file implements a variant of the 'guile' executable that does not complain about locale issues and arranges to reduce startup time by ignoring GUILE_LOAD_PATH and GUILE_LOAD_COMPILED_PATH until it has booted. */ #include #include #include #include /* Saved values of GUILE_LOAD_PATH and GUILE_LOAD_COMPILED_PATH. */ static const char *load_path, *load_compiled_path; static void inner_main (void *unused, int argc, char **argv) { if (load_path != NULL) { setenv ("GUILE_LOAD_PATH", load_path, 1); SCM load_path_var = scm_c_public_lookup ("guile", "%load-path"); SCM addition = scm_parse_path (scm_from_locale_string (load_path), SCM_EOL); scm_variable_set_x (load_path_var, scm_append (scm_list_2 (scm_variable_ref (load_path_var), addition))); } if (load_compiled_path != NULL) { setenv ("GUILE_LOAD_COMPILED_PATH", load_compiled_path, 1); SCM load_compiled_path_var = scm_c_public_lookup ("guile", "%load-compiled-path"); SCM addition = scm_parse_path (scm_from_locale_string (load_compiled_path), SCM_EOL); scm_variable_set_x (load_compiled_path_var, scm_append (scm_list_2 (scm_variable_ref (load_compiled_path_var), addition))); } scm_shell (argc, argv); } int main (int argc, char **argv) { /* Try to install the current locale; remain silent if it fails. */ if (setlocale (LC_ALL, "") == NULL) /* The 'guix pull'-provided 'guix' includes at least en_US.utf8 so use that. That gives us UTF-8 support for 'scm_to_locale_string', etc., which is always preferable over the C locale. */ setlocale (LC_ALL, "en_US.utf8"); const char *str; str = getenv ("GUILE_LOAD_PATH"); load_path = str != NULL ? strdup (str) : NULL; str = getenv ("GUILE_LOAD_COMPILED_PATH"); load_compiled_path = str ? strdup (str) : NULL; unsetenv ("GUILE_LOAD_PATH"); unsetenv ("GUILE_LOAD_COMPILED_PATH"); #if !SCM_ENABLE_MINI_GMP /* XXX: On Guile < 3.0.6 and Guile built without its bundled mini-GMP, do not let GMP allocate via libgc as this can lead to memory corruption in GnuTLS/Nettle since Nettle also uses GMP: . */ scm_install_gmp_memory_functions = 0; #endif scm_boot_guile (argc, argv, inner_main, 0); return 0; /* never reached */ } b-format-options): New variable. (show-deb-format-options, show-deb-format-options/detailed): New procedures. (%options): Register new options. (show-help): Augment with new usage. (guix-pack): Validate and propagate new argument values. * doc/guix.texi (Invoking guix pack)[deb]: Document how to list advanced options. Add an example. * tests/pack.scm (deb archive...): Provide extra-options to the debian-archive procedure, and validate that the provided files are embedded in the pack. Maxim Cournoyer 2021-07-11pack: Adjust test to earlier <compressor> changes....This is a followup to 5a0997ef7f3968d216328b8c63a6e36dd29a5ab8, which broke the "self-contained tarball" test. * tests/pack.scm (%gzip-compressor): Add 'list' in third field. Ludovic Courtès 2021-06-29pack: Add support for the deb format....* .dir-locals.el (scheme-mode)[gexp->derivation]: Define indentation rule. * guix/scripts/pack.scm (debian-archive): New procedure. (%formats): Register the new deb format. (show-formats): Add it to the usage string. * tests/pack.scm (%ar-bootstrap): New variable. (deb archive with symlinks): New test. * doc/guix.texi (Invoking guix pack): Document it. * NEWS: Add news entry. Maxim Cournoyer 2021-06-29tests: pack: Fix compressor extension....* tests/pack.scm (%gzip-compressor): Add the missing leading period to the gzip compressor file extension. Maxim Cournoyer 2020-07-20pack: Build the store database under a UTF-8 locale....Fixes <https://bugs.gnu.org/42389>. Reported by branjam4@gmail.com. * guix/scripts/pack.scm (store-database)[build]: Add calls to 'setenv' and 'setlocale'. * tests/pack.scm ("self-contained-tarball + localstatedir, UTF-8 file names"): New test. Ludovic Courtès 2020-07-20pack: 'self-contained-tarball' runs derivation in a UTF-8local....* guix/scripts/pack.scm (self-contained-tarball) [set-utf8-locale]: New variable. [build]: Use it. * tests/pack.scm ("self-contained-tarball"): Use a <profile> record instead of 'profile-derivation'. Ludovic Courtès 2019-12-26gnu: Remove squashfs-tools-next....* gnu/packages/compression.scm (squashfs-tools-next): Remove variable. * guix/scripts/pack.scm (squashfs-image, guix-pack): Use squashfs-tools. * tests/pack.scm: Use squashfs-tools. Ricardo Wurmus