summaryrefslogtreecommitdiff
path: root/desktop/j4-dmenu-desktop/j4-dmenu-desktop.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/j4-dmenu-desktop/j4-dmenu-desktop.SlackBuild')
-rw-r--r--desktop/j4-dmenu-desktop/j4-dmenu-desktop.SlackBuild30
1 files changed, 26 insertions, 4 deletions
diff --git a/desktop/j4-dmenu-desktop/j4-dmenu-desktop.SlackBuild b/desktop/j4-dmenu-desktop/j4-dmenu-desktop.SlackBuild
index 4501d44476..93dbf04ebb 100644
--- a/desktop/j4-dmenu-desktop/j4-dmenu-desktop.SlackBuild
+++ b/desktop/j4-dmenu-desktop/j4-dmenu-desktop.SlackBuild
@@ -9,12 +9,19 @@
# Zip file created with:
# wget -O j4-dmenu-desktop-$(date +%Y%m%d).zip https://github.com/enkore/j4-dmenu-desktop/archive/master.zip
+# 20140724 bkw: updated to 20140724 snapshot.
+# - Default to TERMINAL=xterm if i3-sensible-terminal not installed
+# on build host. Can still set TERMINAL in env to override.
+# - Fix hangs caused by using an interactive shell when there's no
+# controlling terminal. Thanks to crumb on ##slackware for the
+# bug report.
+
# 20140310 bkw: updated to 20140310 snapshot.
# - Added man page
# - Added default terminal selection
PRGNAM=j4-dmenu-desktop
-VERSION=${VERSION:-20140310}
+VERSION=${VERSION:-20140724}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -60,8 +67,23 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-# for users who don't use i3, let them pick the default terminal.
-TERMINAL="${TERMINAL:-i3-sensible-terminal}"
+# For some reason, j4-dmenu-desktop uses "bash -i -c <command>" to execute
+# the user's choice. bash -i means interactive shell... which causes it to
+# hang if there's no controlling terminal. No idea why upstream wanted the -i
+# option in the first place, I've asked but not gotten an answer.
+patch -p1 < $CWD/no_interactive_shell.diff
+
+# For users who don't use i3, let them pick the default terminal.
+# If TERMINAL not set, and i3-sensible-terminal not installed, just
+# default to xterm.
+if which i3-sensible-terminal &>/dev/null; then
+ DEFTERM="i3-sensible-terminal"
+else
+ DEFTERM="xterm"
+fi
+
+TERMINAL="${TERMINAL:-$DEFTERM}"
+echo "Using TERMINAL=$TERMINAL"
sed -i "s,i3-sensible-terminal,$TERMINAL,g" src/Main.hh
# Don't use 'make install', it wants to run the tests, which require
@@ -91,7 +113,7 @@ cp -a CHANGELOG LICENSE README.md $CWD/$PRGNAM.pod $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
+sed "s,_TERMINAL_,$TERMINAL,g" $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}