2010-05-15 04:57:22 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for BRL-CAD
|
|
|
|
|
2015-02-09 01:54:12 +01:00
|
|
|
# Ryan P.C. McQuen | Everett, WA | ryan.q@linux.com
|
|
|
|
|
2010-05-15 04:57:22 +02:00
|
|
|
# Originally written by Nikolai Saika <nicksaika@gmail.com>
|
|
|
|
# Released under the WTFPL - http://sam.zoy.org/wtfpl/
|
|
|
|
|
|
|
|
# Maintained as of version 7.16.6 by Niels Horn <niels.horn@gmail.com>
|
2012-09-16 14:18:24 +02:00
|
|
|
# Revision date: 2012/09/13
|
2010-05-15 04:57:22 +02:00
|
|
|
|
2013-11-28 00:23:41 +01:00
|
|
|
# Modified by John Vogel <jvogel4@stny.rr.com> for build with cmake
|
|
|
|
# ... and again to fix tcl/tk breakage
|
2013-11-22 06:30:35 +01:00
|
|
|
|
2010-05-15 04:57:22 +02:00
|
|
|
PRGNAM=brlcad
|
2015-02-09 01:54:12 +01:00
|
|
|
VERSION=${VERSION:-7.24.2}
|
|
|
|
BUILD=${BUILD:-1}
|
2010-05-15 04:57:22 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
2010-05-23 19:07:48 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2010-06-04 07:05:08 +02:00
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
2010-05-23 19:07:48 +02:00
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2010-05-15 04:57:22 +02:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
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"
|
2010-05-23 19:07:48 +02:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-15 04:57:22 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
|
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
2013-11-22 06:30:35 +01:00
|
|
|
find -L . \
|
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
|
|
|
|
-o -perm 511 \) -exec chmod 755 {} \; -o \
|
|
|
|
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
2015-02-09 01:54:12 +01:00
|
|
|
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
|
2010-05-15 04:57:22 +02:00
|
|
|
|
2016-02-14 06:29:46 +01:00
|
|
|
patch -p0 < $CWD/brlcad.patch
|
2013-11-22 06:30:35 +01:00
|
|
|
mkdir -p build
|
|
|
|
cd build
|
2011-06-04 05:33:38 +02:00
|
|
|
# There is a "known issue" according to the guys on #brlcad and we need
|
2013-11-22 06:30:35 +01:00
|
|
|
# the cmake define "-DBRLCAD_ENABLE_STRICT=OFF" for now
|
2016-02-14 06:29:46 +01:00
|
|
|
LDFLAGS="-lpng16" \
|
2013-11-22 06:30:35 +01:00
|
|
|
cmake \
|
|
|
|
-DBRLCAD_FLAGS_OPTIMIZATION=ON \
|
|
|
|
-DBRLCAD_ENABLE_STRICT=OFF \
|
|
|
|
-DBRLCAD_FLAGS_DEBUG=OFF \
|
2013-11-28 00:23:41 +01:00
|
|
|
-DBRLCAD_FLAGS_ENABLE_RUNTIME_DEBUG=OFF \
|
|
|
|
-DBRLCAD_ENABLE_OPENGL=ON \
|
2013-11-22 06:30:35 +01:00
|
|
|
-DBRLCAD_BUNDLED_LIBS=OFF \
|
2013-11-28 00:23:41 +01:00
|
|
|
-DBRLCAD_REGEX=SYSTEM \
|
2015-02-09 01:54:12 +01:00
|
|
|
-DBRLCAD_TERMLIB=BUNDLED \
|
2013-11-28 00:23:41 +01:00
|
|
|
-DBRLCAD_XMLLINT=SYSTEM \
|
|
|
|
-DBRLCAD_XSLTPROC=SYSTEM \
|
|
|
|
-DBRLCAD_ZLIB=SYSTEM \
|
|
|
|
-DBRLCAD_TCL=BUNDLED \
|
|
|
|
-DBRLCAD_TK=BUNDLED \
|
|
|
|
-DBRLCAD_ITCL=BUNDLED \
|
|
|
|
-DBRLCAD_ITK=BUNDLED \
|
|
|
|
-DBRLCAD_IWIDGETS=BUNDLED \
|
|
|
|
-DBRLCAD_LEMON=BUNDLED \
|
|
|
|
-DBRLCAD_LIBVDS=BUNDLED \
|
|
|
|
-DBRLCAD_OPENNURBS=BUNDLED \
|
|
|
|
-DBRLCAD_PERPLEX=BUNDLED \
|
2016-02-14 06:29:46 +01:00
|
|
|
-DBRLCAD_PNG=OFF \
|
2013-11-28 00:23:41 +01:00
|
|
|
-DBRLCAD_RE2C=BUNDLED \
|
|
|
|
-DBRLCAD_SCL=BUNDLED \
|
|
|
|
-DBRLCAD_TKHTML=BUNDLED \
|
|
|
|
-DBRLCAD_TKPNG=BUNDLED \
|
|
|
|
-DBRLCAD_TKTABLE=BUNDLED \
|
|
|
|
-DBRLCAD_UTAHRLE=BUNDLED \
|
2013-11-22 06:30:35 +01:00
|
|
|
-DCMAKE_INSTALL_PREFIX=/opt/$PRGNAM \
|
|
|
|
-DMAN_DIR=man \
|
|
|
|
-DDATA_DIR=share \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
|
|
|
|
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" ..
|
2010-05-15 04:57:22 +02:00
|
|
|
|
|
|
|
make
|
|
|
|
make install DESTDIR=$PKG
|
|
|
|
|
2013-11-22 06:30:35 +01:00
|
|
|
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
2010-05-15 04:57:22 +02:00
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
|
|
|
|
2010-08-27 03:53:30 +02:00
|
|
|
find $PKG/opt/$PRGNAM/man -type f -exec gzip -9 {} \;
|
|
|
|
for i in $( find $PKG/opt/$PRGNAM/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
|
2010-05-15 04:57:22 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/etc/profile.d/
|
|
|
|
cat $CWD/profile.d/$PRGNAM.sh > $PKG/etc/profile.d/$PRGNAM.sh
|
|
|
|
cat $CWD/profile.d/$PRGNAM.csh > $PKG/etc/profile.d/$PRGNAM.csh
|
|
|
|
chmod 0755 $PKG/etc/profile.d/*
|
|
|
|
|
|
|
|
# Copy icon & desktop file to package
|
|
|
|
mkdir -p $PKG/usr/share/{applications,pixmaps}
|
2011-03-30 03:37:06 +02:00
|
|
|
cat $CWD/${PRGNAM}_mged.desktop > $PKG/usr/share/applications/${PRGNAM}_mged.desktop
|
|
|
|
cat $CWD/${PRGNAM}_archer.desktop > $PKG/usr/share/applications/${PRGNAM}_archer.desktop
|
2010-05-15 04:57:22 +02:00
|
|
|
cat $CWD/$PRGNAM.png > $PKG/usr/share/pixmaps/$PRGNAM.png
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
cat $CWD/README.SLACKWARE > $PKG/usr/doc/$PRGNAM-$VERSION/README.SLACKWARE
|
2011-03-30 03:37:06 +02:00
|
|
|
cd $PKG/usr/doc/$PRGNAM-$VERSION
|
2010-06-13 21:16:47 +02:00
|
|
|
for sub in doc html; do
|
2011-12-26 07:11:21 +01:00
|
|
|
ln -s ../../../opt/$PRGNAM/share/$sub
|
2010-06-13 21:16:47 +02:00
|
|
|
done
|
2011-03-30 03:37:06 +02:00
|
|
|
cd -
|
2010-05-15 04:57:22 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
|
|
|
|
|
|
|
cd $PKG
|
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|