Skip to content

Commit

Permalink
Use apply_patch for every patch
Browse files Browse the repository at this point in the history
  • Loading branch information
tjammer committed Sep 24, 2024
1 parent 64ceded commit a806705
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 49 deletions.
3 changes: 2 additions & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
dune
dune-configurator
(ctypes (>= 0.14))
(integers (>= 0.5))))
(integers (>= 0.5))
(patch (>= 2.0))))

(package
(name raygui)
Expand Down
2 changes: 1 addition & 1 deletion raylib.opam
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ depends: [
"conf-libxi" {os = "linux" | os-family = "bsd"}
"conf-libxinerama" {os = "linux" | os-family = "bsd"}
"conf-libxrandr" {os = "linux" | os-family = "bsd"}
"patch" {>= "2.0" & (os = "linux" | os-family = "windows" | os = "macos")}
"patch" {>= "2.0"}
"odoc" {with-doc}
]
build: [
Expand Down
60 changes: 13 additions & 47 deletions src/c/dune
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(executable
(name apply_patch)
(modules Apply_patch)
(libraries patch))
(libraries patch))

(library
(name raylib_c)
Expand Down Expand Up @@ -101,14 +101,13 @@
(= %{system} macosx))
(deps
(source_tree vendor/raylib)
enable_jpg.patch)
enable_jpg.patch
(:discover apply_patch.exe))
(action
(no-infer
(progn
(run chmod +w vendor/raylib/src/config.h)
(with-stdin-from
enable_jpg.patch
(run patch -p1))
(run ./apply_patch.exe enable_jpg.patch)
(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 @@ -124,7 +123,7 @@
(source_tree vendor/raylib)
enable_jpg.patch
mingw64.patch
(:discover apply_patch.exe))
(:discover apply_patch.exe))
(action
(no-infer
(progn
Expand All @@ -151,18 +150,15 @@
(deps
(source_tree vendor/raylib)
enable_jpg.patch
freebsd.patch)
freebsd.patch
(:discover apply_patch.exe))
(action
(no-infer
(progn
(run chmod +w vendor/raylib/src/config.h)
(with-stdin-from
enable_jpg.patch
(run patch -p1))
(run ./apply_patch.exe enable_jpg.patch)
(run chmod +w vendor/raylib/src/Makefile)
(with-stdin-from
freebsd.patch
(run patch -p1))
(run ./apply_patch.exe freebsd.patch)
(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 @@ -187,52 +183,22 @@
(rule
(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 -p1))
(run touch raygui-patched)))))

(rule
(alias patch-raygui)
(targets raygui-patched)
(enabled_if
(= %{system} mingw64))
(deps
(source_tree vendor/raygui)
gui_warnings.patch)
gui_warnings.patch
(:discover apply_patch.exe))
(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 -p1))
(run ./apply_patch.exe gui_warnings.patch)
(run touch raygui-patched)))))

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

(rule
Expand Down

0 comments on commit a806705

Please sign in to comment.