ports/174545: [PATCH] sysutils/openipmi (fix pthread/pkg-config issue)
Eric Freeman
freebsdports at chillibear.com
Tue Dec 18 16:50:00 UTC 2012
>Number: 174545
>Category: ports
>Synopsis: [PATCH] sysutils/openipmi (fix pthread/pkg-config issue)
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Tue Dec 18 16:50:00 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: Eric Freeman
>Release: 8.2
>Organization:
Sundive Networks
>Environment:
>Description:
I noticed whilst trying to add OpenIPMI functionality to another port (collectd5) that despite having installed the OpenIPMI port the pkg-config command (used by this other software) was failing to locate the OpenIPMI libraries. For example:
# pkg-config --libs OpenIPMIpthread
Package pthread was not found in the pkg-config search path.
Perhaps you should add the directory containing `pthread.pc'
to the PKG_CONFIG_PATH environment variable
No package 'pthread' found
They were however installed:
# pkg-config --list-all | grep IPMI
OpenIPMIutils OpenIPMIutils - Utilities used by the OpenIPMI library.
OpenIPMI OpenIPMI - Library to make using IPMI easier
OpenIPMIui OpenIPMIui - UI front-end for OpenIPMI
OpenIPMIposix OpenIPMIposix - POSIX unthreaded OS handler for OpenIPMI
OpenIPMIpthread OpenIPMIpthread - Pthread OS handler for OpenIPMI
OpenIPMIcmdlang OpenIPMIcmdlang - Command language for OpenIPMI
OpenIPMIglib OpenIPMIglib - GLIB threaded OS handler for OpenIPMI
The problem it seems is down to the OpenIPMI libs 'requiring' pthread in the 'OpenIPMIpthread.pc.in' file, the lack of pthread.pc caused the pkg-config to exti with a state of 1, stopping the configure script. As per http://www.freebsd.org/doc/en/books/porters-handbook/dads-pthread.html I think this file should be modified so that the requires 'pthread' is removed and instead a '-pthread' (actually $PTHREAD_LIBS) added to the 'CFlags' line.
I've included the patch to do this and to bump the portrevision, which I thought was probably the right thing to do given I was working on patching another port that would depend on this update.
Regards
Eric
>How-To-Repeat:
Install OpenIPMI
pkg-config --libs OpenIPMIpthread
pkg-config --exists OpenIPMIpthread
echo $?
etc
>Fix:
diff -ruN openipmi.orig/Makefile openipmi/Makefile
--- openipmi.orig/Makefile 2012-12-18 16:13:40.000000000 +0000
+++ openipmi/Makefile 2012-12-18 16:26:01.000000000 +0000
@@ -7,6 +7,7 @@
PORTNAME= openipmi
PORTVERSION= 2.0.19
+PORTREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= SF/${PORTNAME}/OpenIPMI%202.0%20Library
DISTNAME= OpenIPMI-${PORTVERSION}
diff -ruN openipmi.orig/files/patch-OpenIPMIpthread.pc.in openipmi/files/patch-OpenIPMIpthread.pc.in
--- openipmi.orig/files/patch-OpenIPMIpthread.pc.in 1970-01-01 01:00:00.000000000 +0100
+++ openipmi/files/patch-OpenIPMIpthread.pc.in 2012-12-18 16:34:28.000000000 +0000
@@ -0,0 +1,11 @@
+--- OpenIPMIpthread.pc.in.orig 2012-12-18 16:15:18.000000000 +0000
++++ OpenIPMIpthread.pc.in 2012-12-18 16:15:29.000000000 +0000
+@@ -6,6 +6,6 @@
+ Name: OpenIPMIpthread
+ Description: Pthread OS handler for OpenIPMI
+ Version: @VERSION@
+-Requires: OpenIPMI pthread
++Requires: OpenIPMI
+ Libs: -L${libdir} -lOpenIPMIutils -lOpenIPMIpthread
+-Cflags: -I${includedir}
++Cflags: -I${includedir} ${PTHREAD_LIBS}
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list