On 2019-04-02 18:54, Anil Madhavapeddy wrote: > On 2 Apr 2019, at 18:26, Cyril Roelandt <tipec...@gmail.com> wrote: > > > > (I'm the author of upt. Please keep me CCed) > > > > On 2019-04-02 12:58, Daniel Jakots wrote: > >> You can look at sysutils/upt. It's not something specific for OpenBSD. > >> It works with "frontends" (language-specific packages systems, cpan pip > >> etc) and "backends" (OS-specific packages systems). There's already an > >> OpenBSD backend so you need to only add a ocaml frontend. > > > > That is a good summary of how upt works. The idea is that every time a > > new frontend is added (for Hackage or NPM, for instance), minimal effort > > is required to add support for it on the OpenBSD side. Support for PyPI > > is just one simple class[1] and one short Jinja2 template[2]. > > > > Instead of writing a new backend for PortGen, you could write a new > > frontend for upt :) It would also help package managers who use other > > operating systems (hey, nobody's perfect!). > > > > I'm willing to help with this if you're interested in using upt. > > This also looks very cool! How does it deal with mapping system > dependencies that a package needs into the ports Makefile?
The frontend is OS-agnostic. It gathers metadata about a package, and allows all backends (OpenBSD, Nix, Fedora...) to see metadata from various package managers in a unified intermediate representation. It is then up to the upt backends to map dependencies properly. For instance, a Python package named "foo" upstream will be named "py-foo" in OpenBSD. The OpenBSD backend could be modified to use depexts to find all OS packages that need to be installed. Cyril