diff options
| -rw-r--r-- | Cargo.lock | 117 | ||||
| -rw-r--r-- | crates/throwshade/src/lib.rs | 1 | ||||
| -rw-r--r-- | flake.lock | 57 | ||||
| -rw-r--r-- | flake.nix | 159 |
4 files changed, 79 insertions, 255 deletions
@@ -20,20 +20,14 @@ checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] name = "adler2" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -250,17 +244,17 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", - "miniz_oxide 0.7.4", + "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -491,19 +485,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] -name = "color-eyre" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55146f5e46f237f7423d74111267d4597b59b0dad0ffaf7303bce9945d843ad5" -dependencies = [ - "backtrace", - "eyre", - "indenter", - "once_cell", - "owo-colors", -] - -[[package]] name = "color_quant" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -572,19 +553,6 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "core-graphics" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "core-graphics-types", - "foreign-types 0.3.2", - "libc", -] - -[[package]] -name = "core-graphics" version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" @@ -708,7 +676,7 @@ checksum = "0c87e182de0887fd5361989c677c4e8f5000cd9491d6d563161a8f3a5519fc7f" [[package]] name = "directories" version = "6.0.0" -source = "git+https://github.com/lcolonq/teleia#7407dc2a99ce74ae733c350ad239d2a4017e0684" +source = "git+https://github.com/lcolonq/teleia#22fbeca88a781aca7bcc965ac8189244497671d6" dependencies = [ "dirs-sys", ] @@ -840,7 +808,7 @@ dependencies = [ "bit_field", "half", "lebe", - "miniz_oxide 0.8.4", + "miniz_oxide", "rayon-core", "smallvec", "zune-inflate", @@ -853,16 +821,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af9673d8203fcb076b19dfd17e38b3d4ae9f44959416ea532ce72415a6020365" [[package]] -name = "eyre" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" -dependencies = [ - "indenter", - "once_cell", -] - -[[package]] name = "fastrand" version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -884,7 +842,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", - "miniz_oxide 0.8.4", + "miniz_oxide", ] [[package]] @@ -1046,9 +1004,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glam" @@ -1062,7 +1020,7 @@ dependencies = [ [[package]] name = "glfw" version = "0.59.0" -source = "git+https://github.com/lcolonq/teleia#7407dc2a99ce74ae733c350ad239d2a4017e0684" +source = "git+https://github.com/lcolonq/teleia#22fbeca88a781aca7bcc965ac8189244497671d6" dependencies = [ "bitflags 1.3.2", "objc2 0.5.2", @@ -1104,7 +1062,7 @@ dependencies = [ [[package]] name = "gltf" version = "1.4.1" -source = "git+https://github.com/lcolonq/teleia#7407dc2a99ce74ae733c350ad239d2a4017e0684" +source = "git+https://github.com/lcolonq/teleia#22fbeca88a781aca7bcc965ac8189244497671d6" dependencies = [ "base64 0.13.1", "byteorder", @@ -1118,7 +1076,7 @@ dependencies = [ [[package]] name = "gltf-derive" version = "1.4.1" -source = "git+https://github.com/lcolonq/teleia#7407dc2a99ce74ae733c350ad239d2a4017e0684" +source = "git+https://github.com/lcolonq/teleia#22fbeca88a781aca7bcc965ac8189244497671d6" dependencies = [ "inflections", "proc-macro2", @@ -1129,7 +1087,7 @@ dependencies = [ [[package]] name = "gltf-json" version = "1.4.1" -source = "git+https://github.com/lcolonq/teleia#7407dc2a99ce74ae733c350ad239d2a4017e0684" +source = "git+https://github.com/lcolonq/teleia#22fbeca88a781aca7bcc965ac8189244497671d6" dependencies = [ "gltf-derive", "serde", @@ -1497,12 +1455,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0263a3d970d5c054ed9312c0057b4f3bde9c0b33836d3637361d4a9e6e7a408" [[package]] -name = "indenter" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" - -[[package]] name = "indexmap" version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1783,15 +1735,6 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "miniz_oxide" version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3b1c9bd4fe1f0f8b387f6eb9eb3b4a1aa26185e5750efb9140301703f62cd1b" @@ -1818,17 +1761,6 @@ dependencies = [ ] [[package]] -name = "mouse_position" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824feb0675ad2ffda7b1da534f394c5779fb39d123b5f376a221d50fad54b3c2" -dependencies = [ - "core-graphics 0.22.3", - "winapi", - "x11-dl", -] - -[[package]] name = "native-tls" version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2037,9 +1969,9 @@ checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" [[package]] name = "object" -version = "0.32.2" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] @@ -2142,12 +2074,6 @@ dependencies = [ ] [[package]] -name = "owo-colors" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" - -[[package]] name = "parking_lot" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2210,7 +2136,7 @@ dependencies = [ "crc32fast", "fdeflate", "flate2", - "miniz_oxide 0.8.4", + "miniz_oxide", ] [[package]] @@ -2490,7 +2416,6 @@ dependencies = [ "lazy_static", "lexpr", "log", - "mouse_position", "polling", "rand", "strum", @@ -3126,12 +3051,12 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "teleia" version = "0.1.0" -source = "git+https://github.com/lcolonq/teleia#7407dc2a99ce74ae733c350ad239d2a4017e0684" +source = "git+https://github.com/lcolonq/teleia#22fbeca88a781aca7bcc965ac8189244497671d6" dependencies = [ + "anyhow", "bimap", "bitflags 2.8.0", "bytes", - "color-eyre", "console_error_panic_hook", "console_log", "directories", @@ -4150,7 +4075,7 @@ dependencies = [ "calloop", "cfg_aliases", "core-foundation", - "core-graphics 0.23.2", + "core-graphics", "cursor-icon", "icrate", "js-sys", diff --git a/crates/throwshade/src/lib.rs b/crates/throwshade/src/lib.rs index 7fffa37..f6ee8a6 100644 --- a/crates/throwshade/src/lib.rs +++ b/crates/throwshade/src/lib.rs @@ -36,7 +36,6 @@ impl ThrowShade { } cfg_if::cfg_if! { - if #[cfg(target_arch = "wasm32")] { struct Game { throwshade: ThrowShade, @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1739898326, - "narHash": "sha256-CqRBf9MKC8eiwDRg9akoWia57Nsjmq3S++YbkmT6p9M=", + "lastModified": 1742143293, + "narHash": "sha256-8oKPsMlqlOQ7qnTWvhBEcfVFY1WqHIcSilGVtaLAquw=", "owner": "ipetkov", "repo": "crane", - "rev": "680a2b47cdef830bca3edfd53383e3292154ba7b", + "rev": "de3bb0155823298161c1c0a7805f10d4b4074bbb", "type": "github" }, "original": { @@ -20,11 +20,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -35,11 +35,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1739482815, - "narHash": "sha256-/5Lwtmp/8j+ro32gXzitucSdyjJ6QehfJCL58WNA7N0=", + "lastModified": 1741865919, + "narHash": "sha256-4thdbnP6dlbdq+qZWTsm4ffAwoS8Tiq1YResB+RP6WE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ba0939c506a03c60a765cd7f7c43794816540eec", + "rev": "573c650e8a14b2faa0041645ab18aed7e60f0c9a", "type": "github" }, "original": { @@ -51,25 +51,27 @@ }, "root": { "inputs": { - "crane": "crane", - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs", - "rust-overlay": "rust-overlay", - "st": "st" + "nixpkgs": [ + "teleia", + "nixpkgs" + ], + "st": "st", + "teleia": "teleia" } }, "rust-overlay": { "inputs": { "nixpkgs": [ + "teleia", "nixpkgs" ] }, "locked": { - "lastModified": 1739673031, - "narHash": "sha256-Z/GT8ebbvc4goxN4A0A5ACj26G1HaGJO+VetrPuC5Mo=", + "lastModified": 1742178793, + "narHash": "sha256-S2onMdoDS4tIYd3/Jc5oFEZBr2dJOgPrh9KzSO/bfDw=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "538528d55318e0c8af1c307dcf10b7629b988fc3", + "rev": "954582a766a50ebef5695a9616c93b5386418c08", "type": "github" }, "original": { @@ -112,6 +114,27 @@ "repo": "default", "type": "github" } + }, + "teleia": { + "inputs": { + "crane": "crane", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1742199860, + "narHash": "sha256-5rPgk2mxhpZwu1wbgdmflwGvsMlLvi8v+KOSmV2POos=", + "owner": "lcolonq", + "repo": "teleia", + "rev": "f22253a2f71e9d1c059c98d5ce3259184830703a", + "type": "github" + }, + "original": { + "owner": "lcolonq", + "repo": "teleia", + "type": "github" + } } }, "root": "root", @@ -1,151 +1,28 @@ { inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - crane = { - url = "github:ipetkov/crane"; - }; - flake-utils.url = "github:numtide/flake-utils"; - rust-overlay = { - url = "github:oxalica/rust-overlay"; - inputs = { - nixpkgs.follows = "nixpkgs"; - }; - }; + teleia.url = "github:lcolonq/teleia"; + nixpkgs.follows = "teleia/nixpkgs"; st = { url = "github:lcolonq/st"; inputs.nixpkgs.follows = "nixpkgs"; }; }; - outputs = { self, nixpkgs, ... }@inputs: - inputs.flake-utils.lib.eachDefaultSystem (system: - let - pkgs = import nixpkgs { - inherit system; - overlays = [ (import inputs.rust-overlay) ]; - }; - inherit (pkgs) lib; - - native = rec { - rustToolchain = pkgs.rust-bin.stable.latest.default.override { - targets = [ "x86_64-unknown-linux-gnu" ]; - }; - craneLib = (inputs.crane.mkLib pkgs).overrideToolchain rustToolchain; - src = lib.cleanSourceWith { - src = ./.; - filter = path: type: - (lib.hasSuffix "\.html" path) || - (lib.hasSuffix "\.js" path) || - (lib.hasSuffix "\.css" path) || - (lib.hasInfix "/assets/" path) || - (craneLib.filterCargoSources path type) - ; - }; - nativeBuildInputs = [ - pkgs.pkg-config - ]; - buildInputs = [ - pkgs.openssl.dev - pkgs.glfw - pkgs.xorg.libX11 - pkgs.xorg.libXcursor - pkgs.xorg.libXi - pkgs.xorg.libXrandr - pkgs.xorg.libXinerama - pkgs.libxkbcommon - pkgs.xorg.libxcb - pkgs.libglvnd - pkgs.alsa-lib - ]; - commonArgs = { - inherit src nativeBuildInputs buildInputs; - strictDeps = true; - CARGO_BUILD_TARGET = "x86_64-unknown-linux-gnu"; - inherit (craneLib.crateNameFromCargoToml { inherit src; }) version; - }; - cargoArtifacts = craneLib.buildDepsOnly (commonArgs // { - doCheck = false; - }); - renderer = craneLib.buildPackage (commonArgs // { - inherit cargoArtifacts; - cargoExtraArgs = "-p renderer"; - }); - }; - - wasm = rec { - rustToolchain = pkgs.rust-bin.stable.latest.default.override { - targets = [ "wasm32-unknown-unknown" ]; - }; - craneLib = (inputs.crane.mkLib pkgs).overrideToolchain rustToolchain; - src = lib.cleanSourceWith { - src = ./.; - filter = path: type: - (lib.hasSuffix "\.html" path) || - (lib.hasSuffix "\.js" path) || - (lib.hasSuffix "\.css" path) || - (lib.hasInfix "/assets/" path) || - (craneLib.filterCargoSources path type) - ; - }; - commonArgs = { - inherit src; - strictDeps = true; - CARGO_BUILD_TARGET = "wasm32-unknown-unknown"; - buildInputs = []; - inherit (craneLib.crateNameFromCargoToml { inherit src; }) version; - wasm-bindgen-cli = pkgs.buildWasmBindgenCli rec { - src = pkgs.fetchCrate { - pname = "wasm-bindgen-cli"; - version = "0.2.100"; - hash = "sha256-3RJzK7mkYFrs7C/WkhW9Rr4LdP5ofb2FdYGz1P7Uxog="; - }; - cargoDeps = pkgs.rustPlatform.fetchCargoVendor { - inherit src; - inherit (src) pname version; - hash = "sha256-qsO12332HSjWCVKtf1cUePWWb9IdYUmT+8OPj/XP2WE="; - }; - }; - }; - throwshade = craneLib.buildTrunkPackage (commonArgs // rec { - pname = "throwshade"; - cargoExtraArgs = "-p throwshade"; - cargoArtifacts = craneLib.buildDepsOnly (commonArgs // { - inherit cargoExtraArgs; - doCheck = false; - }); - preBuild = '' - cd ./crates/throwshade - ''; - postBuild = '' - mv ./dist ../.. - cd ../.. - ''; - }); - }; - in - { - packages = { - inherit native wasm; - st = inputs.st.packages.x86_64-linux.st; - }; + outputs = inputs@{ self, nixpkgs, ... }: + let + system = "x86_64-linux"; + native = { + renderer = inputs.teleia.native.build ./. "renderer"; + }; + wasm = { + throwshade = inputs.teleia.wasm.build ./. "throwshade"; + }; + in { + packages.${system} = { + inherit native wasm; + st = inputs.st.packages.x86_64-linux.st; + }; - devShells.default = native.craneLib.devShell { - packages = native.nativeBuildInputs ++ native.buildInputs ++ [ - pkgs.trunk - pkgs.rust-analyzer - pkgs.glxinfo - pkgs.cmake - ]; - LD_LIBRARY_PATH = "$LD_LIBRARY_PATH:${ - pkgs.lib.makeLibraryPath [ - pkgs.xorg.libX11 - pkgs.xorg.libXcursor - pkgs.xorg.libXi - pkgs.libxkbcommon - pkgs.xorg.libxcb - pkgs.libglvnd - ] - }"; - }; - }); + devShells.${system}.default = inputs.teleia.shell; + }; } |
