Opened 6 years ago

Last modified 6 years ago

#39567 new enhancement

pslib stealth dependence on libraries from /usr/local/lib (affects gnudatalanguage)

Reported by: gnw3 Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.1.3
Keywords: Cc: tenomoto (Takeshi Enomoto), cooljeanius (Eric Gallager)
Port: pslib


This is mainly an attempt to record a potential issue for gnudatalanguage users.

The configure script for pslib searches for graphics libraries in /usr and /usr/local:

 		for i in ${withval} /usr /usr/local ; do
 			if test -r $i/include/png.h ; then

As a result, systems that have one or more of the graphics libraries mentioned in the info file will use the versions from /usr/local/lib. I don't know if gnudatalanguage actually uses the parts of pslib that depend on these libraries, but if the user updates the libraries in /usr/local/lib then gnudatalanguage may get a startup error.

To avoid this macports versions of the graphics libraries in the Portfile:

configure.args-append     --with-png=${prefix} \
                          --with-jpeg=${prefix} \
                          --with-gif=${prefix} \

Note that the gif support is not actually used because the macports library files the configure tests. Also, documentation won't be built because configure looks for an obsolete docbook_to_man utility.

It may also be necessary to provide:

pre-build {
    build.args             LIBS=-lintl

Without this, some systems give runtime errors for missing _libintl_setlocale_. I'm not sure pslib should be calling setlocale as that is normally a responsibilty of the calling program.

CCing the gnudatalanguage maintainer as pslib doesn't appear to be used elsewhere and shows "nomaintainer".

Change History (3)

comment:1 Changed 6 years ago by neverpanic (Clemens Lang)

The very same issue will also show up with lots and lots of other ports. We usually do not specifically deal with stuff in /usr/local/lib but advise users to move it aside. See wiki:FAQ#usrlocal.

Since you have already done the hard part and figured out what to change to produce a working build with files present in /usr/local, we might aswell apply the fix. Just a note for future releases: Starting with MacPorts 2.2 this problem can be avoided by using "trace mode" (by providing the -t switch to port), which enables a library preloading-based sandbox that will hide files in /usr/local from the build system.

comment:2 Changed 6 years ago by tenomoto (Takeshi Enomoto)

I added configure.args and forced linking against libgif in r107812. I don't see what happens during the pre-build phase, so I didn't include libintl. I don't know how to deal with the docbook problem. It seems that pslib needs both docbook2man and docbook-to-man (see doc/ I was able to install docbook2X, which includes docbook2man I was not able to compile docbook-utils. Even if I succeed, docbook-utils conflicts with docbook2X.

comment:3 Changed 6 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

Note: See TracTickets for help on using tickets.