fix build

This commit is contained in:
2025-12-03 02:03:11 -05:00
parent d641610fbf
commit cef372377b
4 changed files with 61 additions and 57 deletions

View File

@@ -9,13 +9,21 @@
inputs.nixpkgs.follows = "nixpkgs";
};
simon-egui = {
url = "github:Titaniumtown/egui/b63c21d70150f1b414370f0f9a8af56e886662f4";
url = "github:Titaniumtown/egui/217d3f250c499ae88c02930b26cacb945c4a2369";
flake = false;
};
};
outputs = { self, nixpkgs, flake-utils, rust-overlay, simon-egui }:
flake-utils.lib.eachDefaultSystem (system:
outputs =
{
self,
nixpkgs,
flake-utils,
rust-overlay,
simon-egui,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
@@ -23,7 +31,7 @@
};
# Use nightly rust with wasm32 target
rustToolchain = pkgs.rust-bin.nightly."2025-05-01".default.override {
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
targets = [ "wasm32-unknown-unknown" ];
};
@@ -32,28 +40,6 @@
rustc = rustToolchain;
};
# Build wasm-bindgen-cli matching the version in Cargo.lock (0.2.106)
wasm-bindgen-cli = rustPlatform.buildRustPackage rec {
pname = "wasm-bindgen-cli";
version = "0.2.106";
src = pkgs.fetchCrate {
inherit pname version;
hash = "sha256-M6WuGl7EruNopHZbqBpucu4RWz44/MSdv6f0zkYw+44=";
};
cargoHash = "sha256-ElDatyOwdKwHg3bNH/1pcxKI7LXkhsotlDPQjiLHBwA=";
nativeBuildInputs = [ pkgs.pkg-config ];
buildInputs = [ pkgs.openssl ] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
pkgs.curl
pkgs.darwin.apple_sdk.frameworks.Security
];
# Tests require network access
doCheck = false;
};
# Create a combined source with the main project and dependencies
combinedSrc = pkgs.stdenv.mkDerivation {
name = "ytbn-combined-src";
@@ -125,9 +111,9 @@
src = ./.;
nativeBuildInputs = [
nativeBuildInputs = with pkgs; [
wasm-bindgen-cli
pkgs.binaryen
binaryen
];
buildPhase = ''
@@ -211,14 +197,17 @@
zstd
];
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (with pkgs; [
libxkbcommon
libGL
wayland
xorg.libX11
xorg.libXcursor
xorg.libXi
]);
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (
with pkgs;
[
libxkbcommon
libGL
wayland
xorg.libX11
xorg.libXcursor
xorg.libXi
]
);
};
}
);