I need to create some opam conf packages, e.g. for bison, and wonder what opam's os-family values might be. I think it makes most sense to switch over the os-family, not over the os-distribution or os. Grepping through opam packages, I got this list of used os-family values: debian|suse|windows|archlinux|fedora|homebrew|macports
and rarely arch|rhel|mageia|alpine|bsd|gentoo
. I guess the gentoo as family is a bug (it appears only in one opam package). Would you agree that it makes most sense to switch over the os-family (maybe wit some special handling for windows/cyhwin/MinGW)?
I would appreciate if you could look at the output of opam var
and tell me if you have an os-family not in the above short list+bsd and if your package managers package name for bison is not bison.
What would be the os-family for nix?
P.S.: I just found an interesting tool: (https://github.com/whohas/whohas) - a script which searches the package list of various distros for a package. It is a bit old and needs some adjustment of current distro versiosn but works reasonably well then.
And a website which serves a similar purpose: (https://pkgs.org/search/)
You also have https://repology.org/. It is very complete and very up-to-date.
What would be the os-family for nix?
Sorry I have no idea.
this should be possible to find out by running:
opam var os-family
if opam is installed inside Nix.
This returns nixos
.
@Michael Soegtrop so the os-family for Nix is: nixos
I don't think gentoo
is a bug, Gentoo Linux is a Linux distribution with a very particular package system (similar to BSD ports)
If the objective is to have depext work, then the list (of known labels) is here https://github.com/ocaml/opam/blob/6aefe95e60084e63d01b1c7c028b6b77de1f839f/src/state/opamSysInteract.ml#L84-L123
If the objective is to have depext work, then the list (of known labels) is here https://github.com/ocaml/opam/blob/6aefe95e60084e63d01b1c7c028b6b77de1f839f/src/state/opamSysInteract.ml#L84-L123
Thanks, most useful - indeed I thought about how to write depext conf packages without decade long trial and error or massive testing.
Just I wonder how can this be nixos when nixos is not in this list ...
No idea, and no idea if opam-depext really works on NixOS given how non-imperative package management is on this system.
You also have https://repology.org/. It is very complete and very up-to-date.
Thanks - this is indeed a vey helpful page for this purpose! Especially because it also lists which distros don't contain a certain package.
No idea, and no idea if opam-depext really works on NixOS given how non-imperative package management is on this system.
So should I ignore dependencies on nixos for the platform for the time being and just add documentation what is needed?
Michael Soegtrop said:
Just I wonder how can this be nixos when nixos is not in this list ...
There is some funny code in opam to find the value of these variables, eg scraping files in /etc.. The values are just strings, but then when you try to run depext, it has to really understand which commands to run, and there is the code I pointed to. So on nixos
you would get the error. Still the conf-whatever
packages makes sense to me, they test if whatever
is in PATH: If the nix user enables the whatever package in his (current) shell, then the opam package should install just fine, if not it should report a meaningful error.
Yes, don't worry about NixOS. We'll probably have a separate packaging process to have the platform there.
Last updated: Jun 03 2023 at 04:30 UTC