source: npl/X/gtk+2/gtk+2.SlackBuild.orig @ c5c522c

gcc484ntopperl-5.22
Last change on this file since c5c522c was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100755
File size: 6.3 KB
Line 
1#!/bin/sh
2
3# Copyright 2008, 2009, 2010, 2011, 2012, 2013  Patrick J. Volkerding, Sebeka, MN, USA
4# All rights reserved.
5#
6# Redistribution and use of this script, with or without modification, is
7# permitted provided that the following conditions are met:
8#
9# 1. Redistributions of this script must retain the above copyright
10#    notice, this list of conditions and the following disclaimer.
11#
12#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
13#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
15#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
16#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
17#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
18#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
19#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
20#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
21#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22
23
24VERSION=${VERSION:-$(echo gtk+-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
25BUILD=${BUILD:-3}
26
27NUMJOBS=${NUMJOBS:-" -j7 "}
28
29# Automatically determine the architecture we're building on:
30if [ -z "$ARCH" ]; then
31  case "$( uname -m )" in
32    i?86) export ARCH=i586 ;;
33    arm*) export ARCH=arm ;;
34    # Unless $ARCH is already set, use uname -m for all other archs:
35       *) export ARCH=$( uname -m ) ;;
36  esac
37fi
38
39CWD=$(pwd)
40TMP=${TMP:-/tmp}
41PKG=$TMP/package-gtk2
42
43if [ "$ARCH" = "i586" ]; then
44  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
45  LIBDIRSUFFIX=""
46elif [ "$ARCH" = "s390" ]; then
47  SLKCFLAGS="-O2"
48  LIBDIRSUFFIX=""
49elif [ "$ARCH" = "x86_64" ]; then
50  SLKCFLAGS="-O2 -fPIC"
51  LIBDIRSUFFIX="64"
52else
53  SLKCFLAGS="-O2"
54  LIBDIRSUFFIX=""
55fi
56
57rm -rf $PKG
58mkdir -p $TMP $PKG/usr
59cd $TMP
60rm -rf gtk+-$VERSION
61tar xvf $CWD/gtk+-$VERSION.tar.?z* || exit 1
62cd gtk+-$VERSION
63
64chown -R root:root .
65find . \
66  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
67  -exec chmod 755 {} \; -o \
68  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
69  -exec chmod 644 {} \;
70
71# Fix build errors
72zcat $CWD/fix_build_issues_on_tutorial_and_faq.diff.gz | patch -p1 --verbose || exit 1
73
74# Do not flood the console or .xsession-errors with "trouble ahead"
75# warnings (most noticable when using Firefox and Flash):
76zcat $CWD/gtk.xid.nowarningflood.diff.gz | patch -p1 --verbose || exit 1
77
78# Patch to restore commonly used icon names, otherwise everything breaks.
79# I fail to see the point of this "cleanup"
80zcat $CWD/gtk+-2.24.x.icon-compat.am.diff.gz | patch -p1 --verbose || exit 1
81zcat $CWD/gtk+-2.24.x.icon-compat.diff.gz | patch -p1 --verbose || exit 1
82
83# Prevents build failures in the docs.  Found online.
84# Only needed if autoreconf is used...  ?
85zcat $CWD/gtk.gtk-faq.diff.gz | patch -p1 --verbose || exit 1
86zcat $CWD/gtk.gtk-tut.diff.gz | patch -p1 --verbose || exit 1
87
88# Regenerate ./configure:
89libtoolize --force
90autoreconf -vif
91
92# Autoconf changes linux to linux-gnu.
93# Our host is $ARCH-slackware-linux not $ARCH-slackware-linux-gnu:
94sed -i -e 's#linux|linux-gnu|#linux|linux|#' config.sub
95
96CFLAGS="$SLKCFLAGS" \
97./configure \
98  --prefix=/usr \
99  --libdir=/usr/lib${LIBDIRSUFFIX} \
100  --sysconfdir=/etc \
101  --mandir=/usr/man \
102  --with-xinput=yes \
103  --enable-xkb \
104  --enable-introspection \
105  --build=$ARCH-slackware-linux
106
107make $NUMJOBS || make || exit 1
108
109# Check the host value that is passed to the compile to the one in this script:
110host="$ARCH-slackware-linux"
111compile_host=$(grep 'host_triplet =' gtk/Makefile | sed -e "s/.* = //")
112if [ "x$compile_host" != "x$host" ]; then
113  echo "Host mismatch: compile='$compile_host', SlackBuild='$host'" && exit 1
114fi
115
116make install \
117  RUN_QUERY_IMMODULES_TEST=false RUN_QUERY_LOADER_TEST=false \
118  DESTDIR=$PKG \
119  || exit 1
120
121# Don't clobber im-multipress.conf
122mv $PKG/etc/gtk-2.0/im-multipress.conf $PKG/etc/gtk-2.0/im-multipress.conf.new || exit 1
123
124# Install a "starter" gtkrc
125# /etc/gtk-2.0/gtkrc overrides this  --rworkman
126echo 'gtk-theme-name="GTK+"' > $PKG/usr/share/gtk-2.0/gtkrc
127
128# We need to have separate 32-bit and 64-bit binaries
129# for places where we have two copies of the GTK+ package installed.
130# (we might have x86_64 and i486 packages on the same system, for example.)
131case "$host" in
132  s390x*|x86_64*)
133   mv $PKG/usr/bin/gtk-query-immodules-2.0{,-64}
134   ( cd $PKG/usr/bin
135     ln -sf gtk-query-immodules-2.0-64 gtk-query-immodules-2.0
136   )
137   ;;
138  *)
139   mv $PKG/usr/bin/gtk-query-immodules-2.0{,-32}
140   ( cd $PKG/usr/bin
141     ln -sf gtk-query-immodules-2.0-32 gtk-query-immodules-2.0
142   )
143   ;;
144esac
145
146# Install wrappers for the binaries:
147cp -a $CWD/update-gtk-immodules* $PKG/usr/bin
148chown root:root $PKG/usr/bin/update-*
149chmod 0755 $PKG/usr/bin/update-*
150
151# Add profile scripts to set up GTK+ environment:
152mkdir -p $PKG/etc/profile.d
153cp -a $CWD/profile.d/* $PKG/etc/profile.d
154chmod 0755 $PKG/etc/profile.d/*
155
156# Strip binaries:
157( cd $PKG
158  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
159  find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
160)
161
162# Compress and if needed symlink the man pages:
163if [ -d $PKG/usr/man ]; then
164  ( cd $PKG/usr/man
165    for manpagedir in $(find . -type d -name "man*") ; do
166      ( cd $manpagedir
167        for eachpage in $( find . -type l -maxdepth 1) ; do
168          ln -s $( readlink $eachpage ).gz $eachpage.gz
169          rm $eachpage
170        done
171        gzip -9 *.?
172      )
173    done
174  )
175fi
176
177mkdir -p $PKG/usr/doc/gtk+-$VERSION
178cp -a \
179  AUTHORS COPYING* NEWS README* TODO \
180  $PKG/usr/doc/gtk+-$VERSION
181( cd $PKG/usr/doc/gtk+-$VERSION
182  ln -s ../../share/gtk-doc/html/gail-libgail-util .
183  ln -s ../../share/gtk-doc/html/gdk .
184  ln -s ../../share/gtk-doc/html/gtk .
185)
186
187# If there's a ChangeLog, installing at least part of the recent history
188# is useful, but don't let it get totally out of control:
189if [ -r ChangeLog ]; then
190  DOCSDIR=$(echo $PKG/usr/doc/*-$VERSION)
191  cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
192  touch -r ChangeLog $DOCSDIR/ChangeLog
193fi
194
195mkdir -p $PKG/install
196cat $CWD/slack-desc > $PKG/install/slack-desc
197zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
198
199cd $PKG
200/sbin/makepkg -l y -c n $TMP/gtk+2-$VERSION-$ARCH-$BUILD.txz
201
Note: See TracBrowser for help on using the repository browser.