Skip to content

Commit 5eb0d78

Browse files
committed
Enforce OxCaml forks
oxcaml-foo.guard ensures unpatched upstreams aren't available oxcaml-foo-patches.enabled depends on patched versions of the upstream package.
1 parent 848da26 commit 5eb0d78

File tree

108 files changed

+1263
-39
lines changed
  • packages
    • ocaml-variants/ocaml-variants.5.2.0+ox
    • oxcaml-alcotest-patches/oxcaml-alcotest-patches.enabled
    • oxcaml-alcotest/oxcaml-alcotest.guard
    • oxcaml-backoff-patches/oxcaml-backoff-patches.enabled
    • oxcaml-backoff/oxcaml-backoff.guard
    • oxcaml-ctypes-foreign-patches/oxcaml-ctypes-foreign-patches.enabled
    • oxcaml-ctypes-foreign/oxcaml-ctypes-foreign.guard
    • oxcaml-ctypes-patches/oxcaml-ctypes-patches.enabled
    • oxcaml-ctypes/oxcaml-ctypes.guard
    • oxcaml-dot-merlin-reader-patches/oxcaml-dot-merlin-reader-patches.enabled
    • oxcaml-dot-merlin-reader/oxcaml-dot-merlin-reader.guard
    • oxcaml-dune-patches/oxcaml-dune-patches.enabled
    • oxcaml-dune-rpc-patches/oxcaml-dune-rpc-patches.enabled
    • oxcaml-dune-rpc/oxcaml-dune-rpc.guard
    • oxcaml-dune/oxcaml-dune.guard
    • oxcaml-dyn-patches/oxcaml-dyn-patches.enabled
    • oxcaml-dyn/oxcaml-dyn.guard
    • oxcaml-eio-patches/oxcaml-eio-patches.enabled
    • oxcaml-eio_linux-patches/oxcaml-eio_linux-patches.enabled
    • oxcaml-eio_linux/oxcaml-eio_linux.guard
    • oxcaml-eio_main-patches/oxcaml-eio_main-patches.enabled
    • oxcaml-eio_main/oxcaml-eio_main.guard
    • oxcaml-eio_posix-patches/oxcaml-eio_posix-patches.enabled
    • oxcaml-eio_posix/oxcaml-eio_posix.guard
    • oxcaml-eio/oxcaml-eio.guard
    • oxcaml-gen_js_api-patches/oxcaml-gen_js_api-patches.enabled
    • oxcaml-gen_js_api/oxcaml-gen_js_api.guard
    • oxcaml-js_of_ocaml-compiler-patches/oxcaml-js_of_ocaml-compiler-patches.enabled
    • oxcaml-js_of_ocaml-compiler/oxcaml-js_of_ocaml-compiler.guard
    • oxcaml-js_of_ocaml-patches/oxcaml-js_of_ocaml-patches.enabled
    • oxcaml-js_of_ocaml-ppx-patches/oxcaml-js_of_ocaml-ppx-patches.enabled
    • oxcaml-js_of_ocaml-ppx/oxcaml-js_of_ocaml-ppx.guard
    • oxcaml-js_of_ocaml-toplevel-patches/oxcaml-js_of_ocaml-toplevel-patches.enabled
    • oxcaml-js_of_ocaml-toplevel/oxcaml-js_of_ocaml-toplevel.guard
    • oxcaml-js_of_ocaml/oxcaml-js_of_ocaml.guard
    • oxcaml-jsonrpc-patches/oxcaml-jsonrpc-patches.enabled
    • oxcaml-jsonrpc/oxcaml-jsonrpc.guard
    • oxcaml-lsp-patches/oxcaml-lsp-patches.enabled
    • oxcaml-lsp/oxcaml-lsp.guard
    • oxcaml-lwt-patches/oxcaml-lwt-patches.enabled
    • oxcaml-lwt_ppx-patches/oxcaml-lwt_ppx-patches.enabled
    • oxcaml-lwt_ppx/oxcaml-lwt_ppx.guard
    • oxcaml-lwt/oxcaml-lwt.guard
    • oxcaml-mdx-patches/oxcaml-mdx-patches.enabled
    • oxcaml-mdx/oxcaml-mdx.guard
    • oxcaml-merlin-lib-patches/oxcaml-merlin-lib-patches.enabled
    • oxcaml-merlin-lib/oxcaml-merlin-lib.guard
    • oxcaml-merlin-patches/oxcaml-merlin-patches.enabled
    • oxcaml-merlin/oxcaml-merlin.guard
    • oxcaml-notty-community-patches/oxcaml-notty-community-patches.enabled
    • oxcaml-notty-community/oxcaml-notty-community.guard
    • oxcaml-obuild-patches/oxcaml-obuild-patches.enabled
    • oxcaml-obuild/oxcaml-obuild.guard
    • oxcaml-ocaml-compiler-libs-patches/oxcaml-ocaml-compiler-libs-patches.enabled
    • oxcaml-ocaml-compiler-libs/oxcaml-ocaml-compiler-libs.guard
    • oxcaml-ocaml-index-patches/oxcaml-ocaml-index-patches.enabled
    • oxcaml-ocaml-index/oxcaml-ocaml-index.guard
    • oxcaml-ocaml-lsp-server-patches/oxcaml-ocaml-lsp-server-patches.enabled
    • oxcaml-ocaml-lsp-server/oxcaml-ocaml-lsp-server.guard
    • oxcaml-ocamlbuild-patches/oxcaml-ocamlbuild-patches.enabled
    • oxcaml-ocamlbuild/oxcaml-ocamlbuild.guard
    • oxcaml-ocamlc-loc-patches/oxcaml-ocamlc-loc-patches.enabled
    • oxcaml-ocamlc-loc/oxcaml-ocamlc-loc.guard
    • oxcaml-ocamlformat-lib-patches/oxcaml-ocamlformat-lib-patches.enabled
    • oxcaml-ocamlformat-lib/oxcaml-ocamlformat-lib.guard
    • oxcaml-ocamlformat-patches/oxcaml-ocamlformat-patches.enabled
    • oxcaml-ocamlformat/oxcaml-ocamlformat.guard
    • oxcaml-odoc-driver-patches/oxcaml-odoc-driver-patches.enabled
    • oxcaml-odoc-driver/oxcaml-odoc-driver.guard
    • oxcaml-odoc-md-patches/oxcaml-odoc-md-patches.enabled
    • oxcaml-odoc-md/oxcaml-odoc-md.guard
    • oxcaml-odoc-parser-patches/oxcaml-odoc-parser-patches.enabled
    • oxcaml-odoc-parser/oxcaml-odoc-parser.guard
    • oxcaml-odoc-patches/oxcaml-odoc-patches.enabled
    • oxcaml-odoc/oxcaml-odoc.guard
    • oxcaml-ojs-patches/oxcaml-ojs-patches.enabled
    • oxcaml-ojs/oxcaml-ojs.guard
    • oxcaml-ordering-patches/oxcaml-ordering-patches.enabled
    • oxcaml-ordering/oxcaml-ordering.guard
    • oxcaml-patch-guards/oxcaml-patch-guards.ox
    • oxcaml-ppx_deriving-patches/oxcaml-ppx_deriving-patches.enabled
    • oxcaml-ppx_deriving/oxcaml-ppx_deriving.guard
    • oxcaml-ppxlib-patches/oxcaml-ppxlib-patches.enabled
    • oxcaml-ppxlib_ast-patches/oxcaml-ppxlib_ast-patches.enabled
    • oxcaml-ppxlib_ast/oxcaml-ppxlib_ast.guard
    • oxcaml-ppxlib/oxcaml-ppxlib.guard
    • oxcaml-re-patches/oxcaml-re-patches.enabled
    • oxcaml-re/oxcaml-re.guard
    • oxcaml-sedlex-patches/oxcaml-sedlex-patches.enabled
    • oxcaml-sedlex/oxcaml-sedlex.guard
    • oxcaml-sherlodoc-patches/oxcaml-sherlodoc-patches.enabled
    • oxcaml-sherlodoc/oxcaml-sherlodoc.guard
    • oxcaml-spawn-patches/oxcaml-spawn-patches.enabled
    • oxcaml-spawn/oxcaml-spawn.guard
    • oxcaml-stdune-patches/oxcaml-stdune-patches.enabled
    • oxcaml-stdune/oxcaml-stdune.guard
    • oxcaml-topkg-patches/oxcaml-topkg-patches.enabled
    • oxcaml-topkg/oxcaml-topkg.guard
    • oxcaml-utop-patches/oxcaml-utop-patches.enabled
    • oxcaml-utop/oxcaml-utop.guard
    • oxcaml-uutf-patches/oxcaml-uutf-patches.enabled
    • oxcaml-uutf/oxcaml-uutf.guard
    • oxcaml-wasm_of_ocaml-compiler-patches/oxcaml-wasm_of_ocaml-compiler-patches.enabled
    • oxcaml-wasm_of_ocaml-compiler/oxcaml-wasm_of_ocaml-compiler.guard
    • oxcaml-zarith-patches/oxcaml-zarith-patches.enabled
    • oxcaml-zarith/oxcaml-zarith.guard

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+1263
-39
lines changed

