You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

279 lines
8.4 KiB

8 years ago
#!/bin/sh
# Generated by Alien's SlackBuild Toolkit: http://slackware.com/~alien/AST
# Copyright 2009, 2010, 2011, 2012, 2013, 2014, 2015 Eric Hameleers, Eindhoven, Netherlands
# Copyright 2015-2017 Thorn Inurcide
# Copyright 2015-2017 tde-slackbuilds project on GitHub
8 years ago
# 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=inkscape
## store version for later use to set $version for package name -
## too late for log file name, but sort that out when Sl current is released as Sl 15
## and this script updated for v1.x.x only
echo 0.92.4 > $TMPVARS/INKSC_VERS && {
## v 1.0.2 for Slackware current
[[ $(ls /var/log/packages/poppler-*) == *-2[1-9].* ]] && echo 1.0.2 > $TMPVARS/INKSC_VERS ; }
VERSION=$(cat $TMPVARS/INKSC_VERS)
8 years ago
BUILD=${BUILD:-1}
ARCHIVE_TYPE="tar.bz2" && [[ $VERSION == 1.0.2 ]] && ARCHIVE_TYPE="tar.xz"
SRCURL="https://media.inkscape.org/dl/resources/file/$PRGNAM-$VERSION.$ARCHIVE_TYPE"
source ../../get-source.sh
## inkscape v1.0.2 for Slackware current needs gdl and double-conversion
# ### gdl and double-conversion - start
[[ $(ls /var/log/packages/poppler-*) == *-2[1-9].* ]] && {
## If they are already installed, go to end
[[ -s /usr/local/lib$LIBDIRSUFFIX/libgdl-3.so ]] && \
[[ -s /usr/local/lib$LIBDIRSUFFIX/libdouble-conversion.so ]] || {
## otherwise, if the source archives are in 'src' ..
[[ -s $BUILD_TDE_ROOT/src/gdl-3.34.0.tar.xz ]] && \
[[ -s $BUILD_TDE_ROOT/src/double-conversion-3.1.5.tar.gz ]] && {
## .. build, package, and install them
(
## gdl:
echo -e "\n building gdl \n"
cd /$TMP_BUILD
rm -rf *gdl*
tar xf $BUILD_TDE_ROOT/src/gdl-3.34.0.tar.xz
cd gdl-3.34.0
LOCALES=$(cat po/LINGUAS)
rm po/LINGUAS
for locale in $I18N
do
[[ $LOCALES == *$locale* ]] && echo $locale >> po/LINGUAS
done
[[ $(cat $TMPVARS/BuildOptions) == *no_warn* ]] && C_Flags='CFLAGS=-w'
./configure --libdir=/usr/local/lib$LIBDIRSUFFIX ${C_Flags:-}
PKG=$TMP_BUILD/package-gdl
make_fn
cd $TMP_BUILD/package-gdl
makepkg -l y -c n $OUTPUT/gdl-3.34.0-$ARCH-$BUILD.txz
installpkg $OUTPUT/gdl-3.34.0-$ARCH-$BUILD.txz
## double-conversion:
echo -e "\n building double-conversion \n"
cd /$TMP_BUILD
rm -rf *double-conversion*
tar xf $BUILD_TDE_ROOT/src/double-conversion-3.1.5.tar.gz
cd double-conversion-3.1.5/
cd cmake/
# LIBDIRSUFFIX not required - builds to lib$LIBDIRSUFFIX ..
cmake ${G_NINJA:-} ../ -DBUILD_SHARED_LIBS=ON
PKG=$TMP_BUILD/package-double-conversion
make_fn
cd $TMP_BUILD/package-double-conversion
makepkg -l y -c n $OUTPUT/double-conversion-3.1.5-$ARCH-$BUILD.txz
installpkg $OUTPUT/double-conversion-3.1.5-$ARCH-$BUILD.txz
)
echo -e "\n returning to building inkscape \n"
} || { ## .. but if the source archives aren't in 'src', display message ..
echo -e "\n ############ \n\n\033[39;1m gdl and/or double-conversion are not installed and are required for this build \n \033[34;1m
Download:
\n wget -O $BUILD_TDE_ROOT/src/gdl-3.34.0.tar.xz https://download.gnome.org/sources/gdl/3.34/gdl-3.34.0.tar.xz
\n wget -O $BUILD_TDE_ROOT/src/double-conversion-3.1.5.tar.gz https://github.com/google/double-conversion/archive/v3.1.5.tar.gz
\n and re-run this script .. \n\n \033[0m ############ \n" ; exit 1 ; }
}
}
# ### gdl and double-conversion - end
getsource_fn
8 years ago
untar_fn
8 years ago
## install to .../lib64 on 64-bit system
## add -DLIB_SUFFIX=$LIBDIRSUFFIX to cmake
[[ -d /lib64 ]] && \
{ ## set RPATH
sed -i 's|ORIGIN/../lib/inkscape|ORIGIN/../lib${LIB_SUFFIX}/inkscape|' CMakeLists.txt
## set output directory
sed -i 's|/lib |/lib${LIB_SUFFIX} |' CMakeLists.txt
## for dynamic lib
sed -i 's|lib/inkscape|lib${LIB_SUFFIX}/inkscape|' src/CMakeLists.txt
## for static libs
sed -i 's|lib/inkscape|lib${LIB_SUFFIX}/inkscape|' CMakeScripts/HelperMacros.cmake
}
## only build for required locales
# ### TODO tidy up when Sl 15 released and v0.92.4 no longer built
{
## set up a directory to store the required locale files temporarily
TEMP_DIR=$TMP_BUILD/tmp-$PRGNAM/loc_tmp
mkdir $TEMP_DIR
## .. for po/LINGUAS
LOCALES=$(cat po/LINGUAS)
rm po/LINGUAS
for locale in $I18N
do
[[ $LOCALES == *$locale* ]] && \
echo $locale >> po/LINGUAS
done
## .. for translations
locas="" ## for slack-desc
for locale in $I18N
do
mv po/$locale.po $TEMP_DIR && locas="$locas $locale"
done
rm -rf po/*.po
mv $TEMP_DIR/* po/
## .. for READMEs
for locale in $I18N
do
mv README.$locale.txt $TEMP_DIR
done
rm README.*.txt
mv $TEMP_DIR/* .
RM_LIST=$(ls -1 README*)
## .. for keys.*.html
for locale in $I18N
do
mv doc/keys.$locale.html $TEMP_DIR
done
rm doc/keys.*.html
mv $TEMP_DIR/* doc/
KEYS_LIST=$(ls -1 doc/keys.*)
## .. for tutorials
for locale in $I18N
do
mv share/tutorials/*.$locale.* $TEMP_DIR
done
rm share/tutorials/*.*.*
mv $TEMP_DIR/* share/tutorials/
## .. for templates
for locale in $I18N
do
mv share/templates/*.$locale.* $TEMP_DIR
done
rm share/templates/*.*.*
mv $TEMP_DIR/* share/templates/
} || true
8 years ago
listdocs_fn
chown_fn
cd_builddir_fn
## default options have been pulled from CMakeLists.txt
## These next two determine the RPATH for the inkscape library relative to the binary:
## INKSCAPE_INSTALL_LIBDIR is an addition for v1.0.2 and is relative to CMAKE_INSTALL_PREFIX/
## LIB_SUFFIX is used for v0.92.4
# ### TODO docs and man to /usr/local ..
cmake ${G_NINJA:-} \
-DCMAKE_C_FLAGS="$SLKCFLAGS" \
-DCMAKE_CXX_FLAGS="$SLKCFLAGS" \
-DCMAKE_C_COMPILER=$COMPILER \
-DCMAKE_CXX_COMPILER=$COMPILER_CXX \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DINKSCAPE_INSTALL_LIBDIR=lib$LIBDIRSUFFIX/inkscape \
-DLIB_SUFFIX=$LIBDIRSUFFIX \
-DBUILD_SHARED_LIBS="ON" \
-DENABLE_BINRELOC="OFF" \
-DENABLE_LCMS="ON" \
-DENABLE_POPPLER="ON" \
-DENABLE_POPPLER_CAIRO="ON" \
-DWITH_ASAN="OFF" \
-DWITH_DBUS="OFF" \
-DWITH_FUZZ="OFF" \
-DWITH_GNOME_VFS="ON" \
-DWITH_GRAPHICS_MAGICK="ON" \
-DWITH_GTK3_EXPERIMENTAL="OFF" \
-DWITH_GTKSPELL="OFF" \
-DWITH_IMAGE_MAGICK="ON" \
-DWITH_INKJAR="ON" \
-DWITH_JEMALLOC="OFF" \
-DWITH_LIBCDR="ON" \
-DWITH_LIBVISIO="ON" \
-DWITH_LIBWPG="ON" \
-DWITH_LPETOOL="OFF" \
-DLPE_ENABLE_TEST_EFFECTS="OFF" \
-DWITH_MANPAGE_COMPRESSION="ON" \
-DWITH_NLS="ON" \
-DWITH_OPENMP="ON" \
-DWITH_PROFILING="OFF" \
-DWITH_SVG2="ON" \
-Wno-dev \
..
make_fn
8 years ago
installdocs_fn
## only package man pages for required locales
mkdir -p $PKG/usr/man/man1/
mv $PKG/usr/local/share/man/man1/* $PKG/usr/man/man1/
rm -rf $PKG/usr/local/share/man
{ for locale in $I18N
do
[[ -s $PKG/usr/man/man1/inkscape.$locale.1 ]] && mv $PKG/usr/man/man1/inkscape.$locale.1 $TEMP_DIR
done
rm $PKG/usr/man/man1/inkscape.*.1
mv $TEMP_DIR/* $PKG/usr/man/man1/
rm -rf $TEMP_DIR
} || true
INSTALL_TDE=/usr
mangzip_fn
8 years ago
strip_fn
8 years ago
mkdir_install_fn
8 years ago
INSTALL_TDE=/usr/local
doinst_sh_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 ':'.
|-----handy-ruler------------------------------------------------------|
$PRGNAM: Inkscape (Open Source vector graphics editor)
$PRGNAM:
$PRGNAM: Inkscape is an Open Source vector graphics editor, with capabilities
$PRGNAM: similar to Illustrator, Freehand, CorelDraw, or Xara X using the W3C
$PRGNAM: standard Scalable Vector Graphics (SVG) file format.
$PRGNAM:
$PRGNAM: With language support for:
$PRGNAM: en$locas
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
" > $PKG/install/slack-desc
makepkg_fn