···23232424 patches = [
2525 ./darwin-remove-impure-links.patch
2626+ # The default behavior is to use the statically linked Raylib libraries,
2727+ # but GLFW still attempts to load Xlib at runtime, which won't normally be
2828+ # available on Nix based systems. Instead, use the "system" Raylib version,
2929+ # which can be provided by a pure Nix expression, for example in a shell.
3030+ ./system-raylib.patch
2631 ];
2732 postPatch = ''
3333+ rm -r vendor/raylib/{linux,macos,macos-arm64,wasm,windows}
3434+2835 patchShebangs --build build_odin.sh
2936 '';
3037···8087 mainProgram = "odin";
8188 maintainers = with lib.maintainers; [
8289 astavie
9090+ diniamo
8391 ];
8492 platforms = lib.platforms.unix;
8593 broken = stdenv.hostPlatform.isMusl;
+141
pkgs/by-name/od/odin/system-raylib.patch
···11+diff --git a/vendor/raylib/raygui.odin b/vendor/raylib/raygui.odin
22+index 559437a60..cd31fbe43 100644
33+--- a/vendor/raylib/raygui.odin
44++++ b/vendor/raylib/raygui.odin
55+@@ -2,34 +2,7 @@ package raylib
66+77+ import "core:c"
88+99+-RAYGUI_SHARED :: #config(RAYGUI_SHARED, false)
1010+-RAYGUI_WASM_LIB :: #config(RAYGUI_WASM_LIB, "wasm/libraygui.a")
1111+-
1212+-when ODIN_OS == .Windows {
1313+- foreign import lib {
1414+- "windows/rayguidll.lib" when RAYGUI_SHARED else "windows/raygui.lib",
1515+- }
1616+-} else when ODIN_OS == .Linux {
1717+- foreign import lib {
1818+- "linux/libraygui.so" when RAYGUI_SHARED else "linux/libraygui.a",
1919+- }
2020+-} else when ODIN_OS == .Darwin {
2121+- when ODIN_ARCH == .arm64 {
2222+- foreign import lib {
2323+- "macos-arm64/libraygui.dylib" when RAYGUI_SHARED else "macos-arm64/libraygui.a",
2424+- }
2525+- } else {
2626+- foreign import lib {
2727+- "macos/libraygui.dylib" when RAYGUI_SHARED else "macos/libraygui.a",
2828+- }
2929+- }
3030+-} else when ODIN_ARCH == .wasm32 || ODIN_ARCH == .wasm64p32 {
3131+- foreign import lib {
3232+- RAYGUI_WASM_LIB,
3333+- }
3434+-} else {
3535+- foreign import lib "system:raygui"
3636+-}
3737++foreign import lib "system:raygui"
3838+3939+ RAYGUI_VERSION :: "4.0"
4040+4141+diff --git a/vendor/raylib/raylib.odin b/vendor/raylib/raylib.odin
4242+index 02bb6deea..0df93009b 100644
4343+--- a/vendor/raylib/raylib.odin
4444++++ b/vendor/raylib/raylib.odin
4545+@@ -99,42 +99,7 @@ MAX_TEXT_BUFFER_LENGTH :: #config(RAYLIB_MAX_TEXT_BUFFER_LENGTH, 1024)
4646+4747+ #assert(size_of(rune) == size_of(c.int))
4848+4949+-RAYLIB_SHARED :: #config(RAYLIB_SHARED, false)
5050+-RAYLIB_WASM_LIB :: #config(RAYLIB_WASM_LIB, "wasm/libraylib.a")
5151+-
5252+-when ODIN_OS == .Windows {
5353+- @(extra_linker_flags="/NODEFAULTLIB:" + ("msvcrt" when RAYLIB_SHARED else "libcmt"))
5454+- foreign import lib {
5555+- "windows/raylibdll.lib" when RAYLIB_SHARED else "windows/raylib.lib" ,
5656+- "system:Winmm.lib",
5757+- "system:Gdi32.lib",
5858+- "system:User32.lib",
5959+- "system:Shell32.lib",
6060+- }
6161+-} else when ODIN_OS == .Linux {
6262+- foreign import lib {
6363+- // Note(bumbread): I'm not sure why in `linux/` folder there are
6464+- // multiple copies of raylib.so, but since these bindings are for
6565+- // particular version of the library, I better specify it. Ideally,
6666+- // though, it's best specified in terms of major (.so.4)
6767+- "linux/libraylib.so.550" when RAYLIB_SHARED else "linux/libraylib.a",
6868+- "system:dl",
6969+- "system:pthread",
7070+- }
7171+-} else when ODIN_OS == .Darwin {
7272+- foreign import lib {
7373+- "macos/libraylib.550.dylib" when RAYLIB_SHARED else "macos/libraylib.a",
7474+- "system:Cocoa.framework",
7575+- "system:OpenGL.framework",
7676+- "system:IOKit.framework",
7777+- }
7878+-} else when ODIN_ARCH == .wasm32 || ODIN_ARCH == .wasm64p32 {
7979+- foreign import lib {
8080+- RAYLIB_WASM_LIB,
8181+- }
8282+-} else {
8383+- foreign import lib "system:raylib"
8484+-}
8585++foreign import lib "system:raylib"
8686+8787+ VERSION_MAJOR :: 5
8888+ VERSION_MINOR :: 5
8989+diff --git a/vendor/raylib/rlgl/rlgl.odin b/vendor/raylib/rlgl/rlgl.odin
9090+index 6ac19695d..78a483a59 100644
9191+--- a/vendor/raylib/rlgl/rlgl.odin
9292++++ b/vendor/raylib/rlgl/rlgl.odin
9393+@@ -112,47 +112,12 @@ import rl "../."
9494+9595+ VERSION :: "5.0"
9696+9797+-RAYLIB_SHARED :: #config(RAYLIB_SHARED, false)
9898+-RAYLIB_WASM_LIB :: #config(RAYLIB_WASM_LIB, "../wasm/libraylib.a")
9999+-
100100+ // Note: We pull in the full raylib library. If you want a truly stand-alone rlgl, then:
101101+ // - Compile a separate rlgl library and use that in the foreign import blocks below.
102102+ // - Remove the `import rl "../."` line
103103+ // - Copy the code from raylib.odin for any types we alias from that package (see PixelFormat etc)
104104+105105+-when ODIN_OS == .Windows {
106106+- @(extra_linker_flags="/NODEFAULTLIB:" + ("msvcrt" when RAYLIB_SHARED else "libcmt"))
107107+- foreign import lib {
108108+- "../windows/raylibdll.lib" when RAYLIB_SHARED else "../windows/raylib.lib" ,
109109+- "system:Winmm.lib",
110110+- "system:Gdi32.lib",
111111+- "system:User32.lib",
112112+- "system:Shell32.lib",
113113+- }
114114+-} else when ODIN_OS == .Linux {
115115+- foreign import lib {
116116+- // Note(bumbread): I'm not sure why in `linux/` folder there are
117117+- // multiple copies of raylib.so, but since these bindings are for
118118+- // particular version of the library, I better specify it. Ideally,
119119+- // though, it's best specified in terms of major (.so.4)
120120+- "../linux/libraylib.so.550" when RAYLIB_SHARED else "../linux/libraylib.a",
121121+- "system:dl",
122122+- "system:pthread",
123123+- }
124124+-} else when ODIN_OS == .Darwin {
125125+- foreign import lib {
126126+- "../macos/libraylib.550.dylib" when RAYLIB_SHARED else "../macos/libraylib.a",
127127+- "system:Cocoa.framework",
128128+- "system:OpenGL.framework",
129129+- "system:IOKit.framework",
130130+- }
131131+-} else when ODIN_ARCH == .wasm32 || ODIN_ARCH == .wasm64p32 {
132132+- foreign import lib {
133133+- RAYLIB_WASM_LIB,
134134+- }
135135+-} else {
136136+- foreign import lib "system:raylib"
137137+-}
138138++foreign import lib "system:raylib"
139139+140140+ GRAPHICS_API_OPENGL_11 :: false
141141+ GRAPHICS_API_OPENGL_21 :: true