summaryrefslogtreecommitdiffstats
path: root/accessibility/mag/mag.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'accessibility/mag/mag.SlackBuild')
-rw-r--r--accessibility/mag/mag.SlackBuild27
1 files changed, 21 insertions, 6 deletions
diff --git a/accessibility/mag/mag.SlackBuild b/accessibility/mag/mag.SlackBuild
index 470ddbc49a..ba6ebb1e84 100644
--- a/accessibility/mag/mag.SlackBuild
+++ b/accessibility/mag/mag.SlackBuild
@@ -2,17 +2,21 @@
# Slackware build script for mag
-# Written by B. Watson (yalhcru@gmail.com)
+# Written by B. Watson (urchlay@slackware.uk)
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
# VERSION comes from the last modified date on the homepage.
+# 20211207 bkw: BUILD=2
+# - fix blank window on -current (it shouldn't have worked on 14.2 either).
+# - add BUGS to man page (no way to exit mag).
+
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=mag
VERSION=${VERSION:-20100913}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -35,16 +39,12 @@ 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
@@ -54,7 +54,22 @@ set -e
# In case you're wondering, -Wl,-s builds a stripped binary.
rm -rf $PKG
mkdir -p $PKG/usr/bin $OUTPUT
+
+cd $PKG
+
+# 20211207 bkw: we *do* have to patch it now, and we don't want
+# to write to $CWD, so:
+cat $CWD/$PRGNAM.c > $PRGNAM.c
+
+# 20211207 bkw: silly mistake in the code: it was calling
+# XDestroyImage(ximage) before the for loop that *uses* ximage.
+# On 14.2's X, this was equivalent to a use-after-free, and worked
+# accidentally most (or even all) of the time, but on -current's X,
+# it results in a blank (all-black) window.
+patch -p0 < $CWD/xdestroyimage.diff
+
gcc $SLKCFLAGS -Wl,-s -o $PKG/usr/bin/$PRGNAM $PRGNAM.c -lX11
+rm $PRGNAM.c
# Man page written by SlackBuild author. Please don't include mag.rst
# in the package, it's the source for the man page only.