2021-07-03 19:48:15 +02:00
|
|
|
#!/bin/bash
|
2011-01-01 07:16:02 +01:00
|
|
|
|
|
|
|
# Slackware build script for cairo-compmgr
|
|
|
|
|
|
|
|
# Written by Geoff Ritter <geoff dot ritter at gmail dot com>
|
|
|
|
# This script is public domain. Use at your own risk.
|
|
|
|
|
2021-07-04 11:41:06 +02:00
|
|
|
cd $(dirname $0) ; CWD=$(pwd)
|
|
|
|
|
2011-01-01 07:16:02 +01:00
|
|
|
PRGNAM=cairo-compmgr
|
|
|
|
VERSION=${VERSION:-0.3.0}
|
2012-09-28 04:34:17 +02:00
|
|
|
BUILD=${BUILD:-3}
|
2011-01-01 07:16:02 +01:00
|
|
|
TAG=${TAG:-_SBo}
|
2021-07-04 12:23:38 +02:00
|
|
|
PKGTYPE=${PKGTYPE:-tgz}
|
2011-01-01 07:16:02 +01:00
|
|
|
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2021-07-04 12:23:38 +02:00
|
|
|
# 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 "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2011-01-01 07:16:02 +01:00
|
|
|
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"
|
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
fi
|
|
|
|
|
2012-09-17 01:02:00 +02:00
|
|
|
set -e
|
2011-01-01 07:16:02 +01:00
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
2013-11-22 08:37:19 +01:00
|
|
|
find -L . \
|
2011-01-01 07:16:02 +01:00
|
|
|
-type d -exec chmod 0755 {} \; -o \
|
|
|
|
-type f -perm /111 -exec chmod 755 {} \; -o \
|
|
|
|
-type f -exec chmod 644 {} \;
|
|
|
|
|
|
|
|
if pkg-config --exists libgtop-2.0 ; then
|
|
|
|
WITH_PERF=YES
|
|
|
|
perf_flags="--enable-perf-plugin"
|
|
|
|
else
|
|
|
|
perf_flags="--disable-perf-plugin"
|
2017-08-11 21:44:23 +02:00
|
|
|
sed -i -e '/schema_install ccm-perf.schemas/d' $CWD/doinst.sh
|
2011-01-01 07:16:02 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
# If vala changes the name of the pkgconfig file from libvala-0.12.pc,
|
|
|
|
# then this patch will have to be changed. It works with vala-0.11.2.
|
2012-09-17 01:02:00 +02:00
|
|
|
patch -p1 < $CWD/patches/fixup-vala-requirement.patch
|
|
|
|
|
|
|
|
# Fix underlinking
|
|
|
|
patch -p1 < $CWD/patches/cairo-compmgr-fix-link.patch
|
|
|
|
patch -p1 < $CWD/patches/cairo-compmgr-link-gmodule.patch
|
|
|
|
patch -p1 < $CWD/patches/cairo-compmgr-link-libICE.patch
|
2011-01-01 07:16:02 +01:00
|
|
|
|
|
|
|
# gobject introspection will not be 'stable' until GTK+3
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
2016-03-29 23:03:15 +02:00
|
|
|
CPPFLAGS="-I/usr/include/libiberty" \
|
2011-01-01 07:16:02 +01:00
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
|
|
|
--enable-shared \
|
|
|
|
--disable-static \
|
|
|
|
--disable-gobject-introspection \
|
|
|
|
--build=$ARCH-slackware-linux \
|
2012-09-17 01:02:00 +02:00
|
|
|
--enable-gconf \
|
|
|
|
--with-gconf-source=\"xml::/etc/gconf/gconf.xml.defaults\" \
|
|
|
|
--disable-schemas-install \
|
2011-01-01 07:16:02 +01:00
|
|
|
${perf_flags}
|
|
|
|
|
|
|
|
make
|
|
|
|
make install DESTDIR=$PKG
|
|
|
|
|
|
|
|
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
|
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
|
|
|
|
|
|
|
find $PKG/usr/man -type f -exec gzip -9 {} \;
|
|
|
|
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
|
|
|
|
|
|
|
|
# Install an icon to the proper location and format the desktop file correctly
|
|
|
|
mkdir -p $PKG/usr/share/icons/hicolor/64x64/apps/
|
|
|
|
cp $PKG/usr/share/pixmaps/cairo-compmgr/cairo-compmgr.png \
|
|
|
|
$PKG/usr/share/icons/hicolor/64x64/apps/cairo-compmgr.png
|
|
|
|
sed -i -e 's/Icon=.*/Icon=cairo-compmgr/' \
|
|
|
|
$PKG/usr/share/applications/cairo-compmgr.desktop
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2017-04-12 09:03:05 +02:00
|
|
|
cp -a AUTHORS COPYING ChangeLog INSTALL NEWS $PKG/usr/doc/$PRGNAM-$VERSION
|
2011-01-01 07:16:02 +01:00
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
|
|
|
|
|
|
|
cd $PKG
|
2021-07-04 12:23:38 +02:00
|
|
|
/sbin/makepkg -p -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
|