aboutsummaryrefslogtreecommitdiff
path: root/desktop/dmenu/dmenu.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/dmenu/dmenu.SlackBuild')
-rw-r--r--desktop/dmenu/dmenu.SlackBuild25
1 files changed, 16 insertions, 9 deletions
diff --git a/desktop/dmenu/dmenu.SlackBuild b/desktop/dmenu/dmenu.SlackBuild
index 28b1706887c7..f7c99ae826e9 100644
--- a/desktop/dmenu/dmenu.SlackBuild
+++ b/desktop/dmenu/dmenu.SlackBuild
@@ -36,10 +36,13 @@ OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
fi
set -e
@@ -48,7 +51,7 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
-tar -xzvf $CWD/$PRGNAM-$VERSION.tar.gz
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
find . \
@@ -57,14 +60,18 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-# Fix the prefix, mandir and CFLAGS
-sed -i \
- -e 's/^PREFIX = \/usr\/local/PREFIX = \/usr/' \
- -e 's/^MANPREFIX = ${PREFIX}\/share\/man/MANPREFIX = ${PREFIX}\/man/' \
- -e 's/^CFLAGS = -std=c99 -pedantic -Wall -Os/CFLAGS += -std=c99 -pedantic -Wall/' \
- config.mk
+# Fixup the CFLAGS and LIBDIR settings to prevent multilib conflicts
+patch -p1 < $CWD/dmenu-4.0-libdir_cflags_fixups.diff
+
+make install \
+ OPTS="$SLKCFLAGS" \
+ PREFIX=/usr \
+ LIBDIR=/usr/lib${LIBDIRSUFFIX} \
+ MANPREFIX=/usr/man \
+ X11INC=/usr/include \
+ X11LIB=/usr/lib${LIBDIRSUFFIX}/X11 \
+ DESTDIR=$PKG
-CFLAGS=${SLKCFLAGS} make install DESTDIR=$PKG
( find $PKG | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
xargs strip --strip-unneeded 2> /dev/null || true
@@ -85,4 +92,4 @@ 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.tgz
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}