From f8d61d957d4a2d086f4b97f2e3d7d19d0bb35f13 Mon Sep 17 00:00:00 2001 From: Vika Date: Sun, 1 Sep 2024 18:10:26 +0300 Subject: Mesonify build This took a while and had me scratching my head often. But I managed to combine the best parts of Crane and Meson together, allowing me to have blazing fast Nix builds. This also adds initial scaffolding for gettext and other cool things. --- build.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 build.rs (limited to 'build.rs') diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..8113d1c --- /dev/null +++ b/build.rs @@ -0,0 +1,17 @@ +fn main() { + if std::env::var_os("PKGDATADIR").is_none() { + println!("cargo::rustc-env=PKGDATADIR={}", { + let mut path = std::path::PathBuf::from(std::env::var_os("OUTDIR").unwrap()); + path.push("share"); + path + }.display()) + } + + if std::env::var_os("LOCALEDIR").is_none() { + println!("cargo::rustc-env=PKGDATADIR={}", { + let mut path = std::path::PathBuf::from(std::env::var_os("OUTDIR").unwrap()); + path.push("locale"); + path + }.display()) + } +} -- cgit 1.4.1