Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 431170

Summary: net-analyzer/rrdtool-1.4.5-r1 with dev-util/pkgconf-0.8.5 installs lua bindings into /usr/local/lib/lua/5.1
Product: Gentoo Linux Reporter: Anthony Basile <blueness>
Component: [OLD] DevelopmentAssignee: Richard Yao (RETIRED) <ryao>
Status: RESOLVED FIXED    
Severity: normal CC: jdhore, nenolod, netmon, zerochaos
Priority: Normal Keywords: Bug
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Make sure at least one space is printted for cflags/libs
Improved patch format for committing to git

Description Anthony Basile gentoo-dev 2012-08-13 01:56:19 UTC
While trying to stabilize =www-servers/lighttpd-1.4.31, bug #430902, I hit this issue since rrdtool is a dep of libhttpd.  The problem has to do with the way pkgconf and pkg-config return a "no flags" answer to

     LUA_CFLAGS=`$PKGCONFIG --cflags $f 2>/dev/null`

on line 772 of rrdtool-1.4.5-r1's configure.ac.  This is supposed to be "blank" but not empty, so that later on line 790, the test

     # if not set with pkg-config, use default values 
     if test "$LUA_CFLAGS" = ""; then

fails for pkg-config but succeeds for pkgconf.  rrdtool's configure.ac assumes that if $PKGCONFIG --cflags succeeds in running, but does not return any cflags, then a single blank space is returned.  pkg-config provides this behaviour while pkgconf does not.  When that test passes, then LUA_INSTALL_CMOD is set to the /usr/local/ path causing the problem.

The easiest way to demonstrate the different behavior is as follows:

# echo "|`pkg-config --cflags lua`|"
| |


# echo "|`pkgconf --cflags lua`|"
||
Comment 1 Anthony Basile gentoo-dev 2012-08-13 02:04:58 UTC
Is there any standard to which pkgconfig must conform?
Comment 2 Alexandre Rostovtsev (RETIRED) gentoo-dev 2012-08-13 02:21:26 UTC
(In reply to comment #1)
> Is there any standard to which pkgconfig must conform?

http://cgit.freedesktop.org/pkg-config/tree/pkg-config-guide.html and http://cgit.freedesktop.org/pkg-config/tree/pkg-config.1 are probably the closest that pkgconfig has to a specification.
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2012-08-13 06:27:14 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Is there any standard to which pkgconfig must conform?
> 
> http://cgit.freedesktop.org/pkg-config/tree/pkg-config-guide.html and
> http://cgit.freedesktop.org/pkg-config/tree/pkg-config.1 are probably the
> closest that pkgconfig has to a specification.

nod, those are it.  pkgconf needs to be fixed to get same result.
Comment 4 Anthony Basile gentoo-dev 2012-10-14 00:35:16 UTC
Created attachment 326492 [details, diff]
Make sure at least one space is printted for cflags/libs

I've looked at all the specific pkg-config database fields and compared pkgconf to pkg-config.  Of these, its seems only the following must print out at least one space:

  --cflags                          print required CFLAGS to stdout
  --cflags-only-I                   print required include-dir CFLAGS to stdout
  --cflags-only-other               print required non-include-dir CFLAGS to stdout
  --libs                            print required linker flags to stdout
  --libs-only-L                     print required LDPATH linker flags to stdout
  --libs-only-l                     print required LIBNAME linker flags to stdout
  --libs-only-other                 print required other linker flags to stdout

Digging through all their linked lists, I came up with a very simple solution.  Just make sure at least one space is printed out for any --cflags* or --libs*.  This can't go wrong :)

I'll push it upstream.
Comment 5 Anthony Basile gentoo-dev 2012-10-14 05:07:07 UTC
Created attachment 326506 [details, diff]
Improved patch format for committing to git
Comment 6 Richard Yao (RETIRED) gentoo-dev 2012-10-17 16:08:40 UTC
Comment on attachment 326506 [details, diff]
Improved patch format for committing to git

jdhore is on devaway, so I will handle this bug.

net-analyzer/rrdtool-1.4.5-r1 fails to build on my system in what is likely another bug. net-analyzer/rrdtool-1.4.7-r1 works perfectly.

This issue appears to have already been fixed in pkgconf 0.8.9. I have committed dev-util/pkgconf-0.8.9 to portage. I will leave this bug open until dev-util/pkgconf-0.8.9 is stabilized.
Comment 7 Richard Yao (RETIRED) gentoo-dev 2012-12-16 06:00:23 UTC
(In reply to comment #6)
> Comment on attachment 326506 [details, diff] [details, diff]
> Improved patch format for committing to git
> 
> jdhore is on devaway, so I will handle this bug.
> 
> net-analyzer/rrdtool-1.4.5-r1 fails to build on my system in what is likely
> another bug. net-analyzer/rrdtool-1.4.7-r1 works perfectly.
> 
> This issue appears to have already been fixed in pkgconf 0.8.9. I have
> committed dev-util/pkgconf-0.8.9 to portage. I will leave this bug open
> until dev-util/pkgconf-0.8.9 is stabilized.

Hurricane Sandy caused me to get behind on handling bugs. Anyway, bug #443788 has been opened to ahndle stabilization. I am closing this as fixed.