diff --git a/dune b/dune index 270b6151f5..8f9be19de0 100644 --- a/dune +++ b/dune @@ -3,13 +3,14 @@ (rule (target main.css) (deps + %{workspace_root}/tool/tailwind/tailwindcss (:config %{workspace_root}/tailwind.config.js) (:input %{workspace_root}/src/ocamlorg_frontend/css/styles.css) (source_tree %{workspace_root}/src/ocamlorg_frontend)) (action (chdir %{workspace_root} - (run tailwindcss -m -c %{config} -i %{input} -o %{target}))))) + (run %{workspace_root}/tool/tailwind/tailwindcss -m -c %{config} -i %{input} -o %{target}))))) (subdir asset/ diff --git a/dune-project b/dune-project index 530808fd14..ccfb6ce69c 100644 --- a/dune-project +++ b/dune-project @@ -52,7 +52,6 @@ (>= 2.0.0)) yojson lwt - tailwindcss (hilite (>= 0.4.0)) (river @@ -75,3 +74,14 @@ (>= 1.1.0)) xmlm uri)) + +(pin + (url + "git+https://github.com/aantron/river#476dc945a908a69548bddd267f143a3e5d9c8a1a") + (package + (name river))) + +(pin + (url "git+https://github.com/tarides/olinkcheck") + (package + (name olinkcheck))) diff --git a/dune-workspace b/dune-workspace deleted file mode 100644 index 5adb477991..0000000000 --- a/dune-workspace +++ /dev/null @@ -1,19 +0,0 @@ -(lang dune 3.15) - -(pin - (name river) - (url "git+https://github.com/aantron/river#476dc945a908a69548bddd267f143a3e5d9c8a1a") - (package (name river))) - -(pin - (name tailwindcss) - (url "git+https://github.com/tmattio/opam-tailwindcss#3e60fc32bbcf82525999d83ad0f395e16107026b") - (package (name tailwindcss))) - -(pin - (name olinkcheck) - (url "git+https://github.com/tarides/olinkcheck") - (package (name olinkcheck))) - -(lock_dir - (pins river tailwindcss olinkcheck)) diff --git a/ocamlorg.opam b/ocamlorg.opam index 40d3092094..9b6def8e28 100644 --- a/ocamlorg.opam +++ b/ocamlorg.opam @@ -36,7 +36,6 @@ depends: [ "timedesc" {>= "2.0.0"} "yojson" "lwt" - "tailwindcss" "hilite" {>= "0.4.0"} "river" {>= "0.3"} "syndic" @@ -71,6 +70,5 @@ build: [ dev-repo: "git+https://github.com/ocaml/ocaml.org.git" pin-depends: [ ["river.dev" "git+https://github.com/aantron/river#476dc945a908a69548bddd267f143a3e5d9c8a1a"] - ["tailwindcss.dev" "https://github.com/tmattio/opam-tailwindcss/archive/3e60fc32bbcf82525999d83ad0f395e16107026b.tar.gz"] ["olinkcheck.~dev" "git+https://github.com/tarides/olinkcheck"] ] diff --git a/ocamlorg.opam.template b/ocamlorg.opam.template index b57ce018d1..2c4b9bce71 100644 --- a/ocamlorg.opam.template +++ b/ocamlorg.opam.template @@ -1,5 +1,4 @@ pin-depends: [ ["river.dev" "git+https://github.com/aantron/river#476dc945a908a69548bddd267f143a3e5d9c8a1a"] - ["tailwindcss.dev" "https://github.com/tmattio/opam-tailwindcss/archive/3e60fc32bbcf82525999d83ad0f395e16107026b.tar.gz"] ["olinkcheck.~dev" "git+https://github.com/tarides/olinkcheck"] ] diff --git a/tool/tailwind/dune b/tool/tailwind/dune new file mode 100644 index 0000000000..90593bfbf9 --- /dev/null +++ b/tool/tailwind/dune @@ -0,0 +1,79 @@ +(rule + (target tailwindcss-linux-x64) + (action + (progn + (run + curl + -sLO + https://github.com/tailwindlabs/tailwindcss/releases/download/v3.3.6/%{target}) + (run chmod +x %{target})))) + +(rule + (target tailwindcss-linux-arm64) + (action + (progn + (run + curl + -sLO + https://github.com/tailwindlabs/tailwindcss/releases/download/v3.3.6/%{target}) + (run chmod +x %{target})))) + +(rule + (target tailwindcss-macos-x64) + (action + (progn + (run + curl + -sLO + https://github.com/tailwindlabs/tailwindcss/releases/download/v3.3.6/%{target}) + (run chmod +x %{target})))) + +(rule + (target tailwindcss-macos-arm64) + (action + (progn + (run + curl + -sLO + https://github.com/tailwindlabs/tailwindcss/releases/download/v3.3.6/%{target}) + (run chmod +x %{target})))) + +(rule + (enabled_if + (and + (= %{architecture} amd64) + (= %{system} linux))) + (target tailwindcss) + (deps tailwindcss-linux-x64) + (action + (copy %{deps} tailwindcss))) + +(rule + (enabled_if + (and + (= %{architecture} arm64) + (= %{system} linux))) + (target tailwindcss) + (deps tailwindcss-linux-arm64) + (action + (copy %{deps} tailwindcss))) + +(rule + (enabled_if + (and + (= %{architecture} amd64) + (= %{system} macosx))) + (target tailwindcss) + (deps tailwindcss-macos-x64) + (action + (copy %{deps} tailwindcss))) + +(rule + (enabled_if + (and + (= %{architecture} arm64) + (= %{system} macosx))) + (target tailwindcss) + (deps tailwindcss-macos-arm64) + (action + (copy %{deps} tailwindcss)))