GIMP 2.9.6

Dopo una lunga battaglia sono riuscito, non so bene come, a compilare gimp all’ultima versione disponibile sul repository sulla mia slackware current, giusto in concomitanza con la notizia del rilascio della versione 2.9.6


Ci sono ancora delle cose da sistemare perchè non tutto funziona a dovere.

Allego lo script derivato da quello di igorek7

#!/bin/sh

# Slackware build script for the Development Version of the GIMP+BABL+GEGL
# SlackBuild Version: 160710
#
# Copyright 2008, 2009, 2010, 2011 Patrick J. Volkerding, Sebeka, MN, USA
# Copyright 2015 igor29768 AT gmail.com
# Copyright 2017 Giorgio Peron <giorgio.peron@gmail.com>, Belluno, Italy
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#
# To compile a development version of gimp-2.9
# Based on discussions at:
# http://gimp.1065349.n5.nabble.com/building-GIMP-from-git-td46202.html
# https://mail.gnome.org/archives/gimp-developer-list/2015-February/msg00051.html
# http://ninedegreesbelow.com/photography/build-gimp-in-prefix-for-artists.html
# http://crunchbang.org/forums/viewtopic.php?id=25716
# http://www.gimp.org/source/howtos/gimp-git-build.html
# 160710 Added libmypaint-gegl from git since gimp now requires ver.1.3

PKGNAM="gimp2p9"
SRCNAM="gimp"
VERSION=`date +%g%m%d`
#VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
BUILD=${BUILD:-1}
TAG=${TAG:-gperon}
LIBMYPAINTGIT="6477ad3"
BUILDBABL=${BUILDBABL:-"no"}
BUILDGEGL=${BUILDGEGL:-"no"}
BUILDMYPAINT=${BUILDMYPAINT:-"no"}

# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) export ARCH=i486 ;;
arm*) export ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) export ARCH=$( uname -m ) ;;
esac
fi

NUMJOBS=${NUMJOBS:-" -j7 "}

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-gimp
OUTPUT=${OUTPUT:-/tmp}
BRANCH="2.9"
PREFIX="/opt/gimp-${BRANCH}"

rm -rf $PKG
mkdir -p $TMP $PKG

if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "s390" ]; then
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi

# Establish the prefix
export PATH=${PREFIX}/bin:$PATH
export LD_LIBRARY_PATH=${PREFIX}/lib${LIBDIRSUFFIX}:$LD_LIBRARY_PATH
#export XDG_DATA_DIRS=${PREFIX}/share:$XDG_DATA_DIRS
#export ACLOCAL_FLAGS="-I $PREFIX/share/aclocal"
export PKG_CONFIG_PATH=${PREFIX}/lib${LIBDIRSUFFIX}/pkgconfig:$PKG_CONFIG_PATH
export GIO_EXTRA_MODULES=/usr/lib${LIBDIRSUFFIX}/gio/modules

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
#mkdir -p $PREFIX/share/aclocal
#touch $PREFIX/share/aclocal/gimp-2.0.m4

cd $TMP
#
#rm -rf gimp-$VERSION
#tar xvf $CWD/gimp-$VERSION.tar.?z* || exit 1
#cd gimp-$VERSION || exit 1
#
#
# Getting the Development versions of BABL & GEGL
#########
# BABL
#########
if [ $BUILDBABL = "yes" ]; then
if [ ! -e babl ]; then
git clone git://git.gnome.org/babl babl
cd babl
else
cd babl
make clean
git pull --rebase
fi

CFLAGS="$SLKCFLAGS" \
LDFLAGS="-Wl,-rpath -Wl,${PREFIX}/lib${LIBDIRSUFFIX}" \
./autogen.sh --prefix=${PREFIX} \
--libdir=${PREFIX}/lib${LIBDIRSUFFIX} \
--disable-docs \
--build=$ARCH-slackware-linux
make ${NUMJOBS}
make install
make install DESTDIR=$PKG || exit 1
# Added 170220
libtool --finish ${PREFIX}/lib64
#libtool --finish ${PREFIX}/lib64/babl-0.1
cd ..
fi

