From 9d0e5877bd5ad481cda3c5c04d634d6bf91c1513 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 26 Dec 2023 20:10:20 +0100 Subject: [PATCH] asset packaging --- Cargo.lock | 90 ++++++++++++++++++++++++------------------------------ flake.lock | 22 +++++++++++++ flake.nix | 25 ++++++++++++++- 3 files changed, 86 insertions(+), 51 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9856f16..5c7de43 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -131,7 +131,7 @@ checksum = "fdf6721fb0140e4f897002dd086c06f6c27775df19cfe1fccb21181a48fd2c98" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -203,7 +203,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -325,7 +325,7 @@ checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -402,7 +402,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -485,21 +485,20 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.16" +version = "0.9.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2fe95351b870527a5d09bf563ed3c97c0cffb87cf1c78a591bf48bb218d9aa" +checksum = "0e3681d554572a651dda4186cd47240627c3d0114d45a95f6ad27f2f22e7548d" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset", ] [[package]] name = "crossbeam-utils" -version = "0.8.17" +version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d96137f14f244c37f989d9fff8f95e6c18b918e71f36638f8c49112e4c78f" +checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c" dependencies = [ "cfg-if", ] @@ -601,9 +600,9 @@ dependencies = [ [[package]] name = "fdeflate" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d6dafc854908ff5da46ff3f8f473c6984119a2876a383a860246dd7841a868" +checksum = "7caf4086251adeba90011a7ff9bd1f6d7f7595be0871867daa4dbb0fcf2ca932" dependencies = [ "simd-adler32", ] @@ -739,7 +738,7 @@ dependencies = [ "inflections", "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -1171,7 +1170,7 @@ dependencies = [ "proc-macro2", "quote", "regex-syntax 0.6.29", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -1223,15 +1222,6 @@ version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] - [[package]] name = "miette" version = "5.10.0" @@ -1261,7 +1251,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -1409,14 +1399,14 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] @@ -1485,7 +1475,7 @@ dependencies = [ "regex", "regex-syntax 0.7.5", "structmeta", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -1531,7 +1521,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -1562,7 +1552,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -1608,7 +1598,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" dependencies = [ - "toml_edit 0.20.2", + "toml_edit 0.20.7", ] [[package]] @@ -1898,7 +1888,7 @@ checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -1930,7 +1920,7 @@ checksum = "3081f5ffbb02284dda55132aa26daecedd7372a42417bbbab6f14ab7d6bb9145" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -2060,7 +2050,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta-derive", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -2071,7 +2061,7 @@ checksum = "a60bcaff7397072dca0017d1db428e30d5002e00b6847703e2e42005c95fbe00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -2115,9 +2105,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.42" +version = "2.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b7d0a2c048d661a1a59fcd7355baa232f7ed34e0ee4df2eef3c1c1c0d3852d8" +checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" dependencies = [ "proc-macro2", "quote", @@ -2206,9 +2196,9 @@ dependencies = [ [[package]] name = "tf-asset-loader" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275b2de4a4f056ac6b881a3e890983911f355dfb69b0ac5ec83c3fddd886418" +checksum = "326290157536076fb15061d8c070966bc7fddc43a17c24f444cfcc4cb11ac7a1" dependencies = [ "steamlocate", "thiserror", @@ -2219,22 +2209,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.51" +version = "1.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11c217e1416d6f036b870f14e0413d480dbf28edbee1f877abaf0206af43bb7" +checksum = "83a48fd946b02c0a526b2e9481c8e2a17755e47039164a86c4070446e3a4614d" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.51" +version = "1.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01742297787513b79cf8e29d1056ede1313e2420b7b3b15d0a768b4921f549df" +checksum = "e7fbe9b594d6568a6a1443250a7e67d80b74e1e96f6d1715e1e21cc1888291d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -2300,7 +2290,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -2350,9 +2340,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.20.2" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ "indexmap", "toml_datetime", @@ -2436,7 +2426,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -2756,7 +2746,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", "wasm-bindgen-shared", ] @@ -2790,7 +2780,7 @@ checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3022,7 +3012,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] diff --git a/flake.lock b/flake.lock index 589c77c..230e869 100644 --- a/flake.lock +++ b/flake.lock @@ -64,6 +64,7 @@ "naersk": "naersk", "nixpkgs": "nixpkgs", "rust-overlay": "rust-overlay", + "steam-fetcher": "steam-fetcher", "utils": "utils" } }, @@ -90,6 +91,27 @@ "type": "github" } }, + "steam-fetcher": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1703615423, + "narHash": "sha256-LIK2g0Qo3+ykC3J8x4b/rvxoTVsJ/WA9HzfIVIHvdRE=", + "owner": "icewind1991", + "repo": "steam-fetcher", + "rev": "0eba31348de19e91ffaf375467b448f6549a7eb3", + "type": "github" + }, + "original": { + "owner": "icewind1991", + "ref": "filelist", + "repo": "steam-fetcher", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1681028828, diff --git a/flake.nix b/flake.nix index d341773..c226893 100644 --- a/flake.nix +++ b/flake.nix @@ -10,6 +10,11 @@ cross-naersk.url = "github:icewind1991/cross-naersk"; cross-naersk.inputs.nixpkgs.follows = "nixpkgs"; cross-naersk.inputs.naersk.follows = "naersk"; + steam-fetcher = { +# url = "github:nix-community/steam-fetcher/filelist"; + url = "github:icewind1991/steam-fetcher/filelist"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { @@ -19,9 +24,13 @@ naersk, rust-overlay, cross-naersk, + steam-fetcher, }: utils.lib.eachDefaultSystem (system: let - overlays = [(import rust-overlay)]; + overlays = [ + steam-fetcher.overlays.default + (import rust-overlay) + ]; pkgs = (import nixpkgs) { inherit system overlays; }; @@ -96,6 +105,20 @@ ''; buildInputs = with pkgs; [meshoptimizer]; }); + assets = pkgs.fetchSteam { + name = "tf2-vpks"; + appId = "232250"; + depotId = "232250"; + manifestId = "4816422920228384230"; # 22 December 2023 – 00:14:30 UTC + hash = "sha256-X2U7H6ydQ2z4YHjqvA6UlJp4VrECNhgoVu8OPdTsxKE="; + fileList = ["regex:(tf2|hl2)_misc.*vpk" "cp_badlands.bsp"]; + }; + server-with-assets = server.overrideAttrs (old: { + buildInputs = server.buildInputs ++ [ pkgs.makeWrapper ]; + postInstall = '' + wrapProgram "$out/bin/vbsp-server" --set TF_DIR "${assets}" + ''; + }); default = vbsp-to-gltf; };