summaryrefslogtreecommitdiff
path: root/games/veloren-weekly/files/patch-shaderc
blob: 94b0989d62a58254d59d237ba2b22f9d6e71c30d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
This file is in the public domain.
https://github.com/google/shaderc-rs/issues/62

- Restore system shaderc support
- Detect system shaderc on BSDs

--- Cargo.lock.orig	2024-02-07 19:13:27 UTC
+++ Cargo.lock
@@ -5792,8 +5792,9 @@ dependencies = [
 
 [[package]]
 name = "shaderc"
-version = "0.8.0"
-source = "git+https://github.com/pythonesque/shaderc-rs?rev=f2605a02062834019bedff911aee2fd2998c49f9#f2605a02062834019bedff911aee2fd2998c49f9"
+version = "0.8.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "27e07913ada18607bb60d12431cbe3358d3bbebbe95948e1618851dc01e63b7b"
 dependencies = [
  "libc",
  "shaderc-sys",
@@ -5801,8 +5802,9 @@ dependencies = [
 
 [[package]]
 name = "shaderc-sys"
-version = "0.8.0"
-source = "git+https://github.com/pythonesque/shaderc-rs?rev=f2605a02062834019bedff911aee2fd2998c49f9#f2605a02062834019bedff911aee2fd2998c49f9"
+version = "0.8.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "73120d240fe22196300f39ca8547ca2d014960f27b19b47b21288b396272f7f7"
 dependencies = [
  "cmake",
  "libc",
--- voxygen/Cargo.toml.orig	2025-08-14 15:14:34 UTC
+++ voxygen/Cargo.toml
@@ -36,7 +36,6 @@ egui-ui = ["voxygen-egui", "egui", "egui_wgpu_backend"
 # enables heap profiling with tracy
 plugins = ["client/plugins", "server/plugins", "anim/plugins", "common/plugins"]
 egui-ui = ["voxygen-egui", "egui", "egui_wgpu_backend", "egui_winit_platform"]
-shaderc-from-source = ["shaderc/build-from-source"]
 discord = ["discord-sdk"]
 bin_cmd_doc_gen = []
 
@@ -48,7 +47,7 @@ default-publish = [
     "discord",
     "simd",
 ]
-default = ["default-publish", "hot-reloading", "shaderc-from-source", "egui-ui"]
+default = ["default-publish", "hot-reloading", "egui-ui"]
 
 [dependencies]
 client = { package = "veloren-client", path = "../client" }
@@ -71,9 +70,7 @@ bytemuck = { version = "1.7", features = ["derive"] }
 wgpu = { version = "24", default-features = false, features = ["spirv", "glsl"] }
 wgpu-profiler = "0.22.0"
 bytemuck = { version = "1.7", features = ["derive"] }
-# shaderc = "0.8.0"
-# Working around a current bug in shaderc that causes it to use the system installation even if we specify compile from source
-shaderc = { git = "https://github.com/pythonesque/shaderc-rs", rev = "f2605a02062834019bedff911aee2fd2998c49f9" }
+shaderc = "0.8.0"
 
 # Ui
 conrod_core = { git = "https://gitlab.com/veloren/conrod.git", branch = "copypasta_0.7" }
--- cargo-crates/shaderc-sys-0.8.3/build/build.rs.orig	1970-01-01 00:00:00 UTC
+++ cargo-crates/shaderc-sys-0.8.3/build/build.rs
@@ -309,10 +309,13 @@ fn main() {
             }
         } {
             match (target_os.as_str(), target_env.as_str()) {
-                ("linux", _) => {
+                ("linux", _) | ("dragonfly", _) | ("freebsd", _) | ("netbsd", _) | ("openbsd", _) => {
                     println!("cargo:rustc-link-search=native={search_dir_str}");
                     println!("cargo:rustc-link-lib={lib_kind}={lib_name}");
-                    println!("cargo:rustc-link-lib=dylib=stdc++");
+                    println!("cargo:rustc-link-lib=dylib={}", match target_os.as_str() {
+                        "freebsd" | "openbsd" => "c++",
+                        _ => "stdc++",
+                    });
                     return;
                 }
                 ("windows", "msvc") => {
@@ -395,8 +398,8 @@ fn emit_std_cpp_link() {
     let target_env = env::var("CARGO_CFG_TARGET_ENV").unwrap();
 
     match (target_os.as_str(), target_env.as_str()) {
-        ("linux", _) | ("windows", "gnu") => println!("cargo:rustc-link-lib=dylib=stdc++"),
-        ("macos", _) => println!("cargo:rustc-link-lib=dylib=c++"),
+        ("linux", _) | ("dragonfly", _) | ("netbsd", _) | ("windows", "gnu") => println!("cargo:rustc-link-lib=dylib=stdc++"),
+        ("macos", _) | ("freebsd", _) | ("openbsd", _) => println!("cargo:rustc-link-lib=dylib=c++"),
         _ => {}
     }
 }