Set up a flake command for the l10n-codegen-rust
This commit is contained in:
parent
30198f0038
commit
8ceca454b1
|
@ -2710,10 +2710,6 @@ dependencies = [
|
||||||
"tokio",
|
"tokio",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "kifu-l10n"
|
|
||||||
version = "0.1.0"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "kv-log-macro"
|
name = "kv-log-macro"
|
||||||
version = "1.0.7"
|
version = "1.0.7"
|
||||||
|
|
95
Cargo.nix
95
Cargo.nix
|
@ -2249,6 +2249,25 @@ rec {
|
||||||
"arbitrary" = [ "dep:arbitrary" ];
|
"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 {
|
"cookie" = rec {
|
||||||
crateName = "cookie";
|
crateName = "cookie";
|
||||||
version = "0.17.0";
|
version = "0.17.0";
|
||||||
|
@ -8793,6 +8812,18 @@ rec {
|
||||||
crateName = "l10n";
|
crateName = "l10n";
|
||||||
version = "0.1.0";
|
version = "0.1.0";
|
||||||
edition = "2021";
|
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
|
# We can't filter paths with references in Nix 2.4
|
||||||
# See https://github.com/NixOS/nix/issues/5410
|
# See https://github.com/NixOS/nix/issues/5410
|
||||||
src = if ((lib.versionOlder builtins.nixVersion "2.4pre20211007") || (lib.versionOlder "2.5" builtins.nixVersion ))
|
src = if ((lib.versionOlder builtins.nixVersion "2.4pre20211007") || (lib.versionOlder "2.5" builtins.nixVersion ))
|
||||||
|
@ -8807,6 +8838,10 @@ rec {
|
||||||
name = "chrono-tz";
|
name = "chrono-tz";
|
||||||
packageId = "chrono-tz";
|
packageId = "chrono-tz";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
name = "convert_case";
|
||||||
|
packageId = "convert_case";
|
||||||
|
}
|
||||||
{
|
{
|
||||||
name = "fixed_decimal";
|
name = "fixed_decimal";
|
||||||
packageId = "fixed_decimal";
|
packageId = "fixed_decimal";
|
||||||
|
@ -8816,6 +8851,10 @@ rec {
|
||||||
name = "fluent";
|
name = "fluent";
|
||||||
packageId = "fluent";
|
packageId = "fluent";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
name = "fluent-ergonomics";
|
||||||
|
packageId = "fluent-ergonomics";
|
||||||
|
}
|
||||||
{
|
{
|
||||||
name = "icu";
|
name = "icu";
|
||||||
packageId = "icu";
|
packageId = "icu";
|
||||||
|
@ -8828,10 +8867,23 @@ rec {
|
||||||
name = "icu_provider";
|
name = "icu_provider";
|
||||||
packageId = "icu_provider";
|
packageId = "icu_provider";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
name = "serde";
|
||||||
|
packageId = "serde 1.0.193";
|
||||||
|
features = [ "derive" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "serde_yaml";
|
||||||
|
packageId = "serde_yaml";
|
||||||
|
}
|
||||||
{
|
{
|
||||||
name = "sys-locale";
|
name = "sys-locale";
|
||||||
packageId = "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 {
|
"sgf" = rec {
|
||||||
crateName = "sgf";
|
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 {
|
"url 1.7.2" = rec {
|
||||||
crateName = "url";
|
crateName = "url";
|
||||||
|
|
|
@ -20,7 +20,6 @@ members = [
|
||||||
"ifc",
|
"ifc",
|
||||||
"kifu/core",
|
"kifu/core",
|
||||||
"kifu/gtk",
|
"kifu/gtk",
|
||||||
"kifu/l10n",
|
|
||||||
"l10n",
|
"l10n",
|
||||||
"memorycache",
|
"memorycache",
|
||||||
"nom-training",
|
"nom-training",
|
||||||
|
|
15
flake.nix
15
flake.nix
|
@ -86,6 +86,17 @@
|
||||||
file-service = cargo_nix.workspaceMembers.file-service.build;
|
file-service = cargo_nix.workspaceMembers.file-service.build;
|
||||||
fitnesstrax = cargo_nix.workspaceMembers.fitnesstrax.build;
|
fitnesstrax = cargo_nix.workspaceMembers.fitnesstrax.build;
|
||||||
kifu-gtk = cargo_nix.workspaceMembers.kifu-gtk.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;
|
xdg-test = cargo_nix.workspaceMembers.xdg-test.build;
|
||||||
|
|
||||||
all = pkgs.symlinkJoin {
|
all = pkgs.symlinkJoin {
|
||||||
|
@ -95,7 +106,9 @@
|
||||||
dashboard
|
dashboard
|
||||||
file-service
|
file-service
|
||||||
fitnesstrax
|
fitnesstrax
|
||||||
kifu-gtk
|
# kifu-gtk
|
||||||
|
l10n
|
||||||
|
l10n-codegen-rust
|
||||||
xdg-test
|
xdg-test
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,4 +4,11 @@ fn main() {
|
||||||
"gresources.xml",
|
"gresources.xml",
|
||||||
"com.luminescent-dreams.kifu-gtk.gresource",
|
"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());
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,17 +6,20 @@ edition = "2021"
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
chrono = { version = "0.4" }
|
|
||||||
chrono-tz = { version = "0.8" }
|
chrono-tz = { version = "0.8" }
|
||||||
|
chrono = { version = "0.4" }
|
||||||
convert_case = { version = "0.6" }
|
convert_case = { version = "0.6" }
|
||||||
fixed_decimal = { version = "0.5.5", features = [ "ryu" ] }
|
fixed_decimal = { version = "0.5.5", features = [ "ryu" ] }
|
||||||
fluent = { version = "0.16" }
|
|
||||||
fluent-ergonomics = { path = "../fluent-ergonomics" }
|
fluent-ergonomics = { path = "../fluent-ergonomics" }
|
||||||
icu = { version = "1" }
|
fluent = { version = "0.16" }
|
||||||
icu_locid = { version = "1" }
|
icu_locid = { version = "1" }
|
||||||
icu_provider = { version = "1" }
|
icu_provider = { version = "1" }
|
||||||
serde = { version = "1" }
|
icu = { version = "1" }
|
||||||
|
serde = { version = "1", features = [ "derive" ] }
|
||||||
serde_yaml = { version = "0.9" }
|
serde_yaml = { version = "0.9" }
|
||||||
sys-locale = { version = "0.3" }
|
sys-locale = { version = "0.3" }
|
||||||
unic-langid = { version = "*" }
|
unic-langid = { version = "*" }
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "codegen-rust"
|
||||||
|
src = "src/bin/codegen-rust.rs"
|
||||||
|
|
Loading…
Reference in New Issue