Synth - ports-mgmt/synth

Synth - ports-mgmt/synth

Synth is best summed up by the first paragraph of README.md at the maintainer's github site.

Synth is an advanced concurrent (parallel) ports building tool aimed at regular users that prefer
or require building their own packages from source. Synth will build packages in a clean environment
that exactly mirrors the system it builds on, creates a local repository, installs a pkg repository
configuration file that causes the local packages to be used with the highest priority,and automatically
upgrades the system with a single command.

It is further described by its own pkg-descr file.

Synth is a custom package repository builder for FreeBSD and DragonFly.

It is intended to replace Portmaster, portupgrade, and poudriere for
the average user.  It is simple to learn (the powerful options are
limited in number) and user-friendly, but it is extremely fast due
to its parallel building capability.  It will "drop-in" on any system
as it leverages the stock pkg(8) facilities.  All ports are built
in a clean environment, so it is finally safe to build ports as
needed on a live system.  The default profile is the system itself, not
a new jail, which can be a valuable feature for some environments.

To bring a system up-to-date only requires one command after the ports
tree is updated:

  > synth upgrade-system

 

Synth builds ports for its repository in its own work directories leaving the system's ports tree clean and unmodified.

The first-run will be the longest as Synth compiles all installed packages as well their respective build-time and run-time dependencies for it's own repository. Thereafter Synth will maintain it's repository of precompiled packages and dependencies, keeping them up-to-date. When a dependency port in Synth's repository is updated, all ports that depend on it will also be rebuilt.

If /etc/make.conf exists on the system, it should be copied to /usr/local/etc/synth/LiveSystem-make.conf prior to running Synth.

 

Port Make Config Options

Synth will not present you with any port configuration options dialogs, and will proceed with any saved options that exist, or will use defaults for all options if none have been saved. If you do need to make changes to a port's configuration options, then prior to running Synth simply change to the given port's directory, manually run make config, and save the changes.

Occasionally an error similar to the following, will stop the upgrade-system process before Synth moves to the build phase:

A preliminary scan has revealed the cached options of 2 ports are
obsolete.  Please update or remove the saved options and try again.
  e.g. make -C /usr/ports/devel/oniguruma config
  e.g. make -C /usr/ports/devel/oniguruma rmconfig
Unfortunately, the system upgrade failed.

The solution is to save a new config or remove it using one of the two respective examples provided. This will need to be done for each port identified by Synth. Once all saved options configurations have been resolved, Synth can continue on to the build phase.

To avoid this problem, marino has written a tool script /usr/ports/Tools/scripts/redundant-opt-files.sh that will display the full path to the port's saved options if the cached options are the same as the defaults. This output is suitable to pipe to "xargs rm -rf" to remove all the redundant options in a single command.
/usr/ports/Tools/scripts/redundant-opt-files.sh | xargs rm -rf

Whenever you are presented with make config options dialogs, if you do not need to change the default choices, then preferably either hit ESC or click Cancel in the options dialog instead of hitting ENTER or clicking "OK" which saves those (default) options.

 

Suggested Workflow

portsnap auto to update the ports tree.
synth status  to scan the updated ports tree.
synth upgrade-system to build and install the updates.

 

To automate the workflow add the following series of commands to root's crontab:

portsnap auto > /dev/null; synth status

Upon receiving the email from the completed crob job notifying you there are updates to install, login and install the updates:
synth upgrade-system

 

When Synth begins building packages it will display a ncurses status page like this:

Example of displayed info while Synth is building packages

Once all the ports and dependencies have been compiled into packages, Synth then updates its local repository with them.

Lastly Synth compares packages in its local repository to the packages installed on the system, installing, reinstalling, or upgrading them as required.

 

Synth can also be used to build and install new ports to the system.
synth install port-origin

Synth supports devel/ccache which can dramatically reduce port build times as well as overall time to completion.

Refer to Synth(1) for more information regarding this and other available command options.

Maintainer: https://github.com/jrmarino/synth