[Bug 276893] devel/ocaml-dune: dune install should be able to install stublibs in the package directory

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 08 Feb 2024 14:22:37 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=276893

            Bug ID: 276893
           Summary: devel/ocaml-dune: dune install should be able to
                    install stublibs in the package directory
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: Individual Port(s)
          Assignee: danfe@FreeBSD.org
          Reporter: freebsd@dev.thsi.be
             Flags: maintainer-feedback?(danfe@FreeBSD.org)
          Assignee: danfe@FreeBSD.org

Created attachment 248257
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=248257&action=edit
0001-devel-ocaml-dune-FreeBSD-patch-for-custom-stublibs-d.patch

Hello,

It seems that, traditionnaly, packages are more-or-less expected to install
their OCaml stublibs in a package-specific subdirectory, cf. USE_OCAML_LDCONFIG
and/or USE_OCAML_FINDLIB. It has the advantage of not polluting the global
OCaml namespace (that is, unless the ld.conf is modified of course). 

The problem is that dune, which is the "last gen" OCaml build tool that is used
by a growing number of OCaml projects, seems unable to support this
configuration by default. Meaning that a growing number of FreeBSD packages are
likely to install their C shared-libraries into the same "stublibs"
subdirectory, which is a sub-optimal solution in my opinion.

The attached patch provide a solution to this problem by modifying dune in the
context of the FreeBSD ports. It also convert dune's own packaging to that
"new-old" way by defining the introduced
DUNE_FREEBSD_STUBLIBS_RELATIVE_TO_LIBDIR variable.

I've rebuilt about 86 OCaml packages with this patch, and I haven't been able
to detect any regression. I intend to propose further contribution to the OCaml
ports, so I'd gladly hear any feedback there would be about this proposal.

Thanks!

-- 
You are receiving this mail because:
You are the assignee for the bug.