Modified koffice.SlackBuild as detailed in issue 37 to fix chalk crash.

pull/7/head
Ray-V 7 years ago
parent fb2c49da11
commit 8ff281e6a2

@ -25,14 +25,57 @@
PRGNAM=koffice
VERSION=${VERSION:-$TDEVERSION}
BUILD=${BUILD:-1}
BUILD=${BUILD:-2}
TAG=${TAG:-_tde}
## if GraphicsMagick not chosen in BUILD-TDE.sh, set up build to use ImageMagick
[[ ${USE_GM_LIBS:-} != yes ]] && IM_LDFLAGS=$($(which Magick++-config) --libs)
## build with libpng-1.4 - set in BUILD-TDE.sh - loading pngs in chalk/krita crashes with libpng16
[[ ${USE_PNG14:-} == yes ]] && \
[[ $(ls -l /usr/include/png.h) != *libpng14* ]] && \
{ [[ $(getconf LONG_BIT) == 64 ]] && ARCH=x86_64 || ARCH=i686
} && \
{ installpkg $LIBPNG_TMP/libpng-1.4.20-$ARCH-1.txz || \
{ echo -e "\033[39;1m\n (re)install libpng-1.4 \n\033[0m" && \
exit
}
} || true
source ../../get-source.sh
getsource_fn
untar_fn
## fix chalk crashing - set liblcms as a direct dependency - see issue 37 for details
sed -i '2iLCMS1LIBS = -llcms' chalk/Makefile.am
sed -i 's|LDADD) \\$(LIBS)|& \\$(LCMS1LIBS)|' admin/am_edit
## fix chalk crashing when launched from Applications menu
sed -i "s|Exec=.*$|Exec=$INSTALL_TDE/bin/chalk %U|" chalk/chalk.desktop
## revert name 'chalk' to 'krita' - set in BUILD-TDE.sh
[[ ${REVERT:-} == yes ]] && APP=krita && \
(echo -e "\n Reverting chalk to krita .. \n"
## Rename directories and files:
mv chalk krita
for file in $(find . -name "*chalk*")
do
rename chalk krita $file 2>/dev/null || true # errors will be corrected next loop
done
## repeat for instances of 'chalk' appearing twice:
for file in $(find . -name "*chalk*")
do
rename chalk krita $file
done
mv "krita/doc/Developing Chalk Plugins.odt" "krita/doc/Developing Krita Plugins.odt"
## Rename contents:
find . -type f -exec sed -i -e 's/chalk/krita/g' {} \;
find . -type f -exec sed -i -e 's/CHALK/KRITA/g' {} \;
find . -type f -exec sed -i -e 's/Chalk/Krita/g' {} \;
sed -i 's|Swedish for krita|Swedish for chalk|' krita/README)
listdocs_fn
ltoolupdate_fn
@ -42,7 +85,7 @@ chown_fn
cd_builddir_fn
# Refusing to compile with Clang =[
LDFLAGS="${SLKLDFLAGS} $($(which Magick++-config) --libs)" \
LDFLAGS="${SLKLDFLAGS} ${IM_LDFLAGS:-}" \
CFLAGS="${SLKCFLAGS} $TQT_INCLUDE_PATH" \
CXXFLAGS="${SLKCFLAGS}" \
CC="gcc" \
@ -52,8 +95,7 @@ CXX="g++" \
--sysconfdir="/etc/trinity" \
--mandir=${INSTALL_TDE}/man \
--disable-rpath \
--enable-closure \
--build=$ARCH-slackware-linux
--enable-closure
make_fn
@ -71,7 +113,7 @@ echo "
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
$PRGNAM|-----handy-ruler------------------------------------------------------|
$PRGNAM: $PRGNAM (Office Suite)
$PRGNAM:
$PRGNAM: KOffice is a collection of office applications linked together by a
@ -97,8 +139,9 @@ if [ -d usr/share/icons/hicolor ]; then
chroot . /usr/bin/gtk-update-icon-cache -f -t ${INSTALL_TDE}/share/icons/hicolor 1> /dev/null 2> /dev/null
fi
fi
EOINS
makepkg_fn
## restore libpng16 links
[[ ${USE_PNG14:-} == yes ]] && libpng16_fn || true

