Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Mar 2015 06:21:47 +0000 (UTC)
From:      Mikhail Teterin <mi@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r380834 - in head/graphics/xfpovray: . files
Message-ID:  <201503090621.t296Ll1W015726@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mi
Date: Mon Mar  9 06:21:47 2015
New Revision: 380834
URL: https://svnweb.freebsd.org/changeset/ports/380834
QAT: https://qat.redports.org/buildarchive/r380834/

Log:
  The actual reason, this port was broken was a bug in a recent version of
  x11-toolkits/xforms. That bug was fixed earlier today.
  
  Make sure, this builds with both erroneous as well as corrected xforms.
  
  Fix the problems with parallelized build -- by replacing the upstream's
  rudimentary Imakefiles with a BSDmakefile. Relocate application's help-
  files into DOCSDIR.
  
  Fix compiler warnings up to WARNS=3 and a few genuine (if ancient) bugs,
  that this process revealed. Bump PORTREVISION and unbreak.

Added:
  head/graphics/xfpovray/files/BSDmakefile   (contents, props changed)
  head/graphics/xfpovray/files/patch-warnings   (contents, props changed)
Modified:
  head/graphics/xfpovray/Makefile
  head/graphics/xfpovray/files/patch-src_show_image.c
  head/graphics/xfpovray/files/patch-src_xfprovray.c
  head/graphics/xfpovray/pkg-plist

Modified: head/graphics/xfpovray/Makefile
==============================================================================
--- head/graphics/xfpovray/Makefile	Mon Mar  9 06:07:38 2015	(r380833)
+++ head/graphics/xfpovray/Makefile	Mon Mar  9 06:21:47 2015	(r380834)
@@ -3,7 +3,7 @@
 
 PORTNAME=	xfpovray
 PORTVERSION=	1.3.1
-PORTREVISION=	12
+PORTREVISION=	13
 CATEGORIES=	graphics
 MASTER_SITES=	http://www.batse.msfc.nasa.gov/~mallozzi/home/software/xforms/src/ \
 		${MASTER_SITE_SUNSITE}
@@ -12,18 +12,20 @@ MASTER_SITE_SUBDIR=	apps/graphics/rays/p
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Graphical interface to POV-Ray
 
-BROKEN=		Fails to link
-DEPRECATED=	Broken for more than 6 months
-EXPIRATION_DATE=	2015-03-28
-
 LIB_DEPENDS=	libforms.so:${PORTSDIR}/x11-toolkits/xforms
 RUN_DEPENDS=	povray:${PORTSDIR}/graphics/povray-meta
 
-USES=		imake tar:tgz
+USES=		tar:tgz uidfix
 USE_XORG=	x11 xext xpm
-MAKE_JOBS_UNSAFE=	yes
+MAKEFILE=	${FILESDIR}/BSDmakefile
+MAKE_ENV+=	DOCSDIR="${DOCSDIR}"
 
 post-patch:
 	@${REINPLACE_CMD} -e "s|%%LOCALBASE%%|${LOCALBASE}|g;" ${WRKSRC}/src/xfpovray.h
+	@${REINPLACE_CMD} -e "s|fl_drw_box|fl_draw_box|g;"	\
+		${WRKSRC}/flx/flx_return_button/flx_return_button.c
+
+post-install:
+	${MV} ${WRKSRC}/help ${STAGEDIR}${DOCSDIR}
 
 .include <bsd.port.mk>

Added: head/graphics/xfpovray/files/BSDmakefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/xfpovray/files/BSDmakefile	Mon Mar  9 06:21:47 2015	(r380834)
@@ -0,0 +1,18 @@
+PROG=	xfpovray
+NO_MAN=	nope
+BINDIR=	${PREFIX}/bin
+CFLAGS+=-Iflx -I${LOCALBASE}/include -DHELP_DIR='"${DOCSDIR}"'
+LDADD+=	-L${LOCALBASE}/lib -lforms -lX11
+
+.PATH:	src flx/flx_filebox flx/flx_help_dialog flx/flx_return_button	\
+	flx/flx_show_dialog flx/flx_util
+
+WARNS=	3
+
+SRCS=	flx_filebox.c flx_help_dialog.c flx_justify_input.c	\
+	flx_return_button.c flx_scale_form.c flx_show_dialog.c	\
+	flx_show_input.c flx_sort_browser.c	\
+	build_pages.c callbacks.c config.c run_program.c	\
+	show_image.c state.c tips.c util.c xfpovray.c
+
+.include <bsd.prog.mk>

