desktop/gtk-chtheme: Fixed build error with new gtk+2 ; misc cleanup

This adds a patch to use modern gtk+2 API as well as using
RPM_OPT_FLAGS to use our SLKCFLAGS instead of having to sed
the Makefile.  The other changes are aesthetic only  :)

Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
This commit is contained in:
Robby Workman 2011-01-01 23:45:33 -06:00
parent c1906f2648
commit bf4727e8be
3 changed files with 40 additions and 22 deletions

View file

@ -0,0 +1,14 @@
Thanks to Fedora for the (simple) patch :)
--- gtk-chtheme-0.3.1/util.c~ 2004-02-08 14:42:33.000000000 +0100
+++ gtk-chtheme-0.3.1/util.c 2010-07-14 10:40:18.000000000 +0200
@@ -19,7 +19,8 @@
GtkWidget* unfocussable(GtkWidget *w)
{
- GTK_WIDGET_UNSET_FLAGS(w, GTK_CAN_FOCUS);
+ /* GTK_WIDGET_UNSET_FLAGS(w, GTK_CAN_FOCUS); */
+ gtk_widget_set_can_focus(w, FALSE);
return w;
}

View file

@ -26,7 +26,7 @@
PRGNAM=gtk-chtheme
VERSION=0.3.1
BUILD=${BUILD:-1}
BUILD=${BUILD:-2}
TAG=${TAG=_SBo}
# Automatically determine the architecture we're building on:
@ -46,39 +46,43 @@ OUTPUT=${OUTPUT:-/tmp}
DOCS="COPYING ChangeLog"
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
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP || exit 1
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvjf $CWD/$PRGNAM-$VERSION.tar.bz2
cd $PRGNAM-$VERSION || exit 1
tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
cd $PRGNAM-$VERSION
chown -R root:root .
chmod -R u+w,go+r-w,a-s .
# Rewrite CFLAGS
if [ "$ARCH" = "i486" ]; then
sed -i 's#CFLAGS += -Wall#CFLAGS += -O2 -march=i486 -mtune=i686#' $TMP/$PRGNAM-$VERSION/Makefile
elif [ "$ARCH" = "i686" ]; then
sed -i 's#CFLAGS += -Wall#CFLAGS += -O2 -march=i686 -mtune=i686#' $TMP/$PRGNAM-$VERSION/Makefile
elif [ "$ARCH" = "x86_64" ]; then
sed -i 's#CFLAGS += -Wall#CFLAGS += -O2 -fPIC#' $TMP/$PRGNAM-$VERSION/Makefile
fi
patch -p1 < $CWD/gtk-chtheme-0.3.1-new-api.patch
make || exit 1
make install DESTDIR=$PKG MANDIR=usr/man || exit 1
make RPM_OPT_FLAGS="$SLKCFLAGS"
make install DESTDIR=$PKG MANDIR=usr/man
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
( cd $PKG/usr/man
find . -type f -exec gzip -9 {} \;
find . -type f -exec chmod 644 {} \;
for i in $(find . -type l) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
)
find $PKG/usr/man -type f -exec gzip -9 {} \;
# Docs, slack-desc, buildscript
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install

View file

@ -7,4 +7,4 @@ DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
MAINTAINER="Andrew Brouwers"
EMAIL="abrouwers@gmail.com"
APPROVED="BP{k}"
APPROVED="BP{k},rworkman"