summaryrefslogtreecommitdiffstats
path: root/misc/gcolor2/gcolor2.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'misc/gcolor2/gcolor2.SlackBuild')
-rw-r--r--misc/gcolor2/gcolor2.SlackBuild21
1 files changed, 18 insertions, 3 deletions
diff --git a/misc/gcolor2/gcolor2.SlackBuild b/misc/gcolor2/gcolor2.SlackBuild
index bc7e364b8f..8552758e1f 100644
--- a/misc/gcolor2/gcolor2.SlackBuild
+++ b/misc/gcolor2/gcolor2.SlackBuild
@@ -19,6 +19,10 @@ if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
fi
set -e
@@ -37,13 +41,24 @@ find . \
-o -perm 400 \) -exec chmod 644 {} \;
# gcolor2 prefills the saved colors with the contents of rgb.txt - which it
-# can't find without this patch.
+# can't find without this patch. Merged with the patch on:
+# http://tinyurl.com/gcolor-64bitpatch . This makes it possible to compile on
+#64bit systems, and not segfault at runtime.
patch -p1 < $CWD/rgb.patch
+# and add a couple of Debian patches and a FreeBSD for x64 segfaults and so on
+patch -p1 < $CWD/callbacks.c.patch
+patch -p0 < $CWD/callbacks.c.2.patch
+patch -p1 < $CWD/main.c.patch
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
- --prefix=/usr
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --build=$ARCH-slackware-linux
make
make DESTDIR=$PKG install-strip
@@ -61,4 +76,4 @@ cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}