sapling: set LOCALE_ARCHIVE properly

Without this, `sl` simply fails on any non-NixOS machine with an
immediate failure, as it can't set the locale properly.

As usual, this can be fixed by setting LOCALE_ARCHIVE for glibc
explicitly. With this, `sl` works out of the box on NixOS and non-NixOS
machines.

Also add myself as a maintainer.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
This commit is contained in:
Austin Seipp 2022-11-24 20:01:33 -06:00
parent 7b3a88ed26
commit c110260568

View File

@ -1,4 +1,4 @@
{ lib, stdenv, python3Packages, fetchFromGitHub, fetchurl, sd, curl, pkg-config, openssl, rustPlatform, fetchYarnDeps, yarn, nodejs, fixup_yarn_lock }:
{ lib, stdenv, python3Packages, fetchFromGitHub, fetchurl, sd, curl, pkg-config, openssl, rustPlatform, fetchYarnDeps, yarn, nodejs, fixup_yarn_lock, glibcLocales }:
let
inherit (lib.importJSON ./deps.json) links version versionHash;
@ -85,6 +85,11 @@ let
sed -i "s|https://files.pythonhosted.org/packages/[[:alnum:]]*/[[:alnum:]]*/[[:alnum:]]*/|file://$NIX_BUILD_TOP/$sourceRoot/hack_pydeps/|g" $sourceRoot/setup.py
'';
postFixup = ''
wrapProgram $out/bin/sl \
--set LOCALE_ARCHIVE "${glibcLocales}/lib/locale/locale-archive"
'';
nativeBuildInputs = [
curl
pkg-config
@ -130,7 +135,7 @@ stdenv.mkDerivation {
description = "A Scalable, User-Friendly Source Control System";
homepage = "https://sapling-scm.com";
license = licenses.gpl2Only;
maintainers = with maintainers; [ pbar ];
maintainers = with maintainers; [ pbar thoughtpolice ];
platforms = platforms.linux;
mainProgram = "sl";
};