From 77d16a17acd63df5e40072086ec118e59b198809 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Tue, 12 Nov 2024 19:39:00 -0500 Subject: [PATCH] cargo-i18n: fix build with newer versions of Clang MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cargo-i81n depends on the gettext-sys crate, which vendors a version of gettext that fails to build with the default Clang in nixpkgs. Using the packaged (“system”) gettext avoids the issue. --- pkgs/by-name/ca/cargo-i18n/package.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/by-name/ca/cargo-i18n/package.nix b/pkgs/by-name/ca/cargo-i18n/package.nix index 5aac2590db82..8ca8dda553d9 100644 --- a/pkgs/by-name/ca/cargo-i18n/package.nix +++ b/pkgs/by-name/ca/cargo-i18n/package.nix @@ -1,6 +1,7 @@ { lib , rustPlatform , fetchFromGitHub +, gettext }: rustPlatform.buildRustPackage rec { @@ -16,6 +17,14 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-vN62QmCuhu7AjL6xSpBU6/ul4WgNLZbjWDCFyHj6rIM="; + # Devendor gettext in the gettext-sys crate. The paths to the bin/lib/include folders have to be specified because + # setting `GETTEXT_SYSTEM` only works on some platforms (i.e., not Darwin). + env = { + GETTEXT_BIN_DIR = "${lib.getBin gettext}/bin"; + GETTEXT_LIB_DIR = "${lib.getLib gettext}/lib"; + GETTEXT_INCLUDE_DIR = "${lib.getInclude gettext}/include"; + }; + cargoTestFlags = [ "--lib" ]; meta = with lib; {