aboutsummaryrefslogtreecommitdiff
path: root/graphics/ralcgm
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2017-12-20 23:40:31 +0000
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2017-12-21 08:19:32 +0700
commitf01ffa798d72b60465726910f881baae696a7d5e (patch)
tree30280a588c38b19c91c2d16d0cbb2cd8a11d99fc /graphics/ralcgm
parent3f90f9b40d84ec24d9705f623b7a36fcf017cf8e (diff)
graphics/ralcgm: Added (view/convert CGM vector image files).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'graphics/ralcgm')
-rw-r--r--graphics/ralcgm/README14
-rw-r--r--graphics/ralcgm/fix_warnings.diff86
-rw-r--r--graphics/ralcgm/no_interactive_config.diff413
-rw-r--r--graphics/ralcgm/ralcgm-linux.patch240
-rw-r--r--graphics/ralcgm/ralcgm.SlackBuild101
-rw-r--r--graphics/ralcgm/ralcgm.info10
-rw-r--r--graphics/ralcgm/slack-desc19
7 files changed, 883 insertions, 0 deletions
diff --git a/graphics/ralcgm/README b/graphics/ralcgm/README
new file mode 100644
index 000000000000..2bd6ce50249c
--- /dev/null
+++ b/graphics/ralcgm/README
@@ -0,0 +1,14 @@
+ralcgm (view/convert CGM vector image files)
+
+RAL-CGM is a program to translate or interpret CGM (Computer Graphics
+Metafile) files, either to a different encoding (Binary, Character or
+Clear Text) or to view on a terminal or to send to a plotter (PostScript
+or HPGL).
+
+It can be used as an ImageMagick or GraphicsMagick delegate to convert
+from CGM format.
+
+If you want to compile the example code:
+
+gcc -o testcgm -I/usr/include/ralcgm \
+ /usr/doc/ralcgm-3.50/examples/testcgm.c -lcgm -lm -lX11
diff --git a/graphics/ralcgm/fix_warnings.diff b/graphics/ralcgm/fix_warnings.diff
new file mode 100644
index 000000000000..94d0b1f750e8
--- /dev/null
+++ b/graphics/ralcgm/fix_warnings.diff
@@ -0,0 +1,86 @@
+diff -Naur a/include/cgmtek.h b/include/cgmtek.h
+--- a/include/cgmtek.h 1993-08-10 04:10:54.000000000 -0400
++++ b/include/cgmtek.h 2017-12-20 00:25:38.734568061 -0500
+@@ -187,7 +187,7 @@
+ };
+
+ /* Tektronix colour table variables*/
+-static n_coltab = DEF_N_COLTAB;
++static int n_coltab = DEF_N_COLTAB;
+ static RGBcolour TEKcoltab[MAX_N_COLTAB]; /* The TEK colour table */
+ static Enum TEKcoluse[MAX_N_COLTAB]; /* The TEK colour flags */
+ static Int colset_n; /* Number of colour table entries set */
+diff -Naur a/src/cgmlib.c b/src/cgmlib.c
+--- a/src/cgmlib.c 1993-08-10 04:10:34.000000000 -0400
++++ b/src/cgmlib.c 2017-12-20 00:33:41.535568880 -0500
+@@ -38,6 +38,12 @@
+ #define CGMLIB_C
+ #include "cgmlib.h"
+
++extern void CGMOhpgl(FILE *, Code, Long*, Float*, char* );
++
++#ifdef TEK4200
++ extern void CGMOtek( FILE*, Code, long *, float *, char * );
++#endif
++
+ /* Driver Routines */
+
+ #ifdef PROTO
+diff -Naur a/src/cgmmain.c b/src/cgmmain.c
+--- a/src/cgmmain.c 1995-06-13 11:32:22.000000000 -0400
++++ b/src/cgmmain.c 2017-12-20 00:23:32.606567847 -0500
+@@ -280,6 +280,7 @@
+ #define OUTMESS (void) fprintf( (FILE *) cgmerr,
+
+ /******************************************************** main *********/
++int
+ #ifdef PROTO
+ main ( int argc, char **argv)
+ #else
+diff -Naur a/src/cgmoxw.c b/src/cgmoxw.c
+--- a/src/cgmoxw.c 1994-04-15 09:30:07.000000000 -0400
++++ b/src/cgmoxw.c 2017-12-20 00:24:37.448567957 -0500
+@@ -111,6 +111,8 @@
+
+ */
+
++#include <unistd.h>
++
+ #define CGMOXW_C
+ #include "cgmout.h"
+
+diff -Naur a/src/cgmtrap.c b/src/cgmtrap.c
+--- a/src/cgmtrap.c 1995-06-13 11:33:02.000000000 -0400
++++ b/src/cgmtrap.c 2017-12-20 00:27:03.439568205 -0500
+@@ -45,6 +45,7 @@
+ #include "cgmelem.h"
+ #include "cgmpar.h"
+ #include "cgmpts.h"
++#include "cgmgraph.h"
+
+ /* Fixed Limit to the number trapezoids (protect CPU from bug) */
+ #define MAXTRAPS 100000
+diff -Naur a/src/genbez.c b/src/genbez.c
+--- a/src/genbez.c 1995-06-16 03:26:44.000000000 -0400
++++ b/src/genbez.c 2017-12-20 00:22:46.548567769 -0500
+@@ -37,7 +37,7 @@
+ BezDir Dir;
+ BezFont Bfont;
+
+-main()
++int main(int argc, char **argv)
+ {
+ FILE *generator, *directory;
+ char *dirname, *genname;
+diff -Naur a/src/genher.c b/src/genher.c
+--- a/src/genher.c 1995-06-16 03:26:48.000000000 -0400
++++ b/src/genher.c 2017-12-20 00:22:56.659567786 -0500
+@@ -51,7 +51,7 @@
+ static char *func = "genher";
+ Logical cgmerrcount=FALSE, cgmquiet=FALSE;
+
+-main()
++int main(int argc, char **argv)
+
+ {
+ int last, code, i;
diff --git a/graphics/ralcgm/no_interactive_config.diff b/graphics/ralcgm/no_interactive_config.diff
new file mode 100644
index 000000000000..587a1f1d7876
--- /dev/null
+++ b/graphics/ralcgm/no_interactive_config.diff
@@ -0,0 +1,413 @@
+diff -Naur a/data/m_ps.fnt b/data/m_ps.fnt
+--- a/data/m_ps.fnt 1969-12-31 19:00:00.000000000 -0500
++++ b/data/m_ps.fnt 2017-12-19 22:33:27.691556645 -0500
+@@ -0,0 +1,35 @@
++ 1 0013 1947 1 5 5 1 4.5.1 0 0 0 1 Times-Roman
++ 2 0013 1947 1 7 5 1 4.5.1 0 0 0 1 Times-Bold
++ 3 0013 1947 2 5 5 1 4.5.1 0 0 0 1 Times-Italic
++ 4 0013 1947 2 7 5 1 4.5.1 0 0 0 1 Times-BoldItalic
++ 5 0013 1921 1 5 5 1 5.1.2 0 0 0 1 Helvetica
++ 6 0013 1921 1 7 5 1 5.1.2 0 0 0 1 Helvetica-Bold
++ 7 0013 1921 2 5 5 1 5.1.2 0 0 0 1 Helvetica-Oblique
++ 8 0013 1921 2 7 5 1 5.1.2 0 0 0 1 Helvetica-BoldOblique
++ 9 0013 1970 1 5 5 1 4.6.5 0 0 0 1 Courier
++ 10 0013 1970 1 7 5 1 4.6.5 0 0 0 1 Courier-Bold
++ 11 0013 1970 2 5 5 1 4.6.5 0 0 0 1 Courier-Oblique
++ 12 0013 1970 2 7 5 1 4.6.5 0 0 0 1 Courier-BoldOblique
++ 13 0013 1650 1 5 5 1 8.2.0 0 0 0 91 Symbol
++ 14 0013 1087 1 5 5 1 4.4.2 0 0 0 1 AvantGarde-Book
++ 15 0013 1087 2 5 5 1 4.4.2 0 0 0 1 AvantGarde-BookOblique
++ 16 0013 1087 1 6 5 1 4.4.2 0 0 0 1 AvantGarde-Demi
++ 17 0013 1087 2 6 5 1 4.4.2 0 0 0 1 AvantGarde-DemiOblique
++ 18 0013 1097 1 6 5 1 4.5.2 0 0 0 1 Bookman-Demi
++ 19 0013 1097 2 6 5 1 4.5.2 0 0 0 1 Bookman-DemiItalic
++ 20 0013 1097 1 4 5 1 4.5.2 0 0 0 1 Bookman-Light
++ 21 0013 1097 2 4 5 1 4.5.2 0 0 0 1 Bookman-LightItalic
++ 22 0013 1921 1 5 3 1 5.1.2 0 0 0 1 Helvetica-Narrow
++ 23 0013 1921 2 7 3 1 5.1.2 0 0 0 1 Helvetica-Narrow-Bold
++ 24 0013 1921 1 7 3 1 5.1.2 0 0 0 1 Helvetica-Narrow-BoldOblique
++ 25 0013 1921 2 5 3 1 5.1.2 0 0 0 1 Helvetica-Narrow-Oblique
++ 26 0013 1106 1 5 5 1 4.1.3 0 0 0 1 NewCenturySchlbk-Roman
++ 27 0013 1106 2 5 5 1 4.1.3 0 0 0 1 NewCenturySchlbk-Italic
++ 28 0013 1106 1 7 5 1 4.1.3 0 0 0 1 NewCenturySchlbk-Bold
++ 29 0013 1106 2 7 5 1 4.1.3 0 0 0 1 NewCenturySchlbk-BoldItalic
++ 30 0013 1276 1 5 5 1 4.4.2 0 0 0 1 Palatino-Roman
++ 31 0013 1276 2 5 5 1 4.4.2 0 0 0 1 Palatino-Italic
++ 32 0013 1276 1 7 5 1 4.4.2 0 0 0 1 Palatino-Bold
++ 33 0013 1276 2 7 5 1 4.4.2 0 0 0 1 Palatino-BoldItalic
++ 34 0013 1810 1 5 5 1 8.0.0 0 0 0 92 ZapfDingbats
++ 35 0013 1193 2 5 5 1 6.1.1 0 0 0 1 ZapfChancery-MediumItalic
+diff -Naur a/include/mach.h b/include/mach.h
+--- a/include/mach.h 1969-12-31 19:00:00.000000000 -0500
++++ b/include/mach.h 2017-12-19 22:34:41.145556770 -0500
+@@ -0,0 +1,33 @@
++/* RAL-CGM Interpreter header file
++ *
++ * Linux specific setting for CGM interpreter
++ */
++
++/* Define Machine */
++
++#define LINUX
++
++/* Define Graphics system(s) */
++
++#define POSTSCRIPT
++#define BEZIER
++#define HERSHEY
++#define XW
++
++#define DATADIR "../data/"
++
++#define NAMELGTH 32
++#define EXTLGTH 8
++
++#define Posint64 unsigned long long
++#define MALLOCH
++#include <stdlib.h>
++
++#ifdef CGMOXW_C /* X-Window specific settings */
++
++#include <X11/cursorfont.h>
++#include <X11/Xlib.h>
++#include <X11/Xutil.h>
++#include <X11/Xatom.h>
++
++#endif
+diff -Naur a/src/Makefile b/src/Makefile
+--- a/src/Makefile 1969-12-31 19:00:00.000000000 -0500
++++ b/src/Makefile 2017-12-19 22:35:58.377556901 -0500
+@@ -0,0 +1,333 @@
++# RAL-CGM Interpreter source Makefile: @(#) Makebase version 3.4
++#
++# Name of executable module (usually ../bin/ralcgm)
++#
++MODULE = ../bin/ralcgm
++#
++# Name of callable library (Optional) (usually ../bin/libcgm.a)
++#
++LIB = ../bin/libcgm.a
++#
++# Include file directory (usually ../include)
++#
++INCLUDE = ../include
++#
++# Data files directory (usually ../data)
++#
++DATADIR = ../data
++#
++# Main Interpreter object file (usually cgmmain.o)
++#
++MAIN = cgmmain.o
++#
++#
++#
++MAKEFILE = Makefile
++#
++# CGM input encoding - Object files
++# Include here files for each encoding that
++# may need to be processed; usually
++# cgmichar.o cgmitext.o cgmibin.o
++#
++INPUT = cgmichar.o cgmitext.o cgmibin.o
++#
++# CGM output encoding - Object files
++# Include here files for each encoding that
++# may be generated; usually
++# cgmochar.o cgmotext.o cgmobin.o
++#
++OUTPUT = cgmochar.o cgmotext.o cgmobin.o
++#
++# User callable Library (comment out if not required)
++#
++CGMLIB = cgmlib.o
++#
++# Optional Drivers
++#
++# IGL - Iris Graphics Library
++# PS - PostScript
++# XW - X-Windows
++# VID - Topaz Library
++#
++IGL = cgmoigl.o
++PS = cgmops.o
++XW = cgmoxw.o
++VID = cgmotpz.o
++TEK = cgmotek.o
++HPGL = cgmohpgl.o
++#
++# List of driver files to be used in generating the $(MODULE).
++#
++# The possible candidates are:
++#
++# $(OUTPUT) list of CGM output encodings defined above
++# $(IGL) Iris graphics library
++# $(XW) X-Windows
++# $(PS) PostScript
++# $(HPGL) HPGL
++# $(TEK) Tektronix 4200
++# $(VID) Video system
++#
++DRIVERS = $(PS) $(XW) $(HPGL) $(TEK)
++#
++# Input utilities Object files
++# These provides random access input and convenient
++# handling of input attributes
++#
++ERRUTILS = cgmerr.o
++ERRINCLUDES = $(INCLUDE)/cgmerr.h
++
++FILEUTILS = cgmfile.o
++FILEINCLUDES = $(INCLUDE)/cgmfile.h
++
++GENUTILS = $(FILEUTILS) $(ERRUTILS)
++GENINCS = $(FILEINCLUDES) \
++ $(ERRINCLUDES)
++
++RANUTILS = cgmrand.o cgmprof.o
++INPUTILS = cgminput.o
++#
++# Output utility Object files (only needed with output drivers)
++# These provide emulation of GDPs, filled areas
++# and other graphical operations. Not needed by all drivers
++# currently cgmgdp.o is used by XW, IGL & VID
++# cgmfill.o & cgmgraph.o are used by IGL only
++#
++ATTUTILS = cgmatt.o
++GDPUTILS = cgmgdp.o
++FILUTILS = cgmpoly.o cgmtrap.o cgmfill.o cgmgraph.o
++COLRUTILS = cgmcolr.o
++CELLUTILS = cgmcell.o
++PTSUTILS = cgmpts.o
++#
++OUTUTILS = $(ATTUTILS) $(GDPUTILS) $(FILUTILS) $(COLRUTILS) $(CELLUTILS) $(PTSUTILS)
++#
++# Text utility Object files
++# These provide software emulation of text and
++# generally useful text facilities.
++#
++# cgmtext.o - general text utility - PS & XW
++# cgmfont.o - general font utility - PS & XW
++# cgmbez.o - Bezier text - if wanted
++# cgmher.o - Hershey text - if wanted
++#
++FNTUTILS = cgmfont.o
++FNTINCLUDES = $(INCLUDE)/cgmfont.h
++TEXTUTILS = cgmtext.o
++TEXTINCLUDES = $(INCLUDE)/cgmtext.h
++#
++BEZIER = genbez
++BEZUTILS = cgmbez.o
++BEZLINK = $(BEZIER).o
++BEZDATA = $(DATADIR)/*.bfs
++BEZINCLUDES = $(INCLUDE)/cgmbez.h
++#
++HERSHEY = genher
++HERUTILS = cgmher.o
++HERLINK = $(HERSHEY).o
++HERDATA = $(DATADIR)/*.hfs
++HERINCLUDES = $(INCLUDE)/cgmher.h
++#
++# TXTSYS settings, supported text systems are:
++#
++# $(HERSHEY)
++# $(BEZIER)
++#
++TXTSYS = $(BEZIER) $(HERSHEY)
++#
++# TXTUTILS settings, supported text utilities are:
++#
++# $(HERUTILS)
++# $(BEZUTILS)
++# List of utility modules required;
++#
++TXTUTILS = $(BEZUTILS) $(HERUTILS)
++#
++#
++CGMUTILS = $(RANUTILS)\
++ $(INPUTILS)\
++ $(GENUTILS)\
++ $(OUTUTILS)\
++ $(TXTUTILS)\
++ $(TEXTUTILS)\
++ $(FNTUTILS)
++#
++# Set up names for the modules that make up `ralcgm' and `cgmlib'.
++#
++RALCGM = $(INPUT)\
++ $(OUTPUT)\
++ $(DRIVERS)\
++ $(CGMUTILS)
++
++LIBCGM = $(CGMLIB)\
++ $(OUTPUT)\
++ $(DRIVERS)\
++ $(INPUTILS)\
++ $(GENUTILS)\
++ $(OUTUTILS)\
++ $(TXTUTILS)\
++ $(TEXTUTILS)\
++ $(FNTUTILS)
++#
++# Local flags for Compiler (system dependent)
++#
++# Examples: (Iris 3130) -Zf -g -p
++# (Iris 4D) -O
++# (GNU C on Topaz) -O -m68881 -g
++# (Sun 3) -O -fswitch
++# (Sun 4) -O
++# (Unicos) -O -g
++#
++CFLAGS = -c -DPOSTSCRIPT="" -DXW="" -DHPGL="" -DTEK4200="" -DBEZIER="" -DHERSHEY=""
++#
++# Local flags for Linker (system dependent)
++# For X-windows, add some extra libraries (comment out otherwise)
++#
++# Examples: (Iris 3130) -Zg -lm
++# (Iris 4D) -lm -lgl_s -lX11_s -lc_s
++# (Topaz) -lE -lmalloc -lm
++# (Sun 3 or 4) -lm -lX11 -lc
++# (Unicos) -lm -lX11 -lnet -lc
++# (Unicos - scc) -lm -lX11 -lnet -lsc
++#
++LFLAGS = -lm -lX11
++#
++# Common include files
++#
++GENINCLUDES = $(INCLUDE)/cgmmach.h $(INCLUDE)/mach.h \
++ $(INCLUDE)/cgmtypes.h \
++ $(INCLUDE)/cgmstruc.h \
++ $(INCLUDE)/cgmelem.h \
++ $(INCLUDE)/cgmpar.h \
++ $(INCLUDE)/cgmtran.h \
++ $(INCLUDE)/cgmatt.h
++#
++# List of includes for the text system; must match the text utility
++# .o files given above.
++#
++INCLUDES = $(GENINCLUDES) $(TXTINCLUDES) $(FNTINCLUDES) \
++ $(BEZINCLUDES) $(HERINCLUDES) $(GENINCS)
++#
++# Define various commands in just one place.
++#
++# for Unicos LINK = segldr
++# AR = bld rv
++# all others LINK = cc $(LFLAGS)
++# AR = ar rv
++#
++COMPILE = cc
++LINK = cc
++AR = ar crs
++#
++# Main dependencies (should not need altering)
++
++ralcgm: $(MODULE) $(TXTSYS)
++ @echo "$(MODULE) is now made"
++
++cgmlib: $(LIB) $(TXTSYS)
++ @echo "$(LIB) is now made"
++
++iutils: $(INPUTILS) $(GENUTILS)
++
++outils: $(OUTUTILS)
++
++tutils: $(TXTUTILS)
++
++clean:
++ rm -f *.o core a.out $(TXTSYS)
++
++$(MODULE): $(MAIN) $(RALCGM)
++ $(LINK) $(MAIN) $(RALCGM) $(LFLAGS) -o $(MODULE)
++ chmod 755 $(MODULE)
++
++$(LIB): $(LIBCGM)
++ $(AR) $(LIB) $(LIBCGM)
++ chmod 644 $(LIB)
++
++# include file dependencies
++
++$(MAIN): $(INCLUDE)/cgminit.h $(GENINCLUDES) $(MAKEFILE)
++
++$(CGMLIB): $(INCLUDE)/cgmlib.h $(INCLUDE)/cgminit.h $(INCLUDE)/cgmin.h \
++ $(GENINCLUDES) $(MAKEFILE)
++
++$(INPUT) $(INPUTILS) $(RANUTILS): $(INCLUDE)/cgmin.h $(GENINCLUDES) $(MAKEFILE)
++
++$(GENUTILS): $(GENINCLUDES)
++
++$(OUTPUT) $(OUTUTILS): $(GENINCLUDES) $(MAKEFILE)
++
++$(DRIVERS): $(INCLUDE)/cgmout.h \
++ $(INCLUDES) \
++ $(MAKEFILE)
++
++$(FNTUTILS): $(FNTINCLUDES) \
++ $(INCLUDE)/cgmufont.h \
++ $(TXTINCLUDES) \
++ $(MAKEFILE)
++
++$(TEXTUTILS): $(TEXTINCLUDES) \
++ $(FNTINCLUDES) \
++ $(MAKEFILE)
++
++$(ERRUTILS): $(ERRINCLUDES) \
++ $(GENINCLUDES) \
++ $(MAKEFILE)
++
++$(BEZUTILS): $(BEZINCLUDES) \
++ $(INCLUDE)/cgmubez.h \
++ $(GENINCLUDES) \
++ $(MAKEFILE)
++
++$(BEZIER): $(BEZLINK) \
++ $(GENINCS) \
++ $(INCLUDE)/cgmubez.h \
++ $(BEZDATA) \
++ $(MAKEFILE)
++ $(LINK) $(BEZLINK) $(GENUTILS) $(LFLAGS) -o $(BEZIER)
++ ./$(BEZIER)
++ chmod 644 $(DATADIR)/*.bfb $(DATADIR)/fontdir.bez
++
++$(HERUTILS): $(HERINCLUDES) \
++ $(INCLUDE)/cgmuher.h \
++ $(GENINCLUDES) \
++ $(MAKEFILE)
++
++$(HERSHEY): $(HERLINK) \
++ $(GENINCS) \
++ $(INCLUDE)/cgmuher.h \
++ $(HERDATA) \
++ $(MAKEFILE)
++ $(LINK) $(HERLINK) $(GENUTILS) $(LFLAGS) -o $(HERSHEY)
++ ./$(HERSHEY)
++ chmod 644 $(DATADIR)/*.hfb $(DATADIR)/fontdir.her
++
++$(IGL): $(INCLUDE)/cgmigl.h \
++ $(INCLUDE)/cgmgdp.h \
++ $(INCLUDE)/cgmfill.h \
++ $(INCLUDE)/cgmgraph.h \
++ $(INCLUDE)/cgmpoly.h \
++ $(INCLUDE)/cgmtrap.h
++
++$(PS): $(INCLUDE)/cgmps.h \
++ $(INCLUDE)/cgmgdp.h \
++ $(INCLUDE)/cgmpoly.h \
++ $(INCLUDE)/cgmtrap.h
++
++$(XW): $(INCLUDE)/cgmxw.h \
++ $(INCLUDE)/cgmgdp.h
++
++$(HPGL): $(INCLUDE)/cgmhpgl.h \
++ $(INCLUDE)/cgmgdp.h \
++ $(INCLUDE)/cgmcolr.h
++
++$(TEK): $(INCLUDE)/cgmtek.h \
++ $(INCLUDE)/cgmgdp.h \
++ $(INCLUDE)/cgmcolr.h \
++ $(INCLUDE)/cgmcell.h \
++ $(INCLUDE)/cgmpts.h
++
++.c.o:
++ $(COMPILE) $(CFLAGS) -I$(INCLUDE) $<
++
++.SUFFIXES: .c .o
diff --git a/graphics/ralcgm/ralcgm-linux.patch b/graphics/ralcgm/ralcgm-linux.patch
new file mode 100644
index 000000000000..4121c62a0bbb
--- /dev/null
+++ b/graphics/ralcgm/ralcgm-linux.patch
@@ -0,0 +1,240 @@
+diff -Nur ralcgm-3.50.orig/CGMconfig ralcgm-3.50/CGMconfig
+--- ralcgm-3.50.orig/CGMconfig Tue Apr 19 11:42:17 1994
++++ ralcgm-3.50/CGMconfig Mon Mar 19 23:10:54 2001
+@@ -111,13 +111,13 @@
+ echo; exit
+ fi
+
+-systems='sun3|sun4|cray|craypcc|iris|iris4d|indigo|rs6000|hpux|ultrix|decosf|topaz'
++systems='sun3|sun4|cray|craypcc|iris|iris4d|indigo|rs6000|hpux|ultrix|decosf|topaz|linux'
+
+ #
+ # Set the echo options - check the system.
+ #
+ case $1 in
+-sun3|sun4|iris|ultrix|dec|rs6000)
++sun3|sun4|iris|ultrix|dec|rs6000|linux)
+ # Berkely echo format
+ el="-n"
+ er=""
+@@ -269,6 +269,14 @@
+ cflags="-c -O -m68881"
+ lflags="-lE -lmalloc -lm"
+ ;;
++linux)
++ system=linux
++ cflags="-c ${OPT}"
++ lflags="-lm"
++ xw="yes"
++ xlib="-lX11"
++ ar="ar crs"
++ ;;
+ esac
+
+ #
+@@ -672,31 +680,31 @@
+ echo Your desired system will now be configured.
+ echo
+
+-oututils="$(ATTUTILS)"
++oututils='$(ATTUTILS)'
+
+ if test "$gdpflag" = "yes"
+ then
+- oututils=$oututils" $(GDPUTILS)"
++ oututils=$oututils' $(GDPUTILS)'
+ fi
+
+ if test "$filflag" = "yes"
+ then
+- oututils=$oututils" $(FILUTILS)"
++ oututils=$oututils' $(FILUTILS)'
+ fi
+
+ if test "$colrflag" = "yes"
+ then
+- oututils=$oututils" $(COLRUTILS)"
++ oututils=$oututils' $(COLRUTILS)'
+ fi
+
+ if test "$cellflag" = "yes"
+ then
+- oututils=$oututils" $(CELLUTILS)"
++ oututils=$oututils' $(CELLUTILS)'
+ fi
+
+ if test "$ptsflag" = "yes"
+ then
+- oututils=$oututils" $(PTSUTILS)"
++ oututils=$oututils' $(PTSUTILS)'
+ fi
+
+ sed "/^MODULE =/s!=.*\$!= $module!
+diff -Nur ralcgm-3.50.orig/CGMinstall ralcgm-3.50/CGMinstall
+--- ralcgm-3.50.orig/CGMinstall Tue Apr 19 11:42:17 1994
++++ ralcgm-3.50/CGMinstall Mon Mar 19 23:10:54 2001
+@@ -111,13 +111,13 @@
+ echo; exit
+ fi
+
+-systems='sun3|sun4|cray|craypcc|iris|iris4d|indigo|rs6000|hpux|ultrix|decosf|topaz'
++systems='sun3|sun4|cray|craypcc|iris|iris4d|indigo|rs6000|hpux|ultrix|decosf|topaz|linux'
+
+ #
+ # Set the echo options - check the system.
+ #
+ case $1 in
+-sun3|sun4|iris|ultrix|dec|rs6000)
++sun3|sun4|iris|ultrix|dec|rs6000|linux)
+ # Berkely echo format
+ el="-n"
+ er=""
+@@ -269,6 +269,14 @@
+ cflags="-c -O -m68881"
+ lflags="-lE -lmalloc -lm"
+ ;;
++linux)
++ system=linux
++ cflags="-c ${OPT}"
++ lflags="-lm"
++ xw="yes"
++ xlib="-lX11"
++ ar="ar crs"
++ ;;
+ esac
+
+ #
+@@ -672,31 +680,31 @@
+ echo Your desired system will now be configured.
+ echo
+
+-oututils="$(ATTUTILS)"
++oututils='$(ATTUTILS)'
+
+ if test "$gdpflag" = "yes"
+ then
+- oututils=$oututils" $(GDPUTILS)"
++ oututils=$oututils' $(GDPUTILS)'
+ fi
+
+ if test "$filflag" = "yes"
+ then
+- oututils=$oututils" $(FILUTILS)"
++ oututils=$oututils' $(FILUTILS)'
+ fi
+
+ if test "$colrflag" = "yes"
+ then
+- oututils=$oututils" $(COLRUTILS)"
++ oututils=$oututils' $(COLRUTILS)'
+ fi
+
+ if test "$cellflag" = "yes"
+ then
+- oututils=$oututils" $(CELLUTILS)"
++ oututils=$oututils' $(CELLUTILS)'
+ fi
+
+ if test "$ptsflag" = "yes"
+ then
+- oututils=$oututils" $(PTSUTILS)"
++ oututils=$oututils' $(PTSUTILS)'
+ fi
+
+ sed "/^MODULE =/s!=.*\$!= $module!
+diff -Nur ralcgm-3.50.orig/include/cgmmach.h ralcgm-3.50/include/cgmmach.h
+--- ralcgm-3.50.orig/include/cgmmach.h Mon Jun 12 15:18:12 1995
++++ ralcgm-3.50/include/cgmmach.h Mon Mar 19 23:10:54 2001
+@@ -87,6 +87,9 @@
+ #ifndef Double
+ #define Double double
+ #endif
++#ifndef Posint64
++#define Posint64 unsigned long
++#endif
+
+ /* Define macros for some maths routines which may cause problems */
+
+diff -Nur ralcgm-3.50.orig/include/mc_linux.h ralcgm-3.50/include/mc_linux.h
+--- ralcgm-3.50.orig/include/mc_linux.h Thu Jan 1 01:00:00 1970
++++ ralcgm-3.50/include/mc_linux.h Mon Mar 19 23:10:54 2001
+@@ -0,0 +1,33 @@
++/* RAL-CGM Interpreter header file
++ *
++ * Linux specific setting for CGM interpreter
++ */
++
++/* Define Machine */
++
++#define LINUX
++
++/* Define Graphics system(s) */
++
++#define POSTSCRIPT
++#define BEZIER
++#define HERSHEY
++#define XW
++
++#define DATADIR ""
++
++#define NAMELGTH 32
++#define EXTLGTH 8
++
++#define Posint64 unsigned long long
++#define MALLOCH
++#include <stdlib.h>
++
++#ifdef CGMOXW_C /* X-Window specific settings */
++
++#include <X11/cursorfont.h>
++#include <X11/Xlib.h>
++#include <X11/Xutil.h>
++#include <X11/Xatom.h>
++
++#endif
+diff -Nur ralcgm-3.50.orig/src/cgmobin.c ralcgm-3.50/src/cgmobin.c
+--- ralcgm-3.50.orig/src/cgmobin.c Fri Jun 16 15:10:19 1995
++++ ralcgm-3.50/src/cgmobin.c Mon Mar 19 23:11:52 2001
+@@ -1593,7 +1593,8 @@
+ Enum real_type, real_or_vdc;
+ #endif
+ {
+- Posint whole, exponent, fract, neg;
++ Posint whole, exponent, neg;
++ Posint64 fract;
+ Prec prec;
+ Double f;
+
+@@ -1610,7 +1611,7 @@
+ prec = (real_or_vdc == VDC ? curbin.vdc_whole
+ : curbin.real_whole);
+ whole = (Posint)( neg ? -((floor(x))) : x );
+- fract = (Posint)( ( neg ? x + (Double)whole : x - (Double)whole )
++ fract = (Posint64)( ( neg ? x + (Double)whole : x - (Double)whole )
+ * ( 1L<<prec-2 ) * 4.0 );
+
+ #ifdef DEBUG
+@@ -1669,7 +1670,7 @@
+ exponent--;
+ }
+ }
+- fract = (Long) ( (f - 1.0) * (Double)(1L<<(prec == 12 ? 52 : 23)) );
++ fract = (Posint64) ( (f - 1.0) * (Double)(1L<<(prec == 12 ? 52 : 23)) );
+ }
+
+ #ifdef DEBUG
+diff -Nur ralcgm-3.50.orig/src/cgmrand.c ralcgm-3.50/src/cgmrand.c
+--- ralcgm-3.50.orig/src/cgmrand.c Tue Jun 13 17:32:50 1995
++++ ralcgm-3.50/src/cgmrand.c Mon Mar 19 23:10:54 2001
+@@ -349,7 +349,11 @@
+ /* Correct any overrun */
+ if(cgmoverrun)
+ {
++#ifdef LINUX
++ disk_addr.__pos -= cgmoverrun;
++#else
+ disk_addr -= cgmoverrun;
++#endif
+ cgmoverrun = 0;
+ }
+
diff --git a/graphics/ralcgm/ralcgm.SlackBuild b/graphics/ralcgm/ralcgm.SlackBuild
new file mode 100644
index 000000000000..28c95aae9a9b
--- /dev/null
+++ b/graphics/ralcgm/ralcgm.SlackBuild
@@ -0,0 +1,101 @@
+#!/bin/sh
+
+# Slackware build script for ralcgm
+
+# Written by B. Watson (yalhcru@gmail.com)
+
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+PRGNAM=ralcgm
+VERSION=${VERSION:-3.50}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+mkdir -p $PRGNAM-$VERSION
+cd $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.Z
+chown -R root:root .
+
+# Departure from template here due to annoying perms in the tarball.
+find . -type d -exec chmod 755 {} \+
+find . -type f -exec chmod 644 {} \+
+
+# This SlackBuild owes a great debt to PLD Linux:
+# git://git.pld-linux.org/packages/ralcgm.git
+
+# Add "linux" as a supported OS.
+patch -p1 < $CWD/ralcgm-linux.patch
+
+# Patch was created by running the interactive config, then diffing against
+# the un-configured source. Also file locations were edited in mach.h.
+patch -p1 < $CWD/no_interactive_config.diff
+
+# Compiler warnings scare me.
+patch -p1 < $CWD/fix_warnings.diff
+
+# These 3 stanzas come from PLD's ralcgm.spec:
+# The genbez and genher tools need to be built with DATADIR set to ../data/
+make -j1 -C src COMPILE="gcc $SLKCFLAGS" cgmfile.o cgmerr.o genbez genher
+
+# ..everything else needs it as /usr/share/ralcgm/.
+sed -i '/^#define *DATADIR/s,"\..*,"/usr/share/ralcgm/",' include/mach.h
+
+# Clean up, then build for real.
+rm -f src/cgmfile.o src/cgmerr.o
+make -C src $PRGNAM cgmlib COMPILE="gcc $SLKCFLAGS"
+
+# Manual install, since the "install" script doesn't actually install.
+# Not sure that all the includes are necessary, but they shouldn't do
+# any harm.
+mkdir -p $PKG/usr/bin $PKG/usr/lib$LIBDIRSUFFIX $PKG/usr/man/man1 \
+ $PKG/usr/share/$PRGNAM $PKG/usr/include/$PRGNAM
+install -s -oroot -groot -m0755 bin/$PRGNAM $PKG/usr/bin
+install -oroot -groot -m0644 bin/libcgm.a $PKG/usr/lib$LIBDIRSUFFIX
+install -oroot -groot -m0644 data/* $PKG/usr/share/$PRGNAM
+install -oroot -groot -m0644 include/* $PKG/usr/include/$PRGNAM
+
+gzip -9c < docs/$PRGNAM.man > $PKG/usr/man/man1/$PRGNAM.1.gz
+
+# The INSTALL actually has somewhat useful info.
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a README docs/INSTALL examples $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/graphics/ralcgm/ralcgm.info b/graphics/ralcgm/ralcgm.info
new file mode 100644
index 000000000000..1a190b348ce8
--- /dev/null
+++ b/graphics/ralcgm/ralcgm.info
@@ -0,0 +1,10 @@
+PRGNAM="ralcgm"
+VERSION="3.50"
+HOMEPAGE="http://www.agocg.ac.uk/train/cgm/ralcgm.htm"
+DOWNLOAD="http://web.warwick.ac.uk/ftp/x11/ralcgm-3.50.tar.Z"
+MD5SUM="c132d8533527c35eb99581ed7cc738db"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="B. Watson"
+EMAIL="yalhcru@gmail.com"
diff --git a/graphics/ralcgm/slack-desc b/graphics/ralcgm/slack-desc
new file mode 100644
index 000000000000..44766bb19b4a
--- /dev/null
+++ b/graphics/ralcgm/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+ralcgm: ralcgm (view/convert CGM vector image files)
+ralcgm:
+ralcgm: RAL-CGM is a program to translate or interpret CGM (Computer Graphics
+ralcgm: Metafile) files, either to a different encoding (Binary, Character
+ralcgm: or Clear Text) or to view on a terminal or to send to a plotter
+ralcgm: (PostScript or HPGL).
+ralcgm:
+ralcgm: It can be used as an ImageMagick or GraphicsMagick delegate to
+ralcgm: convert from CGM format.
+ralcgm:
+ralcgm: