pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: How to install and find things in nonstandard locations?



"Thomas Mueller" <mueller6724%bellsouth.net@localhost> writes:

> I asked some time ago about the possibility of building experimental
> versions of packages, such as Seamonkey 2.1 alpha or beta, and
> installing to a nonstandard location such as /usr/local2 or
> /usr/testing.  Then I could run such a package by spawning a subshell
> with /usr/local2/bin and /usr/local2/sbin at the start of the PATH,
> and I would still have access to the established base system and
> packages without installing everything in duplicate.  Then after
> exiting the spawned subshell, I would still be able to use the
> installed release version (Seamonkey-2.0.11 or whatever).

> Question is how to install to such a directory prefix, and
> subsequently when I need to subsequently link to these packages' libs
> and includes, how to make the compiler and linker, and programs run
> therefrom, such as sed and grep, find these libs and includes.

I deploy several installation of packages under different localbase to
work with setups when some libraries conflict.

In particular, I bootstrap from shared pkgsrc tree to different places:

./bootstrap --workdir /tmp/work --prefix /usr/pkg-smth --pkgdbdir 
/usr/pkg-smth/pkgdb
  --varbase /usr/pkg-smth/var --mk-fragment ~/path/to/mk.conf.inc

mk.conf.inc is approximatly this:

DISTDIR?=       /usr/distfiles # share distfiles
PACKAGES?=      $(LOCALBASE)/packages # don't share packages
BINPKG_SITES=   # don't ask network
MAKE_JOBS?=     2

WRKOBJDIR?=     /tmp$(LOCALBASE) # don't share work directories
USE_DESTDIR=    yes
PKG_DEVELOPER=  yes
DEPENDS_TARGET= package-install clean
UPDATE_TARGET=  package-install clean

X11_TYPE=       modular # and more tweaks, if you have them.


Then you just use /usr/pkg-smth/bin/bmake to work with installation
under /usr/pkg-smth.


If this doesn't suffice your needs, you want to learn how "builtin" mechanism 
works.

> This problem arises with Slackware Linux, though I am not using pkgsrc
>  in this case, or not yet, and spawned programs such as sed and grep
>  can't find things in /usr/local/lib or /usr/local/include even though
>  I add these directories to the lib and include paths.  In this case,
>  I can't see how gcc in Slackware would find things in /usr/pkg
>  either, and would have problems using pkgsrc if I tried that.
>  Perhaps libtool is at fault?  One possible workaround, albeit
>  inelegant, is to put a symbolic link in /usr/lib to anything not
>  found because it was in /usr/local/lib; I actually did that in some
>  cases.  I'm afraid to remove the libtool package, though I see there
>  is no libtool in NetBSD base system, and NetBSD does not suffer from
>  libtool's absence.  I have compiled and recompiled the kernel many times.

libtool is build-time tool, you don't need it for normal operation.

> Slackware package manager is good at installing, removing and
> upgrading binary packages but knows nothing about dependencies, or
> about building from source.  Seeing what NetBSD pkgsrc, FreeBSD ports,
> and some other Linux distributions do makes me realize how backward
> Slackware is.

It should be possible to create slackware-compatible packages, but this
isn't very much elaborate mechanics.


-- 
HE CE3OH...



Home | Main Index | Thread Index | Old Index