From b89ba185a16ad7d9f69341b7cc0920399b627fa6 Mon Sep 17 00:00:00 2001 From: Kyle Guinn Date: Sun, 7 Jul 2019 14:24:42 -0500 Subject: development/icon: Fix URLs, add upstream patches. Signed-off-by: Kyle Guinn --- development/icon/icon.SlackBuild | 123 +++++++++++--------- development/icon/icon.info | 4 +- development/icon/patches/display.patch | 44 ++++++++ development/icon/patches/glibc.patch | 23 ++++ development/icon/patches/implicit-defs.patch | 162 +++++++++++++++++++++++++++ development/icon/patches/lexer.patch | 18 +++ development/icon/patches/maxtype.patch | 18 +++ 7 files changed, 335 insertions(+), 57 deletions(-) create mode 100644 development/icon/patches/display.patch create mode 100644 development/icon/patches/glibc.patch create mode 100644 development/icon/patches/implicit-defs.patch create mode 100644 development/icon/patches/lexer.patch create mode 100644 development/icon/patches/maxtype.patch diff --git a/development/icon/icon.SlackBuild b/development/icon/icon.SlackBuild index a981930b94..c444ae2fbe 100644 --- a/development/icon/icon.SlackBuild +++ b/development/icon/icon.SlackBuild @@ -2,37 +2,38 @@ # Slackware build script for icon -# Copyright 2013 Kyle Guinn , USA +# Copyright 2010-2019 Kyle Guinn # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright -# notice, this list of conditions and the following disclaimer. +# notice, this list of conditions and the following disclaimer. # -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED -# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=icon VERSION=${VERSION:-9.5.1} -BUILD=${BUILD:-1} +SRCVER=v$(echo $VERSION | tr -d .)src +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then - case "$(uname -m)" in - i?86) ARCH=i486 ;; - arm*) ARCH=arm ;; - *) ARCH=$(uname -m) ;; - esac + case "$(uname -m)" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$(uname -m) ;; + esac fi CWD=$(pwd) @@ -40,66 +41,78 @@ TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM-$VERSION OUTPUT=${OUTPUT:-/tmp} -# Removed "-O2"; enabling optimization seems to cause -# "Run-time error 302", "memory violation" -# whenever running icon programs. +# At one point, enabling "-O2" appeared to cause +# "Run-time error 302", "memory violation" (from the SIGSEGV trap) +# whenever running icon programs. I can't reproduce it. +# However, one of the tests fails with "-O2". Use "-O" instead +# since it is the default in config/linux/Makedefs. if [ "$ARCH" = "i486" ]; then - SLKCFLAGS="-march=i486 -mtune=i686" - LIBDIRSUFFIX="" + SLKCFLAGS="-O -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O -march=i586 -mtune=i686" + LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then - SLKCFLAGS="-march=i686 -mtune=i686" - LIBDIRSUFFIX="" + SLKCFLAGS="-O -march=i686 -mtune=i686" + LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then - SLKCFLAGS="-fPIC" - LIBDIRSUFFIX="64" + SLKCFLAGS="-O -fPIC" + LIBDIRSUFFIX="64" else - SLKCFLAGS="" - LIBDIRSUFFIX="" + SLKCFLAGS="-O" + LIBDIRSUFFIX="" fi set -e -PKGVERSION=$(echo $VERSION | tr -d .) rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP -rm -rf $PRGNAM-v${PKGVERSION}src -tar xvf $CWD/$PRGNAM-v${PKGVERSION}src.tgz -cd $PRGNAM-v${PKGVERSION}src +rm -rf $PRGNAM-$SRCVER +tar xvf $CWD/$PRGNAM-$SRCVER.tgz +cd $PRGNAM-$SRCVER chown -R root:root . -find -L . \ - \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ - -o -perm 511 \) -exec chmod 755 {} \; -o \ - \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ - -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; - -# Let's put the package in /opt/icon instead of filling /usr/lib -# (and not a '/usr/lib/icon' subdirectory) with icon-related files. -# The makefile will attempt to create the /opt/icon directory, but -# doesn't use the -p option with mkdir, so we have to create only -# its parent directory first. -mkdir -p $PKG/opt +chmod -R u+w,go-w,a+rX-st . + +# Cherry-picked bugfix and ftbfs patches from upstream +# https://github.com/gtownsend/icon +patch -p1 < $CWD/patches/display.patch +patch -p1 < $CWD/patches/maxtype.patch +patch -p1 < $CWD/patches/lexer.patch +patch -p1 < $CWD/patches/implicit-defs.patch +patch -p1 < $CWD/patches/glibc.patch + +# Installation creates bin, lib, man, and doc dirs inside the "dest" dir. +# Edit the Install rule to avoid having to manually rearrange files. +# The bin and lib dirs need to share a parent directory, but we don't want +# to clutter /usr/lib with icon files, nor /usr/bin with demo programs and +# a shared lib. Move both to /opt/icon, the suggested canonical location. +sed -i -e "s|mkdir|mkdir -p|" \ + -e "s|\$D/bin|\$D/opt/$PRGNAM/bin|g" \ + -e "s|\$D/lib|\$D/opt/$PRGNAM/lib|g" \ + -e "s|\$D/man|\$D/usr/man|g" \ + -e "s|\$D/doc|\$D/usr/doc/$PRGNAM-$VERSION|g" Makefile + make X-Configure name=linux make CFLAGS="$SLKCFLAGS" -make Install dest=$PKG/opt/icon +make Test +make Samples +make Install dest=$PKG # Create symlinks from /usr/bin to /opt/icon/bin. +# Anything not symlinked is a demo/sample program. mkdir -p $PKG/usr/bin for i in icon icont iconx vib; do - ln -s ../../opt/icon/bin/$i $PKG/usr/bin/$i + ln -s /opt/$PRGNAM/bin/$i $PKG/usr/bin/$i done -find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ +find $PKG -exec file {} + | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true -# Move man pages and docs to their usual locations. -mkdir -p $PKG/usr/doc -mv $PKG/opt/icon/man $PKG/usr/man -mv $PKG/opt/icon/doc $PKG/usr/doc/$PRGNAM-$VERSION -mv $PKG/opt/icon/README $PKG/usr/doc/$PRGNAM-$VERSION - -find $PKG/usr/man -type f -exec gzip -9 {} \; +find $PKG/usr/man -type f -exec gzip -9 {} + +mv $PKG/README $PKG/usr/doc/$PRGNAM-$VERSION +rm $PKG/usr/doc/$PRGNAM-$VERSION/clnroff.sed cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install diff --git a/development/icon/icon.info b/development/icon/icon.info index 2f383854c2..0df2ab5bd9 100644 --- a/development/icon/icon.info +++ b/development/icon/icon.info @@ -1,7 +1,7 @@ PRGNAM="icon" VERSION="9.5.1" -HOMEPAGE="http://www.cs.arizona.edu/icon/" -DOWNLOAD="http://www.cs.arizona.edu/icon/ftp/packages/unix/icon-v951src.tgz" +HOMEPAGE="https://www2.cs.arizona.edu/icon/" +DOWNLOAD="https://www2.cs.arizona.edu/icon/ftp/packages/unix/icon-v951src.tgz" MD5SUM="8fdeb7c5408d9d9bf06bc5e7f4f54498" DOWNLOAD_x86_64="" MD5SUM_x86_64="" diff --git a/development/icon/patches/display.patch b/development/icon/patches/display.patch new file mode 100644 index 0000000000..05eab35d2c --- /dev/null +++ b/development/icon/patches/display.patch @@ -0,0 +1,44 @@ +commit d0cd013653360f6f11e3b5dbdbbf3788a5c08b02 +Author: Gregg Townsend +Date: Thu Dec 4 15:37:39 2014 -0700 + + Handle $DISPLAY longer than 63 characters. + First seen as a problem on Macintosh OS X 10.10 ("Yosemite"). + Side effects revealed other bugs in cross-display CopyArea and + gamma correction. + +diff --git a/src/h/graphics.h b/src/h/graphics.h +--- a/src/h/graphics.h ++++ b/src/h/graphics.h +@@ -201,7 +201,7 @@ + typedef struct _wdisplay { + int refcount; + int serial; /* serial # */ +- char name[MAXDISPLAYNAME]; ++ char *name; + Display * display; + Visual * visual; + GC icongc; +diff --git a/src/h/xwin.h b/src/h/xwin.h +--- a/src/h/xwin.h ++++ b/src/h/xwin.h +@@ -73,7 +73,6 @@ + */ + #define WMAXCOLORS 256 + #define MAXCOLORNAME 40 +-#define MAXDISPLAYNAME 64 + #define CSHARED 0 + #define CMUTABLE 1 + #define NUMCURSORSYMS 78 +diff --git a/src/runtime/rxrsc.ri b/src/runtime/rxrsc.ri +--- a/src/runtime/rxrsc.ri ++++ b/src/runtime/rxrsc.ri +@@ -376,7 +376,7 @@ + + GRFX_ALLOC(wd, _wdisplay); + +- strcpy(wd->name,s); ++ wd->name = salloc(s); + wd->display = XOpenDisplay((*s=='\0') ? NULL : s); + + if (wd->display == NULL) { diff --git a/development/icon/patches/glibc.patch b/development/icon/patches/glibc.patch new file mode 100644 index 0000000000..b0629d0cc8 --- /dev/null +++ b/development/icon/patches/glibc.patch @@ -0,0 +1,23 @@ +commit bfc4a6004d0d3984c8066289b8d8e563640c4ddd +Author: Gregg Townsend +Date: Mon Oct 29 10:07:31 2018 -0700 + + Adapt to change in GLIBC v2.28 internals (thx Cheyenne Wills). + +diff --git a/ipl/cfuncs/fpoll.c b/ipl/cfuncs/fpoll.c +--- a/ipl/cfuncs/fpoll.c ++++ b/ipl/cfuncs/fpoll.c +@@ -60,12 +64,9 @@ + + /* check for data already in buffer */ + /* there's no legal way to do this in C; we cheat */ +-#if defined(__GLIBC__) && defined(_STDIO_USES_IOSTREAM) /* new GCC library */ ++#if defined(__GLIBC__) /* new GCC library */ + if (f->_IO_read_ptr < f->_IO_read_end) + RetArg(1); +-#elif defined(__GLIBC__) /* old GCC library */ +- if (f->__bufp < f->__get_limit) +- RetArg(1); + #elif defined(_FSTDIO) /* new BSD library */ + if (f->_r > 0) + RetArg(1); diff --git a/development/icon/patches/implicit-defs.patch b/development/icon/patches/implicit-defs.patch new file mode 100644 index 0000000000..9e015c7ad7 --- /dev/null +++ b/development/icon/patches/implicit-defs.patch @@ -0,0 +1,162 @@ +commit 8cb4887b886ad0c9caf0be595e236d2a74a41a8d +Author: Gregg Townsend +Date: Mon Aug 28 09:10:00 2017 -0700 + + Fix compilation warnings in xpm code (thx Sean Jensen). + +diff --git a/src/xpm/create.c b/src/xpm/create.c +--- a/src/xpm/create.c ++++ b/src/xpm/create.c +@@ -344,6 +344,7 @@ + + #endif + ++int + xpmCreateImage(display, attrib, image_return, shapeimage_return, attributes) + Display *display; + xpmInternAttrib *attrib; +diff --git a/src/xpm/data.c b/src/xpm/data.c +--- a/src/xpm/data.c ++++ b/src/xpm/data.c +@@ -110,6 +110,7 @@ + /* + * skip to the end of the current string and the beginning of the next one + */ ++void + xpmNextString(mdata) + xpmData *mdata; + { +@@ -277,6 +278,7 @@ + /* + * get the current comment line + */ ++void + xpmGetCmt(mdata, cmt) + xpmData *mdata; + char **cmt; +@@ -403,6 +405,7 @@ + /* + * close the file related to the xpmData if any + */ ++void + XpmDataClose(mdata) + xpmData *mdata; + { +diff --git a/src/xpm/misc.c b/src/xpm/misc.c +--- a/src/xpm/misc.c ++++ b/src/xpm/misc.c +@@ -14,6 +14,7 @@ + * Free the computed color table + */ + ++void + xpmFreeColorTable(colorTable, ncolors) + char ***colorTable; + int ncolors; +@@ -39,6 +40,7 @@ + * which ones must be freed later on. + */ + ++void + xpmInitInternAttrib(attrib) + xpmInternAttrib *attrib; + { +@@ -55,6 +57,7 @@ + * Free the xpmInternAttrib pointers which have been allocated + */ + ++void + xpmFreeInternAttrib(attrib) + xpmInternAttrib *attrib; + { +@@ -80,6 +83,7 @@ + /* + * Free array of extensions + */ ++void + XpmFreeExtensions(extensions, nextensions) + XpmExtension *extensions; + int nextensions; +@@ -108,6 +112,7 @@ + * Return the XpmAttributes structure size + */ + ++int + XpmAttributesSize() + { + return sizeof(XpmAttributes); +@@ -119,6 +124,7 @@ + * but the structure itself + */ + ++void + XpmFreeAttributes(attributes) + XpmAttributes *attributes; + { +@@ -167,6 +173,7 @@ + * the xpmInternAttrib structure. + */ + ++void + xpmSetAttributes(attrib, attributes) + xpmInternAttrib *attrib; + XpmAttributes *attributes; +diff --git a/src/xpm/xpm.h b/src/xpm/xpm.h +--- a/src/xpm/xpm.h ++++ b/src/xpm/xpm.h +@@ -191,8 +191,8 @@ + XpmAttributes * attributes)); + + FUNC(XpmAttributesSize, int, ()); +- FUNC(XpmFreeAttributes, int, (XpmAttributes * attributes)); +- FUNC(XpmFreeExtensions, int, (XpmExtension * extensions, int nextensions)); ++ FUNC(XpmFreeAttributes, void, (XpmAttributes * attributes)); ++ FUNC(XpmFreeExtensions, void, (XpmExtension * extensions, int nextensions)); + + #ifdef __cplusplus + } /* for C++ V2.0 */ +diff --git a/src/xpm/xpmP.h b/src/xpm/xpmP.h +--- a/src/xpm/xpmP.h ++++ b/src/xpm/xpmP.h +@@ -159,13 +159,13 @@ + XpmAttributes * attributes, + xpmInternAttrib * attrib)); + +-FUNC(xpmFreeColorTable, int, (char ***colorTable, int ncolors)); ++FUNC(xpmFreeColorTable, void, (char ***colorTable, int ncolors)); + +-FUNC(xpmInitInternAttrib, int, (xpmInternAttrib * xmpdata)); ++FUNC(xpmInitInternAttrib, void, (xpmInternAttrib * xmpdata)); + +-FUNC(xpmFreeInternAttrib, int, (xpmInternAttrib * xmpdata)); ++FUNC(xpmFreeInternAttrib, void, (xpmInternAttrib * xmpdata)); + +-FUNC(xpmSetAttributes, int, (xpmInternAttrib * attrib, ++FUNC(xpmSetAttributes, void, (xpmInternAttrib * attrib, + XpmAttributes * attributes)); + + FUNC(xpmGetAttributes, int, (XpmAttributes * attributes, +@@ -173,18 +173,20 @@ + + /* I/O utility */ + +-FUNC(xpmNextString, int, (xpmData * mdata)); ++FUNC(atoui, unsigned int, (char *p, unsigned int l, unsigned int *ui_return)); ++FUNC(xpmGetString, int, (xpmData *mdata, char **sptr, unsigned int *l)); ++FUNC(xpmNextString, void, (xpmData * mdata)); + FUNC(xpmNextUI, int, (xpmData * mdata, unsigned int *ui_return)); + + #define xpmGetC(mdata) \ + (mdata->type ? (getc(mdata->stream.file)) : (*mdata->cptr++)) + + FUNC(xpmNextWord, unsigned int, (xpmData * mdata, char *buf)); +-FUNC(xpmGetCmt, int, (xpmData * mdata, char **cmt)); ++FUNC(xpmGetCmt, void, (xpmData * mdata, char **cmt)); + FUNC(xpmReadFile, int, (char *filename, xpmData * mdata)); + FUNC(xpmWriteFile, int, (char *filename, xpmData * mdata)); + FUNC(xpmOpenArray, void, (char **data, xpmData * mdata)); +-FUNC(XpmDataClose, int, (xpmData * mdata)); ++FUNC(XpmDataClose, void, (xpmData * mdata)); + + /* RGB utility */ + diff --git a/development/icon/patches/lexer.patch b/development/icon/patches/lexer.patch new file mode 100644 index 0000000000..290ed67364 --- /dev/null +++ b/development/icon/patches/lexer.patch @@ -0,0 +1,18 @@ +commit bb7c6b5232d8cf0ad98e5ab8e8e3afd3a249751f +Author: Gregg Townsend +Date: Mon Aug 28 08:08:32 2017 -0700 + + Fix ancient potential lexer bug (thx Sean Jensen). + +diff --git a/src/common/yylex.h b/src/common/yylex.h +--- a/src/common/yylex.h ++++ b/src/common/yylex.h +@@ -263,7 +263,7 @@ + { + register char *s1; + s1 = lex_sbuf.strtimage; +- while (s != '\0' && s1 < lex_sbuf.endimage && *s == *s1) { ++ while (*s != '\0' && s1 < lex_sbuf.endimage && *s == *s1) { + ++s; + ++s1; + } diff --git a/development/icon/patches/maxtype.patch b/development/icon/patches/maxtype.patch new file mode 100644 index 0000000000..4e4651cc96 --- /dev/null +++ b/development/icon/patches/maxtype.patch @@ -0,0 +1,18 @@ +commit e91f59f3affe69043586cb171ad1f8027e31d930 +Author: Gregg Townsend +Date: Sat Mar 11 08:41:26 2017 -0700 + + Fix innocuous MaxType definition bug (thx Don Ward). + +diff --git a/src/h/rmacros.h b/src/h/rmacros.h +--- a/src/h/rmacros.h ++++ b/src/h/rmacros.h +@@ -301,7 +301,7 @@ + #define T_Kywdstr 24 /* string keyword */ + #define T_Kywdevent 25 /* keyword &eventsource, etc. */ + +-#define MaxType 26 /* maximum type number */ ++#define MaxType 25 /* maximum type number */ + + /* + * Definitions for keywords. -- cgit v1.2.3