Unverified Commit 77d16a17 authored by Randy Eckenrode's avatar Randy Eckenrode
Browse files

cargo-i18n: fix build with newer versions of Clang

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.
parent 47ad8bbe
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
{ 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; {