From 4a71093841ed90f6a1d68c1627a2e8c525f7a942 Mon Sep 17 00:00:00 2001 From: Saul <47524932+spector-9@users.noreply.github.com> Date: Tue, 20 Aug 2024 17:43:49 +0530 Subject: [PATCH] Update: Add emscripten scope to packages. --- Cargo.lock | 55 +++++++++------------------------------------ libraw-sys/build.rs | 15 +++++++++---- 2 files changed, 22 insertions(+), 48 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fcf3a72..d1fe70c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -682,16 +682,6 @@ version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" -[[package]] -name = "libjpeg-sys" -version = "0.1.0" -source = "git+https://github.com/aftershootco/libjpeg-sys#602bf3541c8ac0def2c84982888e7e0b7f900d50" -dependencies = [ - "anyhow", - "cmake", - "tap", -] - [[package]] name = "libloading" version = "0.8.3" @@ -711,8 +701,6 @@ dependencies = [ "dunce", "fs_extra", "libc", - "libjpeg-sys", - "libz-sys", "openmp-sys", "pkg-config", "shellexpand", @@ -730,6 +718,7 @@ dependencies = [ "img-parts", "libc", "libraw-sys", + "rayon", "semver", "serde", "thiserror", @@ -737,6 +726,16 @@ dependencies = [ "widestring", ] +[[package]] +name = "libraw_structs" +version = "1.0.0-rc.2" +dependencies = [ + "libraw-sys", + "libraw_r", + "serde", + "serde_json", +] + [[package]] name = "libraw_wasm" version = "1.0.0-rc.2" @@ -756,17 +755,6 @@ dependencies = [ "libc", ] -[[package]] -name = "libz-sys" -version = "1.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c15da26e5af7e25c90b37a2d75cdbf940cf4a55316de9d84c679c9b8bfabf82e" -dependencies = [ - "cc", - "pkg-config", - "vcpkg", -] - [[package]] name = "linux-raw-sys" version = "0.4.13" @@ -999,15 +987,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "raw_rendering" -version = "1.0.0-rc.2" -dependencies = [ - "libraw_r", - "serde", - "serde_json", -] - [[package]] name = "rayon" version = "1.10.0" @@ -1201,12 +1180,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - [[package]] name = "tests" version = "0.1.0" @@ -1285,12 +1258,6 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "walkdir" version = "2.5.0" diff --git a/libraw-sys/build.rs b/libraw-sys/build.rs index e7d4298..950c560 100644 --- a/libraw-sys/build.rs +++ b/libraw-sys/build.rs @@ -376,8 +376,11 @@ fn build( // thread safety libraw.flag_if_supported("-pthread"); + let os = std::env::var("CARGO_CFG_TARGET_OS").unwrap(); // Add libraries - libraw.flag("-DUSE_DNGSDK"); + if os != "emscripten" { + libraw.flag("-DUSE_DNGSDK"); + } // Don't set if emscripten as rawspeed doesn't build on wasm yet //#[cfg(any( @@ -400,7 +403,8 @@ fn build( libraw.flag("-DUSE_ZLIB"); - #[cfg(all(not(target_arch = "wasm32"), not(target_os = "unknown")))] + + if os != "emscripten" { libraw.flag("-DUSE_INTOPIX_CPU_CODEC"); libraw.flag("-DIPXCPUCODEC_LIB_STATIC"); @@ -424,7 +428,9 @@ fn build( //))] //println!("cargo:rustc-link-lib=static=rawspeed"); - println!("cargo:rustc-link-lib=static=dng"); + if os != "emscripten" { + println!("cargo:rustc-link-lib=static=dng"); + } println!("cargo:rustc-link-lib=static=jxl_threads"); println!("cargo:rustc-link-lib=static=jxl"); println!("cargo:rustc-link-lib=static=jxl_cms"); @@ -437,7 +443,8 @@ fn build( println!("cargo:rustc-link-lib=static=pugixml"); println!("cargo:rustc-link-lib=static=XMP"); - #[cfg(all(not(target_arch = "wasm32"), not(target_os = "unknown")))] + + if os != "emscripten" { println!("cargo:rustc-link-lib=static=IpxCpuCodec_static"); }