Subject: pkg/35219: misc/koffice fails to compile on NetBSD 3.1
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <dhgutteridge@sympatico.ca>
List: pkgsrc-bugs
Date: 12/09/2006 09:25:01
>Number:         35219
>Category:       pkg
>Synopsis:       misc/koffice fails to compile on NetBSD 3.1
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 09 09:25:00 +0000 2006
>Originator:     David H. Gutteridge
>Release:        NetBSD 3.1
>Organization:
>Environment:
NetBSD arcusiii.nonus-porta.net 3.1 NetBSD 3.1 (ARCUSIII) #0: Mon Nov  6 01:25:07 EST 2006  root@arcusiii.nonus-porta.net:/usr/src/sys/arch/i386/compile/ARCUSIII i386

>Description:
KOffice 1.6.1 from pkgsrc fails to compile on NetBSD 3.1
because releases before 4.0 do not have the trunc() function
in math.h
>How-To-Repeat:
Try compiling KOffice.
>Fix:
Something like this should fix the problem I think.

--- patch-aa~   2006-12-08 06:00:48.000000000 -0500
+++ patch-aa    2006-12-08 23:18:06.000000000 -0500
@@ -7,7 +7,7 @@
  }
  
 -#if defined ( Q_WS_WIN)
-+#if defined ( Q_WS_WIN) || defined(__DragonFly__)
++#if defined ( Q_WS_WIN) || defined(__DragonFly__) || (defined(__NetBSD__) && __NetBSD_Version__ < 399000000)
  #define trunc(x) ((int)(x))
  #endif