Discussion:
recommended setup for building ports in development env?
(too old to reply)
Gary Aitken
2018-04-25 01:18:50 UTC
Permalink
Asked this on questions a while ago and got no response;
any thoughts would be much appreciated.

I'm trying to set up a development environment for a few ports.
I established a parallel ports tree and set the environment variables
PREFIX=${MYFREEBSD}/usr/local
WORKDIR=${MYFREEBSD}/var/db/portsnap
PORTSDIR=${MYFREEBSD}/usr/ports

With those set, I can build and install some things.

For example, I can build and install graphics/ufraw, and with my PATH
properly extended to include ${MYFREEBSD}/usr/local/bin I can execute it.
I can also build and install x11/babl into ${MYFREEBSD}.
Running a normally built gimp finds the new libbabl located in a
different, non-standard place:
$ ldd `which gimp` | grep babl
libbabl-0.1.so.0 => /usr/home/.../usr/local/lib/libbabl-0.1.so.0
I didn't expect that to work; nice.

However, when I go to build graphics/gegl it fails because it can't find
the installed babl:
===> gegl-0.3.34 depends on shared library: libbabl-0.1.so - not found

If I set
LOCALBASE=${MYFREEBSD}/usr/local
it wants to rebuild all dependencies, since it doesn't find any of the
normally installed stuff.

Adding
-L${MYFREEBSD}/usr/local/lib to LDFLAGS
-I${MYFREEBSD}/usr/local/include to CPPFLAGS
in the Makefile doesn't solve the problem.

Is there a good solution to this, or do I have to set LOCALBASE with the
resulting build of everything else, not just the things that I need to
upgrade for this work? Hopefully there's a way to extend the normal
search path for port builds?

Thanks for any hints,

Gary
Tijl Coosemans
2018-04-25 08:54:47 UTC
Permalink
Post by Gary Aitken
Asked this on questions a while ago and got no response;
any thoughts would be much appreciated.
I'm trying to set up a development environment for a few ports.
I established a parallel ports tree and set the environment variables
PREFIX=${MYFREEBSD}/usr/local
WORKDIR=${MYFREEBSD}/var/db/portsnap
PORTSDIR=${MYFREEBSD}/usr/ports
With those set, I can build and install some things.
For example, I can build and install graphics/ufraw, and with my PATH
properly extended to include ${MYFREEBSD}/usr/local/bin I can execute it.
I can also build and install x11/babl into ${MYFREEBSD}.
Running a normally built gimp finds the new libbabl located in a
$ ldd `which gimp` | grep babl
libbabl-0.1.so.0 => /usr/home/.../usr/local/lib/libbabl-0.1.so.0
I didn't expect that to work; nice.
However, when I go to build graphics/gegl it fails because it can't find
===> gegl-0.3.34 depends on shared library: libbabl-0.1.so - not found
If I set
LOCALBASE=${MYFREEBSD}/usr/local
it wants to rebuild all dependencies, since it doesn't find any of the
normally installed stuff.
Adding
-L${MYFREEBSD}/usr/local/lib to LDFLAGS
-I${MYFREEBSD}/usr/local/include to CPPFLAGS
in the Makefile doesn't solve the problem.
Is there a good solution to this, or do I have to set LOCALBASE with the
resulting build of everything else, not just the things that I need to
upgrade for this work? Hopefully there's a way to extend the normal
search path for port builds?
Thanks for any hints,
Try setting LIB_DIRS. Its default value is "/lib /usr/lib ${LOCALBASE}/lib".
Gary Aitken
2018-04-25 17:22:30 UTC
Permalink
Post by Tijl Coosemans
Post by Gary Aitken
Asked this on questions a while ago and got no response;
any thoughts would be much appreciated.
I'm trying to set up a development environment for a few ports.
I established a parallel ports tree and set the environment variables
PREFIX=${MYFREEBSD}/usr/local
WORKDIR=${MYFREEBSD}/var/db/portsnap
PORTSDIR=${MYFREEBSD}/usr/ports
With those set, I can build and install some things.
For example, I can build and install graphics/ufraw, and with my PATH
properly extended to include ${MYFREEBSD}/usr/local/bin I can execute it.
I can also build and install x11/babl into ${MYFREEBSD}.
Running a normally built gimp finds the new libbabl located in a
$ ldd `which gimp` | grep babl
libbabl-0.1.so.0 => /usr/home/.../usr/local/lib/libbabl-0.1.so.0
I didn't expect that to work; nice.
However, when I go to build graphics/gegl it fails because it can't find
===> gegl-0.3.34 depends on shared library: libbabl-0.1.so - not found
If I set
LOCALBASE=${MYFREEBSD}/usr/local
it wants to rebuild all dependencies, since it doesn't find any of the
normally installed stuff.
Adding
-L${MYFREEBSD}/usr/local/lib to LDFLAGS
-I${MYFREEBSD}/usr/local/include to CPPFLAGS
in the Makefile doesn't solve the problem.
Is there a good solution to this, or do I have to set LOCALBASE with the
resulting build of everything else, not just the things that I need to
upgrade for this work? Hopefully there's a way to extend the normal
search path for port builds?
...
Post by Tijl Coosemans
Try setting LIB_DIRS. Its default value is "/lib /usr/lib ${LOCALBASE}/lib".
Thanks, that mostly did the trick.
However, I still have an issue with a library which resides in a subdir
of /usr/local/lib:
===> gegl-0.3.34 depends on shared library: libcgraph.so - not found
$ pkg info -l graphviz
...
/usr/local/lib/graphviz/libcgraph.so
/usr/local/lib/graphviz/libcgraph.so.6
/usr/local/lib/graphviz/libcgraph.so.6.0.0

I tried tweaking the Makefile:
LIB_DEPENDS+= graphviz/libcgraph.so:graphics/graphviz
but that fails:
Error: pattern graphviz/libcgraph.so in LIB_DEPENDS is not valid

Also tried some permutations with trailing '/' and '/*' on the directory
with no success.

I could not find any discussion of this situation in the porter's
handbook, probably because it "just works" building in /usr/ports.
I can get it to work by explicitly adding the subdir as another element
of LIB_DIRS but that seems wrong; I have 92 subdirs to /usr/local/lib.

Gary
Tijl Coosemans
2018-04-26 19:09:10 UTC
Permalink
Post by Gary Aitken
Post by Tijl Coosemans
Post by Gary Aitken
Asked this on questions a while ago and got no response;
any thoughts would be much appreciated.
I'm trying to set up a development environment for a few ports.
I established a parallel ports tree and set the environment variables
PREFIX=${MYFREEBSD}/usr/local
WORKDIR=${MYFREEBSD}/var/db/portsnap
PORTSDIR=${MYFREEBSD}/usr/ports
With those set, I can build and install some things.
For example, I can build and install graphics/ufraw, and with my PATH
properly extended to include ${MYFREEBSD}/usr/local/bin I can execute it.
I can also build and install x11/babl into ${MYFREEBSD}.
Running a normally built gimp finds the new libbabl located in a
$ ldd `which gimp` | grep babl
libbabl-0.1.so.0 => /usr/home/.../usr/local/lib/libbabl-0.1.so.0
I didn't expect that to work; nice.
However, when I go to build graphics/gegl it fails because it can't find
===> gegl-0.3.34 depends on shared library: libbabl-0.1.so - not found
If I set
LOCALBASE=${MYFREEBSD}/usr/local
it wants to rebuild all dependencies, since it doesn't find any of the
normally installed stuff.
Adding
-L${MYFREEBSD}/usr/local/lib to LDFLAGS
-I${MYFREEBSD}/usr/local/include to CPPFLAGS
in the Makefile doesn't solve the problem.
Is there a good solution to this, or do I have to set LOCALBASE with the
resulting build of everything else, not just the things that I need to
upgrade for this work? Hopefully there's a way to extend the normal
search path for port builds?
...
Post by Tijl Coosemans
Try setting LIB_DIRS. Its default value is "/lib /usr/lib ${LOCALBASE}/lib".
Thanks, that mostly did the trick.
However, I still have an issue with a library which resides in a subdir
===> gegl-0.3.34 depends on shared library: libcgraph.so - not found
$ pkg info -l graphviz
...
/usr/local/lib/graphviz/libcgraph.so
/usr/local/lib/graphviz/libcgraph.so.6
/usr/local/lib/graphviz/libcgraph.so.6.0.0
LIB_DEPENDS+= graphviz/libcgraph.so:graphics/graphviz
Error: pattern graphviz/libcgraph.so in LIB_DEPENDS is not valid
Also tried some permutations with trailing '/' and '/*' on the directory
with no success.
I could not find any discussion of this situation in the porter's
handbook, probably because it "just works" building in /usr/ports.
I can get it to work by explicitly adding the subdir as another element
of LIB_DIRS but that seems wrong; I have 92 subdirs to /usr/local/lib.
The code to find libraries is in /usr/ports/Mk/Scripts/find-lib.sh. These
are the directories:

dirs="${LIB_DIRS} `cat ${LOCALBASE}/libdata/ldconfig/* 2>/dev/null || :`"

So either you modified LOCALBASE or ${LOCALBASE}/libdata/ldconfig/
doesn't contain an file for graphviz.

Loading...