From 9eca7cf55255face2f843905652573bee9a7386c Mon Sep 17 00:00:00 2001 From: Et7f3 Date: Sun, 7 Jun 2020 15:47:31 +0200 Subject: [PATCH 1/4] build: dune upgrade --- bench/exe/dune | 16 ++++----- bench/lib/dune | 9 +++-- bench/reason-skia/dune | 11 ++---- dune | 2 +- dune-project | 6 ++-- examples/dune | 1 + examples/font-manager-cli/dune | 34 +++++++++---------- examples/harfbuzz-cli/dune | 1 + examples/skia-cli/dune | 16 ++++----- examples/stubs/dune | 14 ++++---- src/Core/dune | 10 +++--- src/Draw/dune | 21 ++++-------- src/Font/dune | 21 ++++-------- src/IO/dune | 9 ++--- src/Lwt/dune | 6 ++-- src/Math/dune | 6 ++-- src/Native/config/dune | 5 +-- src/Native/dune | 48 ++++++++++++++++----------- src/UI/dune | 10 +++--- src/UI_Hooks/dune | 9 ++--- src/UI_Primitives/dune | 10 +++--- src/Utility/dune | 14 +++++--- src/dune | 16 +++++---- src/reason-font-manager/config/dune | 1 + src/reason-font-manager/dune | 14 +++++--- src/reason-harfbuzz/config/dune | 1 + src/reason-harfbuzz/dune | 14 +++++--- src/reason-sdl2/config/dune | 5 +-- src/reason-sdl2/dune | 30 +++++++++++------ src/reason-skia/config/dune | 1 + src/reason-skia/dune | 22 ++++++------ src/reason-skia/wrapped/bindings/dune | 13 +++----- src/reason-skia/wrapped/c/dune | 26 ++++++++++----- src/reason-skia/wrapped/lib/dune | 39 +++++++++++++--------- src/reason-skia/wrapped/stubgen/dune | 24 +++++++++++--- test/Core/dune | 9 ++--- test/Math/dune | 9 ++--- test/UI/dune | 13 +++++--- test/collateral/dune | 6 ++-- test/dune | 14 +++----- test/reason-skia/dune | 18 ++++------ 41 files changed, 304 insertions(+), 250 deletions(-) diff --git a/bench/exe/dune b/bench/exe/dune index 6d77130c0..be790da6f 100644 --- a/bench/exe/dune +++ b/bench/exe/dune @@ -1,11 +1,11 @@ (executable - (name bench) - (public_name ReveryBench) - (libraries ReveryBench.lib Skia_Bench) - (package ReveryBench) -) + (modes byte exe) + (name bench) + (public_name ReveryBench) + (libraries ReveryBench.lib Skia_Bench) + (package ReveryBench)) (install - (section bin) - (package ReveryBench) - (files TestFont.ttf)) + (section bin) + (package ReveryBench) + (files TestFont.ttf)) diff --git a/bench/lib/dune b/bench/lib/dune index ce3d1895e..950ef0683 100644 --- a/bench/lib/dune +++ b/bench/lib/dune @@ -1,6 +1,5 @@ (library - (name ReveryBench) - (public_name ReveryBench.lib) - (ocamlopt_flags -linkall) - (libraries Revery reperf.lib) -) + (name ReveryBench) + (public_name ReveryBench.lib) + (ocamlopt_flags -linkall) + (libraries Revery reperf.lib)) diff --git a/bench/reason-skia/dune b/bench/reason-skia/dune index a8cd73caf..22d2699a9 100644 --- a/bench/reason-skia/dune +++ b/bench/reason-skia/dune @@ -1,9 +1,4 @@ (library - (name Skia_Bench) - (ocamlopt_flags -linkall) - (libraries - skia - skia.wrapped - skia.wrapped.bindings - reperf.lib -)) + (name Skia_Bench) + (ocamlopt_flags -linkall) + (libraries skia skia.wrapped skia.wrapped.bindings reperf.lib)) diff --git a/dune b/dune index 34b257d1a..618b59581 100644 --- a/dune +++ b/dune @@ -1 +1 @@ -(dirs src test examples bench) +(dirs src test examples bench) diff --git a/dune-project b/dune-project index 957ac80e0..75c24236b 100644 --- a/dune-project +++ b/dune-project @@ -1,2 +1,4 @@ -(lang dune 1.6) -(using fmt 1.0 (enabled_for reason)) +(lang dune 2.0) + +(formatting + (enabled_for reason)) diff --git a/examples/dune b/examples/dune index 9802a18f4..c7bbda6fb 100644 --- a/examples/dune +++ b/examples/dune @@ -1,4 +1,5 @@ (executables + (modes byte exe) (names Examples) (preprocess (pps brisk-reconciler.ppx lwt_ppx)) diff --git a/examples/font-manager-cli/dune b/examples/font-manager-cli/dune index 503d526b0..e70d7d88a 100644 --- a/examples/font-manager-cli/dune +++ b/examples/font-manager-cli/dune @@ -1,19 +1,19 @@ (executable - (name FontQuery) - (public_name FontQuery) - (libraries - font-manager -; NOTE: -; There is a known leak on Linux that causes us to not run it generally: -; It's caused by not calling FcFini(), but FcFini() crashes if we call it - -; seems like a libconfig bug. -; -; Direct leak of 256 byte(s) in 1 object(s) allocated from: -; #0 0x7f7f54a09602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602) -; #1 0x7f7f5474b0b9 (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1d0b9) - -; Uncomment this line to run ASAN: -; -; reason-native-crash-utils.asan + (modes byte exe) + (name FontQuery) + (public_name FontQuery) + (libraries + font-manager + ; NOTE: + ; There is a known leak on Linux that causes us to not run it generally: + ; It's caused by not calling FcFini(), but FcFini() crashes if we call it - + ; seems like a libconfig bug. + ; + ; Direct leak of 256 byte(s) in 1 object(s) allocated from: + ; #0 0x7f7f54a09602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602) + ; #1 0x7f7f5474b0b9 (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1d0b9) + ; Uncomment this line to run ASAN: + ; + ; reason-native-crash-utils.asan ) - (package ReveryExamples)) + (package ReveryExamples)) diff --git a/examples/harfbuzz-cli/dune b/examples/harfbuzz-cli/dune index 5747d6c3e..56a60863f 100644 --- a/examples/harfbuzz-cli/dune +++ b/examples/harfbuzz-cli/dune @@ -1,4 +1,5 @@ (executable + (modes byte exe) (name HarfbuzzCli) (package ReveryExamples) (public_name HarfbuzzCli) diff --git a/examples/skia-cli/dune b/examples/skia-cli/dune index 2e87ce85b..1fff40b26 100644 --- a/examples/skia-cli/dune +++ b/examples/skia-cli/dune @@ -1,14 +1,10 @@ (executables - (names SkiaCli) - (package ReveryExamples) - (public_names SkiaCli) - (modes native byte) - (libraries - skia - skia.wrapped.bindings - skia.wrapped - reason-native-crash-utils.asan -)) + (names SkiaCli) + (package ReveryExamples) + (public_names SkiaCli) + (modes native byte) + (libraries skia skia.wrapped.bindings skia.wrapped + reason-native-crash-utils.asan)) (install (section bin) diff --git a/examples/stubs/dune b/examples/stubs/dune index a4035047a..704f99de1 100644 --- a/examples/stubs/dune +++ b/examples/stubs/dune @@ -1,6 +1,8 @@ -(library - (name ExampleStubs) - (c_names example_stubs) - (c_flags :standard -Wall -Wextra -Werror) - (js_of_ocaml (javascript_files example_stubs.js)) -) +(library + (foreign_stubs + (language c) + (names example_stubs) + (flags :standard -Wall -Wextra -Werror)) + (name ExampleStubs) + (js_of_ocaml + (javascript_files example_stubs.js))) diff --git a/src/Core/dune b/src/Core/dune index d5b4184c8..28ec0e0d1 100644 --- a/src/Core/dune +++ b/src/Core/dune @@ -1,5 +1,7 @@ (library - (name Revery_Core) - (public_name Revery.Core) - (preprocess (pps ppx_deriving.show)) - (libraries threads console.lib str lwt sdl2 skia flex Rench re Revery_Native revery-text-wrap timber)) + (name Revery_Core) + (public_name Revery.Core) + (preprocess + (pps ppx_deriving.show)) + (libraries threads console.lib str lwt sdl2 skia flex Rench re Revery_Native + revery-text-wrap timber)) diff --git a/src/Draw/dune b/src/Draw/dune index ac59bdfb4..8ee12a009 100644 --- a/src/Draw/dune +++ b/src/Draw/dune @@ -1,16 +1,7 @@ (library - (name Revery_Draw) - (public_name Revery.Draw) - (preprocess (pps lwt_ppx)) - (libraries - skia - brisk-reconciler - lwt - lwt.unix - sdl2 - flex - rebez.lib - Revery_Core - Revery_Font - Revery_Math -)) + (name Revery_Draw) + (public_name Revery.Draw) + (preprocess + (pps lwt_ppx)) + (libraries skia brisk-reconciler lwt lwt.unix sdl2 flex rebez.lib + Revery_Core Revery_Font Revery_Math)) diff --git a/src/Font/dune b/src/Font/dune index 74fe6e36a..808ede012 100644 --- a/src/Font/dune +++ b/src/Font/dune @@ -1,16 +1,7 @@ (library - (name Revery_Font) - (public_name Revery.Font) - (preprocess (pps lwt_ppx)) - (libraries - harfbuzz - font-manager - lru - lwt - lwt.unix - sdl2 - flex - rebez.lib - Revery_Core - Revery_Math -)) + (name Revery_Font) + (public_name Revery.Font) + (preprocess + (pps lwt_ppx)) + (libraries harfbuzz font-manager lru lwt lwt.unix sdl2 flex rebez.lib + Revery_Core Revery_Math)) diff --git a/src/IO/dune b/src/IO/dune index 0cd24f11e..b7f5d54d5 100644 --- a/src/IO/dune +++ b/src/IO/dune @@ -1,5 +1,6 @@ (library - (name Revery_IO) - (public_name Revery.IO) - (preprocess (pps lwt_ppx)) - (libraries bos lwt lwt.unix Revery_Core uri fetch-native-lwt)) + (name Revery_IO) + (public_name Revery.IO) + (preprocess + (pps lwt_ppx)) + (libraries bos lwt lwt.unix Revery_Core uri fetch-native-lwt)) diff --git a/src/Lwt/dune b/src/Lwt/dune index 7de67dd9f..f94820dd6 100644 --- a/src/Lwt/dune +++ b/src/Lwt/dune @@ -1,4 +1,4 @@ (library - (name Revery_Lwt) - (public_name Revery.lwt) - (libraries Revery)) + (name Revery_Lwt) + (public_name Revery.lwt) + (libraries Revery)) diff --git a/src/Math/dune b/src/Math/dune index 3a22e2f5b..a301f7b83 100644 --- a/src/Math/dune +++ b/src/Math/dune @@ -1,4 +1,4 @@ (library - (name Revery_Math) - (public_name Revery.Math) - (libraries skia)) + (name Revery_Math) + (public_name Revery.Math) + (libraries skia)) diff --git a/src/Native/config/dune b/src/Native/config/dune index 1b69462b1..bf7c751f9 100644 --- a/src/Native/config/dune +++ b/src/Native/config/dune @@ -1,3 +1,4 @@ (executable - (name discover) - (libraries dune.configurator)) + (modes byte exe) + (name discover) + (libraries dune.configurator)) diff --git a/src/Native/dune b/src/Native/dune index 594abcc18..1acfa3a82 100644 --- a/src/Native/dune +++ b/src/Native/dune @@ -1,25 +1,33 @@ (library - (name Revery_Native) - (public_name Revery.Native) - (preprocess (pps lwt_ppx)) - (library_flags (:include flags.sexp)) - (js_of_ocaml (javascript_files dialog.js)) - (c_names - Revery_Native - dialog dialog_cocoa dialog_win32 dialog_gtk - notification notification_cocoa - icon icon_cocoa icon_win32 - shell shell_cocoa shell_gtk shell_win32 - utilities - ReveryAppDelegate ReveryAppDelegate_func - ReveryProgressBar) - (c_flags :standard -Wall -Wextra -Werror (:include c_flags.sexp)) - (c_library_flags (:include c_library_flags.sexp)) - (libraries sdl2)) + (foreign_stubs + (language c) + (names Revery_Native dialog dialog_cocoa dialog_win32 dialog_gtk + notification notification_cocoa icon icon_cocoa icon_win32 shell + shell_cocoa shell_gtk shell_win32 utilities ReveryAppDelegate + ReveryAppDelegate_func ReveryProgressBar) + (flags + :standard + -Wall + -Wextra + -Werror + (:include c_flags.sexp))) + (name Revery_Native) + (public_name Revery.Native) + (preprocess + (pps lwt_ppx)) + (library_flags + (:include flags.sexp)) + (js_of_ocaml + (javascript_files dialog.js)) + (c_library_flags + (:include c_library_flags.sexp)) + (libraries sdl2)) (copy_files cocoa/*) (rule -(targets flags.sexp c_flags.sexp c_library_flags.sexp) -(deps (:discover config/discover.exe)) -(action (run %{discover}))) + (targets flags.sexp c_flags.sexp c_library_flags.sexp) + (deps + (:discover config/discover.exe)) + (action + (run %{discover}))) diff --git a/src/UI/dune b/src/UI/dune index fea1cf8b5..4b1ded770 100644 --- a/src/UI/dune +++ b/src/UI/dune @@ -1,5 +1,7 @@ (library - (name Revery_UI) - (public_name Revery.UI) - (preprocess (pps lwt_ppx ppx_deriving.show)) - (libraries brisk-reconciler lwt lwt.unix sdl2 skia flex rebez.lib Revery_Core Revery_Draw Revery_Math)) + (name Revery_UI) + (public_name Revery.UI) + (preprocess + (pps lwt_ppx ppx_deriving.show)) + (libraries brisk-reconciler lwt lwt.unix sdl2 skia flex rebez.lib + Revery_Core Revery_Draw Revery_Math)) diff --git a/src/UI_Hooks/dune b/src/UI_Hooks/dune index 430e1555f..0cc9be2e6 100644 --- a/src/UI_Hooks/dune +++ b/src/UI_Hooks/dune @@ -1,5 +1,6 @@ (library - (name Revery_UI_Hooks) - (public_name Revery.UI_Hooks) - (preprocess (pps brisk-reconciler.ppx lwt_ppx)) - (libraries lwt lwt.unix sdl2 flex Revery_Core Revery_Math Revery_UI)) + (name Revery_UI_Hooks) + (public_name Revery.UI_Hooks) + (preprocess + (pps brisk-reconciler.ppx lwt_ppx)) + (libraries lwt lwt.unix sdl2 flex Revery_Core Revery_Math Revery_UI)) diff --git a/src/UI_Primitives/dune b/src/UI_Primitives/dune index 142a3f71a..e76897061 100644 --- a/src/UI_Primitives/dune +++ b/src/UI_Primitives/dune @@ -1,5 +1,7 @@ (library - (name Revery_UI_Primitives) - (public_name Revery.UI_Primitives) - (preprocess (pps brisk-reconciler.ppx)) - (libraries lwt lwt.unix sdl2 flex Revery_Core Revery_Math Revery_UI Revery_IO)) + (name Revery_UI_Primitives) + (public_name Revery.UI_Primitives) + (preprocess + (pps brisk-reconciler.ppx)) + (libraries lwt lwt.unix sdl2 flex Revery_Core Revery_Math Revery_UI + Revery_IO)) diff --git a/src/Utility/dune b/src/Utility/dune index dbdef908e..155dcf956 100644 --- a/src/Utility/dune +++ b/src/Utility/dune @@ -1,6 +1,10 @@ (library - (name Revery_Utility) - (public_name Revery.Utility) - (c_flags :standard -Wall -Wextra -Werror) - (preprocess (pps ppx_deriving.show)) - (libraries threads console.lib str lwt sdl2 skia flex Rench re Revery_Core Revery_UI revery-text-wrap timber)) + (foreign_stubs + (language c) + (flags :standard -Wall -Wextra -Werror)) + (name Revery_Utility) + (public_name Revery.Utility) + (preprocess + (pps ppx_deriving.show)) + (libraries threads console.lib str lwt sdl2 skia flex Rench re Revery_Core + Revery_UI revery-text-wrap timber)) diff --git a/src/dune b/src/dune index d0cab90a3..9d900104e 100644 --- a/src/dune +++ b/src/dune @@ -1,8 +1,12 @@ (library - (name Revery) - (preprocess (pps brisk-reconciler.ppx lwt_ppx)) - (public_name Revery) - (libraries console.lib lwt lwt.unix sdl2 Revery_Core Revery_Font Revery_Draw Revery_Math Revery_UI Revery_UI_Components Revery_Native Revery_UI_Primitives Revery_UI_Hooks Revery_Utility)) + (name Revery) + (preprocess + (pps brisk-reconciler.ppx lwt_ppx)) + (public_name Revery) + (libraries console.lib lwt lwt.unix sdl2 Revery_Core Revery_Font Revery_Draw + Revery_Math Revery_UI Revery_UI_Components Revery_Native + Revery_UI_Primitives Revery_UI_Hooks Revery_Utility)) + (documentation - (package Revery) - (mld_files index)) + (package Revery) + (mld_files index)) diff --git a/src/reason-font-manager/config/dune b/src/reason-font-manager/config/dune index 187bd5e12..0876c6e66 100644 --- a/src/reason-font-manager/config/dune +++ b/src/reason-font-manager/config/dune @@ -1,3 +1,4 @@ (executable + (modes byte exe) (name discover) (libraries dune-configurator)) diff --git a/src/reason-font-manager/dune b/src/reason-font-manager/dune index 9ed79232b..2eb769ce9 100644 --- a/src/reason-font-manager/dune +++ b/src/reason-font-manager/dune @@ -1,11 +1,17 @@ (library + (foreign_stubs + (language cxx) + (names FontManager FontManagerWindows FontManagerMac FontManagerLinux) + (flags + (:include cxx_flags.sexp))) + (foreign_stubs + (language c) + (flags + (:include c_flags.sexp))) (name FontManager) (public_name font-manager) (library_flags - (:include flags.sexp)) - (c_flags (:include c_flags.sexp)) - (cxx_flags (:include cxx_flags.sexp)) - (cxx_names FontManager FontManagerWindows FontManagerMac FontManagerLinux)) + (:include flags.sexp))) (rule (targets c_flags.sexp cxx_flags.sexp flags.sexp) diff --git a/src/reason-harfbuzz/config/dune b/src/reason-harfbuzz/config/dune index 187bd5e12..0876c6e66 100644 --- a/src/reason-harfbuzz/config/dune +++ b/src/reason-harfbuzz/config/dune @@ -1,3 +1,4 @@ (executable + (modes byte exe) (name discover) (libraries dune-configurator)) diff --git a/src/reason-harfbuzz/dune b/src/reason-harfbuzz/dune index 74efcfcae..7d74ffa0d 100644 --- a/src/reason-harfbuzz/dune +++ b/src/reason-harfbuzz/dune @@ -1,11 +1,17 @@ (library + (foreign_stubs + (language cxx) + (names harfbuzz) + (flags + (:include cxx_flags.sexp))) + (foreign_stubs + (language c) + (flags + (:include c_flags.sexp))) (name harfbuzz) (public_name harfbuzz) (library_flags - (:include flags.sexp)) - (c_flags (:include c_flags.sexp)) - (cxx_flags (:include cxx_flags.sexp)) - (cxx_names harfbuzz)) + (:include flags.sexp))) (rule (targets c_flags.sexp cxx_flags.sexp flags.sexp) diff --git a/src/reason-sdl2/config/dune b/src/reason-sdl2/config/dune index 1b69462b1..bf7c751f9 100644 --- a/src/reason-sdl2/config/dune +++ b/src/reason-sdl2/config/dune @@ -1,3 +1,4 @@ (executable - (name discover) - (libraries dune.configurator)) + (modes byte exe) + (name discover) + (libraries dune.configurator)) diff --git a/src/reason-sdl2/dune b/src/reason-sdl2/dune index 325fed22f..4478ca936 100644 --- a/src/reason-sdl2/dune +++ b/src/reason-sdl2/dune @@ -1,13 +1,23 @@ (library - (name sdl2) - (public_name Revery.sdl2) - (library_flags (:include flags.sexp)) - (c_library_flags (:include c_library_flags.sexp)) - (c_flags (:include c_flags.sexp)) - (cxx_names sdl2_wrapper stb_image) - (cxx_flags (:include cxx_flags.sexp))) + (foreign_stubs + (language cxx) + (names sdl2_wrapper stb_image) + (flags + (:include cxx_flags.sexp))) + (foreign_stubs + (language c) + (flags + (:include c_flags.sexp))) + (name sdl2) + (public_name Revery.sdl2) + (library_flags + (:include flags.sexp)) + (c_library_flags + (:include c_library_flags.sexp))) (rule - (targets c_flags.sexp cxx_flags.sexp flags.sexp c_library_flags.sexp) - (deps (:discover config/discover.exe)) - (action (run %{discover}))) + (targets c_flags.sexp cxx_flags.sexp flags.sexp c_library_flags.sexp) + (deps + (:discover config/discover.exe)) + (action + (run %{discover}))) diff --git a/src/reason-skia/config/dune b/src/reason-skia/config/dune index 21a5f9a54..bf7c751f9 100644 --- a/src/reason-skia/config/dune +++ b/src/reason-skia/config/dune @@ -1,3 +1,4 @@ (executable + (modes byte exe) (name discover) (libraries dune.configurator)) diff --git a/src/reason-skia/dune b/src/reason-skia/dune index 272490ff8..5b254297a 100644 --- a/src/reason-skia/dune +++ b/src/reason-skia/dune @@ -1,13 +1,15 @@ (rule - (targets c_library_flags.sexp c_flags.sexp flags.sexp) - (deps (:discover config/discover.exe)) - (action (run %{discover}))) + (targets c_library_flags.sexp c_flags.sexp flags.sexp) + (deps + (:discover config/discover.exe)) + (action + (run %{discover}))) (library - (name skia) - (public_name skia) - (library_flags (:include flags.sexp)) - (c_library_flags (:include c_library_flags.sexp)) - (libraries - SkiaWrapped -)) + (name skia) + (public_name skia) + (library_flags + (:include flags.sexp)) + (c_library_flags + (:include c_library_flags.sexp)) + (libraries SkiaWrapped)) diff --git a/src/reason-skia/wrapped/bindings/dune b/src/reason-skia/wrapped/bindings/dune index 4bff6adea..cbdff9822 100644 --- a/src/reason-skia/wrapped/bindings/dune +++ b/src/reason-skia/wrapped/bindings/dune @@ -1,16 +1,13 @@ (rule (targets skia_generated_type_stubs.ml) (deps ../stubgen/ml_types_stubgen.exe) - (action (with-stdout-to %{targets} (run %{deps})))) + (action + (with-stdout-to + %{targets} + (run %{deps})))) (library (name SkiaWrappedBindings) (flags -w -9) (public_name skia.wrapped.bindings) - (libraries - skia.wrapped.types - skia.wrapped.c - ctypes.stubs - ctypes - integers -)) + (libraries skia.wrapped.types skia.wrapped.c ctypes.stubs ctypes integers)) diff --git a/src/reason-skia/wrapped/c/dune b/src/reason-skia/wrapped/c/dune index d9ac24ed4..56ddf6c95 100644 --- a/src/reason-skia/wrapped/c/dune +++ b/src/reason-skia/wrapped/c/dune @@ -1,7 +1,9 @@ (rule (targets c_flags.txt c_library_flags.txt) - (deps (:discover ../../config/discover.exe)) - (action (run %{discover}))) + (deps + (:discover ../../config/discover.exe)) + (action + (run %{discover}))) (library (name skia_wrapped_c) @@ -13,19 +15,25 @@ (rule (targets libskia_wrapped_c_stubs.a) (deps c_stubs.o) - (action (run ar rcs %{targets} %{deps}))) + (action + (run ar rcs %{targets} %{deps}))) (rule (targets dllskia_wrapped_c_stubs.dll) - (deps c_stubs.o) - (action (run %{cc} -shared -o %{targets} %{deps} %{read-lines:c_library_flags.txt}))) + (deps c_stubs.o) + (action + (run %{cc} -shared -o %{targets} %{deps} %{read-lines:c_library_flags.txt}))) (rule (targets dllskia_wrapped_c_stubs.so) - (deps c_stubs.o) - (action (run %{cc} %{read-lines:c_library_flags.txt} -shared -o %{targets} %{deps}))) + (deps c_stubs.o) + (action + (run %{cc} %{read-lines:c_library_flags.txt} -shared -o %{targets} %{deps}))) (rule (targets c_stubs.o) - (deps (:c c_stubs.c c_stubs.h) c_flags.txt) - (action (run %{cc} %{read-lines:c_flags.txt} -c %{c}))) + (deps + (:c c_stubs.c c_stubs.h) + c_flags.txt) + (action + (run %{cc} %{read-lines:c_flags.txt} -c %{c}))) diff --git a/src/reason-skia/wrapped/lib/dune b/src/reason-skia/wrapped/lib/dune index 1201c8f9c..de7e92e9b 100644 --- a/src/reason-skia/wrapped/lib/dune +++ b/src/reason-skia/wrapped/lib/dune @@ -1,24 +1,31 @@ (rule (targets skia_generated_stubs.ml) (deps ../stubgen/stubgen.exe) - (action (with-stdout-to %{targets} (run %{deps} -ml)))) + (action + (with-stdout-to + %{targets} + (run %{deps} -ml)))) (rule (targets skia_generated_stubs.c) - (deps (:stubgen ../stubgen/stubgen.exe)) - (action (with-stdout-to %{targets} (run %{stubgen} -c)))) + (deps + (:stubgen ../stubgen/stubgen.exe)) + (action + (with-stdout-to + %{targets} + (run %{stubgen} -c)))) (library - (name SkiaWrapped) - (flags (-w -40 -w +26)) - (public_name skia.wrapped) - (libraries - skia.wrapped.types - skia.wrapped.bindings - skia.wrapped.c - ctypes - integers - ) - (c_names skia_generated_stubs raw_bindings) - (c_flags (:include ../../c_flags.sexp)) - (c_library_flags (:include ../../c_library_flags.sexp))) + (foreign_stubs + (language c) + (names skia_generated_stubs raw_bindings) + (flags + (:include ../../c_flags.sexp))) + (name SkiaWrapped) + (flags + (-w -40 -w +26)) + (public_name skia.wrapped) + (libraries skia.wrapped.types skia.wrapped.bindings skia.wrapped.c ctypes + integers) + (c_library_flags + (:include ../../c_library_flags.sexp))) diff --git a/src/reason-skia/wrapped/stubgen/dune b/src/reason-skia/wrapped/stubgen/dune index 83556d88a..6ac41bc71 100644 --- a/src/reason-skia/wrapped/stubgen/dune +++ b/src/reason-skia/wrapped/stubgen/dune @@ -1,4 +1,5 @@ (executable + (modes byte exe) (name stubgen) (package skia) (modules stubgen) @@ -6,6 +7,7 @@ (libraries skia.wrapped.bindings ctypes)) (executable + (modes byte exe) (name types_stubgen) (package skia) (modules types_stubgen) @@ -15,12 +17,24 @@ (rule (targets ml_types_stubgen.c) (deps ./types_stubgen.exe) - (action (with-stdout-to %{targets} (run %{deps})))) + (action + (with-stdout-to + %{targets} + (run %{deps})))) -(rule (targets ctypes_path.txt) - (action (with-stdout-to %{targets} (run ocamlfind query ctypes)))) +(rule + (targets ctypes_path.txt) + (action + (with-stdout-to + %{targets} + (run ocamlfind query ctypes)))) (rule (targets ml_types_stubgen.exe) - (deps (:c ./ml_types_stubgen.c) (:ctypes_path ctypes_path.txt) ../c/libskia_wrapped_c_stubs.a) - (action (run %{cc} %{c} %{read-lines:../c/c_flags.txt} -I%{read-lines:ctypes_path.txt} -I%{ocaml_where} -o %{targets}))) + (deps + (:c ./ml_types_stubgen.c) + (:ctypes_path ctypes_path.txt) + ../c/libskia_wrapped_c_stubs.a) + (action + (run %{cc} %{c} %{read-lines:../c/c_flags.txt} + -I%{read-lines:ctypes_path.txt} -I%{ocaml_where} -o %{targets}))) diff --git a/test/Core/dune b/test/Core/dune index beeee2a8e..f19abd259 100644 --- a/test/Core/dune +++ b/test/Core/dune @@ -1,5 +1,6 @@ (library - (name Revery_Core_Test) - (library_flags (-linkall -g)) - (modules (:standard)) - (libraries Revery_Core rely.lib)) + (name Revery_Core_Test) + (library_flags + (-linkall -g)) + (modules (:standard)) + (libraries Revery_Core rely.lib)) diff --git a/test/Math/dune b/test/Math/dune index 9ba71eea8..8ab152734 100644 --- a/test/Math/dune +++ b/test/Math/dune @@ -1,5 +1,6 @@ (library - (name Revery_Math_Test) - (library_flags (-linkall -g)) - (modules (:standard)) - (libraries Revery_Math rely.lib)) + (name Revery_Math_Test) + (library_flags + (-linkall -g)) + (modules (:standard)) + (libraries Revery_Math rely.lib)) diff --git a/test/UI/dune b/test/UI/dune index c3801e832..881e1ead4 100644 --- a/test/UI/dune +++ b/test/UI/dune @@ -1,6 +1,9 @@ (library - (name Revery_UI_Test) - (library_flags (-linkall -g)) - (modules (:standard)) - (preprocess (pps brisk-reconciler.ppx)) - (libraries Revery_UI Revery_UI_Primitives Revery_UI_Hooks Revery_Math rely.lib)) + (name Revery_UI_Test) + (library_flags + (-linkall -g)) + (modules (:standard)) + (preprocess + (pps brisk-reconciler.ppx)) + (libraries Revery_UI Revery_UI_Primitives Revery_UI_Hooks Revery_Math + rely.lib)) diff --git a/test/collateral/dune b/test/collateral/dune index 17782cd22..6e102e278 100644 --- a/test/collateral/dune +++ b/test/collateral/dune @@ -1,4 +1,4 @@ (install - (section bin) - (package ReveryTest) - (files test-asset.txt)) + (section bin) + (package ReveryTest) + (files test-asset.txt)) diff --git a/test/dune b/test/dune index f8b3579eb..a158f4025 100644 --- a/test/dune +++ b/test/dune @@ -1,10 +1,6 @@ (executable - (name TestRunner) - (public_name ReveryTestRunner) - (package ReveryTest) - (libraries - Revery_Core_Test - Revery_Math_Test - Revery_UI_Test - Skia_Test - )) + (modes byte exe) + (name TestRunner) + (public_name ReveryTestRunner) + (package ReveryTest) + (libraries Revery_Core_Test Revery_Math_Test Revery_UI_Test Skia_Test)) diff --git a/test/reason-skia/dune b/test/reason-skia/dune index 406f66001..f35733e02 100644 --- a/test/reason-skia/dune +++ b/test/reason-skia/dune @@ -1,11 +1,7 @@ -(library - (name Skia_Test) - (flags (:standard (-w -39))) - (ocamlopt_flags -linkall -g) - (libraries rely.lib rely.internal - skia - skia.wrapped.bindings - skia.wrapped - ) - -) +(library + (name Skia_Test) + (flags + (:standard + (-w -39))) + (ocamlopt_flags -linkall -g) + (libraries rely.lib rely.internal skia skia.wrapped.bindings skia.wrapped)) From 5e0b7dc5139fcfaa0302d7e3834a11b971a48fde Mon Sep 17 00:00:00 2001 From: Et7f3 Date: Sun, 7 Jun 2020 15:48:08 +0200 Subject: [PATCH 2/4] fix(build): finish manual upgrade. --- dune-project | 2 +- src/Utility/dune | 3 --- src/reason-skia/wrapped/c/dune | 34 ++++++---------------------------- 3 files changed, 7 insertions(+), 32 deletions(-) diff --git a/dune-project b/dune-project index 75c24236b..033defd4d 100644 --- a/dune-project +++ b/dune-project @@ -1,4 +1,4 @@ (lang dune 2.0) (formatting - (enabled_for reason)) + (enabled_for reason dune)) diff --git a/src/Utility/dune b/src/Utility/dune index 155dcf956..41dbf7f71 100644 --- a/src/Utility/dune +++ b/src/Utility/dune @@ -1,7 +1,4 @@ (library - (foreign_stubs - (language c) - (flags :standard -Wall -Wextra -Werror)) (name Revery_Utility) (public_name Revery.Utility) (preprocess diff --git a/src/reason-skia/wrapped/c/dune b/src/reason-skia/wrapped/c/dune index 56ddf6c95..1cc544ae0 100644 --- a/src/reason-skia/wrapped/c/dune +++ b/src/reason-skia/wrapped/c/dune @@ -1,5 +1,5 @@ (rule - (targets c_flags.txt c_library_flags.txt) + (targets c_flags.txt c_flags.sexp c_library_flags.txt) (deps (:discover ../../config/discover.exe)) (action @@ -10,30 +10,8 @@ (public_name skia.wrapped.c) (preprocess no_preprocessing) (libraries sdl2) - (self_build_stubs_archive (skia_wrapped_c))) - -(rule - (targets libskia_wrapped_c_stubs.a) - (deps c_stubs.o) - (action - (run ar rcs %{targets} %{deps}))) - -(rule - (targets dllskia_wrapped_c_stubs.dll) - (deps c_stubs.o) - (action - (run %{cc} -shared -o %{targets} %{deps} %{read-lines:c_library_flags.txt}))) - -(rule - (targets dllskia_wrapped_c_stubs.so) - (deps c_stubs.o) - (action - (run %{cc} %{read-lines:c_library_flags.txt} -shared -o %{targets} %{deps}))) - -(rule - (targets c_stubs.o) - (deps - (:c c_stubs.c c_stubs.h) - c_flags.txt) - (action - (run %{cc} %{read-lines:c_flags.txt} -c %{c}))) + (foreign_stubs + (language c) + (names c_stubs) + (flags + (:include c_flags.sexp)))) From 1593dec93ccfb98d5f8de797f6757bb7e0818cd5 Mon Sep 17 00:00:00 2001 From: Et7f3 Date: Sun, 7 Jun 2020 16:00:33 +0200 Subject: [PATCH 3/4] build(deps): Bump dune lower bound --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0e7225e91..5889d3bee 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@esy-ocaml/reason": "^3.6.0", "@opam/bos": "0.2.0", "@opam/ctypes": "0.15.1", - "@opam/dune": ">=1.6.0", + "@opam/dune": ">=2.0.0", "@opam/dune-configurator": "*", "@opam/lru": "bryphe/lru:lru.opam#2708c70", "@opam/lwt": "^4.0.0", From b06b90dd9f03c69f2e924249e827d2d417fac3df Mon Sep 17 00:00:00 2001 From: Github Runner Date: Sun, 7 Jun 2020 14:06:47 +0000 Subject: [PATCH 4/4] Update lockdir, --- bench.esy.lock/index.json | 2 +- doc.esy.lock/index.json | 2 +- esy.lock/index.json | 2 +- js.esy.lock/index.json | 2 +- test.esy.lock/index.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bench.esy.lock/index.json b/bench.esy.lock/index.json index fdd2115e1..6ba3ac3d2 100644 --- a/bench.esy.lock/index.json +++ b/bench.esy.lock/index.json @@ -1,5 +1,5 @@ { - "checksum": "e1f9a327c7a8829965c9b84f337ae943", + "checksum": "629be2c44ce985f0e264179276bc2e4e", "root": "revery@link-dev:./package.json", "node": { "yarn-pkg-config@github:esy-ocaml/yarn-pkg-config#db3a0b63883606dd57c54a7158d560d6cba8cd79@d41d8cd9": { diff --git a/doc.esy.lock/index.json b/doc.esy.lock/index.json index 46cb5361b..60fddc774 100644 --- a/doc.esy.lock/index.json +++ b/doc.esy.lock/index.json @@ -1,5 +1,5 @@ { - "checksum": "6f573c3f4b6c7575290c21aae811b57c", + "checksum": "610f0e1d0cb57952501a576d8526557b", "root": "revery@link-dev:./package.json", "node": { "yarn-pkg-config@github:esy-ocaml/yarn-pkg-config#db3a0b63883606dd57c54a7158d560d6cba8cd79@d41d8cd9": { diff --git a/esy.lock/index.json b/esy.lock/index.json index 1a37d6b15..c6e7e7231 100644 --- a/esy.lock/index.json +++ b/esy.lock/index.json @@ -1,5 +1,5 @@ { - "checksum": "e1f9a327c7a8829965c9b84f337ae943", + "checksum": "629be2c44ce985f0e264179276bc2e4e", "root": "revery@link-dev:./package.json", "node": { "yarn-pkg-config@github:esy-ocaml/yarn-pkg-config#db3a0b63883606dd57c54a7158d560d6cba8cd79@d41d8cd9": { diff --git a/js.esy.lock/index.json b/js.esy.lock/index.json index be24f73bb..83454f257 100644 --- a/js.esy.lock/index.json +++ b/js.esy.lock/index.json @@ -1,5 +1,5 @@ { - "checksum": "9af1052ed8ac4356f28e022f71263c09", + "checksum": "b5910e498348429a7bcc16e3af983c9f", "root": "revery@link-dev:./package.json", "node": { "yarn-pkg-config@github:esy-ocaml/yarn-pkg-config#db3a0b63883606dd57c54a7158d560d6cba8cd79@d41d8cd9": { diff --git a/test.esy.lock/index.json b/test.esy.lock/index.json index 10f8d493b..69fca26a0 100644 --- a/test.esy.lock/index.json +++ b/test.esy.lock/index.json @@ -1,5 +1,5 @@ { - "checksum": "ab12d1c94c35171a025b62be292c431f", + "checksum": "eb95622c8a3d6416ffc79d3d38878f1c", "root": "revery@link-dev:./package.json", "node": { "yarn-pkg-config@github:esy-ocaml/yarn-pkg-config#db3a0b63883606dd57c54a7158d560d6cba8cd79@d41d8cd9": {