aboutsummaryrefslogtreecommitdiff
path: root/academic/qtoctave
diff options
context:
space:
mode:
Diffstat (limited to 'academic/qtoctave')
-rw-r--r--academic/qtoctave/qtoctave-0.8.1-gcc4.4.patch8
-rw-r--r--academic/qtoctave/qtoctave.SlackBuild24
2 files changed, 28 insertions, 4 deletions
diff --git a/academic/qtoctave/qtoctave-0.8.1-gcc4.4.patch b/academic/qtoctave/qtoctave-0.8.1-gcc4.4.patch
new file mode 100644
index 0000000000000..4bc26f858cb53
--- /dev/null
+++ b/academic/qtoctave/qtoctave-0.8.1-gcc4.4.patch
@@ -0,0 +1,8 @@
+diff -Naur qtoctave-0.8.1/qtoctave/src/search_dialog.cpp qtoctave-0.8.1.new/qtoctave/src/search_dialog.cpp
+--- qtoctave-0.8.1/qtoctave/src/search_dialog.cpp 2008-09-21 05:00:30.000000000 -0400
++++ qtoctave-0.8.1.new/qtoctave/src/search_dialog.cpp 2009-07-31 09:04:20.000000000 -0400
+@@ -1,3 +1,4 @@
++#include <cstdio>
+ #include "search_dialog.h"
+
+ SearchDialog::SearchDialog(QWidget *parent): QDialog(parent)
diff --git a/academic/qtoctave/qtoctave.SlackBuild b/academic/qtoctave/qtoctave.SlackBuild
index f88c5236f8173..fd5aa04ef199d 100644
--- a/academic/qtoctave/qtoctave.SlackBuild
+++ b/academic/qtoctave/qtoctave.SlackBuild
@@ -7,26 +7,39 @@
PRGNAM=qtoctave
VERSION=${VERSION:-0.8.1}
-ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i486 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
+
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686 -DNDEBUG"
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
- SLKCFLAGS="-O2 -march=i686 -mtune=i686 -DNDEBUG"
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
- SLKCFLAGS="-O2 -fPIC -DNDEBUG"
+ SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
+
set -e # Exit on most errors
rm -rf $PKG
@@ -42,6 +55,9 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
+# Fix building with gcc4.4
+patch -p2 < $CWD/qtoctave-0.8.1-gcc4.4.patch
+
cmake \
-DCMAKE_C_FLAGS_RELEASE:STRING="$SLKCFLAGS" \
-DCMAKE_CXX_FLAGS_RELEASE:STRING="$SLKCFLAGS" \