Skip to content

Commit

Permalink
Patch raygui on its own build
Browse files Browse the repository at this point in the history
  • Loading branch information
tjammer committed May 21, 2024
1 parent 1a599e0 commit cb038d0
Showing 1 changed file with 53 additions and 28 deletions.
81 changes: 53 additions & 28 deletions src/c/dune
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,14 @@
(= %{system} elf)))
(deps
(source_tree vendor/raylib)
enable_jpg.patch
gui_warnings.patch)
enable_jpg.patch)
(action
(no-infer
(progn
(run chmod +w vendor/raylib/src/config.h)
(with-stdin-from
enable_jpg.patch
(run patch -sp1))
(run chmod +w vendor/raygui/src/raygui.h)
(with-stdin-from
gui_warnings.patch
(run patch -sp1))
(run make -C vendor/raylib/src RAYLIB_LIBTYPE=STATIC -j 8)
(copy vendor/raylib/src/libraylib.a libraylib.a)
(run make -C vendor/raylib/src clean)
Expand All @@ -102,19 +97,14 @@
(= %{system} macosx))
(deps
(source_tree vendor/raylib)
enable_jpg.patch
gui_warnings.patch)
enable_jpg.patch)
(action
(no-infer
(progn
(run chmod +w vendor/raylib/src/config.h)
(with-stdin-from
enable_jpg.patch
(run patch -sp1))
(run chmod +w vendor/raygui/src/raygui.h)
(with-stdin-from
gui_warnings.patch
(run patch -sp1))
(run make -C vendor/raylib/src RAYLIB_LIBTYPE=STATIC -j 8)
(copy vendor/raylib/src/libraylib.a libraylib.a)
(run make -C vendor/raylib/src clean)
Expand All @@ -129,8 +119,7 @@
(deps
(source_tree vendor/raylib)
enable_jpg.patch
mingw64.patch
gui_warnings.patch)
mingw64.patch)
(action
(no-infer
(progn
Expand All @@ -144,11 +133,6 @@
(with-stdin-from
mingw64.patch
(run patch --binary -p1))
(run chmod +w vendor/raygui/src/raygui.h)
(run unix2dos vendor/raygui/src/raygui.h)
(with-stdin-from
gui_warnings.patch
(run patch --binary -sp1))
(run make -C vendor/raylib/src RAYLIB_LIBTYPE=STATIC -j 8)
(copy vendor/raylib/src/libraylib.a libraylib.a)
(run make -C vendor/raylib/src clean)
Expand All @@ -168,8 +152,7 @@
(deps
(source_tree vendor/raylib)
enable_jpg.patch
freebsd.patch
gui_warnings.patch)
freebsd.patch)
(action
(no-infer
(progn
Expand All @@ -181,10 +164,6 @@
(with-stdin-from
freebsd.patch
(run patch -sp1))
(run chmod +w vendor/raygui/src/raygui.h)
(with-stdin-from
gui_warnings.patch
(run patch -sp1))
(run gmake -C vendor/raylib/src RAYLIB_LIBTYPE=STATIC -j 8)
(copy vendor/raylib/src/libraylib.a libraylib.a)
(run gmake -C vendor/raylib/src clean)
Expand All @@ -207,9 +186,55 @@
(:include library_flags.sexp)))

(rule
(with-stdout-to
c_generated_gui.c
(run stubgen/generate_c_gui.exe raygui_stub)))
(alias patch-raygui)
(targets raygui-patched)
(enabled_if
(or
(= %{system} linux)
(= %{system} linux_elf)
(= %{system} elf)
(= %{system} netbsd)
(= %{system} freebsd)
(= %{system} openbsd)
(= %{system} bsd)
(= %{system} bsd_elf)
(= %{system} macosx)))
(deps
(source_tree vendor/raygui)
gui_warnings.patch)
(action
(no-infer
(progn
(run chmod +w vendor/raygui/src/raygui.h)
(with-stdin-from
gui_warnings.patch
(run patch -sp1))
(run touch raygui-patched)))))

(rule
(alias patch-raygui)
(targets raygui-patched)
(enabled_if
(= %{system} mingw64))
(deps
(source_tree vendor/raygui)
gui_warnings.patch)
(action
(no-infer
(progn
(run chmod +w vendor/raygui/src/raygui.h)
(run unix2dos vendor/raygui/src/raygui.h)
(with-stdin-from
gui_warnings.patch
(run patch --binary -sp1))
(run touch raygui-patched)))))

(rule
(deps raygui-patched)
(action
(with-stdout-to
c_generated_gui.c
(run stubgen/generate_c_gui.exe raygui_stub))))

(rule
(with-stdout-to
Expand Down

0 comments on commit cb038d0

Please sign in to comment.