Set up a flake command for the l10n-codegen-rust

This commit is contained in:
Savanni D'Gerinel 2024-03-10 14:56:13 -04:00
parent 30198f0038
commit 8ceca454b1
6 changed files with 123 additions and 10 deletions

4
Cargo.lock generated
View File

@ -2710,10 +2710,6 @@ dependencies = [
"tokio",
]
[[package]]
name = "kifu-l10n"
version = "0.1.0"
[[package]]
name = "kv-log-macro"
version = "1.0.7"

View File

@ -2249,6 +2249,25 @@ rec {
"arbitrary" = [ "dep:arbitrary" ];
};
};
"convert_case" = rec {
crateName = "convert_case";
version = "0.6.0";
edition = "2018";
sha256 = "1jn1pq6fp3rri88zyw6jlhwwgf6qiyc08d6gjv0qypgkl862n67c";
authors = [
"Rutrum <dave@rutrum.net>"
];
dependencies = [
{
name = "unicode-segmentation";
packageId = "unicode-segmentation";
}
];
features = {
"rand" = [ "dep:rand" ];
"random" = [ "rand" ];
};
};
"cookie" = rec {
crateName = "cookie";
version = "0.17.0";
@ -8793,6 +8812,18 @@ rec {
crateName = "l10n";
version = "0.1.0";
edition = "2021";
crateBin = [
{
name = "codegen-rust";
path = "src/bin/codegen-rust.rs";
requiredFeatures = [ ];
}
{
name = "msggen";
path = "src/bin/msggen.rs";
requiredFeatures = [ ];
}
];
# We can't filter paths with references in Nix 2.4
# See https://github.com/NixOS/nix/issues/5410
src = if ((lib.versionOlder builtins.nixVersion "2.4pre20211007") || (lib.versionOlder "2.5" builtins.nixVersion ))
@ -8807,6 +8838,10 @@ rec {
name = "chrono-tz";
packageId = "chrono-tz";
}
{
name = "convert_case";
packageId = "convert_case";
}
{
name = "fixed_decimal";
packageId = "fixed_decimal";
@ -8816,6 +8851,10 @@ rec {
name = "fluent";
packageId = "fluent";
}
{
name = "fluent-ergonomics";
packageId = "fluent-ergonomics";
}
{
name = "icu";
packageId = "icu";
@ -8828,10 +8867,23 @@ rec {
name = "icu_provider";
packageId = "icu_provider";
}
{
name = "serde";
packageId = "serde 1.0.193";
features = [ "derive" ];
}
{
name = "serde_yaml";
packageId = "serde_yaml";
}
{
name = "sys-locale";
packageId = "sys-locale";
}
{
name = "unic-langid";
packageId = "unic-langid";
}
];
};
@ -13177,6 +13229,38 @@ rec {
}
];
};
"serde_yaml" = rec {
crateName = "serde_yaml";
version = "0.9.29";
edition = "2021";
sha256 = "0aci065jjqjwxn4qm27r4li20w1wfdd6vgx0j34affgrdgv0wpm1";
authors = [
"David Tolnay <dtolnay@gmail.com>"
];
dependencies = [
{
name = "indexmap";
packageId = "indexmap";
}
{
name = "itoa";
packageId = "itoa";
}
{
name = "ryu";
packageId = "ryu";
}
{
name = "serde";
packageId = "serde 1.0.193";
}
{
name = "unsafe-libyaml";
packageId = "unsafe-libyaml";
}
];
};
"sgf" = rec {
crateName = "sgf";
@ -16157,6 +16241,17 @@ rec {
}
];
};
"unsafe-libyaml" = rec {
crateName = "unsafe-libyaml";
version = "0.2.10";
edition = "2021";
crateBin = [];
sha256 = "0jsyc1kqc536wpgx1js61lwj86crniqw16lyvh02va4m1f9r0k5b";
authors = [
"David Tolnay <dtolnay@gmail.com>"
];
};
"url 1.7.2" = rec {
crateName = "url";

View File

@ -20,7 +20,6 @@ members = [
"ifc",
"kifu/core",
"kifu/gtk",
"kifu/l10n",
"l10n",
"memorycache",
"nom-training",

View File

@ -86,6 +86,17 @@
file-service = cargo_nix.workspaceMembers.file-service.build;
fitnesstrax = cargo_nix.workspaceMembers.fitnesstrax.build;
kifu-gtk = cargo_nix.workspaceMembers.kifu-gtk.build;
l10n = cargo_nix.workspaceMembers.l10n.build;
l10n-codegen-rust = pkgs.stdenv.mkDerivation {
name = "l10n-codegen-rust";
src = ./.;
buildInputs = [ l10n ];
installPhase = ''
mkdir -p $out/bin
cp ${l10n}/bin/codegen-rust $out/bin/l10n-codegen-rust
'';
};
xdg-test = cargo_nix.workspaceMembers.xdg-test.build;
all = pkgs.symlinkJoin {
@ -95,7 +106,9 @@
dashboard
file-service
fitnesstrax
kifu-gtk
# kifu-gtk
l10n
l10n-codegen-rust
xdg-test
];
};

View File

@ -4,4 +4,11 @@ fn main() {
"gresources.xml",
"com.luminescent-dreams.kifu-gtk.gresource",
);
let messages = std::process::Command::new("codegen-rust")
.arg("messages/en.yaml")
.output()
.expect("Failed to execute command");
println!("{}", String::from_utf8(messages.stdout).unwrap());
}

View File

@ -6,17 +6,20 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
chrono = { version = "0.4" }
chrono-tz = { version = "0.8" }
chrono = { version = "0.4" }
convert_case = { version = "0.6" }
fixed_decimal = { version = "0.5.5", features = [ "ryu" ] }
fluent = { version = "0.16" }
fluent-ergonomics = { path = "../fluent-ergonomics" }
icu = { version = "1" }
fluent = { version = "0.16" }
icu_locid = { version = "1" }
icu_provider = { version = "1" }
serde = { version = "1" }
icu = { version = "1" }
serde = { version = "1", features = [ "derive" ] }
serde_yaml = { version = "0.9" }
sys-locale = { version = "0.3" }
unic-langid = { version = "*" }
[[bin]]
name = "codegen-rust"
src = "src/bin/codegen-rust.rs"