source: npl/X/gdk_pixbuf2/gdk-pixbuf2.SlackBuild.orig @ 7c410f9

Last change on this file since 7c410f9 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: 4.6 KB
Line 
1#!/bin/sh
2
3# Copyright 2010, 2011  Robby Workman, Northport, Alabama, USA
4# Copyright 2010, 2011  Patrick Volkerding, Sebeka, Minnesota, USA
5# All rights reserved.
6#
7# Redistribution and use of this script, with or without modification, is
8# permitted provided that the following conditions are met:
9#
10# 1. Redistributions of this script must retain the above copyright
11#    notice, this list of conditions and the following disclaimer.
12#
13#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
14#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
16#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
18#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
19#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
20#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
21#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
24PKGNAM=gdk-pixbuf
25VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
26BUILD=${BUILD:-1}
27
28# Automatically determine the architecture we're building on:
29if [ -z "$ARCH" ]; then
30  case "$( uname -m )" in
31    i?86) export ARCH=i586 ;;
32    arm*) export ARCH=arm ;;
33    # Unless $ARCH is already set, use uname -m for all other archs:
34       *) export ARCH=$( uname -m ) ;;
35  esac
36fi
37
38NUMJOBS=${NUMJOBS:-" -j7 "}
39
40CWD=$(pwd)
41TMP=${TMP:-/tmp}
42PKG=$TMP/package-$PKGNAM
43
44if [ "$ARCH" = "i586" ]; then
45  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
46  LIBDIRSUFFIX=""
47elif [ "$ARCH" = "i686" ]; then
48  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
49  LIBDIRSUFFIX=""
50elif [ "$ARCH" = "x86_64" ]; then
51  SLKCFLAGS="-O2 -fPIC"
52  LIBDIRSUFFIX="64"
53else
54  SLKCFLAGS="-O2"
55  LIBDIRSUFFIX=""
56fi
57
58rm -rf $PKG
59mkdir -p $TMP $PKG
60cd $TMP
61rm -rf $PKGNAM-$VERSION
62tar xvf $CWD/$PKGNAM-$VERSION.tar.xz || exit 1
63cd $PKGNAM-$VERSION || exit 1
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# There's been this long standing debate about PNG and -lz
72# and this patch is the workaround.  ;-)
73zcat $CWD/gdk-pixbuf.pnglz.diff.gz | patch -p1 || exit 1
74
75CFLAGS="$SLKCFLAGS" \
76CXXFLAGS="$SLKCFLAGS" \
77./configure \
78  --prefix=/usr \
79  --libdir=/usr/lib${LIBDIRSUFFIX} \
80  --sysconfdir=/etc \
81  --localstatedir=/var \
82  --mandir=/usr/man \
83  --docdir=/usr/doc/$PKGNAM-$VERSION \
84  --enable-introspection \
85  --with-x11 \
86  --build=$ARCH-slackware-linux
87
88make $NUMJOBS || make || exit 1
89make install DESTDIR=$PKG || exit 1
90
91# We need to have separate 32-bit and 64-bit binaries
92# for places where we have two copies of the GTK+ package installed.
93# (we might have x86_64 and i486 packages on the same system, for example.)
94host="$ARCH-slackware-linux"
95case "$host" in
96  s390x*|x86_64*)
97   mv $PKG/usr/bin/gdk-pixbuf-query-loaders{,-64}
98   ( cd $PKG/usr/bin
99     ln -sf gdk-pixbuf-query-loaders-64 gdk-pixbuf-query-loaders
100   )
101   ;;
102  *)
103   mv $PKG/usr/bin/gdk-pixbuf-query-loaders{,-32}
104   ( cd $PKG/usr/bin
105     ln -sf gdk-pixbuf-query-loaders-32 gdk-pixbuf-query-loaders
106   )
107   ;;
108esac
109
110# Install wrappers for the binaries:
111cp $CWD/update-gdk-pixbuf-loaders $PKG/usr/bin/update-gdk-pixbuf-loaders
112chmod 0755 $PKG/usr/bin/update-gdk-pixbuf-loaders
113
114find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
115  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
116
117# Compress and link manpages, if any:
118if [ -d $PKG/usr/man ]; then
119  ( cd $PKG/usr/man
120    for manpagedir in $(find . -type d -name "man*") ; do
121      ( cd $manpagedir
122        for eachpage in $( find . -type l -maxdepth 1) ; do
123          ln -s $( readlink $eachpage ).gz $eachpage.gz
124          rm $eachpage
125        done
126        gzip -9 *.?
127      )
128    done
129  )
130fi
131
132mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
133cp -a \
134  AUTHORS COPYING* INSTALL NEWS README* \
135  $PKG/usr/doc/$PKGNAM-$VERSION
136
137# If there's a ChangeLog, installing at least part of the recent history
138# is useful, but don't let it get totally out of control:
139if [ -r ChangeLog ]; then
140  DOCSDIR=$(echo $PKG/usr/doc/*-$VERSION)
141  cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
142  touch -r ChangeLog $DOCSDIR/ChangeLog
143fi
144
145mkdir -p $PKG/install
146cat $CWD/slack-desc > $PKG/install/slack-desc
147zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
148
149cd $PKG
150/sbin/makepkg -l y -c n $TMP/${PKGNAM}2-$VERSION-$ARCH-$BUILD.txz
151
Note: See TracBrowser for help on using the repository browser.