On 2021/01/23 13:33, Jeremie Courreges-Anglas wrote: > On Fri, Jan 22 2021, Bjorn Ketelaars <b...@openbsd.org> wrote: > > > > Don't think so. If we are building on a non-native arch we want to make > > sure that lang/ocaml is added as BDEP and RDEP, independent how > > MODOCAML_RUNDEP or MODOCAML_BUILDDEP are used in a Makefile. > > [...] > > An OCaml port probably needs lang/ocaml at build time on *all archs*, > I don't see a reason to introduce a difference between native and > non-native archs *at build time*, nor do I see a good reason to ignore > what a port specifies.
Agreed, variable build dependencies per-arch sounds like it's asking for trouble. > | # Assume that we want to automatically add ocaml to BUILD_DEPENDS > | -# and RUN_DEPENDS unless the port specifically requests not to. > | +# unless the port specifically requests not to. > | MODOCAML_BUILDDEP?= Yes > | +# Same for RUN_DEPENDS, but MODOCAML_RUN_DEPENDS can take three values: > | +# Yes, No or if-not-native (translates to Yes if native-code is > unsupported) > | MODOCAML_RUNDEP?= Yes > | > | .if ${NO_BUILD:L} == no && ${MODOCAML_BUILDDEP:L} == yes > | BUILD_DEPENDS+= ${MODOCAML_BUILD_DEPENDS} > | .endif I'm not totally objecting to MODOCAML_BUILDDEP=no but I'm not sure there's a use for it. I'd be tempted to leave it out for now. If we do that and someone does comes up with a port that wants to disable build dep's later, they could just change ocaml.port.mk at the same time, no need to hack around it. Apart from anything else port-modules(5) is already hard to read and I'd be happy to avoid adding more :) I think MODGO_BUILDDEP can be removed from go.port.mk too, nothing uses it and I don't really see how it could.. It's used quite a lot for python, and a bit for PHP though possibly not enough - this discussion made me wonder if I should change that to No by default for PHP. But those are quite different to the case of go or ocaml. > | +.if ${MODOCAML_RUNDEP:L} == if-not-native && ${MODOCAML_NATIVE} == No > | +MODOCAML_RUNDEP = Yes > | +.endif > | .if ${MODOCAML_RUNDEP:L} == yes > | RUN_DEPENDS+= ${MODOCAML_RUN_DEPENDS} > | .endif > > This implements the three choice logic suggested by sthen, doesn't > affect current defaults, and only cares about the runtime dep. > I hope that "if-not-native" is an improvement over "nonative". love the "if-not-native" wording, that's perfect :) > Index: ocaml.port.mk > =================================================================== > RCS file: /cvs/ports/lang/ocaml/ocaml.port.mk,v > retrieving revision 1.32 > diff -u -p -r1.32 ocaml.port.mk > --- ocaml.port.mk 3 Dec 2017 11:10:10 -0000 1.32 > +++ ocaml.port.mk 23 Jan 2021 12:19:27 -0000 > @@ -33,8 +33,27 @@ MODOCAML_OCAMLDOC?=ocamldoc > PKG_ARGS+=-Ddynlink=0 > .endif > > -RUN_DEPENDS += lang/ocaml > -BUILD_DEPENDS += lang/ocaml > +MODOCAML_RUN_DEPENDS= lang/ocaml > +MODOCAML_BUILD_DEPENDS= lang/ocaml > + > +# Assume that we want to automatically add ocaml to BUILD_DEPENDS > +# unless the port specifically requests not to. > +MODOCAML_BUILDDEP?= Yes > +# Same for RUN_DEPENDS, but MODOCAML_RUN_DEPENDS can take three values: > +# Yes, No or if-not-native (translates to Yes if native-code is unsupported) > +MODOCAML_RUNDEP?= Yes > + > +.if ${NO_BUILD:L} == no && ${MODOCAML_BUILDDEP:L} == yes > +BUILD_DEPENDS+= ${MODOCAML_BUILD_DEPENDS} > +.endif > + > +.if ${MODOCAML_RUNDEP:L} == if-not-native && ${MODOCAML_NATIVE} == No > +MODOCAML_RUNDEP = Yes > +.endif > +.if ${MODOCAML_RUNDEP:L} == yes > +RUN_DEPENDS+= ${MODOCAML_RUN_DEPENDS} > +.endif > + > MAKE_ENV += OCAMLFIND_DESTDIR=${DESTDIR}${TRUEPREFIX}/lib/ocaml \ > OCAMLFIND_COMMANDS="ocamldoc=${MODOCAML_OCAMLDOC}" > > > -- > jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE >