Subject: pkg/36757: print/ghostscript: fails to build on linux
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: Yakovetsky Vladimir <yx@x.ua>
List: pkgsrc-bugs
Date: 08/09/2007 15:30:01
>Number:         36757
>Category:       pkg
>Synopsis:       print/ghostscript: fails to build on linux
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 09 15:30:01 +0000 2007
>Originator:     Yakovetsky Vladimir
>Release:        
>Environment:
System: Linux bres 2.6.21.5 #1 SMP Fri Jul 6 09:48:19 GMT 2007 i686 GNU/Linux
Architecture: i686

>Description:
	print/ghostscript fails to build on linux

>How-To-Repeat:
% uname -sr; cat /etc/debian_version
Linux 2.6.21.5
lenny/sid

% cd /usr/pkgsrc/print/ghostscript
% bmake
...
gcc  -DHAVE_MKSTEMP -DHAVE_HYPOT -DHAVE_FILE64  -O2 -I/usr/pkg/include -I/usr/include  -Wall -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -Wno-strict-aliasing -fno-builtin -fno-common -DHAVE_STDINT_H -DGX_COLOR_INDEX_TYPE="unsigned long long" -O2 -march=pentium3 -mfpmath=sse -msse -finline-functions -fomit-frame-pointer -ffast-math -DA4 -I/usr/pkg/include -I/usr/include  -I./obj -I./src  -o ./obj/gpmisc.o -c ./src/gpmisc.c
./src/gpmisc.c: In function 'gp_fopentemp_generic':
./src/gpmisc.c:97: error: 'fdopen64' undeclared (first use in this function)
./src/gpmisc.c:97: error: (Each undeclared identifier is reported only once
./src/gpmisc.c:97: error: for each function it appears in.)
make: *** [obj/gpmisc.o] Error 1
*** Error code 2

Stop.
bmake: stopped in /usr/pkgsrc/print/ghostscript
*** Error code 1

>Fix:
:r /usr/pkgsrc/print/ghostscript/patches/patch-ae
--- src/gpmisc.c.~1~
+++ src/gpmisc.c
@@ -93,7 +93,7 @@
      * fdopen as (char *), rather than following the POSIX.1 standard,
      * which defines it as (const char *).  Patch this here.
      */
-#if defined (HAVE_FILE64) && !defined(_AIX)
+#if defined (HAVE_FILE64) && !defined(_AIX) && !defined(__linux__)
     file = (b64 ? fdopen64 : fdopen)(fildes, (char *)mode); /* still really const */
 #else
     file = fdopen(fildes, (char *)mode); /* still really const */