ports/178578: print/ghostview: Fix build with clang
KATO Tsuguru
tkato432 at yahoo.com
Mon May 13 18:10:03 UTC 2013
>Number: 178578
>Category: ports
>Synopsis: print/ghostview: Fix build with clang
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Mon May 13 18:10:03 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator: KATO Tsuguru
>Release: FreeBSD 7.4-RELEASE-p11 i386
>Organization:
>Environment:
>Description:
- Fix build with clang
- Update MASTER_SITES
- Support PLIST_FILES
>How-To-Repeat:
>Fix:
diff -urN /usr/ports/print/ghostview/Makefile print/ghostview/Makefile
--- /usr/ports/print/ghostview/Makefile 2012-11-08 09:23:24.000000000 +0900
+++ print/ghostview/Makefile 2013-05-14 00:00:25.000000000 +0900
@@ -1,22 +1,17 @@
-# New ports collection makefile for: ghostview
-# Date created: 21 October 1994
-# Whom: jkh
-#
+# Created by: jkh
# $FreeBSD: head/print/ghostview/Makefile 300897 2012-07-14 14:29:18Z beat $
-#
PORTNAME= ghostview
PORTVERSION= 1.5
PORTREVISION= 3
CATEGORIES= print
MASTER_SITES= http://ftp.gnu.org/old-gnu/ghostview/ \
- ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/gnu/ghostview/
+ http://ftp.sunet.se/pub/text-processing/postscript/interpreters/ghostscript/gnu/ghostview/
MAINTAINER= ports at FreeBSD.org
-COMMENT= An X11 front-end for ghostscript, the GNU postscript previewer
+COMMENT= X11 front-end for ghostscript, the GNU postscript previewer
LICENSE= GPLv2 # (or later)
-LICENSE_FILE= ${WRKSRC}/COPYING
USE_IMAKE= yes
USE_XORG= xbitmaps xaw
@@ -24,8 +19,8 @@
MAKE_JOBS_SAFE= yes
MAN1= ghostview.1
-
-CFLAGS+= -DUSG
+PLIST_FILES= bin/ghostview \
+ lib/X11/app-defaults/Ghostview
post-install:
@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
diff -urN /usr/ports/print/ghostview/files/patch-Dir.c print/ghostview/files/patch-Dir.c
--- /usr/ports/print/ghostview/files/patch-Dir.c 1970-01-01 09:00:00.000000000 +0900
+++ print/ghostview/files/patch-Dir.c 2013-05-14 00:00:25.000000000 +0900
@@ -0,0 +1,10 @@
+--- Dir.c.orig
++++ Dir.c
+@@ -25,6 +25,7 @@
+ */
+
+ #include <stdio.h>
++#include <stdlib.h>
+
+ #ifdef SEL_FILE_IGNORE_CASE
+ #include <ctype.h>
diff -urN /usr/ports/print/ghostview/files/patch-Draw.c print/ghostview/files/patch-Draw.c
--- /usr/ports/print/ghostview/files/patch-Draw.c 1970-01-01 09:00:00.000000000 +0900
+++ print/ghostview/files/patch-Draw.c 2013-05-14 00:00:25.000000000 +0900
@@ -0,0 +1,33 @@
+--- Draw.c.orig
++++ Draw.c
+@@ -59,6 +59,7 @@
+
+ static XtIntervalId SFscrollTimerId;
+
++void
+ SFinitFont()
+ {
+ TextData *data;
+@@ -86,6 +87,7 @@
+ SFcharHeight = SFcharAscent + SFfont->max_bounds.descent;
+ }
+
++void
+ SFcreateGC()
+ {
+ XGCValues gcValues;
+@@ -228,12 +230,12 @@
+ }
+
+ if (!(--dir->nEntries)) {
+- return;
++ return 1;
+ }
+
+ n = dir - &(SFdirs[SFdirPtr]);
+ if ((n < 0) || (n > 2)) {
+- return;
++ return 1;
+ }
+
+ XawScrollbarSetThumb(
diff -urN /usr/ports/print/ghostview/files/patch-Ghostview.c print/ghostview/files/patch-Ghostview.c
--- /usr/ports/print/ghostview/files/patch-Ghostview.c 1970-01-01 09:00:00.000000000 +0900
+++ print/ghostview/files/patch-Ghostview.c 2013-05-14 00:00:25.000000000 +0900
@@ -0,0 +1,11 @@
+--- Ghostview.c.orig
++++ Ghostview.c
+@@ -23,6 +23,8 @@
+ * FAX: (608)262-9777 Madison, WI 53706
+ */
+
++#include <stdlib.h>
++
+ #include <X11/IntrinsicP.h>
+ #include <X11/StringDefs.h>
+ #include <X11/Xatom.h>
diff -urN /usr/ports/print/ghostview/files/patch-Imakefile print/ghostview/files/patch-Imakefile
--- /usr/ports/print/ghostview/files/patch-Imakefile 1970-01-01 09:00:00.000000000 +0900
+++ print/ghostview/files/patch-Imakefile 2013-05-14 00:00:25.000000000 +0900
@@ -0,0 +1,33 @@
+--- Imakefile.orig
++++ Imakefile
+@@ -29,17 +29,17 @@
+
+ #ifdef Use_SelFile
+ SRCS = main.c misc.c callbacks.c actions.c dialogs.c \
+- Ghostview.c ps.c getenv.c setenv.c strcasecmp.c \
++ Ghostview.c ps.c \
+ SelFile.c Dir.c Path.c Draw.c
+ OBJS = main.o misc.o callbacks.o actions.o dialogs.o \
+- Ghostview.o ps.o getenv.o setenv.o strcasecmp.o \
++ Ghostview.o ps.o \
+ SelFile.o Dir.o Path.o Draw.o
+ SELFILE_DEFINE = -DSELFILE
+ #else
+ SRCS = main.c misc.c callbacks.c actions.c dialogs.c \
+- Ghostview.c ps.c getenv.c setenv.c strcasecmp.c
++ Ghostview.c ps.c
+ OBJS = main.o misc.o callbacks.o actions.o dialogs.o \
+- Ghostview.o ps.o getenv.o setenv.o strcasecmp.o
++ Ghostview.o ps.o
+ SELFILE_DEFINE =
+ #endif
+
+@@ -49,7 +49,7 @@
+
+ XCOMM Add -DBSD4_2 to DEFINES if you system does not have memset() and memcpy()
+
+- DEFINES = -DNON_BLOCKING_IO $(SIGNAL_DEFINES) $(SELFILE_DEFINE)
++ DEFINES = -DUSG -DNON_BLOCKING_IO $(SIGNAL_DEFINES) $(SELFILE_DEFINE)
+
+ .NOEXPORT:
+
diff -urN /usr/ports/print/ghostview/files/patch-Path.c print/ghostview/files/patch-Path.c
--- /usr/ports/print/ghostview/files/patch-Path.c 1970-01-01 09:00:00.000000000 +0900
+++ print/ghostview/files/patch-Path.c 2013-05-14 00:00:25.000000000 +0900
@@ -0,0 +1,20 @@
+--- Path.c.orig
++++ Path.c
+@@ -568,7 +568,7 @@
+
+ if (SFtwiddle) {
+ if (SFfindHomeDir(begin, end)) {
+- return;
++ return 1;
+ }
+ }
+ *end = 0;
+@@ -616,7 +616,7 @@
+ }
+ } else {
+ if (SFfindFile(&(SFdirs[SFdirEnd-1]), begin)) {
+- return;
++ return 1;
+ }
+ }
+ } else {
diff -urN /usr/ports/print/ghostview/files/patch-aa print/ghostview/files/patch-aa
--- /usr/ports/print/ghostview/files/patch-aa 2012-11-08 09:23:24.000000000 +0900
+++ print/ghostview/files/patch-aa 2013-05-14 00:00:25.000000000 +0900
@@ -1,6 +1,15 @@
--- misc.c.orig Sat Jul 24 03:29:12 1993
+++ misc.c Wed Jun 5 22:41:39 2002
-@@ -60,8 +60,9 @@
+@@ -24,6 +24,8 @@
+ */
+
+ #include <stdio.h>
++#include <stdlib.h>
++
+ #ifndef SEEK_SET
+ #define SEEK_SET 0
+ #endif
+@@ -60,8 +62,9 @@
#ifdef VMS
#include <perror.h>
#else
diff -urN /usr/ports/print/ghostview/files/patch-actions.c print/ghostview/files/patch-actions.c
--- /usr/ports/print/ghostview/files/patch-actions.c 1970-01-01 09:00:00.000000000 +0900
+++ print/ghostview/files/patch-actions.c 2013-05-14 00:00:25.000000000 +0900
@@ -0,0 +1,11 @@
+--- actions.c.orig
++++ actions.c
+@@ -23,6 +23,8 @@
+ * FAX: (608)262-9777 Madison, WI 53706
+ */
+
++#include <stdlib.h>
++
+ #include <X11/Intrinsic.h>
+ #include <X11/StringDefs.h>
+ #include <X11/Xaw/Cardinals.h>
diff -urN /usr/ports/print/ghostview/files/patch-callbacks.c print/ghostview/files/patch-callbacks.c
--- /usr/ports/print/ghostview/files/patch-callbacks.c 1970-01-01 09:00:00.000000000 +0900
+++ print/ghostview/files/patch-callbacks.c 2013-05-14 00:00:25.000000000 +0900
@@ -0,0 +1,20 @@
+--- callbacks.c.orig
++++ callbacks.c
+@@ -24,6 +24,8 @@
+ */
+
+ #include <stdio.h>
++#include <stdlib.h>
++
+ #ifndef BUFSIZ
+ #define BUFSIZ 1024
+ #endif
+@@ -32,8 +34,6 @@
+ #define getenv _getenv
+ #endif
+
+-extern char *getenv();
+-
+ #include <X11/Intrinsic.h>
+ #include <X11/StringDefs.h>
+ #include <X11/Shell.h>
diff -urN /usr/ports/print/ghostview/files/patch-main.c print/ghostview/files/patch-main.c
--- /usr/ports/print/ghostview/files/patch-main.c 1970-01-01 09:00:00.000000000 +0900
+++ print/ghostview/files/patch-main.c 2013-05-14 00:00:25.000000000 +0900
@@ -0,0 +1,20 @@
+--- main.c.orig
++++ main.c
+@@ -23,6 +23,8 @@
+ * FAX: (608)262-9777 Madison, WI 53706
+ */
+
++#include <stdlib.h>
++
+ #include <X11/Intrinsic.h>
+ #include <X11/cursorfont.h>
+ #include <X11/StringDefs.h>
+@@ -53,8 +55,6 @@
+ #include "gv.h"
+ #include "ps.h"
+
+-extern char *getenv();
+-
+ static String version = "Ghostview, version 1.5";
+
+ static XtResource resources[] = {
diff -urN /usr/ports/print/ghostview/files/patch-ps.c print/ghostview/files/patch-ps.c
--- /usr/ports/print/ghostview/files/patch-ps.c 1970-01-01 09:00:00.000000000 +0900
+++ print/ghostview/files/patch-ps.c 2013-05-14 00:00:25.000000000 +0900
@@ -0,0 +1,12 @@
+--- ps.c.orig
++++ ps.c
+@@ -24,6 +24,9 @@
+ */
+
+ #include <stdio.h>
++#include <stdlib.h>
++#include <strings.h>
++
+ #ifndef SEEK_SET
+ #define SEEK_SET 0
+ #endif
diff -urN /usr/ports/print/ghostview/pkg-plist print/ghostview/pkg-plist
--- /usr/ports/print/ghostview/pkg-plist 2012-11-08 09:23:24.000000000 +0900
+++ print/ghostview/pkg-plist 1970-01-01 09:00:00.000000000 +0900
@@ -1,2 +0,0 @@
-bin/ghostview
-lib/X11/app-defaults/Ghostview
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list