On Wed, Mar 5, 2025 at 11:03 AM Igor Kolesnik <[email protected]> wrote:
>
> On Mon, Mar 03, 2025 at 08:22:12PM +0300, Gleb Popov wrote:
> > Ports are expected to locate their dependencies under the ${LOCALBASE} 
> > prefix.
>
> Well, specifically, I need paths to llvm and openjdk.  I can use
>
> ${LOCALBASE}/openjdk${JAVA_VERSION}
> ${LOCALBASE}/llvm
>
> or
>
> ${JAVA_HOME}
> ${LLVM_PREFIX}
>
> What approach is a preferred one?

The latter is more canonical. You need USES=llvm:noexport to get
LLVM_PREFIX and USES=java for JAVA_HOME and other vars.

On Wed, Mar 5, 2025 at 12:04 PM Igor Kolesnik <[email protected]> wrote:
>
> I think, I got it.
>
> LOCALBASE is always the same, e.g. /usr/local
> LLVM_PREFIX may change
>
> If I do 'make install', LLVM_PREFIX == LOCALBASE/llvm,
> but if, for example, 'PREFIX=/opt make install' then
> LOCALBASE still /usr/local, and
> LLVM_PREFIX will be /opt/llvm
>
> Is that right?

Not sure, because it depends on what port you're executing 'make install'.

A probably better explanation is that PREFIX allows a user to choose
where to install a given port, while LOCALBASE specifies where all
dependencies are installed.
LOCALBASE should be adjusted globally for the whole Ports tree and all
ports should be built for the same LOCALBASE value.
A port may be installed into a PREFIX that is not equal to LOCALBASE -
it will work, but other ports won't be able to use it as a dependency.

Specifically to your question, if you're building a port that is using
llvm, then LLVM_PREFIX will always be ${LOCALBASE}/llvm for you.
Changing PREFIX would not affect it.

Reply via email to