Mik J <mikyde...@yahoo.fr> wrote:
> Hello,
> I'm trying to make a port
> This program has dependencies with Go to name one.
> How should I indicate this dependency in the Makefile ?

for some big stuff like go, python etc the right way is often just
include the correct module

        MODULES = lang/go

see bsd.port.mk(5) and port-modules(5) for more info.

(by the way, for go portgen(1) often does a good work at scaffolding the
port for you.)

> Should I use BUILD_DEPENDS = or LIB_DEPENDS =Go is used to build my program 
> but also to use it thereafter.
> Should I use WANTLIB += ?

BUILD_DEPENDS are for stuff needed to build the thing, while LIB_DEPENDS
for packages that provides the libraries needed.  WANTLIB lists the
libraries that the program links to.

usually you can fix LIB_DEPENDS and WANTLIB using

        $ make port-lib-depends-check

once you have something that works.  it will complain about missing
packages in LIB_DEPENDS (look for the NOT REACHABLE lines in the output)
and will suggest a sensible WANTLIB.  99% of the times this is enough.

(there are programs that dlopen(3) libraries at run time but luckly
these are not the majority.  For these you need to see which libraries
they want and register them in the port; make port-lib-depends-check
will complain but that's expected in this case.)

modules will often add stuff to BUILD_DEPENDS, when in doubt don't
forget to run `make show=BUILD_DEPENDS' (or any other variable really)
to see its content.

> Also what is the right way to make an Openbsd package ?I read that in a port 
> tutorial that the right way is to make the port and during that process the 
> make package will do that.
> Thank you

yep, `make package' will create a package under /usr/ports/packages/.
`make install' will install it thru pkg_add.  again, see bsd.port.mk(5)
for more information, it carefully describes how "package", "install",
"update", "deinstall" etc works.

Reply via email to