From 67a5661a6a46f724aee29004fa3d9547d8eaabbb Mon Sep 17 00:00:00 2001 From: Karl Hallsby Date: Mon, 25 Nov 2024 14:58:39 -0600 Subject: [PATCH] octavePackages: Ensure locales are found and present in final env Add locale as buildInput to Octave packages buildEnv Some Octave packages use a Perl script to translate their documentation to other languages, which shells out to the locale program. Before, this would error every time locale was called (which is on every file), and would lead to a large number of what looked like errors being printed out. Set the path to the glibc locales using LOCALE_ARCHIVE in the makeWrapper invocation, so the wrapped program knows where to find locales for translations at run-time. --- pkgs/development/interpreters/octave/build-env.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/development/interpreters/octave/build-env.nix b/pkgs/development/interpreters/octave/build-env.nix index 8e81d7eebc38..1b5849a68eb3 100644 --- a/pkgs/development/interpreters/octave/build-env.nix +++ b/pkgs/development/interpreters/octave/build-env.nix @@ -1,5 +1,6 @@ { lib, stdenv, octave, buildEnv -, makeWrapper, texinfo +, makeWrapper +, locale, texinfo, glibcLocalesUtf8 , wrapOctave , computeRequiredOctavePackages , extraLibs ? [] @@ -20,7 +21,7 @@ in buildEnv { extraOutputsToInstall = [ "out" ] ++ extraOutputsToInstall; nativeBuildInputs = [ makeWrapper ]; - buildInputs = [ texinfo wrapOctave ]; + buildInputs = [ locale texinfo wrapOctave ]; # During "build" we must first unlink the /share symlink to octave's /share # Then, we can re-symlink the all of octave/share, except for /share/octave @@ -33,7 +34,9 @@ in buildEnv { cd "${octave}/bin" for prg in *; do if [ -x $prg ]; then - makeWrapper "${octave}/bin/$prg" "$out/bin/$prg" --set OCTAVE_SITE_INITFILE "$out/share/octave/site/m/startup/octaverc" + makeWrapper "${octave}/bin/$prg" "$out/bin/$prg" \ + --set OCTAVE_SITE_INITFILE "$out/share/octave/site/m/startup/octaverc" \ + --set LOCALE_ARCHIVE "${glibcLocalesUtf8}/lib/locale/locale-archive" fi done cd $out