diff --git a/packages/ocaml-system/ocaml-system.4.14.3+dev-xapi-2025-02-13/opam b/packages/ocaml-system/ocaml-system.4.14.3+dev-xapi-2025-02-13/opam new file mode 100644 index 000000000..b69c16a05 --- /dev/null +++ b/packages/ocaml-system/ocaml-system.4.14.3+dev-xapi-2025-02-13/opam @@ -0,0 +1,70 @@ +opam-version: "2.0" +name: "ocaml-system" +version: "4.14.3+dev-xapi-2025-02-13" +synopsis: "The OCaml compiler (system version, from outside of opam)" +maintainer: [ + "David Allsopp " + "Florian Angeletti " +] +authors: "Xavier Leroy and many contributors" +license: "LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception" +homepage: "https://ocaml.org" +bug-reports: "https://github.com/ocaml/opam-repository/issues" +depends: [ + "ocaml" {>= "4.14.3~" & < "4.14.4~" & post} + "base-unix" {post} + "base-threads" {post} + "base-bigarray" {post} + "host-arch-arm32" {?sys-ocaml-arch & sys-ocaml-arch = "arm" & post} + "host-arch-arm64" {?sys-ocaml-arch & sys-ocaml-arch = "arm64" & post} + "host-arch-ppc64" {?sys-ocaml-arch & sys-ocaml-arch = "power" & post} + "host-arch-riscv64" {?sys-ocaml-arch & sys-ocaml-arch = "riscv" & post} + "host-arch-s390x" {?sys-ocaml-arch & sys-ocaml-arch = "s390x" & post} + "host-arch-x86_32" {?sys-ocaml-arch & sys-ocaml-arch = "i686" & post} + "host-arch-x86_64" {?sys-ocaml-arch & sys-ocaml-arch = "x86_64" & post} + "host-arch-unknown" + {(!?sys-ocaml-arch) | + sys-ocaml-arch != "arm" & sys-ocaml-arch != "arm64" & + sys-ocaml-arch != "power" & + sys-ocaml-arch != "riscv" & + sys-ocaml-arch != "s390x" & + sys-ocaml-arch != "i686" & + sys-ocaml-arch != "x86_64" & + post} + "host-system-mingw" + {?sys-ocaml-arch & sys-ocaml-libc = "msvc" & sys-ocaml-cc = "cc" & post} + "host-system-msvc" {?sys-ocaml-arch & sys-ocaml-cc = "msvc" & post} + "host-system-other" {?sys-ocaml-arch & sys-ocaml-libc != "msvc" & post} + "conf-mingw-w64-gcc-x86_64" + {?sys-ocaml-arch & sys-ocaml-arch = "x86_64" & sys-ocaml-libc = "msvc" & + sys-ocaml-cc = "cc" & + post} + "conf-mingw-w64-gcc-i686" + {?sys-ocaml-arch & sys-ocaml-arch = "i686" & sys-ocaml-libc = "msvc" & + sys-ocaml-cc = "cc" & + post} + "mingw-w64-shims" + {?sys-ocaml-arch & sys-ocaml-libc = "msvc" & sys-ocaml-cc = "cc" & + os-distribution = "cygwin" & + post} + "ocaml-env-msvc32" + {?sys-ocaml-arch & sys-ocaml-arch = "i686" & sys-ocaml-cc = "msvc" & post} + "ocaml-env-msvc64" + {?sys-ocaml-arch & sys-ocaml-arch = "x86_64" & sys-ocaml-cc = "msvc" & + post} +] +conflict-class: "ocaml-core-compiler" +available: + (sys-ocaml-version >= "4.14.3~" & sys-ocaml-version < "4.14.4" ) & (os != "win32" | sys-ocaml-libc = "msvc") +flags: compiler +build: ["ocaml" "gen_ocaml_config.ml"] +substs: "gen_ocaml_config.ml" +dev-repo: "git+https://github.com/ocaml/ocaml" +extra-source "gen_ocaml_config.ml.in" { + src: + "https://raw.githubusercontent.com/ocaml/opam-source-archives/main/patches/ocaml-system/gen_ocaml_config.ml.in" + checksum: [ + "sha256=71bcd3d35e28cbf71eda81991c8741268f4b87ced71573b2e75f64f136cebfc1" + "md5=093e7bec1ec95f9e4c6a313d73c5d840" + ] +} diff --git a/packages/ocaml/ocaml.4.14.3/opam b/packages/ocaml/ocaml.4.14.3/opam new file mode 100644 index 000000000..d19effee2 --- /dev/null +++ b/packages/ocaml/ocaml.4.14.3/opam @@ -0,0 +1,39 @@ +opam-version: "2.0" +name: "ocaml" +version: "4.14.3" +synopsis: "The OCaml compiler (virtual package)" +description: """\ +This package requires a matching implementation of OCaml, +and polls it to initialise specific variables like `ocaml:native-dynlink`""" +maintainer: "David Allsopp " +authors: [ + "Xavier Leroy" + "Damien Doligez" + "Alain Frisch" + "Jacques Garrigue" + "Didier Rémy" + "Jérôme Vouillon" +] +license: "LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception" +homepage: "https://ocaml.org" +bug-reports: "https://github.com/ocaml/opam-repository/issues" +depends: [ + "ocaml-config" {>= "2"} + "ocaml-base-compiler" {>= "4.14.3~" & < "4.14.4~"} | + "ocaml-variants" {>= "4.14.3~" & < "4.14.4~"} | + "ocaml-system" {>= "4.14.3" & < "4.14.4~"} | + "dkml-base-compiler" {>= "4.14.3~" & < "4.14.4~"} +] +flags: conf +setenv: [ + [CAML_LD_LIBRARY_PATH = "%{_:stubsdir}%"] + [CAML_LD_LIBRARY_PATH += "%{lib}%/stublibs"] + [OCAML_TOPLEVEL_PATH = "%{toplevel}%"] +] +build: [ + "ocaml" "%{ocaml-config:share}%/gen_ocaml_config.ml" _:version _:name +] +build-env: CAML_LD_LIBRARY_PATH = "" +x-env-path-rewrite: [ + [CAML_LD_LIBRARY_PATH (";" {os = "win32"} ":" {os != "win32"}) "target"] +] diff --git a/packages/rpclib/rpclib.9.0.0+2/files/4f9b5d2b9ef494331eeab070422ba99ca982d82c.patch b/packages/rpclib/rpclib.9.0.0+2/files/4f9b5d2b9ef494331eeab070422ba99ca982d82c.patch deleted file mode 100644 index 47a71f3d7..000000000 --- a/packages/rpclib/rpclib.9.0.0+2/files/4f9b5d2b9ef494331eeab070422ba99ca982d82c.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 4f9b5d2b9ef494331eeab070422ba99ca982d82c Mon Sep 17 00:00:00 2001 -From: Vincent Liu -Date: Thu, 29 Feb 2024 16:42:38 +0000 -Subject: [PATCH 3/3] Fix typo in test_pythongen.ml - ---- - tests/rpc/test_pythongen.ml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tests/rpc/test_pythongen.ml b/tests/rpc/test_pythongen.ml -index 0572169..6a5f586 100644 ---- a/tests/rpc/test_pythongen.ml -+++ b/tests/rpc/test_pythongen.ml -@@ -199,6 +199,6 @@ let tests = - , lint_bindings ) - ; "Check generated commandline bindings", `Slow, test_commandline - ; "Check generated test class with commandline bindings", `Slow, check_test_class -- ; "Cehck generated exceptions", `Slow, check_exceptions -+ ; "Check generated exceptions", `Slow, check_exceptions - ; "Check python generation on variants with zero-arg constructors", `Quick, check_unit_variants - ] --- -2.41.0 - diff --git a/packages/rpclib/rpclib.9.0.0+2/files/6cacde3c903e959d6e9b89a275b271ab7040ef54.patch b/packages/rpclib/rpclib.9.0.0+2/files/6cacde3c903e959d6e9b89a275b271ab7040ef54.patch deleted file mode 100644 index d889e6d58..000000000 --- a/packages/rpclib/rpclib.9.0.0+2/files/6cacde3c903e959d6e9b89a275b271ab7040ef54.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 6cacde3c903e959d6e9b89a275b271ab7040ef54 Mon Sep 17 00:00:00 2001 -From: Vincent Liu -Date: Wed, 28 Feb 2024 17:02:12 +0000 -Subject: [PATCH 1/3] Check for list emptiness before checking variants - -Signed-off-by: Vincent Liu ---- - src/lib/pythongen.ml | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - -diff --git a/src/lib/pythongen.ml b/src/lib/pythongen.ml -index ead82af..70fbb74 100644 ---- a/src/lib/pythongen.ml -+++ b/src/lib/pythongen.ml -@@ -213,10 +213,12 @@ let rec typecheck : type a. a typ -> string -> t list = - variants - in - let check_contents = -- List.fold_left -- (fun acc x -> List.concat [ acc; check false x ]) -- (check true (List.hd variants_to_check)) -- (List.tl variants_to_check) -+ match variants_to_check with -+ | [] -> [] -+ | v :: vs -> -+ List.fold_left -+ (fun acc x -> List.concat [ acc; check false x ]) -+ (check true v) vs - in - let all_tags = List.map (fun (BoxedTag t) -> t.tname) variants in - let pylist = --- -2.41.0 - diff --git a/packages/rpclib/rpclib.9.0.0+2/files/d610d47bfebbea9b0b1707bfffe26a0ff52a0720.patch b/packages/rpclib/rpclib.9.0.0+2/files/d610d47bfebbea9b0b1707bfffe26a0ff52a0720.patch deleted file mode 100644 index 9255746f8..000000000 --- a/packages/rpclib/rpclib.9.0.0+2/files/d610d47bfebbea9b0b1707bfffe26a0ff52a0720.patch +++ /dev/null @@ -1,86 +0,0 @@ -From d610d47bfebbea9b0b1707bfffe26a0ff52a0720 Mon Sep 17 00:00:00 2001 -From: Vincent Liu -Date: Thu, 29 Feb 2024 11:21:33 +0000 -Subject: [PATCH 2/3] Add unit test for pythongen code - -This tests whether it can handle the case where a varaiant consist only -of zero-arg constructors. - -Signed-off-by: Vincent Liu ---- - tests/rpc/test_pythongen.ml | 47 +++++++++++++++++++++++++++++++++++++ - 1 file changed, 47 insertions(+) - -diff --git a/tests/rpc/test_pythongen.ml b/tests/rpc/test_pythongen.ml -index 1544b03..0572169 100644 ---- a/tests/rpc/test_pythongen.ml -+++ b/tests/rpc/test_pythongen.ml -@@ -67,6 +67,50 @@ module Interface (R : Idl.RPC) = struct - end - - module IfCode = Interface (Codegen.Gen ()) -+module UnitVInterface (R : Idl.RPC) = struct -+ open R -+ -+ type unit_variant = -+ | Empty -+ | Hollow -+ | Vacant -+ | Void -+ [@@deriving rpcty] -+ -+ let unit_variant_p = Idl.Param.mk ~name:"unit_variant" unit_variant -+ let int_p = Idl.Param.mk Rpc.Types.int -+ -+ let discard_v = -+ R.declare -+ "discard_v" -+ [ "constant function taking a unit variant and discards it by returning an integer" -+ ] -+ (unit_variant_p @-> returning int_p Idl.DefaultError.err) -+ -+ let implementation = -+ implement -+ { Idl.Interface.name = "UnitVInterface" -+ ; namespace = Some "UnitVInterface" -+ ; description = -+ [ "Unit variant interface which does absolutely nothing. Only used to test \ -+ whether the pythongen code can handle variants with zero argument \ -+ constructors." -+ ] -+ ; version = 1, 0, 0 -+ } -+end -+ -+module UnitVCode : sig -+ val implementation : unit -> Codegen.Interface.t -+end = -+ UnitVInterface (Codegen.Gen ()) -+ -+let unitv_interface = -+ Codegen.Interfaces.create -+ ~name:"unitv" -+ ~title:"Unit Variant" -+ ~description:[ "Interface for Unit variant" ] -+ ~interfaces:[ UnitVCode.implementation () ] - - let interfaces = - Codegen.Interfaces.create -@@ -146,6 +190,8 @@ let check_exceptions () = - gen_python_bindings "python/bindings.py"; - run_cmd "Exceptions should be correctly generated" "python python/exn_test.py" - -+let check_unit_variants () = -+ Pythongen.of_interfaces interfaces |> Pythongen.string_of_ts |> ignore - - let tests = - [ ( "Check generated test interface bindings with pylint & pycodestyle" -@@ -154,4 +200,5 @@ let tests = - ; "Check generated commandline bindings", `Slow, test_commandline - ; "Check generated test class with commandline bindings", `Slow, check_test_class - ; "Cehck generated exceptions", `Slow, check_exceptions -+ ; "Check python generation on variants with zero-arg constructors", `Quick, check_unit_variants - ] --- -2.41.0 - diff --git a/packages/rpclib/rpclib.9.0.0+2/files/e7054a81e126cf69ce5eea26cbd10741ea67fe2d.patch b/packages/rpclib/rpclib.9.0.0+2/files/e7054a81e126cf69ce5eea26cbd10741ea67fe2d.patch deleted file mode 100644 index 471eff00e..000000000 --- a/packages/rpclib/rpclib.9.0.0+2/files/e7054a81e126cf69ce5eea26cbd10741ea67fe2d.patch +++ /dev/null @@ -1,72 +0,0 @@ -From e7054a81e126cf69ce5eea26cbd10741ea67fe2d Mon Sep 17 00:00:00 2001 -From: Bernhard Kaindl -Date: Mon, 26 Jun 2023 15:19:07 +0200 -Subject: [PATCH] src/lib/pythongen.ml: Fix InternalError(str(exception)) for - Py3 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -In `src/lib/pythongen.ml`, fix `return InternalError(str(exn)).failure()`: - -For Python3, `compat_block` defines `str = bytes`: -```ml - ; Line "if sys.version_info[0] > 2:" - ; Block [ Line "long = int"; Line "unicode = str"; Line "str = bytes" ] -``` -The easy fix is to get a copy of `str` and use it to convert `exn` to `str`: -```py -get_str = str -if PY3: - str = bytes -... - # In the generated code: - return InternalError(get_str(exn).failure()) -``` -(Instead, we could also prepend `def get_str(a): return str(a)`, -this is just shorter. It would be fine either way.) - -Without this fix, `str(Exception())`, `compat_block` causes it to be -`bytes(Exception())` on Py3. This would raise a `TypeError` because -`Exception` can't be converted to `bytes`: - -```py -$ python3 -c 'str = bytes; str(Exception("hi"))' - -Traceback (most recent call last): - File "", line 1, in -TypeError: cannot convert 'Exception' object to bytes -``` - -Setting `get_str()` to be `str()` for Py2 and Py3 fixes it and gets a `str` -for `InternalError.__init__(arg)` (which expects a `str` value as argument) - -Co-authored-by: Edwin Török -Signed-off-by: Bernhard Kaindl ---- - src/lib/pythongen.ml | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/src/lib/pythongen.ml b/src/lib/pythongen.ml -index 424c65d..ead82af 100644 ---- a/src/lib/pythongen.ml -+++ b/src/lib/pythongen.ml -@@ -97,7 +97,8 @@ class ListAction(argparse.Action): - - - let compat_block = -- [ Line "if sys.version_info[0] > 2:" -+ [ Line "get_str = str" -+ ; Line "if sys.version_info[0] > 2:" - ; Block [ Line "long = int"; Line "unicode = str"; Line "str = bytes" ] - ; Line "" - ] -@@ -847,7 +848,7 @@ let of_interfaces ?(helpers = inline_defaults) i = - ; Block - [ Line {|logging.log("caught %s", exn)|} - ; Line "traceback.print_exc()" -- ; Line "return InternalError(str(exn)).failure()" -+ ; Line "return InternalError(get_str(exn)).failure()" - ] - ] - ] diff --git a/packages/rpclib/rpclib.9.0.0+2/files/fddc7da9e35527f049a7fbabd072d55e0ace14ea.patch b/packages/rpclib/rpclib.9.0.0+2/files/fddc7da9e35527f049a7fbabd072d55e0ace14ea.patch deleted file mode 100644 index d34039a91..000000000 --- a/packages/rpclib/rpclib.9.0.0+2/files/fddc7da9e35527f049a7fbabd072d55e0ace14ea.patch +++ /dev/null @@ -1,41 +0,0 @@ -From fddc7da9e35527f049a7fbabd072d55e0ace14ea Mon Sep 17 00:00:00 2001 -From: Marcello Seri -Date: Thu, 16 Jun 2022 20:32:22 +0200 -Subject: [PATCH] rpclib-js: address deprecation - -Signed-off-by: Marcello Seri ---- - src/js/rpc_client_js_helper.ml | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/js/rpc_client_js_helper.ml b/src/js/rpc_client_js_helper.ml -index c0ec1e5..1bd3ee7 100644 ---- a/src/js/rpc_client_js_helper.ml -+++ b/src/js/rpc_client_js_helper.ml -@@ -5,7 +5,7 @@ - let keys obj = - let arr = - Js_of_ocaml.Js.Unsafe.meth_call -- (Js_of_ocaml.Js.Unsafe.variable "Object") -+ (Js_of_ocaml.Js.Unsafe.pure_js_expr "Object") - "keys" - [| Js_of_ocaml.Js.Unsafe.inject obj |] - in -@@ -16,7 +16,7 @@ let keys obj = - let is_array obj = - let str = - Js_of_ocaml.Js.Unsafe.call -- (Js_of_ocaml.Js.Unsafe.variable "Object.prototype.toString") -+ (Js_of_ocaml.Js.Unsafe.pure_js_expr "Object.prototype.toString") - obj - [||] - in -@@ -24,7 +24,7 @@ let is_array obj = - - - (* Magic to find out whether something is one of the Js_of_ocaml Javascript string types *) --let mlString_constr = Js_of_ocaml.Js.Unsafe.variable "MlString" -+let mlString_constr = Js_of_ocaml.Js.Unsafe.pure_js_expr "MlString" - let is_string obj = Js_of_ocaml.Js.instanceof obj mlString_constr - - (* Seems to work. I hope there's a better way of doing this! *) diff --git a/packages/rpclib/rpclib.9.0.0+2/opam b/packages/rpclib/rpclib.9.0.0+2/opam index eee3bd7a0..27df9ae13 100644 --- a/packages/rpclib/rpclib.9.0.0+2/opam +++ b/packages/rpclib/rpclib.9.0.0+2/opam @@ -35,42 +35,11 @@ build: [ ["dune" "build" "-p" name "-j" jobs] ["dune" "runtest" "-p" name "-j" jobs] {with-test} ] -patches: [ - "fddc7da9e35527f049a7fbabd072d55e0ace14ea.patch" - "e7054a81e126cf69ce5eea26cbd10741ea67fe2d.patch" - "6cacde3c903e959d6e9b89a275b271ab7040ef54.patch" - "d610d47bfebbea9b0b1707bfffe26a0ff52a0720.patch" - "4f9b5d2b9ef494331eeab070422ba99ca982d82c.patch" -] +patches: [ ] dev-repo: "git+https://github.com/mirage/ocaml-rpc.git" extra-files: [ - [ - "fddc7da9e35527f049a7fbabd072d55e0ace14ea.patch" - "sha256=40f9c30a32ffd4ba5c442a189ff34b3c7b8b381966d11f9e0d5567cc7883b67a" - ] - [ - "e7054a81e126cf69ce5eea26cbd10741ea67fe2d.patch" - "sha256=710434a738856df4481a79ef1ec6c34a0e6752ffc9b0463f11fd92ecfc75d1eb" - ] - [ - "6cacde3c903e959d6e9b89a275b271ab7040ef54.patch" - "sha256=543864f94b09a6b1b0fa866b3af8bb94eebfcd66dd0fb8fd3a6e4c10105158ec" - ] - [ - "d610d47bfebbea9b0b1707bfffe26a0ff52a0720.patch" - "sha256=a618d191570194d9f0020e1099c927480b3db7de8fd2f4c4ce380da6158e8cf7" - ] - [ - "4f9b5d2b9ef494331eeab070422ba99ca982d82c.patch" - "sha256=b220112573f132d10409168f75367da1ce32321f64103b25af29349ddf0a7526" - ] ] url { src: - "https://github.com/mirage/ocaml-rpc/releases/download/9.0.0/rpclib-9.0.0.tbz" - checksum: [ - "sha256=ce23eb756c028d9374bd19823296bddb7c237d3f055452d30d1cf7d15216e963" - "sha512=d4dfd7a9ee1b7996c24819ac1895925af0ad732f117c6e06cd28c215b14aa094dbd045e44d7f84c0eeb7ab807ed970d6879c29d07b02377fcb928325124ba7f6" - ] + "https://github.com/edwintorok/ocaml-rpc/archive/test.tar.gz" } -x-commit-hash: "273c27c8d37110ca1c92b997d93e979aebcb5079"