Skip to content

Commit

Permalink
Merge pull request #25861 from dra27/windows-initial
Browse files Browse the repository at this point in the history
Update ocaml-base-compiler, ocaml-system and ocaml-variants 4.13.0+ with support for native Windows
  • Loading branch information
raphael-proust authored Jun 5, 2024
2 parents 5979d63 + 416bb59 commit 0042660
Show file tree
Hide file tree
Showing 124 changed files with 2,779 additions and 71 deletions.
22 changes: 22 additions & 0 deletions packages/arch-x86_32/arch-x86_32.1/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
opam-version: "2.0"
synopsis: "Build OCaml for x86 (32-bit)"
description: """
Installing this package causes the OCaml compiler packages to target
32bit Intel x86 (x86_32/x86).

At present, this facility is only available for the native Windows ports of
OCaml."""
maintainer: "David Allsopp <david@tarides.com>"
authors: "David Allsopp"
license: "CC0-1.0+"
homepage: "https://opam.ocaml.org"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
# This package is marked avoid-version in order to steer the default on 64-bit
# systems towards a 64-bit compiler.
flags: [compiler avoid-version]
available: os = "win32"
depends: [
("ocaml-base-compiler" {post & >= "4.13.0~"} | "ocaml-variants" {post & >= "4.13.0~"})
"host-arch-x86_32" {post}
]
conflict-class: "ocaml-arch"
27 changes: 27 additions & 0 deletions packages/arch-x86_64/arch-x86_64.1/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
opam-version: "2.0"
synopsis: "Build OCaml for amd64 (64-bit)"
description: """
Installing this package causes the OCaml compiler packages to target
64-bit Intel x86 (x86_64/amd64/x64).

At present, this facility is only available for the native Windows ports of
OCaml."""
maintainer: "David Allsopp <david@tarides.com>"
authors: "David Allsopp"
license: "CC0-1.0+"
homepage: "https://opam.ocaml.org"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
flags: compiler
# The architecture selection is somewhat belt-and-braces while this system is
# only available for Windows. The dependency of the OCaml ecosystem on either
# Cygwin or MSYS2 means that OCaml cannot be used on 32-bit Windows, although
# 32-bit is fully supported as a target.
# When these packages are extended to all platforms, the available field would
# ensure that this package becomes unavailable on a 32-bit system, and the
# avoid-version in arch-x86_32 will be ignored.
available: os = "win32" & (arch = "x86_64" | arch = "arm64")
depends: [
("ocaml-base-compiler" {post & >= "4.13.0~"} | "ocaml-variants" {post & >= "4.13.0~"})
"host-arch-x86_64" {post}
]
conflict-class: "ocaml-arch"
10 changes: 9 additions & 1 deletion packages/conf-c++/conf-c++.1.0/opam
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ authors: "C++ compiler developers"
homepage: "https://github.com/ocaml/opam-repository"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
license: "GPL-2.0-or-later"
build: ["c++" "--version"]
build: [
"i686-w64-mingw32-c++" {os = "win32" & host-arch-x86_32:installed}
"x86_64-w64-mingw32-c++" {os = "win32" & host-arch-x86_64:installed}
"c++" {os != "win32" | (!host-arch-x86_32:installed & !host-arch-x86_64:installed)}
"--version"
]
depexts: [
["gcc-c++"] {os-distribution = "centos"}
["gcc-c++"] {os-distribution = "fedora"}
Expand All @@ -16,6 +21,9 @@ depexts: [
["gcc"] {os-distribution = "arch"}
["gcc-g++"] {os = "win32" & os-distribution = "cygwinports"}
]
depends:
(("host-arch-x86_32" {os = "win32" & os-distribution != "cygwinports"} & "conf-mingw-w64-g++-i686" {os = "win32" & os-distribution != "cygwinports"}) |
("host-arch-x86_64" {os = "win32" & os-distribution != "cygwinports"} & "conf-mingw-w64-g++-x86_64" {os = "win32" & os-distribution != "cygwinports"}))
synopsis: "Virtual package relying on the c++ compiler"
description:
"This package can only install if the c++ compiler is installed on the system."
Expand Down
10 changes: 9 additions & 1 deletion packages/conf-g++/conf-g++.1.0/opam
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ authors: "Francois Berenger"
homepage: "https://github.com/ocaml/opam-repository"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
license: "GPL-2.0-or-later"
build: ["g++" "--version"]
build: [
"i686-w64-mingw32-g++" {os = "win32" & host-arch-x86_32:installed}
"x86_64-w64-mingw32-g++" {os = "win32" & host-arch-x86_64:installed}
"g++" {os != "win32" | (!host-arch-x86_32:installed & !host-arch-x86_64:installed)}
"--version"
]
depexts: [
["gcc-c++"] {os-distribution = "centos"}
["gcc-c++"] {os-distribution = "fedora"}
Expand All @@ -18,6 +23,9 @@ depexts: [
["gcc-g++"] {os = "win32" & os-distribution = "cygwinports"}
["gcc"] {os = "freebsd"}
]
depends:
("host-arch-x86_32" {os = "win32" & os-distribution != "cygwinports"} & "conf-mingw-w64-g++-i686" {os = "win32" & os-distribution != "cygwinports"}) |
("host-arch-x86_64" {os = "win32" & os-distribution != "cygwinports"} & "conf-mingw-w64-g++-x86_64" {os = "win32" & os-distribution != "cygwinports"})
synopsis: "Virtual package relying on the g++ compiler (for C++)"
description:
"This package can only install if the g++ compiler is installed on the system."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ homepage: "https://www.mingw-w64.org"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
flags: conf
available: os = "win32"
depends: [
"msys2" {build & os = "win32" & os-distribution = "msys2"}
"msys2-mingw32" {os = "win32" & os-distribution = "msys2"}
]
build: ["i686-w64-mingw32-gcc" "--version"]
depexts: [
["mingw64-i686-gcc-core"] {os = "win32" & os-distribution = "cygwin"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ homepage: "https://www.mingw-w64.org"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
flags: conf
available: os = "win32"
depends: [
"msys2" {build & os = "win32" & os-distribution = "msys2"}
"msys2-mingw64" {os = "win32" & os-distribution = "msys2"}
]
build: ["x86_64-w64-mingw32-gcc" "--version"]
depexts: [
["mingw64-x86_64-gcc-core"] {os = "win32" & os-distribution = "cygwin"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ homepage: "http://pkgconf.org"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
flags: conf
available: os = "win32"
depends: [
"msys2" {build & os = "win32" & os-distribution = "msys2"}
"msys2-mingw32" {os = "win32" & os-distribution = "msys2"}
]
build: ["i686-w64-mingw32-pkgconf" "--version"]
depexts: [
["mingw-w64-i686-pkgconf"] {os = "win32" & os-distribution = "msys2"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ homepage: "http://pkgconf.org"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
flags: conf
available: os = "win32"
depends: [
"msys2" {build & os = "win32" & os-distribution = "msys2"}
"msys2-mingw64" {os = "win32" & os-distribution = "msys2"}
]
build: ["x86_64-w64-mingw32-pkgconf" "--version"]
depexts: [
["mingw-w64-x86_64-pkgconf"] {os = "win32" & os-distribution = "msys2"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ flags: conf
available: os = "win32"
build: ["pkgconf" "--personality=i686-w64-mingw32" {os-distribution = "cygwin"} "libzstd"]
depends: [
"msys2" {build & os = "win32" & os-distribution = "msys2"}
"msys2-mingw32" {os = "win32" & os-distribution = "msys2"}
"conf-pkg-config" {build}
"conf-mingw-w64-gcc-i686" {build}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ flags: conf
available: os = "win32"
build: ["pkgconf" "--personality=x86_64-w64-mingw32" {os-distribution = "cygwin"} "libzstd"]
depends: [
"msys2" {build & os = "win32" & os-distribution = "msys2"}
"msys2-mingw64" {os = "win32" & os-distribution = "msys2"}
"conf-pkg-config" {build}
"conf-mingw-w64-gcc-x86_64" {build}
]
Expand Down
6 changes: 5 additions & 1 deletion packages/conf-pkg-config/conf-pkg-config.3/opam
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ authors: ["Francois Berenger"]
homepage: "http://www.freedesktop.org/wiki/Software/pkg-config/"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
license: "GPL-1.0-or-later"
depends: [
("host-arch-x86_64" {os = "win32" & os-distribution = "msys2"} & "conf-mingw-w64-pkgconf-x86_64" {os = "win32" & os-distribution = "msys2"} |
"host-arch-x86_32" {os = "win32" & os-distribution = "msys2"} & "conf-mingw-w64-pkgconf-i686" {os = "win32" & os-distribution = "msys2"})
]
build: [
["pkg-config" "--help"] {os != "openbsd" & os != "win32"}
["pkgconf" "--version"] {os = "win32"}
["pkgconf" "--version"] {os = "win32" & os-distribution != "msys2"}
]
depexts: [
["pkg-config"] {os-family = "debian" | os-family = "ubuntu"}
Expand Down
12 changes: 10 additions & 2 deletions packages/conf-zstd/conf-zstd.1.3.8/opam
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,17 @@ bug-reports: "https://github.com/ocaml/opam-repository/issues"
authors: ["Facebook"]
license: "BSD-3-Clause"
build: [
["pkg-config" "--atleast-version=1.3.8" "libzstd"]
["pkgconf" {os = "win32" & os-distribution = "cygwin"}
"--personality=i686-w64-mingw32" {os = "win32" & os-distribution = "cygwin" & host-arch-x86_32:installed}
"--personality=x86_64-w64-mingw32" {os = "win32" & os-distribution = "cygwin" & host-arch-x86_64:installed}
"pkg-config" {os != "win32" | os-distribution != "cygwin"}
"--atleast-version=1.3.8" "libzstd"]
]
depends: [
"conf-pkg-config" {build}
(("host-arch-x86_32" {os = "win32" & os-distribution != "cygwinports"} & "conf-mingw-w64-zstd-i686" {os = "win32" & os-distribution != "cygwinports"}) |
("host-arch-x86_64" {os = "win32" & os-distribution != "cygwinports"} & "conf-mingw-w64-zstd-x86_64" {os = "win32" & os-distribution != "cygwinports"}))
]
depends: ["conf-pkg-config" {build}]
depexts: [
["libzstd-dev"] {os-family = "debian"}
["libzstd-dev"] {os-family = "ubuntu"}
Expand Down
16 changes: 16 additions & 0 deletions packages/host-arch-arm32/host-arch-arm32.1/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
opam-version: "2.0"
synopsis: "OCaml on AArch32 (32-bit)"
description: """
This package is installed if the underlying OCaml compiler is for 32-bit ARM.

Precisely, this means `ocamlopt -config-var architecture` equals `arm`.

This package may be used in depends or conflicts fields of dependent packages
to indicate either a requirement or an incompatibility with this
architecture."""
maintainer: "David Allsopp <david@tarides.com>"
authors: "David Allsopp"
license: "CC0-1.0+"
homepage: "https://opam.ocaml.org"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
conflict-class: "ocaml-host-arch"
16 changes: 16 additions & 0 deletions packages/host-arch-arm64/host-arch-arm64.1/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
opam-version: "2.0"
synopsis: "OCaml on AArch64 (64-bit)"
description: """
This package is installed if the underlying OCaml compiler is for 64-bit ARM.

Precisely, this means `ocamlopt -config-var architecture` equals `arm64`.

This package may be used in depends or conflicts fields of dependent packages
to indicate either a requirement or an incompatibility with this
architecture."""
maintainer: "David Allsopp <david@tarides.com>"
authors: "David Allsopp"
license: "CC0-1.0+"
homepage: "https://opam.ocaml.org"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
conflict-class: "ocaml-host-arch"
17 changes: 17 additions & 0 deletions packages/host-arch-ppc64/host-arch-ppc64.1/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
opam-version: "2.0"
synopsis: "OCaml on 64-bit IBM POWER"
description: """
This package is installed if the underlying OCaml compiler is for
64-bit IBM POWER.

Precisely, this means `ocamlopt -config-var architecture` equals `power`.

This package may be used in depends or conflicts fields of dependent packages
to indicate either a requirement or an incompatibility with this
architecture."""
maintainer: "David Allsopp <david@tarides.com>"
authors: "David Allsopp"
license: "CC0-1.0+"
homepage: "https://opam.ocaml.org"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
conflict-class: "ocaml-host-arch"
16 changes: 16 additions & 0 deletions packages/host-arch-riscv64/host-arch-riscv64.1/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
opam-version: "2.0"
synopsis: "OCaml on 64-bit RISC-V"
description: """
This package is installed if the underlying OCaml compiler is for 64-bit RISC-V.

Precisely, this means `ocamlopt -config-var architecture` equals `riscv`.

This package may be used in depends or conflicts fields of dependent packages
to indicate either a requirement or an incompatibility with this
architecture."""
maintainer: "David Allsopp <david@tarides.com>"
authors: "David Allsopp"
license: "CC0-1.0+"
homepage: "https://opam.ocaml.org"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
conflict-class: "ocaml-host-arch"
17 changes: 17 additions & 0 deletions packages/host-arch-s390x/host-arch-s390x.1/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
opam-version: "2.0"
synopsis: "OCaml on 64-bit IBM z/Architecture"
description: """
This package is installed if the underlying OCaml compiler is for
64-bit IBM z/Architecture (s390x).

Precisely, this means `ocamlopt -config-var architecture` equals `s390x`.

This package may be used in depends or conflicts fields of dependent packages
to indicate either a requirement or an incompatibility with this
architecture."""
maintainer: "David Allsopp <david@tarides.com>"
authors: "David Allsopp"
license: "CC0-1.0+"
homepage: "https://opam.ocaml.org"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
conflict-class: "ocaml-host-arch"
16 changes: 16 additions & 0 deletions packages/host-arch-unknown/host-arch-unknown.1/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
opam-version: "2.0"
synopsis: "OCaml on an unknown architecture"
description: """
This package is installed if the underlying OCaml compiler is for an unknown
architecture.

Precisely, this means `ocamlopt -config-var architecture` equals `none`.

It is not expected that this package be used in depends or conflicts fields of
dependent packages."""
maintainer: "David Allsopp <david@tarides.com>"
authors: "David Allsopp"
license: "CC0-1.0+"
homepage: "https://opam.ocaml.org"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
conflict-class: "ocaml-host-arch"
17 changes: 17 additions & 0 deletions packages/host-arch-x86_32/host-arch-x86_32.1/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
opam-version: "2.0"
synopsis: "OCaml on x86 (32-bit)"
description: """
This package is installed if the underlying OCaml compiler is for
32-bit Intel x86 (x86_32/x86).

Precisely, this means `ocamlopt -config-var architecture` equals `i386`.

This package may be used in depends or conflicts fields of dependent packages
to indicate either a requirement or an incompatibility with this
architecture."""
maintainer: "David Allsopp <david@tarides.com>"
authors: "David Allsopp"
license: "CC0-1.0+"
homepage: "https://opam.ocaml.org"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
conflict-class: "ocaml-host-arch"
17 changes: 17 additions & 0 deletions packages/host-arch-x86_64/host-arch-x86_64.1/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
opam-version: "2.0"
synopsis: "OCaml on amd64 (64-bit)"
description: """
This package is installed if the underlying OCaml compiler is for
64-bit Intel x86 (x86_64/amd64/x64).

Precisely, this means `ocamlopt -config-var architecture` equals `amd64`.

This package may be used in depends or conflicts fields of dependent packages
to indicate either a requirement or an incompatibility with this
architecture."""
maintainer: "David Allsopp <david@tarides.com>"
authors: "David Allsopp"
license: "CC0-1.0+"
homepage: "https://opam.ocaml.org"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
conflict-class: "ocaml-host-arch"
17 changes: 17 additions & 0 deletions packages/host-system-mingw/host-system-mingw.1/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
opam-version: "2.0"
synopsis: "OCaml for mingw-w64"
description: """
This package is installed if the underlying OCaml compiler is one of the
mingw-w64 native Windows ports of OCaml.

Precisely, this means `ocamlopt -config-var system` is equal to either `mingw`
or `mingw64`.

This package may be used in depends or conflicts fields of dependent packages
to indicate either a requirement or an incompatibility with this OCaml port."""
maintainer: "David Allsopp <david@tarides.com>"
authors: "David Allsopp"
license: "CC0-1.0+"
homepage: "https://opam.ocaml.org"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
conflict-class: "ocaml-host-system"
17 changes: 17 additions & 0 deletions packages/host-system-msvc/host-system-msvc.1/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
opam-version: "2.0"
synopsis: "OCaml for Microsoft Visual Studio"
description: """
This package is installed if the underlying OCaml compiler is one of the "MSVC"
native Windows ports of OCaml.

Precisely, this means `ocamlopt -config-var system` is equal to either `win32`
or `win64`.

This package may be used in depends or conflicts fields of dependent packages
to indicate either a requirement or an incompatibility with this OCaml port."""
maintainer: "David Allsopp <david@tarides.com>"
authors: "David Allsopp"
license: "CC0-1.0+"
homepage: "https://opam.ocaml.org"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
conflict-class: "ocaml-host-system"
15 changes: 15 additions & 0 deletions packages/host-system-other/host-system-other.1/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
opam-version: "2.0"
synopsis: "OCaml on an unidentified system"
description: """
This package is installed if the underlying OCaml compiler's system is not
recognised by opam-repository's compiler packaging.

It is not expected that this package be used in depends or conflicts fields of
dependent packages, given that its use may be changed if the packaging is
subsequently enhanced to recognise the system value."""
maintainer: "David Allsopp <david@tarides.com>"
authors: "David Allsopp"
license: "CC0-1.0+"
homepage: "https://opam.ocaml.org"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
conflict-class: "ocaml-host-system"
Loading

0 comments on commit 0042660

Please sign in to comment.