Skip to content

Commit 67a5661

Browse files
committed
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.
1 parent e2f8979 commit 67a5661

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pkgs/development/interpreters/octave/build-env.nix

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{ lib, stdenv, octave, buildEnv
2-
, makeWrapper, texinfo
2+
, makeWrapper
3+
, locale, texinfo, glibcLocalesUtf8
34
, wrapOctave
45
, computeRequiredOctavePackages
56
, extraLibs ? []
@@ -20,7 +21,7 @@ in buildEnv {
2021
extraOutputsToInstall = [ "out" ] ++ extraOutputsToInstall;
2122

2223
nativeBuildInputs = [ makeWrapper ];
23-
buildInputs = [ texinfo wrapOctave ];
24+
buildInputs = [ locale texinfo wrapOctave ];
2425

2526
# During "build" we must first unlink the /share symlink to octave's /share
2627
# Then, we can re-symlink the all of octave/share, except for /share/octave
@@ -33,7 +34,9 @@ in buildEnv {
3334
cd "${octave}/bin"
3435
for prg in *; do
3536
if [ -x $prg ]; then
36-
makeWrapper "${octave}/bin/$prg" "$out/bin/$prg" --set OCTAVE_SITE_INITFILE "$out/share/octave/site/m/startup/octaverc"
37+
makeWrapper "${octave}/bin/$prg" "$out/bin/$prg" \
38+
--set OCTAVE_SITE_INITFILE "$out/share/octave/site/m/startup/octaverc" \
39+
--set LOCALE_ARCHIVE "${glibcLocalesUtf8}/lib/locale/locale-archive"
3740
fi
3841
done
3942
cd $out

0 commit comments

Comments
 (0)