-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Depexts os distribution os family values
os-distribution
value is usually the value of ID
in /etc/os-release
os-family
value is usually the first value of ID_LIKE
in /etc/os-release
e.g.
Distribution | os-distribution | os-family |
---|---|---|
Archlinux | arch | arch |
Alpine | alpine | alpine |
Ubuntu | ubuntu | ubuntu |
Debian | debian | debian |
Fedora | fedora | fedora |
CentOS | centos | rhel |
Oraclelinux | ol | fedora |
OpenSUSE(leap) | opensuse-leap | suse |
OpenSUSE(tumbleweed) | opensuse-tumbleweed | opensuse |
Gentoo | gentoo | gentoo |
Homebrew | homebrew | homebrew |
Macports | macports | macports |
FreeBSD | freebsd | bsd |
OpenBSD | openbsd | bsd |
NetBSD | netbsd | bsd |
For linux distributions it is generally better to use the os-family
value whenever possible to make distributions derived of those ones work out of the box (e.g. PopOS for Ubuntu and Manjaro for Archlinux).
In the case of CentOS/Fedora/Oraclelinux, using os-family
can get really painful with the addition of the EPEL repository so just using os-distribution
in this case is usually easier.
For macOS it is better to use both os = "macos" & os-distribution = "<distro>"
to avoid the very unlikely case where a linux distribution starts calling itself homebrew
in the future.
For BSDs it is better to just use os
as the os-family
value is not very helpful for depexts purpose.
Package names to populate depexts can be looked up in various websites, like https://pkgs.org/ and https://repology.org/projects/
Windows is a bit more complicated. Quoting from https://github.com/ocaml/opam-repository/pull/25484#issuecomment-1999943746:
The Cygwin part becomes very confusion here, as it's both an OS in its own right but also an os-distribution for native Windows.
-
os-family
iswindows
for both native Windows and Cygwin (i.e.Sys.win32 || Sys.cygwin
⇒os-family
=windows
) -
os
iswin32
for a native Windows build of opam (which includes OCaml for Windows).
For os-distribution, we then have:
Distribution | os | os-distribution | os-family | Notes |
---|---|---|---|---|
Native[^1] Windows | win32 | cygwin | windows | Depexts + Unix tools provided by Cygwin |
Native Windows | win32 | msys2[^2] | windows | Depexts + Unix tools provided by MSYS2 |
Native Windows | win32 | cygwinports | windows | Legacy "OCaml for Windows" (opam 2.0.10 only) |
Cygwin | cygwin | cygwin | windows | Cygwin's own opam distribution |
[^1]: "Native" here refers to programs able to run outside of Cygwin/MSYS2, principally from the Command Prompt or Windows PowerShell. [^2]: At the moment, this is "tier 2" from opam's perspective - Cygwin is the primary supported mechanism for 2.2.0, but we're paying a lot of attention to MSYS2 partly because that's what Diskuv uses now and also because we expect we'll likely switch to recommending it across the board in future.