summaryrefslogtreecommitdiff
path: root/source/x/freeglut
diff options
context:
space:
mode:
Diffstat (limited to 'source/x/freeglut')
-rwxr-xr-xsource/x/freeglut/freeglut.SlackBuild95
-rw-r--r--source/x/freeglut/slack-desc8
2 files changed, 67 insertions, 36 deletions
diff --git a/source/x/freeglut/freeglut.SlackBuild b/source/x/freeglut/freeglut.SlackBuild
index 0d5ecac2..d60a0bdb 100755
--- a/source/x/freeglut/freeglut.SlackBuild
+++ b/source/x/freeglut/freeglut.SlackBuild
@@ -1,8 +1,9 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for freeglut
# Copyright 2012 Robby Workman, Northport, Alabama, USA
+# Copyright 2016, 2018 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,26 +23,39 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-PRGNAM=freeglut
-VERSION=${VERSION:-2.8.1}
-BUILD=${BUILD:-1}
+cd $(dirname $0) ; CWD=$(pwd)
+
+PKGNAM=freeglut
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.xz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-2}
NUMJOBS=${NUMJOBS:-" -j7 "}
+# Automatically determine the architecture we're building on:
+MARCH=$( uname -m )
if [ -z "$ARCH" ]; then
- case "$( uname -m )" in
- i?86) ARCH=i486 ;;
- arm*) ARCH=arm ;;
- *) ARCH=$( uname -m ) ;;
+ case "$MARCH" in
+ i?86) export ARCH=i586 ;;
+ armv7hl) export ARCH=$MARCH ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$MARCH ;;
esac
fi
-CWD=$(pwd)
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
+ exit 0
+fi
+
TMP=${TMP:-/tmp}
-PKG=$TMP/package-$PRGNAM
+PKG=$TMP/package-$PKGNAM
-if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
@@ -57,9 +71,9 @@ fi
rm -rf $PKG
mkdir -p $TMP $PKG
cd $TMP
-rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$PRGNAM-$VERSION.tar.xz || exit 1
-cd $PRGNAM-$VERSION
+rm -rf $PKGNAM-$VERSION
+tar xvf $CWD/$PKGNAM-$VERSION.tar.xz || exit 1
+cd $PKGNAM-$VERSION
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -67,15 +81,39 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-CFLAGS="$SLKCFLAGS" \
-CXXFLAGS="$SLKCFLAGS" \
-./configure \
- --disable-static \
- --prefix=/usr \
- --libdir=/usr/lib${LIBDIRSUFFIX} \
- --sysconfdir=/etc \
- --localstatedir=/var \
- --build=$ARCH-slackware-linux || exit 1
+mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION/html
+cp -a \
+ AUTHORS COPYING* INSTALL NEWS README TODO \
+ $PKG/usr/doc/$PKGNAM-$VERSION
+cp -a doc/*.{html,png} $PKG/usr/doc/$PKGNAM-$VERSION/html
+find $PKG/usr/doc -type f -exec chmod 0644 {} \;
+
+mkdir -p build
+cd build
+ CFLAGS="$SLKCFLAGS" \
+ CXXFLAGS="$SLKCFLAGS" \
+ cmake \
+ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_C_FLAGS_RELEASE:STRING="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS_RELEASE:STRING="$SLKCFLAGS" \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DFREEGLUT_BUILD_DEMOS=ON \
+ -DFREEGLUT_BUILD_SHARED_LIBS=ON \
+ -DFREEGLUT_BUILD_STATIC_LIBS=OFF \
+ -DMAN_INSTALL_DIR=/usr/man \
+ -DLIB_SUFFIX=${LIBDIRSUFFIX} \
+ .. || exit 1
+
+#CFLAGS="$SLKCFLAGS" \
+#CXXFLAGS="$SLKCFLAGS" \
+#./configure \
+# --disable-static \
+# --prefix=/usr \
+# --libdir=/usr/lib${LIBDIRSUFFIX} \
+# --sysconfdir=/etc \
+# --localstatedir=/var \
+# --build=$ARCH-slackware-linux || exit 1
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG || exit 1
@@ -83,15 +121,8 @@ make install DESTDIR=$PKG || exit 1
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/html
-cp -a \
- AUTHORS COPYING* INSTALL NEWS README TODO \
- $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a doc/*.{html,png} $PKG/usr/doc/$PRGNAM-$VERSION/html
-find $PKG/usr/doc -type f -exec chmod 0644 {} \;
-
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
-/sbin/makepkg -l y -c n $TMP/$PRGNAM-$VERSION-$ARCH-$BUILD.txz
+/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
diff --git a/source/x/freeglut/slack-desc b/source/x/freeglut/slack-desc
index 9fcda6f5..8b5ba173 100644
--- a/source/x/freeglut/slack-desc
+++ b/source/x/freeglut/slack-desc
@@ -1,15 +1,15 @@
# HOW TO EDIT THIS FILE:
-# The "handy ruler" below makes it easier to edit a package description. Line
+# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
-# on the right side marks the last column you can put a character in. You must
-# make exactly 11 lines for the formatting to be correct. It's also
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
freeglut: freeglut (alternative GLUT library)
freeglut:
freeglut: freeglut is a completely OpenSourced alternative to the OpenGL
-freeglut: Utility Toolkit (GLUT) library. GLUT (and hence freeglut) allows
+freeglut: Utility Toolkit (GLUT) library. GLUT (and hence freeglut) allows
freeglut: the user to create and manage windows containing OpenGL contexts
freeglut: on a wide range of platforms and also read the mouse, keyboard, and
freeglut: joystick functions.