[packages/urt] - patch to update C dialect, add some missing includes etc.; release 11
qboosh
qboosh at pld-linux.org
Fri Oct 3 19:33:04 CEST 2025
commit 522bb0207169ce8df982ac7bad4c97a5f739835c
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Fri Oct 3 19:36:14 2025 +0200
- patch to update C dialect, add some missing includes etc.; release 11
urt-c.patch | 385 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
urt.spec | 8 +-
2 files changed, 390 insertions(+), 3 deletions(-)
---
diff --git a/urt.spec b/urt.spec
index 56d2b69..dd885a3 100644
--- a/urt.spec
+++ b/urt.spec
@@ -2,7 +2,7 @@ Summary: Utah Raster Toolkit
Summary(pl.UTF-8): Zestaw narzędzi z Utah do grafiki rastrowej
Name: urt
Version: 3.1b
-Release: 10
+Release: 11
License: GPL-like/"reserved" (see documentation for details)
Group: Applications/Graphics
# dead server, now available at https://github.com/sarnold/urt
@@ -12,6 +12,7 @@ Patch0: %{name}-config.patch
Patch1: %{name}-fixes.patch
Patch2: %{name}-DESTDIR.patch
Patch3: %{name}-shared.patch
+Patch4: %{name}-c.patch
URL: https://www2.cs.utah.edu/gdc/projects/urt/
BuildRequires: %{__perl}
BuildRequires: libtiff-devel
@@ -90,6 +91,7 @@ Statyczna biblioteka Utah Raster Toolkit.
%patch -P1 -p1
%patch -P2 -p1
%patch -P3 -p1
+%patch -P4 -p1
%build
%{__mv} config/urt config/urt.old
@@ -288,11 +290,11 @@ rm -rf $RPM_BUILD_ROOT
%defattr(644,root,root,755)
%doc 3.1-changes CHANGES README blurb copyright
%attr(755,root,root) %{_libdir}/librle.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/librle.so.0
+%ghost %{_libdir}/librle.so.0
%files devel
%defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/librle.so
+%{_libdir}/librle.so
%{_libdir}/librle.la
%{_includedir}/rle
%{_mandir}/man3/buildmap.3*
diff --git a/urt-c.patch b/urt-c.patch
new file mode 100644
index 0000000..7da5316
--- /dev/null
+++ b/urt-c.patch
@@ -0,0 +1,385 @@
+--- urt-3.1b/lib/inv_cmap.c.orig 1992-04-30 16:07:29.000000000 +0200
++++ urt-3.1b/lib/inv_cmap.c 2025-10-02 21:39:01.789995215 +0200
+@@ -42,7 +42,7 @@ static long gdist, rdist, cdist;
+ static long cbinc, cginc, crinc;
+ static unsigned long *gdp, *rdp, *cdp;
+ static unsigned char *grgbp, *rrgbp, *crgbp;
+-static gstride, rstride;
++static int gstride, rstride;
+ static long x, xsqr, colormax;
+ static int cindex;
+ #ifdef INSTRUMENT_IT
+--- urt-3.1b/tools/mallocNd.c.orig 1992-04-30 16:10:24.000000000 +0200
++++ urt-3.1b/tools/mallocNd.c 2025-10-02 21:39:59.433659121 +0200
+@@ -67,7 +67,7 @@
+
+ /* Imports */
+ #include <stdio.h>
+-extern char *malloc();
++#include <stdlib.h>
+
+ /* Forward declarations */
+ char *BuildIndirectionTable();
+--- urt-3.1b/tools/mergechan.c.orig 1992-01-23 17:25:19.000000000 +0100
++++ urt-3.1b/tools/mergechan.c 2025-10-02 21:41:49.684291379 +0200
+@@ -78,7 +78,7 @@ char ** argv;
+ else
+ {
+ fprintf( stderr,
+- "%s: Images %d and %d are both from the standard input\n",
++ "mergechan: Images %d and %d are both from the standard input\n",
+ stdin_used, i );
+ exit( -1 );
+ }
+--- urt-3.1b/tools/rlecat.c.orig 1992-04-30 16:11:44.000000000 +0200
++++ urt-3.1b/tools/rlecat.c 2025-10-02 21:42:16.694446275 +0200
+@@ -15,6 +15,7 @@ rlecat() Make a tag.
+ */
+
+ #include <stdio.h>
++#include <unistd.h>
+ #include "rle.h"
+ #include "rle_raw.h"
+
+--- urt-3.1b/tools/avg4.c.orig 1992-04-30 16:08:43.000000000 +0200
++++ urt-3.1b/tools/avg4.c 2025-10-02 21:42:33.947878552 +0200
+@@ -34,7 +34,7 @@ static char rcs_ident[] = "$Header: /l/s
+ #include <stdio.h>
+ #include "rle.h"
+
+-static bit_count[16] = {0, 63, 63, 127, 63, 127, 127,
++static int bit_count[16] = {0, 63, 63, 127, 63, 127, 127,
+ 192, 63, 127, 127, 192, 127, 192, 192, 255};
+
+ void
+--- urt-3.1b/tools/into.c.orig 2025-10-02 21:44:06.491742920 +0200
++++ urt-3.1b/tools/into.c 2025-10-03 06:19:04.939722375 +0200
+@@ -28,6 +28,8 @@
+ #include "rle_config.h"
+ #include <stdio.h>
+ #include <errno.h>
++#include <string.h>
++#include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/param.h> /* for MAXPATHLEN */
+ #include <sys/stat.h>
+@@ -100,7 +102,7 @@ char **argv;
+ if (ferror(outf))
+ {
+ fprintf(stderr, "into: %s, \"%s\" not modified\n",
+- sys_errlist[errno], argv[1]);
++ strerror(errno), argv[1]);
+ unlink(buf);
+ exit(1);
+ }
+--- urt-3.1b/tools/mcut.c.orig 1992-01-23 17:24:41.000000000 +0100
++++ urt-3.1b/tools/mcut.c 2025-10-03 06:20:34.906914965 +0200
+@@ -790,8 +790,8 @@ rle_pixel **scan;
+
+ TRACE( tmp_cb, cb_list )
+ {
+- register color_t *newcol = &tmp_cb->color;
+- register newdist = DISTANCE( ref_col, *newcol );
++ color_t *newcol = &tmp_cb->color;
++ int newdist = DISTANCE( ref_col, *newcol );
+
+ if ( newdist < dist )
+ {
+@@ -963,7 +963,7 @@ int
+ cmp_radices ( h1, h2 )
+ histogram_t **h1, **h2;
+ {
+- register c1 = -1, c2 = -1;
++ int c1 = -1, c2 = -1;
+
+ if ( *h1 )
+ c1 = (*h1)->color & mask;
+--- urt-3.1b/tools/rleaddcom.c.orig 1992-04-30 16:11:00.000000000 +0200
++++ urt-3.1b/tools/rleaddcom.c 2025-10-03 06:21:27.860155319 +0200
+@@ -26,6 +26,7 @@
+ */
+
+ #include <stdio.h>
++#include <unistd.h>
+ #include "rle.h"
+ #include <sys/types.h>
+ #include <sys/param.h> /* for MAXPATHLEN */
+--- urt-3.1b/tools/clock/rleClock.c.orig 1992-04-30 16:19:39.000000000 +0200
++++ urt-3.1b/tools/clock/rleClock.c 2025-10-03 06:23:26.834526207 +0200
+@@ -598,7 +598,7 @@ struct {
+ { TRUE, "-tf", STRING, "Text area format string", (char *)&FormatString },
+ { FALSE, "-Xm", BOOL, "Output the alpha channel on RGB", (char *)&DebugAlpha },
+ { FALSE, "-D", BOOL, "Turn on debugging", (char *)&Debug },
+- NULL
++ { FALSE, NULL, TEXT, NULL, NULL },
+ };
+
+ void
+--- urt-3.1b/lib/rle_open_f.c.orig 1993-05-13 23:28:51.000000000 +0200
++++ urt-3.1b/lib/rle_open_f.c 2025-10-03 06:26:21.566919337 +0200
+@@ -16,6 +16,7 @@
+ #include <signal.h>
+ #include <sys/wait.h>
+ #include <errno.h>
++#include <unistd.h>
+
+ /* Count outstanding children. Assume no more than 100 possible. */
+ #define MAX_CHILDREN 100
+--- urt-3.1b/lib/scanargs.c.orig 1992-02-27 22:18:15.000000000 +0100
++++ urt-3.1b/lib/scanargs.c 2025-10-03 06:27:28.839301095 +0200
+@@ -128,10 +128,10 @@ CONST_DECL char *format;
+ va_list argl;
+ {
+
+- register check; /* check counter to be sure all argvs
++ int check; /* check counter to be sure all argvs
+ are processed */
+- register CONST_DECL char *cp;
+- register cnt;
++ CONST_DECL char *cp;
++ int cnt;
+ int optarg = 0; /* where optional args start */
+ int nopt = 0;
+ char tmpflg, /* temp flag */
+--- urt-3.1b/tools/rlenoise.c.orig 1992-01-23 19:31:37.000000000 +0100
++++ urt-3.1b/tools/rlenoise.c 2025-10-03 17:43:08.880317356 +0200
+@@ -20,6 +20,7 @@
+ */
+
+ #include <stdio.h>
++#include <time.h>
+ #include "rle.h"
+
+ /* Change this according the value on your system. This is a crock. */
+--- urt-3.1b/cnv/giftorle.c.orig 1993-10-18 14:59:37.000000000 +0100
++++ urt-3.1b/cnv/giftorle.c 2025-10-03 17:44:15.520203417 +0200
+@@ -203,7 +203,7 @@ FILE *fd;
+ EasyFail("EOF in extention\n",TRUE);
+ if (c == 0)
+ return FALSE;
+- if (read(fd,buf,(int) c)!=(int) c)
++ if (fread(buf,c,1,fd)!=1)
+ EasyFail("EOF in extention\n",TRUE);
+ }
+ }
+--- urt-3.1b/cnv/rletops.c.orig 1992-01-20 19:04:10.000000000 +0100
++++ urt-3.1b/cnv/rletops.c 2025-10-03 17:44:49.070392747 +0200
+@@ -231,7 +231,7 @@ puthexpix(outfile,p)
+ FILE *outfile;
+ unsigned char p;
+ {
+- static npixo = 0;
++ static int npixo = 0;
+ static char tohex[] = "0123456789ABCDEF";
+
+ putc(tohex[(p>>4)&0xF],outfile);
+--- urt-3.1b/get/getx11/timer.c.orig 1992-03-04 20:31:40.000000000 +0100
++++ urt-3.1b/get/getx11/timer.c 2025-10-03 17:53:55.180705238 +0200
+@@ -22,6 +22,9 @@
+ static char rcsid[] = "$Header: /l/spencer/src/urt/get/getx11/RCS/timer.c,v 3.0.1.3 1992/03/04 19:31:40 spencer Exp $";
+ #endif
+
++#define _XOPEN_SOURCE 500
++#define _DEFAULT_SOURCE
++#include <sys/time.h>
+ #include "rle_config.h"
+ #include <stdio.h>
+ #include <signal.h>
+@@ -72,7 +75,7 @@ wait_timer()
+ {
+ #ifndef NO_ITIMER
+ while (!ringring)
+- sigpause( ~sigmask(SIGALRM));
++ sigpause(SIGALRM);
+ signal(SIGALRM, ofunc);
+ #endif
+ }
+--- urt-3.1b/get/getx11/getx11.c.orig 1995-01-10 22:16:18.000000000 +0100
++++ urt-3.1b/get/getx11/getx11.c 2025-10-03 17:55:15.152550145 +0200
+@@ -39,6 +39,7 @@
+ * Copyright (c) 1989, University of Michigan
+ */
+
++#include <unistd.h>
+ #include "getx11.h"
+
+ /* Make Sys V macros map to BSD macros */
+@@ -72,7 +73,7 @@ Pixel pixel_base;
+
+ char *progname = NULL;
+ Display *dpy = NULL;
+-Window root_window = NULL;
++Window root_window = 0;
+ int screen = 0;
+
+ Boolean debug_flag = False; /* set if debug mode -D */
+@@ -106,12 +107,12 @@ image_information *img_info = NULL;
+ void init_img_info( i )
+ image_information *i;
+ {
+- i->window = i->icn_window = NULL;
+- i->pixmap = i->icn_pixmap = NULL;
+- i->pix_info_window = NULL;
++ i->window = i->icn_window = 0;
++ i->pixmap = i->icn_pixmap = 0;
++ i->pix_info_window = 0;
+ i->gc = i->icn_gc = NULL;
+ i->image = i->icn_image = NULL;
+- i->colormap = NULL;
++ i->colormap = 0;
+ i->visual_class = -1;
+ i->pixmap_failed = False;
+
+--- urt-3.1b/get/getx11/x11_stuff.c.orig 1994-05-14 03:05:44.000000000 +0200
++++ urt-3.1b/get/getx11/x11_stuff.c 2025-10-03 17:58:01.823895287 +0200
+@@ -39,6 +39,7 @@
+ * Copyright (c) 1989, University of Michigan
+ */
+ #include "getx11.h"
++#include <X11/Xlibint.h>
+ #ifdef X_SHARED_MEMORY
+ #include <sys/errno.h>
+ #endif
+@@ -46,13 +47,15 @@
+ #include "circle.bitmap"
+ #include "circle_mask.bitmap"
+
++Status XAllocColors(Display *dpy, Colormap cmap, XColor *defs, int ndefs, Status *statuses);
++
+ static Boolean init_separate_color_rw(), init_color_rw(),
+ init_separate_color_ro(), init_color_ro(), init_mono_rw(), init_mono_ro();
+ static CONST_DECL char *visual_class_to_string();
+
+-static Cursor circle_cursor = NULL;
+-static Cursor left_ptr_cursor = NULL;
+-static Cursor watch_cursor = NULL;
++static Cursor circle_cursor = 0;
++static Cursor left_ptr_cursor = 0;
++static Cursor watch_cursor = 0;
+
+ static int specified_screen = -1; /* No specific screen. */
+
+@@ -82,16 +85,16 @@ Window window;
+ void get_cursors( window )
+ Window window;
+ {
+- if (circle_cursor == NULL)
++ if (circle_cursor == 0)
+ circle_cursor = XCreateFontCursor (dpy, XC_circle);
+
+- if (watch_cursor == NULL)
++ if (watch_cursor == 0)
+ watch_cursor = XCreateFontCursor (dpy, XC_watch);
+
+- if (left_ptr_cursor == NULL)
++ if (left_ptr_cursor == 0)
+ left_ptr_cursor = XCreateFontCursor (dpy, XC_left_ptr);
+
+- if (circle_cursor == NULL) {
++ if (circle_cursor == 0) {
+ Pixmap source;
+ Pixmap mask;
+ XColor color_1;
+@@ -122,10 +125,10 @@ Window window;
+ XFreePixmap (dpy, mask);
+ }
+
+- if (watch_cursor == NULL)
++ if (watch_cursor == 0)
+ watch_cursor = circle_cursor;
+
+- if (left_ptr_cursor == NULL)
++ if (left_ptr_cursor == 0)
+ left_ptr_cursor = circle_cursor;
+ }
+
+@@ -266,12 +269,12 @@ static int handle_x_errors( dpy, event)
+ if ( img ) {
+ if ( xid == img->pixmap ){
+ DPRINTF(stderr, "img->pixmap allocation failed\n");
+- img->pixmap = NULL;
++ img->pixmap = 0;
+ img->pixmap_failed = True;
+ } else
+ if ( xid == img->icn_pixmap ){
+ DPRINTF(stderr, "img->icn_pixmap allocation failed\n");
+- img->icn_pixmap = NULL;
++ img->icn_pixmap = 0;
+ img->pixmap_failed = True;
+ } else
+ _XDefaultError (dpy, event);
+@@ -331,10 +334,10 @@ Boolean reallocate;
+ int iw = img->w * img->mag_fact;
+ int ih = img->h * img->mag_fact;
+
+- if (( img->pixmap != NULL && reallocate ) ||
+- ( img->pixmap != NULL && (img->pix_w < iw || img->pix_h < ih ))){
+- free_X_pixmap( dpy, img->pixmap );
+- img->pixmap = NULL;
++ if (( img->pixmap != 0 && reallocate ) ||
++ ( img->pixmap != 0 && (img->pix_w < iw || img->pix_h < ih ))){
++ free_X_pixmap( img, img->pixmap );
++ img->pixmap = 0;
+ }
+
+ /* reallocate it: use the Min of the winsize and (pic * mag) */
+@@ -522,7 +525,7 @@ image_information *img;
+ {
+ img->colormap = XCreateColormap (dpy, root_window,
+ img->dpy_visual, AllocNone );
+- if (img->colormap == NULL)
++ if (img->colormap == 0)
+ fprintf(stderr, "getx11: Could not create color map for visual\n");
+ else {
+ VPRINTF(stderr, "created colormap for visual type %s\n",
+@@ -609,8 +612,8 @@ register image_information *img;
+ * Now, make the window.
+ */
+
+- new_window = (img->window == NULL && img->icn_window == NULL);
+- new_pixmaps = ((img->pixmap == NULL || img->icn_pixmap == NULL) &&
++ new_window = (img->window == 0 && img->icn_window == 0);
++ new_pixmaps = ((img->pixmap == 0 || img->icn_pixmap == 0) &&
+ !img->pixmap_failed && !stingy_flag);
+
+ if ( !img->window )
+@@ -1280,7 +1283,7 @@ int npixels;
+ nunique = (p - pixels) + 1;
+
+ DPRINTF(stderr, "In free_unique_pixels \n\nPixels: ");
+- for (i=0;i<nunique;i++) DPRINTF(stderr, " %d ",pixels[i]);
++ for (i=0;i<nunique;i++) DPRINTF(stderr, " %ld ",pixels[i]);
+ DPRINTF(stderr, "\n");
+ }
+ else
+@@ -1982,7 +1985,7 @@ int use_top;
+ font_height = pixel_font_info->ascent + pixel_font_info->descent + 4;
+ y = (use_top ? 0 : (h - font_height));
+
+- if ( img->pix_info_window == NULL ) {
++ if ( img->pix_info_window == 0 ) {
+ XSetFont (dpy, img->gc, pixel_font_info->fid );
+ img->pix_info_window = XCreateSimpleWindow(
+ dpy, img->window, 0, y, w, font_height, 0, None,
+--- urt-3.1b/cnv/rletorla.c.orig 1994-08-04 16:01:09.000000000 +0200
++++ urt-3.1b/cnv/rletorla.c 2025-10-03 18:59:48.103491142 +0200
+@@ -29,6 +29,7 @@
+ * System includes.
+ */
+ #include <stdio.h>
++#include <unistd.h>
+ #include "rlb_header.h"
+ #include "rle.h"
+
+--- urt-3.1b/cnv/rletoabA62/rletoabA62.c.orig 1992-04-30 16:15:19.000000000 +0200
++++ urt-3.1b/cnv/rletoabA62/rletoabA62.c 2025-10-03 19:01:22.304032028 +0200
+@@ -42,6 +42,9 @@ rletoabA62() Tag the file.
+ */
+
+ #include <stdio.h>
++#include <stdlib.h>
++#include <fcntl.h>
++#include <unistd.h>
+
+ #ifndef TRUE
+ #define TRUE 1
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/urt.git/commitdiff/522bb0207169ce8df982ac7bad4c97a5f739835c
More information about the pld-cvs-commit
mailing list