From 7322cf00529780f29173304ab2f45ef50a71eae3 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Sat, 11 Jun 2022 08:14:12 +0100 Subject: [PATCH 1/5] Patch opam-depext for bytecode-only builds --- packages/opam-depext/opam-depext.1.2.1-1/opam | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 packages/opam-depext/opam-depext.1.2.1-1/opam diff --git a/packages/opam-depext/opam-depext.1.2.1-1/opam b/packages/opam-depext/opam-depext.1.2.1-1/opam new file mode 100644 index 00000000000..60073f365ed --- /dev/null +++ b/packages/opam-depext/opam-depext.1.2.1-1/opam @@ -0,0 +1,53 @@ +opam-version: "2.0" +synopsis: "Install OS distribution packages" +description: """\ +opam-depext is a simple program intended to facilitate the interaction between +OPAM packages and the host package management system. It can query OPAM for the +right external dependencies on a set of packages, depending on the host OS, and +call the OS's package manager in the appropriate way to install them.""" +maintainer: [ + "Louis Gesbert " + "Anil Madhavapeddy " +] +authors: [ + "Louis Gesbert " + "Anil Madhavapeddy " +] +license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" +homepage: "https://github.com/ocaml/opam-depext" +bug-reports: "https://github.com/ocaml/opam-depext/issues" +depends: [ + "ocaml" {>= "4.00"} + "base-unix" + "cmdliner" {>= "0.9.8" & dev} + "ocamlfind" {dev} +] +depopts: "ocaml-option-bytecode-only" +available: opam-version >= "2.0.0~beta5" +flags: plugin +build: [ + ["sed" "-ib" "-e" "/all:/s/ncl//" "src_ext/Makefile"] + [make "OCAMLOPT=%{ocaml-option-bytecode-only:installed?no:ocamlopt}%"] {!dev} + [ + "ocamlfind" + "%{ocaml:native?ocamlopt:ocamlc}%" + "-package" + "unix,cmdliner" + "-linkpkg" + "-o" + "opam-depext" + "depext.ml" + ] {dev} +] +post-messages: + "opam-depext is unnecessary when used with opam >= 2.1. Please use opam install directly instead" + {opam-version >= "2.1"} +dev-repo: "git+https://github.com/ocaml/opam-depext.git#2.0" +url { + src: + "https://github.com/ocaml-opam/opam-depext/releases/download/v1.2.1/opam-depext-full-1.2.1.tbz" + checksum: [ + "md5=7bda1fdbd88322e8f515919c82a37a2a" + "sha512=a031289ac4e2d4d28bf02b892313b2a0ee724c94f0b7a131b3d9bccc5fbaf2292834d53dd6a0b7134f43bab06ee70bd2c98562fb3a6a03f1a526981290cbf501" + ] +} From ee720211f5597117a549eafd2ceecaf2051b77f0 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Sat, 11 Jun 2022 08:17:28 +0100 Subject: [PATCH 2/5] Conflict native options in bytecode-only Flambda, frame-pointers and AFL are native-code compilation options and don't make sense in a bytecode-only switch. --- .../ocaml-option-bytecode-only/ocaml-option-bytecode-only.1/opam | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/ocaml-option-bytecode-only/ocaml-option-bytecode-only.1/opam b/packages/ocaml-option-bytecode-only/ocaml-option-bytecode-only.1/opam index 3d323fc8eb5..ea2a50b4ae0 100644 --- a/packages/ocaml-option-bytecode-only/ocaml-option-bytecode-only.1/opam +++ b/packages/ocaml-option-bytecode-only/ocaml-option-bytecode-only.1/opam @@ -3,5 +3,6 @@ synopsis: "Compile OCaml without the native-code compiler" depends: [ "ocaml-variants" {post & >= "4.12.0~"} ] +conflicts: [ "ocaml-option-afl" "ocaml-option-fp" "ocaml-option-flambda" ] maintainer: "platform@lists.ocaml.org" flags: compiler From 29070509630e5d09d7701cb1b4c17a498b6dc3a6 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Sat, 11 Jun 2022 08:26:25 +0100 Subject: [PATCH 3/5] ocaml-option-fp only available on linux x86_64 --- packages/ocaml-option-fp/ocaml-option-fp.1/opam | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/ocaml-option-fp/ocaml-option-fp.1/opam b/packages/ocaml-option-fp/ocaml-option-fp.1/opam index dcca3e4008d..de5e6a150f7 100644 --- a/packages/ocaml-option-fp/ocaml-option-fp.1/opam +++ b/packages/ocaml-option-fp/ocaml-option-fp.1/opam @@ -4,5 +4,6 @@ depends: [ "ocaml-variants" {post & >= "4.12.0~"} ] conflicts: ["ocaml-option-musl"] +available: os = "linux" & arch = "x86_64" maintainer: "platform@lists.ocaml.org" flags: compiler From 3487a6f7f7ac386ffe67209186b563fe2d935019 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Sat, 11 Jun 2022 08:26:39 +0100 Subject: [PATCH 4/5] OCaml 5.x doesn't yet support frame pointers --- packages/ocaml-variants/ocaml-variants.5.0.0+trunk/opam | 2 +- packages/ocaml-variants/ocaml-variants.5.1.0+trunk/opam | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ocaml-variants/ocaml-variants.5.0.0+trunk/opam b/packages/ocaml-variants/ocaml-variants.5.0.0+trunk/opam index ecfc6dc9a6c..18480d486c4 100644 --- a/packages/ocaml-variants/ocaml-variants.5.0.0+trunk/opam +++ b/packages/ocaml-variants/ocaml-variants.5.0.0+trunk/opam @@ -63,6 +63,7 @@ post-messages: [ to force a sequential build instead." {failure & jobs > 1 & os != "cygwin" & opam-version >= "2.0.5"} ] +conflicts: [ "ocaml-option-fp" ] depopts: [ "ocaml-option-32bit" "ocaml-option-afl" @@ -70,7 +71,6 @@ depopts: [ "ocaml-option-default-unsafe-string" "ocaml-option-no-flat-float-array" "ocaml-option-flambda" - "ocaml-option-fp" "ocaml-option-musl" "ocaml-option-static" ] diff --git a/packages/ocaml-variants/ocaml-variants.5.1.0+trunk/opam b/packages/ocaml-variants/ocaml-variants.5.1.0+trunk/opam index e186a94ab7d..37b81a8fa12 100644 --- a/packages/ocaml-variants/ocaml-variants.5.1.0+trunk/opam +++ b/packages/ocaml-variants/ocaml-variants.5.1.0+trunk/opam @@ -63,6 +63,7 @@ post-messages: [ to force a sequential build instead." {failure & jobs > 1 & os != "cygwin" & opam-version >= "2.0.5"} ] +conflicts: [ "ocaml-option-fp" ] depopts: [ "ocaml-option-32bit" "ocaml-option-afl" @@ -70,7 +71,6 @@ depopts: [ "ocaml-option-default-unsafe-string" "ocaml-option-no-flat-float-array" "ocaml-option-flambda" - "ocaml-option-fp" "ocaml-option-musl" "ocaml-option-static" ] From 98911a0f405a9a9bad86279c00c823929deb3619 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Sat, 11 Jun 2022 08:42:41 +0100 Subject: [PATCH 5/5] Update OCaml 5.x architecture support Native compiler requires amd64 or arm64. --- packages/ocaml-option-32bit/ocaml-option-32bit.1/opam | 2 +- packages/ocaml-variants/ocaml-variants.5.0.0+trunk/opam | 2 +- packages/ocaml-variants/ocaml-variants.5.1.0+trunk/opam | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/ocaml-option-32bit/ocaml-option-32bit.1/opam b/packages/ocaml-option-32bit/ocaml-option-32bit.1/opam index 872b9f484eb..e782051c597 100644 --- a/packages/ocaml-option-32bit/ocaml-option-32bit.1/opam +++ b/packages/ocaml-option-32bit/ocaml-option-32bit.1/opam @@ -4,7 +4,7 @@ depexts: [ ["gcc-multilib" "g++-multilib"] {os-family = "debian"} ] depends: [ - "ocaml-variants" {post & >= "4.12.0~"} + "ocaml-variants" {post & >= "4.12.0~" & < "5.0.0~~"} | ("ocaml-variants" {post & >= "5.0.0~~"} "ocaml-option-bytecode-only") ] available: [ arch = "x86_64" & (os = "linux" | os = "macos") ] maintainer: "platform@lists.ocaml.org" diff --git a/packages/ocaml-variants/ocaml-variants.5.0.0+trunk/opam b/packages/ocaml-variants/ocaml-variants.5.0.0+trunk/opam index 18480d486c4..d343cedf1a9 100644 --- a/packages/ocaml-variants/ocaml-variants.5.0.0+trunk/opam +++ b/packages/ocaml-variants/ocaml-variants.5.0.0+trunk/opam @@ -13,6 +13,7 @@ depends: [ "base-threads" {post} "base-domains" {post} "base-nnp" {post} + "ocaml-option-bytecode-only" {arch != "arm64" & arch != "x86_64"} "ocaml-beta" {opam-version < "2.1.0"} ] conflict-class: "ocaml-core-compiler" @@ -67,7 +68,6 @@ conflicts: [ "ocaml-option-fp" ] depopts: [ "ocaml-option-32bit" "ocaml-option-afl" - "ocaml-option-bytecode-only" "ocaml-option-default-unsafe-string" "ocaml-option-no-flat-float-array" "ocaml-option-flambda" diff --git a/packages/ocaml-variants/ocaml-variants.5.1.0+trunk/opam b/packages/ocaml-variants/ocaml-variants.5.1.0+trunk/opam index 37b81a8fa12..63c793bd121 100644 --- a/packages/ocaml-variants/ocaml-variants.5.1.0+trunk/opam +++ b/packages/ocaml-variants/ocaml-variants.5.1.0+trunk/opam @@ -13,6 +13,7 @@ depends: [ "base-threads" {post} "base-domains" {post} "base-nnp" {post} + "ocaml-option-bytecode-only" {arch != "arm64" & arch != "x86_64"} "ocaml-beta" {opam-version < "2.1.0"} ] conflict-class: "ocaml-core-compiler" @@ -67,7 +68,6 @@ conflicts: [ "ocaml-option-fp" ] depopts: [ "ocaml-option-32bit" "ocaml-option-afl" - "ocaml-option-bytecode-only" "ocaml-option-default-unsafe-string" "ocaml-option-no-flat-float-array" "ocaml-option-flambda"