.gitattributes

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Automatically determine text files and normalise endings in the repository.
2+
* text=auto
3+
4+
# Shell scripts, etc. must have LF endings, even on Windows
5+
*.sh text eol=lf
6+
7+
# All generated by layout.sh
8+
/packages/oxcaml-**/*/opam text linguist-generated

layout.sh

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
#!/usr/bin/env bash
2+
3+
if [[ $(basename "$PWD") != 'packages' ]]; then
4+
echo 'Expect to be run from within a packages directory?'>&2
5+
exit 1
6+
elif [[ ! -d ocaml-variants/ocaml-variants.5.2.0+ox ]]; then
7+
echo 'Expect to be run in an OxCaml opam-repository?'>&2
8+
exit 1
9+
fi
10+
11+
rm -rf oxcaml-*
12+
for entry in *; do
13+
if [[ -d $entry ]]; then
14+
[[ $entry != 'ocaml-variants' ]] || continue
15+
for package in "$entry/"*; do
16+
if [[ -e $package/opam ]]; then
17+
package="${package#"$entry"/}"
18+
case $package in
19+
*~preview.*)
20+
# Ignore JS 0.18 preview packages
21+
;;
22+
*)
23+
if [[ ! -e oxcaml-patch-guards/oxcaml-patch-guards.ox/opam ]]; then
24+
mkdir -p oxcaml-patch-guards/oxcaml-patch-guards.ox
25+
cat > oxcaml-patch-guards/oxcaml-patch-guards.ox/opam <<EOF
26+
opam-version: "2.0"
27+
synopsis: "OxCaml patched upstream packages"
28+
description: """
29+
oxcaml-patch-guards and the associated oxcaml-* packages ensure that when a
30+
non-Jane Street package in opam-repository has to be patched to work with OxCaml
31+
that only those patched versions can be used in a switch with OxCaml."""
32+
maintainer: "David Allsopp <david@tarides.com>"
33+
authors: "David Allsopp"
34+
license: "CC0-1.0+"
35+
homepage: "https://oxcaml.org"
36+
bug-reports: "https://github.com/oxcaml/opam-repository/issues"
37+
depends: [
38+
EOF
39+
fi
40+
if [[ ! -e oxcaml-$entry/oxcaml-$entry.guard/opam ]]; then
41+
mkdir -p "oxcaml-$entry/oxcaml-$entry.guard"
42+
cat > "oxcaml-$entry/oxcaml-$entry.guard/opam" <<EOF
43+
opam-version: "2.0"
44+
synopsis: "OxCaml patched $entry (not installed)"
45+
description: "OxCaml meta-package indicating this package is not installed"
46+
maintainer: "David Allsopp <david@tarides.com>"
47+
authors: "David Allsopp"
48+
license: "CC0-1.0+"
49+
homepage: "https://oxcaml.org"
50+
bug-reports: "https://github.com/oxcaml/opam-repository/issues"
51+
conflicts: [ "oxcaml-$entry-patches" "$entry" ]
52+
EOF
53+
cat >> oxcaml-patch-guards/oxcaml-patch-guards.ox/opam << EOF
54+
("oxcaml-$entry" {post} | "oxcaml-$entry-patches" {post})
55+
EOF
56+
mkdir -p "oxcaml-$entry-patches/oxcaml-$entry-patches.enabled"
57+
cat > "oxcaml-$entry-patches/oxcaml-$entry-patches.enabled/opam" <<EOF
58+
opam-version: "2.0"
59+
synopsis: "OxCaml patched $entry"
60+
description: "OxCaml meta-package indicating this library is installed"
61+
maintainer: "David Allsopp <david@tarides.com>"
62+
authors: "David Allsopp"
63+
license: "CC0-1.0+"
64+
homepage: "https://oxcaml.org"
65+
bug-reports: "https://github.com/oxcaml/opam-repository/issues"
66+
conflicts: "oxcaml-$entry"
67+
depends: "$entry" {build & (
68+
${entry//?/ } = "${package#"$entry".}"
69+
EOF
70+
else
71+
cat >> "oxcaml-$entry-patches/oxcaml-$entry-patches.enabled/opam" <<EOF
72+
${entry//?/ } | = "${package#"$entry".}"
73+
EOF
74+
fi;;
75+
esac
76+
fi
77+
done
78+
fi
79+
done
80+
81+
for entry in oxcaml-*; do
82+
case $entry in
83+
oxcaml-*-patches)
84+
package="${entry#oxcaml-}"
85+
package="${package%-patches}"
86+
cat >> "$entry/"*"/opam" <<EOF
87+
${package//?/ } )}
88+
EOF
89+
;;
90+
esac
91+
done
92+
93+
echo ']' >> oxcaml-patch-guards/oxcaml-patch-guards.ox/opam

packages/ocaml-variants/ocaml-variants.5.2.0+ox/opam

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ depends: [
1717
"base-domains" {post}
1818
"base-nnp" {post}
1919
"ocaml-options-vanilla" {post}
20+
"oxcaml-patch-guards" {post}
2021
]
2122
conflict-class: "ocaml-core-compiler"
2223
flags: compiler
@@ -105,43 +106,5 @@ extra-files: [
105106
]
106107
]
107108
conflicts: [
108-
"base" {< "v0.18~"}
109-
"alcotest" {!= "1.9.0+ox"}
110-
"backoff" {!= "0.1.1+ox"}
111-
"ctypes" {!= "0.23.0+ox"}
112-
"ctypes-foreign" {!= "0.23.0+ox"}
113-
"dot-merlin-reader" {!= "5.2.1-502+ox"}
114-
"dune" {<= "3.20.2"}
115-
"gen_js_api" {!= "1.1.2+ox"}
116-
"js_of_ocaml" {!= "6.0.1+ox"}
117-
"js_of_ocaml-compiler" {!= "6.0.1+ox"}
118-
"js_of_ocaml-ppx" {!= "6.0.1+ox"}
119-
"js_of_ocaml-toplevel" {!= "6.0.1+ox"}
120-
"jsonrpc" {!= "1.19.0+ox"}
121-
"lsp" {!= "1.19.0+ox"}
122-
"lwt_ppx" {!= "5.9.1+ox"}
123-
"mdx" {!= "2.5.0+ox"}
124-
"merlin" {!= "5.2.1-502+ox"}
125-
"merlin-lib" {!= "5.2.1-502+ox"}
126-
"notty-community" {!= "0.2.4+ox"}
127-
"ocaml-compiler-libs" {!= "v0.17.0+ox"}
128-
"ocaml-index" {!= "1.1+ox"}
129-
"ocaml-lsp-server" {!= "1.19.0+ox"}
130-
"ocamlbuild" {!= "0.15.0+ox"}
131-
"ocamlformat" {!= "0.26.2+ox"}
132-
"ocamlformat-lib" {!= "0.26.2+ox"}
133-
"ojs" {!= "1.1.2+ox"}
134-
"ppxlib" {!= "0.33.0+ox"}
135-
"ppxlib_ast" {!= "0.33.0+ox"}
136-
"re" {!= "1.14.0+ox"}
137-
"sedlex" {!= "3.6+ox"}
138-
"spawn" {!= "v0.15.1+ox"}
139-
"topkg" {!= "1.0.8+ox"}
140-
"uTop" {!= "2.16.0+ox"}
141-
"uutf" {!= "1.0.3+ox"}
142-
"wasm_of_ocaml-compiler" {!= "6.0.1+ox"}
143-
"zarith" {<"1.12"}
144-
"zarith" {="1.12"}
145-
"zarith" {="1.13"}
146-
"zarith" {="1.14"}
109+
"sexplib0" {< "v0.18~"}
147110
]

packages/oxcaml-alcotest-patches/oxcaml-alcotest-patches.enabled/opam

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/oxcaml-alcotest/oxcaml-alcotest.guard/opam

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/oxcaml-backoff-patches/oxcaml-backoff-patches.enabled/opam

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/oxcaml-backoff/oxcaml-backoff.guard/opam

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/oxcaml-ctypes-foreign-patches/oxcaml-ctypes-foreign-patches.enabled/opam

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/oxcaml-ctypes-foreign/oxcaml-ctypes-foreign.guard/opam

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/oxcaml-ctypes-patches/oxcaml-ctypes-patches.enabled/opam

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)