#########
# GEGL
#########
if [ $BUILDGEGL = "yes" ]; then
if [ ! -e gegl ]; then
git clone git://git.gnome.org/gegl gegl
cd gegl
else
cd gegl
make clean
git pull --rebase
fi

export BINUTILS_LD=bfd

#PKG_CONFIG_PATH="${PREFIX}/lib${LIBDIRSUFFIX}/pkgconfig" \
#LDFLAGS="-Wl,-rpath -Wl,${PREFIX}/lib${LIBDIRSUFFIX}" \
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="${SLKCFLAGS}" \
CPPFLAGS="${CPPFLAGS} $(pkg-config lensfun libspiro --cflags-only-I)" \
./autogen.sh --prefix=${PREFIX} \
--libdir=${PREFIX}/lib${LIBDIRSUFFIX} \
--with-cairo \
--with-graphviz \
--with-libjpeg \
--with-libopenraw \
--with-libpng \
--with-librsvg \
--with-libspiro \
--with-libv4l \
--with-lua \
--without-exiv2 \
--with-openexr \
--with-pango --with-pangocairo \
--with-sdl \
--enable-gtk-doc-html=no --disable-workshop \
--without-libavformat --without-vala \
--disable-docs \
--build=$ARCH-slackware-linux

sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

## #[ -f gegl/gegl-0.3.deps ] || echo 'Babl-0.1' > gegl/gegl-0.3.deps
## BABL_CFLAGS="-I$PKG/${PREFIX}/include/babl-0.1" \
#./configure --prefix=${PREFIX} \
#
make ${NUMJOBS}
make install
make install DESTDIR=$PKG || exit 1
cd ..

/sbin/ldconfig
fi

#########
# libmypaint
#########
# 160710 Added libmypaint from git
# 170706 Attempt to fix the branch to 1.3 for now
# Getting the Development versions of libmypaint
if [ $BUILDMYPAINT == "yes" ]; then
if [ ! -e libmypaint ]; then
git clone https://github.com/mypaint/libmypaint.git libmypaint
git checkout $LIBMYPAINTGIT
cd libmypaint
else
cd libmypaint
git checkout $LIBMYPAINTGIT
make clean
git pull --rebase
fi

CFLAGS="$SLKCFLAGS -I${PREFIX}/include/gegl-0.3 -I${PREFIX}/include/babl-0.1" \
PKG_CONFIG_PATH="${PREFIX}/lib${LIBDIRSUFFIX}/pkgconfig" \
LDFLAGS="-Wl,${PREFIX}/lib${LIBDIRSUFFIX}" \
./autogen.sh

# Added 170220
libtool --finish ${PREFIX}/lib64/

CFLAGS="$SLKCFLAGS" \
./configure \
--libdir=${PREFIX}/lib${LIBDIRSUFFIX} \
--enable-gegl \
--disable-docs \
--build=$ARCH-slackware-linux
make ${NUMJOBS}
make install
make install DESTDIR=$PKG || exit 1
cd ..
fi

#########
# GIMP
#########
#if [ ! -e $PRGNAM ]; then
# git clone git://git.gnome.org/gimp ${PRGNAM}
# cd $PRGNAM
#else
# cd $PRGNAM
# git pull
#fi
if [ ! -e $SRCNAM ]; then
git clone git://git.gnome.org/gimp
cd $SRCNAM
else
cd $SRCNAM
make clean
git pull --rebase
fi

chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;

CFLAGS="${SLKCFLAGS} -fno-strict-aliasing -I${PREFIX}/include/libmypaint" \
CXXFLAGS="${SLKCFLAGS} -fno-strict-aliasing -I${PREFIX}/include/libmypaint" \
PKG_CONFIG_PATH="${PREFIX}/lib${LIBDIRSUFFIX}/pkgconfig" \
LDFLAGS="-Wl,-rpath -Wl,${PREFIX}/lib${LIBDIRSUFFIX}" \
./autogen.sh --prefix=${PREFIX} \
--libdir=${PREFIX}/lib${LIBDIRSUFFIX} \
--sysconfdir=${PREFIX}/etc \
--localstatedir=/var/lib \
--mandir=${PREFIX}/man \
--infodir=${PREFIX}/info \
--docdir=${PREFIX}/doc/gimp-$VERSION \
--disable-silent-rules \
--disable-static \
--with-gudev \
--with-poppler \
--with-libmng \
--with-libjasper \
--with-libxpm \
--with-alsa \
--with-script-fu \
--with-cairo-pdf \
--build=$ARCH-slackware-linux

