What does it mean to use ports?

Polytropon freebsd at edvax.de
Mon Jul 15 22:32:45 UTC 2019

On Mon, 15 Jul 2019 05:59:16 +0200, hw wrote:
> Polytropon <freebsd at edvax.de> writes:
> > On Mon, 15 Jul 2019 01:39:21 +0200, hw wrote:
> >> Hi,
> >> 
> >> so I wanted to see what would happen if I used a port and removed the
> >> emacs-nox packages and its dependencies.  Then I started installing the
> >> emacs port.
> >> 
> >> What is going on here?  It seems as if I need to compile the whole
> >> system myself now.
> >
> > That exactly is "using a port". A port is just a description
> > of sources, tools to use, how to use them, and where to put
> > the results. What you're seeing is to be expected: The port
> > you're building (and its dependencies) will be compiled from
> > sources, unless they're already installed in the correct
> > version.
> There seems to be a lot more stuff needing compilation than the
> dependencies of emacs-nox would suggest.  Some of the dependencies are
> quite surprising, like I would think a -nox version wouldn't need
> support for JPEG2000 and not depend on things like font servers and all
> kinds of other stuff.

That seems to be normal. First, there are two kinds of dependencies:
build dependencies (i. e., tools needed to build something), and
runtime dependencies (obviously, libraries and such). Second, there
is a "hierarchy of depencencies" (A requires B, B requires C, and
so on). While those dependencies are automatically resolved, it
can be possible that they need to be built in the correct version.

There is a way to deal with it: List the dependencies ("make missing"),
and feed that output into "pkg install". However, this will not
always work, because if you change default options, dependencies
might change (a la: A requires B and C; A enables feature X, this
requires D, as well as a custom build of B with option Y enabled).
So it won't always work that way.

> I could as well recompile everything so it's all optimized for the CPU
> it's running on.  But are the defaults of the compile options the ones
> used to compile all the binary packages, or are they different?

The packages you obtain via "pkg install" have been built with the
default options, and if you run "make install" without changing
the options, you get, more or less, the same result.

Tayloring your software to match CPU and optimize for the hardware
has often been the first choice in the past, because you could get
software running in a usable manner where the default install would
have been "too slow" for your machine. This especially applied to
multimedia software, where a wise selection of codecs and options
would enable you do do wonders. However, this doesn't seem to be
needed anymore, that's why "pkg install" often is the most convenient
way to get stuff installed - as long as the default options work
for you.


It's widely suggested to use either ports only, or pkg only. Mixing
both forms is possible (see "pkg lock" and the special tasks when
updating your installed software), but it requires more work. Of
course you can use poudriere (no idea why they gave it a name that's
hard to spell and to pronounce, but well, that's "modern" today...)
and provide a local repository with your custom-built software that
you can "pkg install" from, but in cases where you only want one or
two programs built from source, it's probably not worth the work.

After all, you can choose how to do it, everything works. :-)

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list