2022-08-08 23:29:31 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# This script is not meant to be run directly:
|
|
|
|
if [ -z $DEMOVERS ]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Now build/install a small subset of the demos:
|
|
|
|
export CWD SLKCFLAGS NUMJOBS PKG
|
|
|
|
( cd $TMP
|
|
|
|
rm -rf mesa-demos-$DEMOVERS
|
2025-01-22 20:54:48 +00:00
|
|
|
tar xvf $CWD/mesa-demos-$DEMOVERS.tar.?z || exit 1
|
2022-08-08 23:29:31 +00:00
|
|
|
cd mesa-demos-$DEMOVERS
|
2025-02-01 21:14:13 +00:00
|
|
|
|
|
|
|
# "Download" subprojects:
|
|
|
|
if [ -r $CWD/mesa-demos-subprojects.tar.lz ]; then
|
|
|
|
tar xvf $CWD/mesa-demos-subprojects.tar.lz || exit 1
|
|
|
|
fi
|
|
|
|
|
2022-08-08 23:29:31 +00:00
|
|
|
chown -R root:root .
|
|
|
|
find . \
|
|
|
|
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
|
|
|
|
-exec chmod 755 {} \+ -o \
|
|
|
|
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
|
|
|
|
-exec chmod 644 {} \+
|
2023-08-25 01:04:55 +00:00
|
|
|
# Architecture-specific settings can be configured in the mesa.SlackBuild
|
|
|
|
# within the variable 'SLK_MESADEMOS_CONF_OPTS'
|
2025-01-22 20:54:48 +00:00
|
|
|
export CFLAGS="$SLKCFLAGS"
|
|
|
|
export CXXFLAGS="$SLKCFLAGS"
|
|
|
|
mkdir meson-build
|
|
|
|
cd meson-build
|
|
|
|
meson setup \
|
2022-08-08 23:29:31 +00:00
|
|
|
--prefix=/usr \
|
2025-01-22 20:54:48 +00:00
|
|
|
--libdir=lib${LIBDIRSUFFIX} \
|
|
|
|
--libexecdir=/usr/libexec \
|
|
|
|
--bindir=/usr/bin \
|
|
|
|
--sbindir=/usr/sbin \
|
|
|
|
--includedir=/usr/include \
|
|
|
|
--datadir=/usr/share \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--buildtype=release \
|
|
|
|
$SLK_MESADEMOS_CONF_OPTS \
|
|
|
|
.. || exit 1
|
2025-02-01 21:14:13 +00:00
|
|
|
|
|
|
|
# If there's no mesa-subprojects.tar.lz in $CWD, let's try to make one:
|
|
|
|
if [ ! -r $CWD/mesa-demos-subprojects.tar.lz ]; then
|
|
|
|
cd ..
|
|
|
|
mkdir -p tmp/subprojects
|
|
|
|
for file in subprojects/* ; do
|
|
|
|
if [ "$file" -nt "$PKG" ]; then
|
|
|
|
cp -a -v $file tmp/subprojects
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
cd tmp
|
|
|
|
find . -name ".git*" -exec rm -r "{}" \; 2> /dev/null
|
|
|
|
tar cf $CWD/mesa-demos-subprojects.tar subprojects
|
|
|
|
plzip -9 $CWD/mesa-demos-subprojects.tar
|
|
|
|
cd ..
|
|
|
|
rm -r tmp
|
|
|
|
cd meson-build
|
|
|
|
fi
|
|
|
|
|
2025-01-22 20:54:48 +00:00
|
|
|
"${NINJA:=ninja}" $NUMJOBS || exit 1
|
|
|
|
# Install all the demos (including the pointless ones) at first, in a
|
|
|
|
# temporary location:
|
|
|
|
DESTDIR=$PKG/cruft $NINJA install || exit 1
|
|
|
|
cd ..
|
2022-08-08 23:29:31 +00:00
|
|
|
# Install gears and glinfo, as well as a few other demos:
|
|
|
|
mkdir -p $PKG/usr/bin
|
2023-08-25 01:04:55 +00:00
|
|
|
MESA_DEMO_BINS="${MESA_DEMO_BINS:=eglinfo gears glinfo glthreads glxcontexts glxdemo \
|
|
|
|
glxgears glxgears_fbconfig glxheads glxinfo glxpbdemo glxpixmap}"
|
|
|
|
# Install the demo:
|
|
|
|
for demo in $MESA_DEMO_BINS ; do
|
2022-08-08 23:29:31 +00:00
|
|
|
mv --verbose $PKG/cruft/usr/bin/$demo $PKG/usr/bin
|
|
|
|
done
|
|
|
|
# Remove cruft:
|
|
|
|
rm -rf $PKG/cruft
|
|
|
|
# Add the README file(s):
|
|
|
|
rm -rf $PKG/usr/doc/mesa-demos-$DEMOVERS
|
|
|
|
mkdir -p $PKG/usr/doc/mesa-demos-$DEMOVERS
|
|
|
|
cp -a README* $PKG/usr/doc/mesa-demos-$DEMOVERS
|
|
|
|
) || exit 1
|