compile port but install binary deps

Is there a way to compile a port, but tell freebsd to install all necessary dependencies in binary format with pkg ?
 
make install-missing-packages

Code:
     Example 2: Installing Dependencies with pkg(8)

       The following example shows how to build and install a port without
       having to build its dependencies.  Instead, the dependencies are
       downloaded via pkg(8).

         # make install-missing-packages
         # make install

       It is especially useful, when the dependencies are costly in time and
       resources to build (like lang/rust).  The drawback is that pkg(8)
       offers only packages built with the default set of OPTIONS.
ports(7)
 
great, thanks !

edit: strangely, it's not listed in the targets sections of the man page.
 
edit: strangely, it's not listed in the targets sections of the man page.
I agree, but the example is more illustrative than a (sole) succinct mention in the target section would have been (it probably deserves to be mentioned there as well). My guess it that a good samaritan has taken the effort to insert this fine example to alleviate user build problems when a lot of dependencies are at play.

There is a lot of documentation to be covered in ports(7). It always pays to read all sections of a man page carefully—this may sound trivial and easy but it is not. FreeBSD is also not totally free of documentation imperfection; the BUGS section of ports(7) hints at that. The SEE ALSO section mentions further documentation: a rather complete coverage of all relevant settings and options (o.a. install-missing-packages) is to be found at bsd.port.mk or at your local /usr/ports/Mk/bsd.port.mk

Using pre-build packages for all dependencies while still building the main port yourself can also be accomplished with Poudriere. If you are ever considering more automation and control of building ports, possibly with a local package server containing a local package repository, I suggest taking a look at Building Packages with poudriere; setting up poudriere and understanding its various options is however not a trivial task. You have a choice between two poudriere ports:
 
Last edited:
Sure, example are probably one of the most important piece of info you can find in a man page!

The bsd.port.mk seems indeed well commented/documented.

poudriere is on my todo list, I heard it's worth exploring it.

Thanks for all your pointers !
 
Back
Top