Modified: head/graphics/xfpovray/files/patch-src_show_image.c
==============================================================================
--- head/graphics/xfpovray/files/patch-src_show_image.c	Mon Mar  9 06:07:38 2015	(r380833)
+++ head/graphics/xfpovray/files/patch-src_show_image.c	Mon Mar  9 06:21:47 2015	(r380834)
@@ -1,6 +1,16 @@
---- src/show_image.c.orig	Sun Feb  8 04:09:16 1998
-+++ src/show_image.c	Wed Jun  3 09:38:49 1998
-@@ -13,21 +13,6 @@
+--- src/show_image.c	1998-02-07 22:09:16.000000000 -0500
++++ src/show_image.c	2015-03-09 00:55:58.000000000 -0400
+@@ -2,7 +2,8 @@
+ #include <stddef.h>
+ #include <string.h>
+ 
+-#include "forms.h"
++#include <forms.h>
++#include "flx.h"
+ #include "xfpovray.h"
+ 
+ extern struct pov_options pov;
+@@ -13,21 +14,6 @@
  
  extern OUTPUT_PAGE_S *outputPage;
  
@@ -22,7 +32,7 @@
  /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 
  /* 
  ** Display the image after rendering.  Some OS do not allow 
-@@ -45,7 +30,7 @@
+@@ -45,7 +31,7 @@
      
  
      strcpy(temp, pov.input_file_name);
@@ -31,3 +41,12 @@
  
      
      /* 
+@@ -63,7 +49,7 @@
+     strcat(imgfile, ext);
+     
+     sprintf(currentFilter, "*%s", ext);
+-    file = (char *) flx_filebox (CONFIG_POV_DIR, currentFilter, &imgfile); 
++    file = flx_filebox (CONFIG_POV_DIR, currentFilter, imgfile); 
+ 
+     if (strcmp(file, "") != 0) {
+        sprintf(viewit, "%s %s &", CONFIG_DISPLAY_COMMAND, imgfile);

Modified: head/graphics/xfpovray/files/patch-src_xfprovray.c
==============================================================================
--- head/graphics/xfpovray/files/patch-src_xfprovray.c	Mon Mar  9 06:07:38 2015	(r380833)
+++ head/graphics/xfpovray/files/patch-src_xfprovray.c	Mon Mar  9 06:21:47 2015	(r380834)
@@ -1,6 +1,19 @@
---- src/xfpovray.c.orig	Mon Jul  1 03:06:04 2002
-+++ src/xfpovray.c	Mon Jul  1 03:06:57 2002
-@@ -47,7 +47,7 @@
+--- src/xfpovray.c	1998-02-22 22:35:14.000000000 -0500
++++ src/xfpovray.c	2015-03-09 02:07:44.000000000 -0400
+@@ -33,9 +33,11 @@
+ **-
+ ** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+ 
+-
++#include <errno.h>
+ #include <stdlib.h>
+ #include <stdio.h>
++#include <unistd.h>
++#include <sys/stat.h>
+ 
+ #include "forms.h"
+ #include "xfpovray.h"
+@@ -47,7 +48,7 @@
  #include "xfpovray.xpm"
  
  
@@ -9,3 +22,75 @@
  #error
  #error CANNOT COMPILE WITH THIS VERSION OF XFORMS.
  #error PLEASE UPGRADE TO THE LATEST VERSION.
+@@ -158,7 +159,7 @@
+ int main (int argc, char **argv)
+ {
+  
+-    FL_OBJECT *obj, *ret;
++    FL_OBJECT *ret;
+     int version, revision;
+     static char *home;
+     FILE *fp;
+@@ -259,26 +260,33 @@
+      
+     /* Check for directory $HOME/.xfpovray */
+     if ((fp = fopen(TEMP_FILE, "w")) == NULL) {
+-   
+-       temp = (char *) fl_calloc (1, strlen(MKDIR) + strlen(" ") + 
+-           strlen(home) + strlen("/.xfpovray") + 1); 
+-       sprintf (temp, "%s %s/.xfpovray", MKDIR, home);
+-       system (temp);
+-       free (temp);
+-
+-       temp = (char *) fl_calloc (1, 
+-	   strlen("\nWelcome to xfpovray!\nCreated directory ") + 
+-	   strlen(home) + strlen("/.xfpovray") +
+-	   strlen("\n\nCheck your setup with\nOptions->Configure") + 
+-	   + 1); 
+-       sprintf (temp, 
+-           "\nWelcome to xfpovray!\nCreated directory %s/.xfpovray\n\nCheck your setup with\nOptions->Configure",
+-	    home);
+-       flx_set_dialog_font (FL_BOLD_STYLE, FL_NORMAL_SIZE);
++       int success;
++
++       if (errno != ENOTDIR && errno != ENOENT) {
++           success = 0;
++       } else { 
++           temp = fl_calloc (1, strlen(home) + strlen("/.xfpovray") + 1);
++           sprintf (temp, "%s/.xfpovray", home);
++           success = mkdir(temp, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == 0;
++           free (temp);
++       }
++       if (success)
++           asprintf(&temp, "Welcome to xfpovray!\n"
++               "Created directory %s/.xfpovray\n\n"
++	       "Check your setup with\nOptions->Configure",
++		    home);
++       else
++           asprintf(&temp, "Welcome to xfpovray!\n"
++               "Directory %s/.xfpovray inoperable:\n\n%s\n\n"
++	       "Please, resolve the problem and restart",
++		    home, strerror(errno));
++       flx_set_dialog_font (FL_NORMAL_STYLE, FL_NORMAL_SIZE);
+        flx_show_dialog ("message", temp);
+        free (temp);   
+-       fclose (fp);
+-    }
++    } else {
++       fclose(fp);
++       unlink(TEMP_FILE);
++    }
+ 
+     /* 
+     ** Build the various forms 
+@@ -414,9 +420,7 @@
+ 
+ 	/* Check for external routines */
+ 	home = getenv("HOME");
+-        temp = (char *) fl_calloc (1, 
+-	    strlen(home) + strlen(".xfpovray/external.routines") + 1); 
+-	sprintf(temp, "%s/.xfpovray/external.routines", home);
++	asprintf(&temp, "%s/.xfpovray/external.routines", home);
+ 	if ((ext = fopen(temp, "r")) != NULL) {
+            
+            /* Callback key is the menu item number of the first added

Added: head/graphics/xfpovray/files/patch-warnings
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/xfpovray/files/patch-warnings	Mon Mar  9 06:21:47 2015	(r380834)
@@ -0,0 +1,505 @@
+--- flx/flx_show_dialog/flx_show_dialog.c	1998-01-11 10:51:40.000000000 -0500
++++ flx/flx_show_dialog/flx_show_dialog.c	2015-03-09 00:09:19.000000000 -0400
+@@ -56,6 +56,6 @@
+ ** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+ 
+-
+-#include "forms.h"
++#include <stdlib.h>
++#include <forms.h>
+ #include "flx.h"
+ #include "flx_show_dialog.h" /* Internal to this routine */
+@@ -68,9 +68,4 @@
+ 
+ static void usage();
+-void flx_set_dialog_lcol();
+-void flx_set_dialog_font();
+-void flx_set_dialog_color();
+-void flx_set_dialog_bgcolor();
+-
+  
+  
+--- flx/flx_util/flx_justify_input.c	1998-02-20 20:00:26.000000000 -0500
++++ flx/flx_util/flx_justify_input.c	2015-03-08 23:15:09.000000000 -0400
+@@ -30,13 +30,10 @@
+ 
+ 
+-#include "forms.h"
++#include <forms.h>
++#include "flx.h"
+ 
+ #include <stdlib.h>
+ #include <string.h>
+ 
+-
+-void flx_justify_input(FL_OBJECT *input_obj, char *string, int STYLE, int SIZE);
+-
+-
+ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 
+-void flx_justify_input(FL_OBJECT *input_obj, char *string, int STYLE, int SIZE)
++void flx_justify_input(FL_OBJECT *input_obj, const char *string, int STYLE, int SIZE)
+--- flx/flx_util/flx_scale_form.c	1997-09-02 21:57:24.000000000 -0400
++++ flx/flx_util/flx_scale_form.c	2015-03-08 23:18:56.000000000 -0400
+@@ -22,5 +22,5 @@
+ 
+-
+-#include "forms.h"
++#include <forms.h>
++#include "flx.h"
+ 
+ #include <stdio.h>
+@@ -29,7 +30,4 @@
+ 
+ 
+-void flx_scale_form(FL_FORM *form);
+-
+-
+ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 
+ /* Scales a form based on the current font */
+--- flx/flx_filebox/flx_filebox.c	1998-02-21 12:38:23.000000000 -0500
++++ flx/flx_filebox/flx_filebox.c	2015-03-08 23:29:18.000000000 -0400
+@@ -59,5 +59,5 @@
+ #include <unistd.h>
+ 
+-#include "forms.h"
++#include <forms.h>
+ #include "flx.h" 
+ #include "flx_filebox.h"
+@@ -65,7 +65,4 @@
+ #define USE_COLOR 1
+ 
+-
+-
+- 
+ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+ char *flx_filebox(const char *directory, 
+@@ -272,5 +269,5 @@
+         fl_set_object_posthandler(theForm->file_input, change_focus);
+ 
+-        if ((default_file != "") && (default_file != NULL)) {
++        if (default_file != NULL && default_file[0] != '\0') {
+            fl_set_input(theForm->file_input, default_file);
+            flx_justify_input (theForm->file_input, default_file, 
+@@ -589,21 +586,18 @@
+     struct dirent **dir_s;
+     int i, numEntries;
+-    
+-    struct stat *stat_buf = (struct stat *) vmalloc (sizeof(struct stat));    
++ 
++    struct stat *stat_buf = vmalloc (sizeof(struct stat));    
+     int filetype;
+         
+     char *sfile;
+-    char *file_color     = "@C0"; /* default black */ 
+-    char *link_color     = "@C0"; 
+-    char *dir_color      = "@C0"; 
+-    char *chardev_color  = "@C0"; 
+-    char *blockdev_color = "@C0"; 
+-    char *socket_color   = "@C0"; 
+-    char *fifo_color     = "@C0"; 
++    const char *file_color     = "@C0"; /* default black */ 
++    const char *link_color     = "@C0"; 
++    const char *dir_color      = "@C0"; 
++    const char *chardev_color  = "@C0"; 
++    const char *blockdev_color = "@C0"; 
++    const char *socket_color   = "@C0"; 
++    const char *fifo_color     = "@C0"; 
+ 
+     char *currentFile;
+-    int currentWidth, maxWidth = 0;
+-    int min_browser_width = 175;     
+-
+ 
+     if (USE_COLOR) {
+@@ -656,5 +650,5 @@
+ */
+ 
+-        currentFile = (char *) vmalloc (strlen(theForm->dir) + strlen("/") +
++        currentFile = vmalloc (strlen(theForm->dir) + strlen("/") +
+             strlen(dir_s[i]->d_name) + 1);
+         sprintf(currentFile, "%s/%s", theForm->dir, dir_s[i]->d_name);
+@@ -683,5 +677,5 @@
+         
+         /* Filename used for display in filebox: add color */
+-        sfile = (char *) vmalloc (strlen(dir_s[i]->d_name) + 3 + 1);
++        sfile = vmalloc (strlen(dir_s[i]->d_name) + 3 + 1);
+                 
+         switch (filetype) {
+@@ -761,18 +755,5 @@
+     free(stat_buf);
+ 
+-
+-/*
+-    if (maxWidth > min_browser_width) {
+-       fl_set_object_geometry(theForm->file_browser, 
+-           230, 40, wide_string_p + 20, 165);
+-    }
+-    else {
+-       fl_set_object_geometry(theForm->file_browser, 
+-           230, 40, 190, 165);    
+-    }
+-*/
+-
+     fl_unfreeze_form(theForm->main);
+-    
+ 
+ } /* end function parse_dir() */
+@@ -804,5 +785,5 @@
+ 
+     
+-    chunk = (void *) malloc (chunk_size);
++    chunk = malloc (chunk_size);
+     if (chunk == NULL) {
+        perror("flx_filebox");
+--- flx/flx.h	1997-11-10 22:57:34.000000000 -0500
++++ flx/flx.h	2015-03-08 23:32:37.000000000 -0400
+@@ -61,4 +61,16 @@
+ extern FL_FORM *flx_help_dialog(const char *help_text);
+ 
++int flx_show_dialog (const char *type_str, const char *message_str);
++void flx_set_dialog_bgcolor (int theBgColor);
++void flx_set_dialog_color (int theInactiveColor, int theActiveColor);
++void flx_set_dialog_font (int theLabelStyle, int theLabelSize);
++void flx_set_dialog_lcol (int theLabelColor);
++
++void flx_justify_input(FL_OBJECT *input_obj, const char *string, int STYLE, int SIZE);
++
++void flx_scale_form(FL_FORM *form);
++char *flx_filebox(const char *dir, const char *pattern, const char *default_file);
++
++char *flx_show_input (int type, const char *message_str, const char *initial);
+ 
+ #endif /* FLX_H */
+--- flx/flx_filebox/flx_filebox.h	1997-09-03 22:28:48.000000000 -0400
++++ flx/flx_filebox/flx_filebox.h	2015-03-08 23:37:08.000000000 -0400
+@@ -55,5 +55,4 @@
+ static void FilterCB   (FL_OBJECT *ob, long data);
+ static void LocationCB (FL_OBJECT *ob, long data);
+-static void QuitCB     (FL_OBJECT *ob, long data);
+ 
+ /* 
+--- src/build_pages.c	1998-02-22 22:53:11.000000000 -0500
++++ src/build_pages.c	2015-03-09 00:15:48.000000000 -0400
+@@ -1,3 +1,4 @@
+-#include "forms.h"
++#include <forms.h>
++#include "flx.h"
+ #include "xfpovray.h"
+ #include "pov-defaults.h"
+--- flx/flx_show_dialog/flx_show_input.c	1998-01-31 20:39:42.000000000 -0500
++++ flx/flx_show_dialog/flx_show_input.c	2015-03-09 00:36:57.000000000 -0400
+@@ -48,6 +48,6 @@
+ ** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+ 
+-
+-#include "forms.h"
++#include <forms.h>
++#include "flx.h"
+ #include "question.xpm"
+ 
+@@ -58,10 +58,4 @@
+ extern int FLX_DIALOG_LSTYLE;
+ extern int FLX_DIALOG_LSIZE;
+-
+-void flx_set_dialog_lcol();
+-void flx_set_dialog_font();
+-void flx_set_dialog_color();
+-void flx_set_dialog_bgcolor();
+-
+  
+  
+@@ -73,5 +67,4 @@
+     FL_OBJECT *obj, *obj_input, *ret;
+ 
+-    int button_width  = 70;
+     int button_height = 25;
+     int min_x         = 180;
+@@ -82,6 +75,4 @@
+                     
+     int label_width, label_height;
+-    int button_label_width, button_label_height;
+-    int status = 0;
+     int form_x, form_y, yoffset, ymax_height;
+     char **discriminator;
+--- src/xfpovray.h	1998-02-22 23:29:43.000000000 -0500
++++ src/xfpovray.h	2015-03-09 00:39:07.000000000 -0400
+@@ -140,8 +140,10 @@
+ void YesNoCB		   (FL_OBJECT *obj, long data);
+ 
+-/* 
++/*
+ ** Other utility functions 
+ */
+-void write_config (char *ini_file);
++
++int read_config(const char *ini_file);
++void write_config (const char *ini_file);
+ void show_image   (void);
+ void save_state   (void);
+@@ -320,3 +322,7 @@
+ #endif
+ 
++int tokenize(char *command_string, char *tokenlist[], size_t maxtoken);
++char *strtruncate (char *string, char endat);
++
++void showtip(FL_OBJECT *ob, char *s);
+ #endif /* XFPOVRAY_H */
+--- src/callbacks.c	1998-02-22 22:33:45.000000000 -0500
++++ src/callbacks.c	2015-03-09 00:38:37.000000000 -0400
+@@ -3,6 +3,7 @@
+ */
+ 
+-
+-#include "forms.h"
++#include <time.h>
++#include <forms.h>
++#include "flx.h"
+ #include "xfpovray.h"
+ #include "pov-defaults.h"
+@@ -29,10 +30,6 @@
+ extern char *TEMP_FILE;
+  
+-extern void write_config(char *ini_file);
+ extern int  povray_pid;
+ extern int  auto_view;
+-extern void show_image(void);
+-extern int  PovCheckCB(XEvent *ev, void *data);
+-extern void run_program  (int count, ...);
+  
+ struct preview_options {
+@@ -157,5 +154,5 @@
+                       temp = (char *) fl_calloc (1, 
+ 			  strlen(fl_get_input (xfData->sceneFileInput)) + 1);
+-                      sprintf(temp, fl_get_input (xfData->sceneFileInput));
++                      strcpy(temp, fl_get_input (xfData->sceneFileInput));
+ 
+ 		      path = (char *) fl_calloc (1, strlen(temp) + 1);
+@@ -168,5 +165,5 @@
+ 		      }
+ 		      basename = (char *) fl_calloc (1, strlen(tokenList[i])+1);
+-		      sprintf(basename, tokenList[i]);
++		      strcpy(basename, tokenList[i]);
+                       strtruncate (basename, '.');
+                       strcat(basename, ".ini");		      
+@@ -607,5 +604,4 @@
+ void GetFileCB(FL_OBJECT *ob, long data)
+ {   
+-    int pid, type;
+     char *temp;
+ 
+@@ -805,5 +801,5 @@
+     char temp[256];
+     char buf[256];
+-    int i, pid, key;
++    int key;
+     char *t;
+  
+@@ -1219,5 +1215,4 @@
+ void QuitCB(FL_OBJECT *ob, long data)
+ { 
+-    int pid;
+     char *temp;
+     int menuItem = fl_get_menu(ob);
+--- src/config.c	1998-02-22 23:38:31.000000000 -0500
++++ src/config.c	2015-03-09 00:45:15.000000000 -0400
+@@ -3,5 +3,7 @@
+ */
+ 
+-#include "forms.h"
++#include <stdlib.h>
++#include <forms.h>
++#include "flx.h"
+ #include "xfpovray.h"
+ #include "pov-defaults.h"
+@@ -29,14 +31,12 @@
+ ** Function to write the POV-Ray configuration file 
+ */
+-void write_config(char *ini_file)
++void write_config(const char *ini_file)
+ {
+     FILE *options_file;
+-    int i, do_free = FALSE;
+-   
+-    
++    int i;
++
++
+     if (ini_file == NULL) {
+-       ini_file = (char *) fl_calloc (1, strlen(POV_INIFILE) + 1);
+-       sprintf(ini_file, "%s", POV_INIFILE);
+-       do_free = TRUE;
++       ini_file = POV_INIFILE;
+     }
+               
+@@ -228,9 +228,4 @@
+     fl_load_browser (configPage->configBrowser, ini_file);    
+     fl_unfreeze_form (configPage->form);
+-    
+-    if (do_free)
+-       free (ini_file);
+-
+- 
+ }
+ 
+@@ -240,5 +235,5 @@
+ ** Function to read the POV-Ray configuration file, and update widget values 
+ */
+-int read_config(char *ini_file)
++int read_config(const char *ini_file)
+ {
+ 
+--- src/run_program.c	1998-01-31 17:24:36.000000000 -0500
++++ src/run_program.c	2015-03-08 23:02:20.000000000 -0400
+@@ -11,7 +11,11 @@
+ */
+ 
++#include <err.h>
+ #include <stdarg.h>
++#include <stdlib.h>
+ #include <stdio.h>
+-
++#include <unistd.h>
++#include <forms.h>
++#include "xfpovray.h"
+ 
+ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 
+@@ -24,5 +26,4 @@
+     
+-
+-    arg_list = (char **) malloc ((count + 1) * sizeof(char *));
++    arg_list = malloc ((count + 1) * sizeof(char *));
+     if (arg_list == NULL) {
+        perror ("run_program");
+@@ -49,18 +51,15 @@
+     ** Run the program as a child process 
+     */    
+-    pid = fork();
++    pid = vfork();
+     if (pid == 0) {
+        if (execvp (program, arg_list) == -1) {
+-          fprintf (stderr, "\nrun: could not exec() %s\n", arg_list[0]);
++          err(255, "\nrun: could not exec() %s", arg_list[0]);
+           /* sigchld catcher handles the error */
+-          _exit (255);
+        }   
+     }
+     else if (pid < 0)
+-       fprintf (stderr, "\nrun: could not fork()\n");
++       warn("\nrun: could not vfork()");
+ 
+     free (arg_list);
+-    
+-        
+     return;
+ }
+--- src/state.c	1998-02-23 00:26:07.000000000 -0500
++++ src/state.c	2015-03-09 01:07:31.000000000 -0400
+@@ -4,7 +4,10 @@
+ */
+ 
+-
+-#include "forms.h"
++#include <sys/param.h>
++#include <err.h>
++#include <forms.h>
+ #include <stdlib.h>
++
++#include "flx.h"
+ #include "xfpovray.h"
+ #include "pov-defaults.h"
+@@ -36,23 +39,19 @@
+ {
+     FILE *state_file;
+-    char filename[256];
+-    char temp[256];
++    char filename[MAXPATHLEN];
+     int i;
+    
+        
+     /* Get home directory, and set filepath */
+-    sprintf (filename, "%s/.xfpovray/xfpovray.state", getenv("HOME"));
++    snprintf (filename, sizeof filename, "%s/.xfpovray/xfpovray.state", getenv("HOME"));
+ 
+     if ((state_file = fopen(filename, "w")) == NULL) {
+-       fprintf (stderr, "Unable to open %s for writing! State not saved.\n",
++       warn("Unable to open %s for writing! State not saved.",
+                filename);
+        return;
+     }
+ 
+-
+     /* Write the current state */
+-    sprintf(temp, "; xfpovray %s, generated by state.c\n", xfp_version); 
+-    fprintf (state_file, temp);
+-
++    fprintf(state_file, "; xfpovray %s, generated by state.c\n", xfp_version); 
+ 
+     /* Parsing */
+@@ -63,6 +62,5 @@
+                    fl_get_input (parsingPage->libpathInput[i]));    
+         else
+-           fprintf (state_file, "library_path=NULL\n", 
+-                   fl_get_input (parsingPage->libpathInput[i]));    
++           fprintf (state_file, "library_path=NULL\n");
+     }
+     
+@@ -142,5 +140,5 @@
+ 
+     if (strcmp(fl_get_input (tracingPage->antialiasThreshold), "") == 0)
+-       fprintf (state_file, "antialias_threshold=%d\n", 
++       fprintf (state_file, "antialias_threshold=%f\n", 
+            POV_ANTIALIAS_THRESHOLD);
+     else
+@@ -155,5 +153,5 @@
+   
+     if (strcmp(fl_get_input (tracingPage->jitterInput), "") == 0)
+-       fprintf (state_file, "jitter_amount=%d\n", POV_JITTER_AMOUNT);
++       fprintf (state_file, "jitter_amount=%f\n", POV_JITTER_AMOUNT);
+     else
+        fprintf (state_file, "jitter_amount=%s\n", 
+@@ -240,7 +238,7 @@
+     FILE *state_file;
+     char filename[512];
+-    int i, numLibs = 0;
++    int numLibs = 0;
+     char buf[80];
+-    char *key;
++    const char *key;
+     char *value;
+     const char delimiter[] = "=";     
+--- src/tips.c	1998-01-18 22:47:13.000000000 -0500
++++ src/tips.c	2015-03-09 01:10:51.000000000 -0400
+@@ -1,5 +1,7 @@
+-#include "forms.h"
++#include <forms.h>
+ #include <stdlib.h>
+ 
++#include "xfpovray.h"
++
+ extern int show_tips;
+  
+@@ -9,5 +11,6 @@
+  * use the post handler as a tipper
+  */
+-int post_handler(FL_OBJECT *ob, int event, 
++static int
++post_handler(FL_OBJECT *ob, int event, 
+     FL_Coord mx, FL_Coord my, int key, void *xev)
+ {
+--- src/util.c	1998-02-21 20:57:40.000000000 -0500
++++ src/util.c	2015-03-09 01:15:38.000000000 -0400
+@@ -6,5 +6,6 @@
+ #include <string.h>
+ 
+-
++#include <forms.h>
++#include "xfpovray.h"
+ 
+ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 
+@@ -27,5 +28,5 @@
+ {
+     static char tokensep[] = "/";
+-    int tokencount;
++    size_t tokencount;
+     char *thistoken;
+     

Modified: head/graphics/xfpovray/pkg-plist
==============================================================================
--- head/graphics/xfpovray/pkg-plist	Mon Mar  9 06:07:38 2015	(r380833)
+++ head/graphics/xfpovray/pkg-plist	Mon Mar  9 06:21:47 2015	(r380834)
@@ -1,16 +1,16 @@
 bin/xfpovray
-lib/X11/xfpovray/help/Appendices
-lib/X11/xfpovray/help/Chapter_1
-lib/X11/xfpovray/help/Chapter_2
-lib/X11/xfpovray/help/Chapter_3
-lib/X11/xfpovray/help/Chapter_4
-lib/X11/xfpovray/help/Chapter_5
-lib/X11/xfpovray/help/Chapter_6
-lib/X11/xfpovray/help/Chapter_7
-lib/X11/xfpovray/help/Config_File
-lib/X11/xfpovray/help/Include_Preview
-lib/X11/xfpovray/help/Introduction
-lib/X11/xfpovray/help/Options
-lib/X11/xfpovray/help/Table_Of_Contents
-lib/X11/xfpovray/help/Templates
-lib/X11/xfpovray/help/help_topics
+%%DOCSDIR%%/Appendices
+%%DOCSDIR%%/Chapter_1
+%%DOCSDIR%%/Chapter_2
+%%DOCSDIR%%/Chapter_3
+%%DOCSDIR%%/Chapter_4
+%%DOCSDIR%%/Chapter_5
+%%DOCSDIR%%/Chapter_6
+%%DOCSDIR%%/Chapter_7
+%%DOCSDIR%%/Config_File
+%%DOCSDIR%%/Include_Preview
+%%DOCSDIR%%/Introduction
+%%DOCSDIR%%/Options
+%%DOCSDIR%%/Table_Of_Contents
+%%DOCSDIR%%/Templates
+%%DOCSDIR%%/help_topics



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503090621.t296Ll1W015726>