diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 46e722d..f53f5c0 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -102,7 +102,11 @@ jobs: shell: bash - name: Build for x86_64 - run: cargo build --release + run: | + cargo build --release + mv target/relase/jstation-controller target/release/jstation-controller-wgpu + cargo build --release --features glow + mv target/relase/jstation-controller target/release/jstation-controller-glow - name: Build for aarch64 run: | @@ -111,6 +115,9 @@ jobs: export MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx11.1 --show-sdk-platform-version) echo "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET" cargo build --release --target=aarch64-apple-darwin + mv target/aarch64-apple-darwin/relase/jstation-controller target/aarch64-apple-darwin/release/jstation-controller-wgpu + cargo build --release --target=aarch64-apple-darwin --features glow + mv target/aarch64-apple-darwin/relase/jstation-controller target/aarch64-apple-darwin/release/jstation-controller-glow env: DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer shell: bash @@ -123,7 +130,8 @@ jobs: mkdir -p temp/${{ env.app_variant }} cp README.md temp/${{ env.app_variant }}/ cargo-about generate -o temp/${{ env.app_variant }}/LICENSES.html about.hbs - lipo target/release/${APP_NAME} target/aarch64-apple-darwin/release/${APP_NAME} -output temp/${{ env.app_variant }}/${APP_NAME} -create + lipo target/release/${APP_NAME}-wgpu target/aarch64-apple-darwin/release/${APP_NAME}-wgpu -output temp/${{ env.app_variant }}/${APP_NAME}-wgpu -create + lipo target/release/${APP_NAME}-glow target/aarch64-apple-darwin/release/${APP_NAME}-glow -output temp/${{ env.app_variant }}/${APP_NAME}-glow -create mkdir -p packages cd packages TAR=${{ env.app_variant }}.tar.gz diff --git a/Cargo.lock b/Cargo.lock index f57c242..bfd5dc5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -511,6 +511,15 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cgl" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ced0551234e87afee12411d535648dd89d2e7f34c78b753395567aff3d447ff" +dependencies = [ + "libc", +] + [[package]] name = "clipboard-win" version = "4.5.0" @@ -1319,12 +1328,35 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +[[package]] +name = "gl_generator" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" +dependencies = [ + "khronos_api", + "log", + "xml-rs", +] + [[package]] name = "glam" version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "518faa5064866338b013ff9b2350dc318e14cc4fcd6cb8206d7e7c9886c98815" +[[package]] +name = "glow" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8bd5877156a19b8ac83a29b2306fe20537429d318f3ff0a1a2119f8d9c61919" +dependencies = [ + "js-sys", + "slotmap", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "glow" version = "0.12.3" @@ -1337,6 +1369,83 @@ dependencies = [ "web-sys", ] +[[package]] +name = "glow_glyph" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f4e62c64947b9a24fe20e2bba9ad819ecb506ef5c8df7ffc4737464c6df9510" +dependencies = [ + "bytemuck", + "glow 0.11.2", + "glyph_brush", + "log", +] + +[[package]] +name = "glutin" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "444c9ad294fdcaf20ccf6726b78f380b5450275540c9b68ab62f49726ad1c713" +dependencies = [ + "cgl", + "cocoa 0.24.1", + "core-foundation", + "glutin_egl_sys", + "glutin_gles2_sys", + "glutin_glx_sys", + "glutin_wgl_sys", + "libloading 0.7.4", + "log", + "objc", + "once_cell", + "osmesa-sys", + "parking_lot 0.12.1", + "raw-window-handle 0.5.2", + "wayland-client 0.29.5", + "wayland-egl", + "winapi", + "winit", +] + +[[package]] +name = "glutin_egl_sys" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68900f84b471f31ea1d1355567eb865a2cf446294f06cef8d653ed7bcf5f013d" +dependencies = [ + "gl_generator", + "winapi", +] + +[[package]] +name = "glutin_gles2_sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8094e708b730a7c8a1954f4f8a31880af00eb8a1c5b5bf85d28a0a3c6d69103" +dependencies = [ + "gl_generator", + "objc", +] + +[[package]] +name = "glutin_glx_sys" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d93d0575865098580c5b3a423188cd959419912ea60b1e48e8b3b526f6d02468" +dependencies = [ + "gl_generator", + "x11-dl", +] + +[[package]] +name = "glutin_wgl_sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3da5951a1569dbab865c6f2a863efafff193a93caf05538d193e9e3816d21696" +dependencies = [ + "gl_generator", +] + [[package]] name = "glyph_brush" version = "0.7.8" @@ -1500,6 +1609,8 @@ checksum = "efbddf356d01e9d41cd394a9d04d62bfd89650a30f12fda5839cabb8c4591c88" dependencies = [ "iced_core", "iced_futures", + "iced_glow", + "iced_glutin", "iced_graphics", "iced_native", "iced_wgpu", @@ -1514,6 +1625,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "354827beea5d8f08a51a331dee4af146737ec4f253d0c67bcf525ea662d345f6" dependencies = [ "iced_core", + "iced_glow", "iced_graphics", "iced_native", "iced_wgpu", @@ -1543,6 +1655,35 @@ dependencies = [ "wasm-timer", ] +[[package]] +name = "iced_glow" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adc5b081015f5c75777c96ad75e2288916e7d444c97396d6d136517877ef9129" +dependencies = [ + "bytemuck", + "euclid", + "glow 0.11.2", + "glow_glyph", + "glyph_brush", + "iced_graphics", + "iced_native", + "log", +] + +[[package]] +name = "iced_glutin" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c427ca018d29508512581d832fbaa7b6c8ec34c39d438f35f59e363a6419953" +dependencies = [ + "glutin", + "iced_graphics", + "iced_native", + "iced_winit", + "log", +] + [[package]] name = "iced_graphics" version = "0.8.0" @@ -1741,6 +1882,12 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "khronos_api" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" + [[package]] name = "lazy_static" version = "1.4.0" @@ -2212,6 +2359,15 @@ dependencies = [ "num-traits", ] +[[package]] +name = "osmesa-sys" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88cfece6e95d2e717e0872a7f53a8684712ad13822a7979bc760b9c77ec0013b" +dependencies = [ + "shared_library", +] + [[package]] name = "ouroboros" version = "0.13.0" @@ -2763,6 +2919,16 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "shared_library" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" +dependencies = [ + "lazy_static", + "libc", +] + [[package]] name = "signal-hook-registry" version = "1.4.1" @@ -3296,6 +3462,16 @@ dependencies = [ "xcursor", ] +[[package]] +name = "wayland-egl" +version = "0.29.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "402de949f81a012926d821a2d659f930694257e76dd92b6e0042ceb27be4107d" +dependencies = [ + "wayland-client 0.29.5", + "wayland-sys 0.29.5", +] + [[package]] name = "wayland-protocols" version = "0.29.5" @@ -3451,7 +3627,7 @@ dependencies = [ "d3d12", "foreign-types 0.3.2", "fxhash", - "glow", + "glow 0.12.3", "gpu-alloc", "gpu-allocator", "gpu-descriptor", diff --git a/Cargo.toml b/Cargo.toml index 06824d8..7978c60 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ bitflags = "2.4" env_logger = "0.11" flume = "0.11" iced = { version = "0.9", features = [ "smol" ] } -iced_audio = "0.12" +iced_audio = { version = "0.12", default-features = false } iced_lazy = "0.6.1" iced_native = "0.10.3" jstation_derive = { path = "jstation_derive" } @@ -27,5 +27,10 @@ smallvec = { version = "1.10", features = [ "union" ] } smol = "1.3" thiserror = "1.0" +[features] +default = ["wgpu"] +wgpu = ["iced/wgpu", "iced_audio/wgpu"] +glow = ["iced/glow", "iced_audio/glow"] + [profile.release] lto = true diff --git a/deny.toml b/deny.toml index 87f00ec..dc5c380 100644 --- a/deny.toml +++ b/deny.toml @@ -4,6 +4,7 @@ allow = [ "BSD-2-Clause", "BSD-3-Clause", "BSL-1.0", + "CC0-1.0", "ISC", "MIT", "MIT-0",