Skip to content

Commit

Permalink
Build: copy libuv headers out to help luv_unix
Browse files Browse the repository at this point in the history
Closes #150.
  • Loading branch information
aantron committed Dec 11, 2023
1 parent ccebbe8 commit 150c305
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 17 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ release : check-ejected-build clean
opam pin add -y --no-action luv _release/$(RELEASE) --kind=path
opam reinstall -y --verbose luv
cd test/installation && dune exec ./user.exe --root .
cd test/headers && dune exec ./headers.exe --root .
opam remove -y luv
opam pin remove -y luv
md5sum $(RELEASE).tar.gz
Expand Down
36 changes: 20 additions & 16 deletions src/c/dune
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ let foreign_archives, uv_library_flag, include_dirs, i_option, install_h =
"(foreign_archives uv)",
"",
"(include_dirs vendor/libuv/include)",
"-I vendor/libuv/include",
"-I .",
true

let () = Jbuild_plugin.V1.send @@ {|
Expand All @@ -39,25 +39,29 @@ let () = Jbuild_plugin.V1.send @@ {|

|}^ (if not install_h then "" else {|

(rule
(deps (glob_files uv/*.h))
(action (copy vendor/libuv/include/uv.h uv.h)))

(install
(section lib)
(package luv)
(files
(vendor/libuv/include/uv.h as uv.h)
(vendor/libuv/include/uv/aix.h as uv/aix.h)
(vendor/libuv/include/uv/bsd.h as uv/bsd.h)
(vendor/libuv/include/uv/darwin.h as uv/darwin.h)
(vendor/libuv/include/uv/errno.h as uv/errno.h)
(vendor/libuv/include/uv/linux.h as uv/linux.h)
(vendor/libuv/include/uv/os390.h as uv/os390.h)
(vendor/libuv/include/uv/posix.h as uv/posix.h)
(vendor/libuv/include/uv/stdint-msvc2008.h as uv/stdint-msvc2008.h)
(vendor/libuv/include/uv/sunos.h as uv/sunos.h)
(vendor/libuv/include/uv/threadpool.h as uv/threadpool.h)
(vendor/libuv/include/uv/tree.h as uv/tree.h)
(vendor/libuv/include/uv/unix.h as uv/unix.h)
(vendor/libuv/include/uv/version.h as uv/version.h)
(vendor/libuv/include/uv/win.h as uv/win.h)))
(uv.h as uv.h)
(uv/aix.h as uv/aix.h)
(uv/bsd.h as uv/bsd.h)
(uv/darwin.h as uv/darwin.h)
(uv/errno.h as uv/errno.h)
(uv/linux.h as uv/linux.h)
(uv/os390.h as uv/os390.h)
(uv/posix.h as uv/posix.h)
(uv/stdint-msvc2008.h as uv/stdint-msvc2008.h)
(uv/sunos.h as uv/sunos.h)
(uv/threadpool.h as uv/threadpool.h)
(uv/tree.h as uv/tree.h)
(uv/unix.h as uv/unix.h)
(uv/version.h as uv/version.h)
(uv/win.h as uv/win.h)))

|}) ^{|

Expand Down
14 changes: 14 additions & 0 deletions src/c/uv/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
(rule (copy ../vendor/libuv/include/uv/aix.h aix.h))
(rule (copy ../vendor/libuv/include/uv/bsd.h bsd.h))
(rule (copy ../vendor/libuv/include/uv/darwin.h darwin.h))
(rule (copy ../vendor/libuv/include/uv/errno.h errno.h))
(rule (copy ../vendor/libuv/include/uv/linux.h linux.h))
(rule (copy ../vendor/libuv/include/uv/os390.h os390.h))
(rule (copy ../vendor/libuv/include/uv/posix.h posix.h))
(rule (copy ../vendor/libuv/include/uv/stdint-msvc2008.h stdint-msvc2008.h))
(rule (copy ../vendor/libuv/include/uv/sunos.h sunos.h))
(rule (copy ../vendor/libuv/include/uv/threadpool.h threadpool.h))
(rule (copy ../vendor/libuv/include/uv/tree.h tree.h))
(rule (copy ../vendor/libuv/include/uv/unix.h unix.h))
(rule (copy ../vendor/libuv/include/uv/version.h version.h))
(rule (copy ../vendor/libuv/include/uv/win.h win.h))
2 changes: 1 addition & 1 deletion test/headers/headers.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <caml/mlvalues.h>
#include <uv.h>
#include <caml/mlvalues.h>

CAMLprim value retrieve_constant(value unit)
{
Expand Down

0 comments on commit 150c305

Please sign in to comment.