summaryrefslogtreecommitdiff
path: root/desktop/xmobar/xmobar.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/xmobar/xmobar.SlackBuild')
-rw-r--r--desktop/xmobar/xmobar.SlackBuild54
1 files changed, 36 insertions, 18 deletions
diff --git a/desktop/xmobar/xmobar.SlackBuild b/desktop/xmobar/xmobar.SlackBuild
index a6a6cc9c7a..f895befa0f 100644
--- a/desktop/xmobar/xmobar.SlackBuild
+++ b/desktop/xmobar/xmobar.SlackBuild
@@ -4,29 +4,45 @@
# Written by Xavier Maillard <xma@gnu.org>
# Updated by Andy Bailey <bailey@akamai.com>
-# Public domain.
+# Copyright 2012 Mikko Värri, Finland
+# 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.
+#
+# 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=xmobar
-VERSION=${VERSION:-0.11.1}
+VERSION=${VERSION:-0.15}
BUILD=${BUILD:-1}
-TAG=${TAG:-_SBo}
+TAG=${TAG:-_SBo}
-GHC_VERSION=$(ghc-pkg field ghc version | cut -d' ' -f2)
+GHC_VERSION=$(ghc --numeric-version)
-# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
arm*) ARCH=arm ;;
- # Unless $ARCH is already set, use uname -m for all other archs:
*) ARCH=$( uname -m ) ;;
esac
fi
CWD=$(pwd)
-TMP=${TMP:-/tmp/SBo}
+TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
-OUTPUT=${OUTPUT:-/tmp}
+OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
@@ -42,7 +58,7 @@ else
LIBDIRSUFFIX=""
fi
-set -e # Exit on most errors
+set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
@@ -57,27 +73,29 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-# We can enable the Wireless monitor after adding "with_iwlib"
-# here, but the iwlib binding version in xmobar 0.11.1 requires
-# wireless-tools 0.30.x, which is still in beta.
+# Fix mtl 2.1 compatibility
+patch -p0 <$CWD/xmobar_cabal.patch
+
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
-runhaskell Setup.lhs configure \
+runghc Setup configure \
--prefix=/usr \
+ --enable-executable-dynamic \
--libdir=/usr/lib${LIBDIRSUFFIX}/ghc-$GHC_VERSION \
--docdir=/usr/doc/$PRGNAM-$VERSION \
+ --flags="with_threaded" \
+ --flags="with_iwlib" \
--flags="with_xft" \
--flags="with_inotify"
-runhaskell Setup.lhs build
-runhaskell Setup.lhs copy --destdir=$PKG
+runghc Setup build
+runghc Setup copy --destdir=$PKG
-find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a \
- LICENSE README xmobar.config-sample \
+cp -a LICENSE readme.md news.md samples \
$PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild