Bug 75442 - gnokii port does not include ical support
Summary: gnokii port does not include ical support
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-23 19:00 UTC by Sven Berkvens-Matthijsse
Modified: 2004-12-28 20:52 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Berkvens-Matthijsse 2004-12-23 19:00:47 UTC
The gnokii port does not patch the file "configure" so that it may correctly check (on FreeBSD) if the ical library is installed on the system. Normally, the program has a fallback for this library, but the support for the fallback in gnokii itself is broken. This causes problems for me, for example, while restoring calendar information to my phone. If gnokii uses the ical library, everything works as expected.

Fix: Use this "files/patch-configure" file instead of the one in the ports tree:



It's all about the lines with -lical on them.
The rest of the stuff was already in the ports tree file.--YvJxkqm9atMJySZCBZ3Mw3d0xp1CTOcqD1pdAdFI8nmrybMj
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- configure.orig      Sun Oct 17 21:44:38 2004
+++ configure   Thu Dec 23 19:48:31 2004
@@ -26348,13 +26348,15 @@
 # First of all, check if the user has set any of the PTHREAD_LIBS,
 # etcetera environment variables, and if threads linking works using
 # them:
-if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
+if test x"-pthread-D_THREAD_SAFE" != x; then
+       PTHREAD_CFLAGS="-D_THREAD_SAFE"
+       PTHREAD_LIBS="-pthread"
         save_CFLAGS="$CFLAGS"
-        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        CFLAGS="$CFLAGS -D_THREAD_SAFE"
         save_LIBS="$LIBS"
-        LIBS="$PTHREAD_LIBS $LIBS"
-        echo "$as_me:$LINENO: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5
-echo $ECHO_N "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... $ECHO_C" >&6
+        LIBS="-pthread $LIBS"
+        echo "$as_me:$LINENO: checking for pthread_join in LIBS=-pthread with CFLAGS=-D_THREAD_SAFE" >&5
+echo $ECHO_N "checking for pthread_join in LIBS=-pthread with CFLAGS=-D_THREAD_SAFE... $ECHO_C" >&6
         cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -26726,7 +26728,7 @@
 echo $ECHO_N "checking if more special flags are required for pthreads... $ECHO_C" >&6
         flag=no
         case "${host_cpu}-${host_os}" in
-                *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
+                *-aix* | *-darwin*) flag="-D_THREAD_SAFE";;
                 *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
         esac
         echo "$as_me:$LINENO: result: ${flag}" >&5
@@ -27570,7 +27572,7 @@
 USE_LIBICAL="no"
 OLD_LIBS="$LIBS"
 OLD_CFLAGS="$CFLAGS"
-LIBS="$LIBS $ICAL_LIBS -lpthread -lical"
+LIBS="$LIBS $ICAL_LIBS -L/usr/local -pthread -lical"
 CFLAGS="$CFLAGS $ICAL_CFLAGS"
 echo "$as_me:$LINENO: checking whether libical is installed" >&5
 echo $ECHO_N "checking whether libical is installed... $ECHO_C" >&6
How-To-Repeat: Install gnokii on your system. It will not include ical support, even if you the ical library installed.
Comment 1 Volker Stolz freebsd_committer 2004-12-27 11:22:50 UTC
Dear maintainer, please look into this issue!

Regards,
   Volker
Comment 2 Volker Stolz freebsd_committer 2004-12-27 11:23:12 UTC
State Changed
From-To: open->feedback

Forwarded PR to maintainer
Comment 3 Guido Falsi freebsd_committer 2004-12-27 12:09:43 UTC
On Mon, Dec 27, 2004 at 12:22:50PM +0100, Volker Stolz wrote:
> Dear maintainer, please look into this issue!

Here is a patch to the port. It fixes the problem and also automatically
adds the dependency on ical library, or calls it with the new knob
"WITH_ICAL", I took the idea from the mplayer port which has lots of
such knobs.

-- 
Guido Falsi <mad@madpilot.net>

diff -ruN gnokii.old/Makefile gnokii/Makefile
--- gnokii.old/Makefile	Mon Dec 27 12:45:36 2004
+++ gnokii/Makefile	Mon Dec 27 13:04:06 2004
@@ -43,6 +43,14 @@
 
 .include <bsd.port.pre.mk>
 
+.if exists(${LOCALBASE}/lib/libical.so.0)
+WITH_ICAL=	yes
+.endif
+
+.if defined(WITH_ICAL)
+LIB_DEPENDS+=	ical.0:${PORTSDIR}/devel/libical
+.endif
+
 # If smsd is enabled check if MySQL or PostgreSQL are installed and
 # build the modules, no switches to make this port build those, if
 # you want them, just install them before this port. The port will
diff -ruN gnokii.old/files/patch-configure gnokii/files/patch-configure
--- gnokii.old/files/patch-configure	Mon Dec 27 12:45:36 2004
+++ gnokii/files/patch-configure	Mon Dec 27 12:49:07 2004
@@ -1,5 +1,5 @@
---- configure.orig	Mon Jul  5 00:04:50 2004
-+++ configure	Tue Jul  6 12:56:33 2004
+--- configure.orig	Sun Oct 17 21:44:38 2004
++++ configure	Mon Dec 27 12:48:43 2004
 @@ -26348,13 +26348,15 @@
  # First of all, check if the user has set any of the PTHREAD_LIBS,
  # etcetera environment variables, and if threads linking works using
@@ -30,3 +30,12 @@
                  *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
          esac
          echo "$as_me:$LINENO: result: ${flag}" >&5
+@@ -27570,7 +27572,7 @@
+ USE_LIBICAL="no"
+ OLD_LIBS="$LIBS"
+ OLD_CFLAGS="$CFLAGS"
+-LIBS="$LIBS $ICAL_LIBS -lpthread -lical"
++LIBS="$LIBS $ICAL_LIBS -L/usr/local -pthread -lical"
+ CFLAGS="$CFLAGS $ICAL_CFLAGS"
+ echo "$as_me:$LINENO: checking whether libical is installed" >&5
+ echo $ECHO_N "checking whether libical is installed... $ECHO_C" >&6
Comment 4 Volker Stolz freebsd_committer 2004-12-27 12:20:31 UTC
State Changed
From-To: feedback->open

Feedback received
Comment 5 Pav Lucistnik freebsd_committer 2004-12-28 20:52:23 UTC
State Changed
From-To: open->closed

Maintainer's patch committed!