@ -69,6 +69,7 @@ build_core()
# These need to be set here:
export INST=1
TMP=${TMP:-/tmp}
export LIBPNG_TMP=$TMP
ROOT=$(pwd)
@ -355,7 +356,8 @@ Non-TDE apps are in the Misc category and don't need the \Zb\Zr\Z4R\Znequired TD
"Apps/knemo" "The TDE Network Monitor" off "\Zb\Z6 \Zn" \
"Apps/knights" "A graphical chess interface" off "\Zb\Z6 \Zn" \
"Apps/knmap" "A graphical nmap interface" off "\Zb\Z6 Might need tdesudo \Zn" \
"Apps/koffice" "Office Suite" off "\Zb\Z6 \Zn" \
" Misc/GraphicsMagick" "Swiss army knife of image processing" off "\Zb\Z6 Buildtime option for chalk[krita] \Zn" \
"Apps/koffice" "Office Suite" off "\Zb\Z6 Optional build-time dependencies - GraphicsMagick/libpng14 [for chalk/krita] \Zn" \
"Apps/koffice-i18n" "Internationalization files for koffice" off "\Zb\Z6 Required for koffice when \Zb\Z3Additional language support\Zb\Z6 has been selected \Zn" \
"Apps/ksensors" "A graphical interface for sensors" off "\Zb\Z6 Runtime requirement ap/lm_sensors \Zn" \
"Apps/kscope" "A source-editing environment for C and C-style languages." off "\Zb\Z6 Runtime options cscope [d/cscope], ctags [ap/vim], dot [graphviz] \Zn" \
@ -372,13 +374,50 @@ Non-TDE apps are in the Misc category and don't need the \Zb\Zr\Z4R\Znequired TD
"Apps/tdeio-locate" "TDE frontend for the locate command" off "\Zb\Z6 \Zn" \
"Apps/tdesudo" "Graphical frontend for the sudo command" off "\Zb\Z6 \Zn" \
"Apps/twin-style-crystal" "twin theme" off "\Zb\Z6 \Zn" \
" Misc/GraphicsMagick" "Swiss army knife of image processing" off "\Zb\Z6 \Zn" \
" Misc/inkscape" "SVG editor" off "\Zb\Z6 Requires lxml if online help facility is required. \Zn" \
" Misc/lxml" "Python bindings for libxml2 and libxslt" off "\Zb\Z6 Required to use Inkscape online help \Zn" \
2> $TMPVARS/TDEbuilds
# successful builds are removed from the TDEbuilds list by '$dir ' so add a space to the last entry
# and the " needs to be removed because the Misc entries are double-quoted
sed -i -e 's|$| |' -e 's|"||g' $TMPVARS/TDEbuilds
## only run this if building koffice has been selected
[[ $(sed 's|koffice-||' $TMPVARS/TDEbuilds | grep -o Apps/koffice) ]] && \
{
rm -f $TMPVARS/Krita_OPTS
dialog --nocancel --no-shadow --colors --title " Building chalk in koffice " --item-help --checklist \
"\n
There are three options that can be set up for building the imaging app in koffice.
\n\n
[1] It is called \Zb\Z3chalk\Zn in TDE but is known as \Zb\Z3krita\Zn most other places.
\n\n
[2] .pngs loaded into chalk/krita will crash if it is built with libpng-1.6, but will load if libpng-1.4 is used for the build.
\n
If libpng is chosen here, it will be added to the build list and the package placed in $TMP - not installed. It will then be installed by koffice.SB if the libpng unversioned headers and libs are not linked to libpng14.
\n
The koffice.SB will restore those links to libpng16 when the build has finished or failed.
\n\n
[3] The build will prefer ImageMagick to GraphicsMagick if both are installed but many image formats crash with IM, so GM is recommended.
\n
If GM is chosen here, that preference will be overridden and GM will be added to the build list if not already selected or installed." \
28 75 3 \
" krita" "Set the app name to krita" on "\Zb\Z6 otherwise will be \Zb\Z3chalk\Zn \Zb\Z6 \Zn" \
" libpng14" "Build with libpng-1.4" on "\Zb\Z6 otherwise will be \Zb\Z3libpng-1.6\Zn \Zb\Z6 \Zn" \
" useGM" "Use GraphicsMagick" on "\Zb\Z6 otherwise will be \Zb\Z3ImageMagick\Zn \Zb\Z6[if installed] \Zn" \
2> $TMPVARS/Krita_OPTS
## If GM has been selected and isn't in the build list or installed, add it to the build list before koffice
GM_VERSION=$(grep VERSION:- $ROOT/Misc/GraphicsMagick/GraphicsMagick.SlackBuild|cut -d- -f2|cut -d} -f1)
[[ $(cat $TMPVARS/Krita_OPTS) == *useGM* ]] && \
[[ $(cat $TMPVARS/TDEbuilds) != *GraphicsMagick* ]] && \
[[ ! $(ls /var/log/packages/GraphicsMagick-${GM_VERSION}* 2>/dev/null) ]] && \
sed -i 's|Apps/koffice|Misc/GraphicsMagick &|' $TMPVARS/TDEbuilds
## If libpng-1.4 has been selected and hasn't already been built, add it to the build list before koffice
PNG_VERSION=$(grep VERSION:- $ROOT/Misc/libpng/libpng.SlackBuild|cut -d- -f2|cut -d} -f1)
[[ $(cat $TMPVARS/Krita_OPTS) == *libpng14* ]] && \
[[ ! $(ls $LIBPNG_TMP/libpng-${PNG_VERSION}-*-1.txz 2>/dev/null) ]] && \
sed -i 's|Apps/koffice|Misc/libpng &|' $TMPVARS/TDEbuilds
}
}
[[ ! -e $TMPVARS/TDEbuilds ]] && run_dialog
@ -409,7 +448,7 @@ Setup is complete.
\n\n
\Z1S\Zb\Z0tart\Zn building the packages or \Zr\Z4\ZbAbort\Zn" \
9 75
[[ $(echo $?) == 1 ]] && echo && echo && echo "Build aborted" && echo && exit 1
[[ $(echo $?) == 1 ]] && echo -e "\n\nBuild aborted\n" && exit 1
echo
######################
@ -425,6 +464,10 @@ export I18N=$(cat $TMPVARS/I18N)
export TQT_DOCS=$(cat $TMPVARS/TQT_DOCS)
export EXIT_FAIL=$(cat $TMPVARS/EXIT_FAIL)
export KEEP_BUILD=$(cat $TMPVARS/KEEP_BUILD)
# these exports are for koffice.SB
[[ $(cat $TMPVARS/Krita_OPTS 2>/dev/null) == *krita* ]] && export REVERT=yes
[[ $(cat $TMPVARS/Krita_OPTS 2>/dev/null) == *useGM* ]] && export USE_GM_LIBS=yes
[[ $(cat $TMPVARS/Krita_OPTS 2>/dev/null) == *libpng14* ]] && export USE_PNG14=yes
# See which compiler was selected and use the appropriate C++ compiler
[[ $(cat $TMPVARS/COMPILER) == gcc ]] && export COMPILER_CXX="g++" || export COMPILER_CXX="clang++"
@ -485,24 +528,39 @@ do
checkinstall ()
{
if [[ $(ls /var/log/packages/${package}-*$(eval echo $version)-*-${build}*) ]]; then
sed -i "s|$dir ||" $TMPVARS/TDEbuilds
else
## test for what package is being built ..
## if it's not libpng, test for the package installed
## otherwise test for the libpng package only, not installed
{
{
[[ ${package} != libpng ]] && [[ $(ls /var/log/packages/${package}-*$(eval echo $version)-*-${build}* 2>/dev/null) ]]
} || {
[[ ${package} == libpng ]] && [[ $(ls $LIBPNG_TMP/${package}-$(eval echo $version)-*-${build}*.txz 2>/dev/null) ]]
}
} && \
## if either test is successful, the above will exit 0, then remove 'package' from the build list \
sed -i "s|$dir ||" $TMPVARS/TDEbuilds || \
## if unsuccessful, display error message \
{
echo "
Error: ${package} package build failed
Check the build log $TMP/${package}-build-log
"
## if koffice was building with libpng14, restore the libpng16 headers for any following builds
[[ ${USE_PNG14:-} == yes ]] && source $ROOT/get-source.sh && libpng16_fn || true
${EXIT_FAIL:-":"}
fi
}
}
# tde-i18n package installation is handled in tde-i18n.SlackBuild because if more than one i18n package is being built, only the last one will be installed by upgradepkg
## tidy-html5 is a special case because the version number is not in the archive name
## create libpng-1.4 package only - it will be installed by the koffice.SB because it overrides libpng headers which for Sl14.2/current point to libpng16.
[[ ${package} == tidy-html5 ]] && version=$(unzip -c tidy-html5-master.zip | grep -A 1 version.txt | tail -n 1)
if [[ $INST == 1 ]] && [[ ${package} != tde-i18n ]]; then upgradepkg --install-new --reinstall $TMP/${package}-$(eval echo $version)-*-${build}*.txz
if [[ $INST == 1 ]] && [[ ${package} != tde-i18n ]] && [[ ${package} != libpng ]]; then upgradepkg --install-new --reinstall $TMP/${package}-$(eval echo $version)-*-${build}*.txz
checkinstall
## test for last language in the I18N list to ensure they've all been built
elif [[ $INST == 1 ]] && [[ ${package} == tde-i18n ]]; then package=${package}-$(cat $TMPVARS/LASTLANG)
checkinstall
elif [[ ${package} == libpng ]]; then checkinstall
fi
# back to original directory

