Subject: Re: Usage of USE_TOOLS
To: Jon Buller <jon@Bullers.Net>
From: Dieter Baron <>
List: tech-pkg
Date: 11/20/2007 10:04:33
In article <47425BBF.6010407@Bullers.Net> Jon wrote:
: Roland Illig wrote:
: > Min Sik Kim wrote:
: >> The USE_TOOLS definition is used both internally by pkgsrc and also
: >> for individual packages to define what commands are needed for
: >> building  a package (like BUILD_DEPENDS) or for later run-time of an
: >> installed packaged (such as DEPENDS). If the native system provides
: >> an adequate tool, then in many cases, a pkgsrc package will not be
: >> used.
: > 
: > The confusion gets clear when we consider cross-compiling SPARC packages 
: > (target platform) on i386 (native platform). There are many types of 
: > dependencies:
: > 
: > USE_TOOLS: tools for the native platform. References to these tools 
: > should not end up in the package binary, unless the paths are the same. 
: > (XXX: How can this be checked?)
: > 
: > BOOTSTRAP_DEPENDS: Packages for the native platform that must be 
: > installed when building the package.
: > 
: > 
: > DEPENDS: Packages for the target platform that are needed at runtime and 
: > when building the package.
: > 
: > BUILD_DEPENDS: Packages for the target platform that must be installed 
: > when the package is built. They are not needed for running the package 
: > later.
: > 
: > BUILDLINK_DEPENDS: Packages for the target platform whose files must be 
: > available to the compilers and linker when building a package.
: > 
: > 
: > I hope that these definitions meet everyone's view and that the correct 
: > types of dependencies will be used by all pkgsrc packages in the 
: > not-too-far future. Currently they aren't.

: So how should I set up lang/sbcl?  In theory it could cross-compile 
: itself to another machine arch or OS, but that would probably be a very 
: difficult thing to do in pkgsrc.  (It requires several back and forth 
: passes running tools on the host and target to bring things up.) 
: However, SBCL is pretty much required to build itself on a native 
: platform.  In theory, CLisp could also do the job, but reality seems to 
: be somewhat different. Other Common Lisp systems may (or may not) be 
: able to the job also, but we don't have any in pkgsrc.

  None of your suggested solutions work if I don't already have a
binary package for sbcl.  Thus, none of them work on a fresh install
or in a bulk build.

: Should I have lang/sbcl in USE_TOOLS, BOOTSTRAP_DEPENDS, or 
: BUILD_DEPENDS?  And to install the package, lang/sbcl needs to be 
: removed first.  Should I just add a pre-install target that runs 
: "pkg_delete sbcl"?

  You should create a tarball containing the binaries (and support
files) needed to bootstrap sbcl, add those to DISTFILES, and extract
those to WRKDIR for building the package.