Can you compile a port in your home without root rights?
nobody
, so sure this is possible (including make stage
, make package
etc). The only thing that needs root privileges (for obvious reasons) is make install
.Yes, this is the crux because installing those requires root privileges.Yes but you need to have the dependencies installed before.
make fetch
as root in advance. Or you could 'circumvent' it by setting DISTDIR to a directory you can write to. You can even build as a user in the regular ports tree, you just have to set WRKDIRPREFIX (this is where the port's work directory is created) to a directory you can write to. WRKDIRPREFIX Where to create any temporary files. Useful if
PORTSDIR is read-only (perhaps mounted from a CD-ROM).
DISTDIR Where to find/put distfiles, normally distfiles/ in
PORTSDIR.
WRKDIRPREFIX
and DISTDIR
as suggested by SirDice certainly is the easiest solution. I mean, these variables are supported for a reason ?poudriere
overrides both these variables ? make config
(and related friends) write their options to /var/db/ports/, which is also only writable by root. And of course there's a variable for that too. PORT_DBDIR Directory where the results of configuring OPTIONS are
stored. Defaults to /var/db/ports. Each port where
OPTIONS have been configured will have a uniquely named
sub-directory, containing a single file options.
I do like this idea. I think the ability to have private $PREFIX directories is really useful. I am surprised the FreeBSD ports doesn't leverage this more.Brew (the main package manage on macOS, also available for other OSes) keeps the install directory owned by the current user.