make $NUMJOBS || exit 1
mkdir -p ${PKG}/usr/share/applications ${PKG}/usr/share/application-registry
make install DESTDIR=$PKG || exit 1

# Add a manpage symlink for POLA-compliance
( cd $PKG/${PREFIX}/man/man1 ; ln -sf gimptool-2.?.1 gimptool.1 )

# Compress and link manpages, if any:
if [ -d $PKG/${PREFIX}/man ]; then
( cd $PKG/${PREFIX}/man
for manpagedir in $(find . -type d -name "man*") ; do
( cd $manpagedir
for eachpage in $( find . -type l -maxdepth 1) ; do
ln -s $( readlink $eachpage ).gz $eachpage.gz
rm $eachpage
done
gzip -9 *.?
)
done
)
fi

mkdir -p ${PKG}${PREFIX}/doc/gimp-$VERSION
cp -a \
AUTHORS COPYING* HACKING INSTALL LICENSE NEWS README* docs/Wilber* \
${PKG}${PREFIX}/doc/gimp-$VERSION
( cd ${PKG}${PREFIX}/doc/gimp-$VERSION
for i in \
libgimp libgimpbase libgimpcolor libgimpconfig libgimpmath \
libgimpmodule libgimpthumb libgimpwidgets ; do \
ln -s /${PREFIX}/share/gtk-doc/html/$i $i-html ;
done
)

# If there's a ChangeLog, installing at least part of the recent history
# is useful, but don't let it get totally out of control:
if [ -r ChangeLog ]; then
DOCSDIR=$(echo ${PKG$}{PREFIX}/doc/*-$VERSION)
cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
touch -r ChangeLog $DOCSDIR/ChangeLog
fi

find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null

mv ${PKG}${PREFIX}/share/applications/${SRCNAM}.desktop ${PKG}/usr/share/applications/${PKGNAM}.desktop
sed -i "s#Exec=#Exec=${PREFIX}/bin/#g" ${PKG}/usr/share/applications/${PKGNAM}.desktop
sed -i "s#GNU Image Manipulation Program#GIMP 2.9#g" ${PKG}/usr/share/applications/${PKGNAM}.desktop
desktop-file-install --delete-original --vendor="" \
--dir ${PKG}/usr/share/applications \
--remove-category="Application" \
--add-mime-type="image/x-xpm" \
--add-mime-type="image/x-xcf-gimp" \
--add-mime-type="image/x-ico" \
--add-mime-type="image/vnd.microsoft.icon" \
--add-mime-type="video/x-mng" \
--add-mime-type="image/vnd.adobe.photoshop" \
--add-mime-type="image/x-bmp" \
--add-mime-type="image/x-dds" \
${PKG}/usr/share/applications/${PKGNAM}.desktop || exit 1

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat ${CWD}/slack-required > ${PKG}/install/slack-required
install -m 755 ${CWD}/gimp-git ${PKG}${PREFIX}/bin/
cat > ${PKG}/install/doinst.sh < /dev/null 2> /dev/null
fi
if [ -x usr/bin/gtk-update-icon-cache ]; then
\${CHROOT} /usr/bin/touch --no-create /usr/share/icons/hicolor >/dev/null 2>&1
\${CHROOT} /usr/bin/gtk-update-icon-cache -q /usr/share/icons/hicolor > /dev/null 2>&1
fi
EOF

sed -i "s|${SRCNAM}|${PKGNAM}|g" ${PKG}/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PKGNAM-$VERSION-$ARCH-$BUILD.txz

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.