DaemonForums  

Go Back   DaemonForums > Miscellaneous > Guides

Guides All Guides and HOWTO's.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 13th May 2014
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default Cheap Trick: Minimize dependency builds for OpenBSD ports

This trick may be helpful to -current users: # pkg_add -za `make full-build-depends`

From time to time I build a package from its port. As a -current user, minor differences in sync between the project's available "snapshot packages" and the ports tree can sometimes mean that many dependent packages get built, even if FETCH_PACKAGES is set to YES. On a single slow build machine that can extend elapsed build time to many hours or days for complex ports with large numbers of build dependencies.

I've found a simple pkg_add(1) minimizes dependency building, when combined with the full-build-depends target described in bsd.port.mk(5):
Code:
     full-{build,run,all}-depends
           Print all dependencies a package depends upon for building,
           running, or both, as a list of package names.
And so:
# cd /usr/ports/<branch>/<leaf>
# pkg_add -za `make full-build-depends`
The backticks around the make(1) command apply its output as operands to pkg_add. The -z option does fuzzy matching of package versions, and the -a option sets any newly installed packages as automatically installed, which is the norm for dependencies.

After the package build is complete and installed, I can elimintate any unneeded dependencies with a simple pkg_delete(1):
# pkg_delete -a
Along with speeding builds, utilizing all possible available packages minimizes storage consumption by unnecessary distfiles and reduces pobj capacity requirements.

Last edited by jggimi; 14th May 2014 at 02:01 AM. Reason: clarity, typo
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ex-NSA guru builds $4m encrypted email biz J65nko News 0 27th January 2014 11:38 AM
The trick behind camouflaged links J65nko News 0 24th March 2013 05:17 PM
Working around cheap SOHO routers under OpenBSD BSDfan666 Guides 1 23rd November 2008 07:44 PM
Cheap, FreeBSD compatible mini PC? chris General Hardware 2 26th September 2008 06:28 AM
passing make args/variables to builds of prerequisite ports jbhappy FreeBSD Ports and Packages 2 18th July 2008 02:35 PM


All times are GMT. The time now is 12:15 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick