mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-10 06:55:10 +00:00
77d16a17ac
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.
38 lines
1.1 KiB
Nix
38 lines
1.1 KiB
Nix
{ lib
|
|
, rustPlatform
|
|
, fetchFromGitHub
|
|
, gettext
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "cargo-i18n";
|
|
version = "0.2.13";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "kellpossible";
|
|
repo = "cargo-i18n";
|
|
rev = "v${version}";
|
|
hash = "sha256-azwQlXsoCgNB/TjSBBE+taUR1POBJXaPnS5Sr+HVR90=";
|
|
};
|
|
|
|
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; {
|
|
description = "Rust Cargo sub-command and libraries to extract and build localization resources to embed in your application/library";
|
|
homepage = "https://github.com/kellpossible/cargo-i18n";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ xrelkd ];
|
|
mainProgram = "cargo-i18n";
|
|
};
|
|
}
|