csb/zenity/zenity.SlackBuild
Willy Sudiarto Raharjo 11a24b54d4
zenity: Port to meson.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackware-id.org>
2022-06-16 18:09:28 +07:00

91 lines
2.3 KiB
Bash

#!/bin/sh
# Slackware build script for zenity
# Written by Larry Hajali <larryhaja[at]gmail[dot]com>
# Maintained by Erik Hanson <erik@slackbuilds.org>
# Modified by Willy Sudiarto Raharjo for CSB Project
PRGNAM=zenity
VERSION=${VERSION:-3.42.1}
BUILD=${BUILD:-1}
TAG=${TAG:-_csb}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
wget -c http://ftp.acc.umu.se/pub/gnome/sources/zenity/3.42/$PRGNAM-$VERSION.tar.xz
CWD=$(pwd)
TMP=${TMP:-/tmp/csb}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "aarch64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.?z*
cd $PRGNAM-$VERSION
chown -R root:root .
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 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
WEBKIT=false
pkg-config --exists webkit2gtk-4.0 && WEBKIT=true
mkdir build
cd build
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
meson .. \
--buildtype=release \
--infodir=/usr/info \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--localstatedir=/var \
--mandir=/usr/man \
--prefix=/usr \
--sysconfdir=/etc \
-Dlibnotify=true \
-Dwebkitgtk=$WEBKIT
ninja
DESTDIR=$PKG ninja install
cd ..
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
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a AUTHORS ChangeLog COPYING HACKING NEWS README THANKS TODO $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}