Skip to content

Commit 2aad2f1

Browse files
committed
Don't rely on system chmod
1 parent 065c581 commit 2aad2f1

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040

4141
- run: opam install . --deps-only
4242

43-
- run: opam exec -- dune clean
43+
- run: opam exec -- dune build
4444
if: matrix.ocaml-compiler != '4.08.0'
4545

4646
- run: opam install .

src/c/chmodx.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let () = Unix.chmod (Array.get Sys.argv 1) 0o644

src/c/dune

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
(modules Apply_patch)
44
(libraries patch))
55

6+
(executable
7+
(name chmodx)
8+
(modules Chmodx)
9+
(libraries unix))
10+
611
(rule
712
(targets library_flags.sexp)
813
(deps
@@ -23,11 +28,12 @@
2328
(deps
2429
(source_tree vendor/raylib)
2530
enable_formats.patch
26-
(:discover apply_patch.exe))
31+
apply_patch.exe
32+
chmodx.exe)
2733
(action
2834
(no-infer
2935
(progn
30-
(run chmod +w vendor/raylib/src/config.h)
36+
(run ./chmodx.exe vendor/raylib/src/config.h)
3137
(run ./apply_patch.exe enable_formats.patch)
3238
(run make -C vendor/raylib/src RAYLIB_LIBTYPE=STATIC -j 8)
3339
(copy vendor/raylib/src/libraylib.a libraylib.a)
@@ -43,11 +49,12 @@
4349
(deps
4450
(source_tree vendor/raylib)
4551
enable_formats.patch
46-
(:discover apply_patch.exe))
52+
apply_patch.exe
53+
chmodx.exe)
4754
(action
4855
(no-infer
4956
(progn
50-
(run chmod +w vendor/raylib/src/config.h)
57+
(run ./chmodx.exe vendor/raylib/src/config.h)
5158
(run ./apply_patch.exe enable_formats.patch)
5259
(run make -C vendor/raylib/src RAYLIB_LIBTYPE=STATIC -j 8)
5360
(copy vendor/raylib/src/libraylib.a libraylib.a)
@@ -64,13 +71,14 @@
6471
(source_tree vendor/raylib)
6572
enable_formats.patch
6673
mingw64.patch
67-
(:discover apply_patch.exe))
74+
apply_patch.exe
75+
chmodx.exe)
6876
(action
6977
(no-infer
7078
(progn
71-
(run chmod +w vendor/raylib/src/config.h)
79+
(run ./chmodx.exe vendor/raylib/src/config.h)
7280
(run ./apply_patch.exe enable_formats.patch)
73-
(run chmod +w vendor/raylib/src/Makefile)
81+
(run ./chmodx.exe vendor/raylib/src/Makefile)
7482
(run ./apply_patch.exe mingw64.patch)
7583
(run make -C vendor/raylib/src RAYLIB_LIBTYPE=STATIC -j 8)
7684
(copy vendor/raylib/src/libraylib.a libraylib.a)
@@ -92,13 +100,14 @@
92100
(source_tree vendor/raylib)
93101
enable_formats.patch
94102
freebsd.patch
95-
(:discover apply_patch.exe))
103+
apply_patch.exe
104+
chmodx.exe)
96105
(action
97106
(no-infer
98107
(progn
99-
(run chmod +w vendor/raylib/src/config.h)
108+
(run ./chmodx.exe vendor/raylib/src/config.h)
100109
(run ./apply_patch.exe enable_formats.patch)
101-
(run chmod +w vendor/raylib/src/Makefile)
110+
(run ./chmodx.exe vendor/raylib/src/Makefile)
102111
(run ./apply_patch.exe freebsd.patch)
103112
(run gmake -C vendor/raylib/src RAYLIB_LIBTYPE=STATIC -j 8)
104113
(copy vendor/raylib/src/libraylib.a libraylib.a)

0 commit comments

Comments
 (0)