@ -24,11 +24,12 @@
# SUCH DAMAGE.
PRGNAM=GraphicsMagick
VERSION=${VERSION:-1.3.21}
VERSION=${VERSION:-1.3.25}
BUILD=${BUILD:-1}
TAG=${TAG:-}
SRCURL="http://downloads.sourceforge.net/graphicsmagick/${PRGNAM}-${VERSION}.tar.bz2"
SRCURL="https://downloads.sourceforge.net/project/graphicsmagick/graphicsmagick/${VERSION}/GraphicsMagick-${VERSION}.tar.xz"
ARCHIVE_TYPE="tar.xz"
source ../../get-source.sh
getsource_fn

@ -0,0 +1,83 @@
#!/bin/sh
# Copyright 2015-2017 tde-slackbuilds project on GitHub
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software for
# any purpose with or without fee is hereby granted, provided that
# the above copyright notice and this permission notice appear in all
# copies.
#
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 AUTHORS AND COPYRIGHT HOLDERS AND THEIR
# CONTRIBUTORS 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.
PRGNAM=libpng
VERSION=${VERSION:-1.4.20}
BUILD=${BUILD:-1}
TAG=${TAG:-}
SRCURL="https://downloads.sourceforge.net/project/libpng/libpng14/$VERSION/libpng-$VERSION.tar.xz"
ARCHIVE_TYPE="tar.xz"
source ../../get-source.sh
getsource_fn
untar_fn
listdocs_fn
chown_fn
cd_builddir_fn
CFLAGS="$SLKCFLAGS" \
../configure \
--prefix=/usr \
--sysconfdir=/etc \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--includedir=/usr/include \
--mandir=/usr/man \
--disable-static
make_fn
installdocs_fn
mangzip_fn
strip_fn
mkdir_install_fn
echo "
# HOW TO EDIT THIS FILE:
# The 'handy ruler' below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
$PRGNAM|-----handy-ruler------------------------------------------------------|
$PRGNAM: $PRGNAM (Portable Network Graphics library)
$PRGNAM:
$PRGNAM: PNG (Portable Network Graphics) is an extensible file format for the
$PRGNAM: lossless, portable, well-compressed storage of raster images. PNG
$PRGNAM: provides a patent-free replacement for GIF and can also replace many
$PRGNAM: common uses of TIFF. Indexed-color, grayscale, and truecolor images
$PRGNAM: are supported, plus an optional alpha channel. Sample depths range
$PRGNAM: from 1 to 16 bits.
$PRGNAM:
$PRGNAM:
$PRGNAM:
" > $PKG/install/slack-desc
makepkg_fn

@ -235,3 +235,16 @@ cat $PKG/install/slack-desc | grep "^${PRGNAM}" | grep -v handy > $OUTPUT/${PRGN
umask ${_UMASK_}
}
libpng16_fn ()
{
(cd /usr/bin
ln -sf libpng16-config libpng-config )
(cd /usr/include
ln -sf libpng16/pngconf.h pngconf.h
ln -sf libpng16/png.h png.h )
(cd /usr/lib64/pkgconfig
ln -sf libpng16.pc libpng.pc )
(cd /usr/lib64
ln -sf libpng16.so libpng.so
ln -sf libpng16.la libpng.la )
}

Loading…
Cancel
Save