summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2026-04-23 02:40:08 -0400
committerLLLL Colonq <llll@colonq>2026-04-23 02:40:08 -0400
commit2070ee9b704e0a80f486ef45b4b0fc61d7826229 (patch)
treefa0b490634c07d2c7edbb7c098cffda47cdc0668
parent9d2f27b2a9346467a8e5efa8f12e4ea075d3d777 (diff)
Update
-rw-r--r--crates/teleia/build.rs9
-rw-r--r--flake.nix8
2 files changed, 16 insertions, 1 deletions
diff --git a/crates/teleia/build.rs b/crates/teleia/build.rs
index 0233021..f08efa4 100644
--- a/crates/teleia/build.rs
+++ b/crates/teleia/build.rs
@@ -1,3 +1,12 @@
fn main() {
+ match &*std::env::var("CARGO_CFG_TARGET_ARCH").unwrap() {
+ "x86_64" => if let Ok(p) = std::env::var("LIBCOLONQ_PIT_NATIVE") {
+ println!("cargo::rustc-link-search={}", p);
+ },
+ "wasm32" => if let Ok(p) = std::env::var("LIBCOLONQ_PIT_WASM") {
+ println!("cargo::rustc-link-search={}", p);
+ },
+ _ => eprintln!("warning: building for unknown architecture!"),
+ }
println!("cargo::rustc-link-lib=static=colonq-pit");
}
diff --git a/flake.nix b/flake.nix
index a5456e1..1bbdeae 100644
--- a/flake.nix
+++ b/flake.nix
@@ -45,6 +45,9 @@
postPatch = "true";
});
+ LIBCOLONQ_PIT_NATIVE="${inputs.pit.packages.x86_64-linux.default}/lib";
+ LIBCOLONQ_PIT_WASM="${inputs.pit.packages.x86_64-linux.wasm}/lib";
+
native = rec {
nativeBuildInputs = [
pkgs.pkg-config
@@ -61,7 +64,6 @@
pkgs.xorg.libxcb
pkgs.libglvnd
pkgs.alsa-lib
- inputs.pit.packages.x86_64-linux.default
];
deps = path: nm:
let
@@ -77,6 +79,7 @@
};
commonArgs = {
inherit src nativeBuildInputs buildInputs;
+ inherit LIBCOLONQ_PIT_NATIVE;
strictDeps = true;
CARGO_BUILD_TARGET = "x86_64-unknown-linux-gnu";
CARGO_BUILD_RUSTFLAGS="-L ${glfw}/lib";
@@ -101,6 +104,7 @@
};
commonArgs = {
inherit src nativeBuildInputs buildInputs;
+ inherit LIBCOLONQ_PIT_NATIVE;
strictDeps = true;
CARGO_BUILD_TARGET = "x86_64-unknown-linux-gnu";
CARGO_BUILD_RUSTFLAGS="-L ${glfw}/lib";
@@ -133,6 +137,7 @@
};
commonArgs = {
inherit src;
+ inherit LIBCOLONQ_PIT_WASM;
strictDeps = true;
CARGO_BUILD_TARGET = "wasm32-unknown-unknown";
buildInputs = [];
@@ -230,6 +235,7 @@
LIBRARY_PATH = "$LIBRARY_PATH:${pkgs.lib.makeLibraryPath native.buildInputs}";
RUSTFLAGS="-L ${glfw}/lib";
LD_LIBRARY_PATH = "$LD_LIBRARY_PATH:${pkgs.lib.makeLibraryPath native.buildInputs}";
+ inherit LIBCOLONQ_PIT_NATIVE LIBCOLONQ_PIT_WASM;
};
in {
inherit shell native wasm windows;