summaryrefslogtreecommitdiffstats
path: root/network/irssi_otr/irssi_otr.SlackBuild
diff options
context:
space:
mode:
author B. Watson <yalhcru@gmail.com>2013-04-11 17:08:54 -0500
committer Robby Workman <rworkman@slackbuilds.org>2013-04-15 17:20:34 -0500
commit1a31f01c20c1adb9c482f2fe7e32b6c5c10320d6 (patch)
tree9ee5bb867f012c1987f9c3da56be488b4955f2c0 /network/irssi_otr/irssi_otr.SlackBuild
parent328934f2d97c6345c998107022b10880b575a880 (diff)
downloadslackbuilds-1a31f01c20c1adb9c482f2fe7e32b6c5c10320d6.tar.gz
slackbuilds-1a31f01c20c1adb9c482f2fe7e32b6c5c10320d6.tar.xz
network/irssi_otr: Fix build (use static libotr)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'network/irssi_otr/irssi_otr.SlackBuild')
-rw-r--r--network/irssi_otr/irssi_otr.SlackBuild108
1 files changed, 93 insertions, 15 deletions
diff --git a/network/irssi_otr/irssi_otr.SlackBuild b/network/irssi_otr/irssi_otr.SlackBuild
index 087c05871b..dafdbcd565 100644
--- a/network/irssi_otr/irssi_otr.SlackBuild
+++ b/network/irssi_otr/irssi_otr.SlackBuild
@@ -6,17 +6,35 @@
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+# 20130326 bkw:
+# - Use a private copy of libotr 3.x, statically built.
+# Needed because SBo libotr has upgraded to 4.0, which this
+# plugin won't build with. Removed libotr from REQUIRES in .info file.
+# - Add xchat support (upstream already supported it, no patching needed)
+# - Better template compliance (cmake in a build dir, actually use SLKCFLAGS)
+# - Bumped BUILD to 2
+
+# For anyone that gets tempted to try the latest git irssi-otr code, here's
+# what I found when I messed with a git checkout from 20130326:
+
+# Pros: libotr 4.0 is supported
+# weechat support has been added
+# Cons: xchat support is totally broken
+# irssi segfaults on plugin load, unless the plugin is built with -O0
+# the weechat support doesn't work without patching
+
+# In view of the above, I decided to stick with the irssi_otr 0.3 release.
+# Sorry, weechat users.
+
PRGNAM=irssi_otr
VERSION=${VERSION:-0.3}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
-# 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
@@ -41,36 +59,96 @@ else
fi
TARNAM=$( echo $PRGNAM | sed 's/_/-/g' )
-LIBNAM="libotr.so"
-PKGLIBDIR=$PKG/usr/lib$LIBDIRSUFFIX/irssi/modules
+LIBOTR_VERSION=3.2.1
+
+IRSSI=${IRSSI:-yes}
+IRSSI_PLUGIN="libotr.so"
+IRSSI_PLUGIN_DIR=$PKG/usr/lib$LIBDIRSUFFIX/irssi/modules
+
+XCHAT=${XCHAT:-yes}
+XCHAT_PLUGIN="libxchatotr.so"
+XCHAT_PLUGIN_DIR=$PKG/usr/lib$LIBDIRSUFFIX/xchat/plugins
+
+if [ "$IRSSI" != "yes" -a "$XCHAT" != "yes" ]; then
+ echo "Can't build with both irssi and xchat disabled (nothing to build)" 2>&1
+ exit 1
+fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
+
+# First, build our static libotr3. It won't get installed as part of
+# the package.
+rm -rf libotr-$LIBOTR_VERSION
+tar xvf $CWD/libotr-$LIBOTR_VERSION.tar.gz
+cd libotr-$LIBOTR_VERSION
+
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure --prefix=$( pwd )/installed \
+ --enable-static \
+ --disable-shared \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --build=$ARCH-slackware-linux
+
+make
+make install
+
+# Now we can build irssi_otr.
+cd $TMP
rm -rf $TARNAM-$VERSION
tar xvf $CWD/$TARNAM-$VERSION.tar.gz
cd $TARNAM-$VERSION
chown -R root:root .
chmod -R a-s,u+w,go+r-w .
-cmake -D CMAKE_C_FLAGS_RELEASE:STRING="-O2 -fPIC" \
- -D CMAKE_BUILD_TYPE:STRING="release" \
- .
-make
+mkdir build
+cd build
+
+if [ "$IRSSI" = "yes" ]; then
+ CLIENTS=" irssi"
+ cmake -DCMAKE_C_FLAGS_RELEASE="$SLKCFLAGS" \
+ -DCMAKE_BUILD_TYPE="release" \
+ -DLIBOTR_INCLUDE_DIR=$TMP/libotr-$LIBOTR_VERSION/installed/include \
+ -DLIBOTR_LIBRARY=$TMP/libotr-$LIBOTR_VERSION/installed/lib/libotr.a \
+ ..
+ make
+
+ # Easier to manually install than to coerce cmake's install
+ # target into using LIBDIRSUFFIX
+ mkdir -p $IRSSI_PLUGIN_DIR
+ install -s -o root -g root -m 0755 $IRSSI_PLUGIN $IRSSI_PLUGIN_DIR
+fi
+
+if [ "$XCHAT" = "yes" ]; then
+ CLIENTS="$CLIENTS xchat"
+ rm -rf *
+ sed -i 's,irssi,xchat,' ../tarballdefs.cmake
+ cmake -DCMAKE_C_FLAGS_RELEASE="$SLKCFLAGS" \
+ -DCMAKE_BUILD_TYPE="release" \
+ -DLIBOTR_INCLUDE_DIR=$TMP/libotr-$LIBOTR_VERSION/installed/include \
+ -DLIBOTR_LIBRARY=$TMP/libotr-$LIBOTR_VERSION/installed/lib/libotr.a \
+ -DXCHAT_INCLUDE_DIR=$CWD \
+ ..
+
+ make
+ mkdir -p $XCHAT_PLUGIN_DIR
+ install -s -o root -g root -m 0755 $XCHAT_PLUGIN $XCHAT_PLUGIN_DIR
+fi
-# Easier to manually install than to coerce cmake's install
-# target into using LIBDIRSUFFIX
-mkdir -p $PKGLIBDIR
-install -s -o root -g root -m 0755 $LIBNAM $PKGLIBDIR
+cd ..
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp LICENSE README ChangeLog $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a LICENSE README ChangeLog *.txt $PKG/usr/doc/$PRGNAM-$VERSION
+[ "$XCHAT" = "yes" ] && cp -a README.xchat $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/@CLIENTS@/$CLIENTS/" $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}