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.

194 lines
5.2 KiB

#!/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
# 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
VERSION=0.92.4
BUILD=${BUILD:-1}
SRCURL="https://media.inkscape.org/dl/resources/file/inkscape-$VERSION.tar.bz2"
ARCHIVE_TYPE="tar.bz2"
source ../../get-source.sh
getsource_fn
untar_fn
## 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
{
## 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
listdocs_fn
chown_fn
cd_builddir_fn
## default options have been pulled from CMakeLists.txt
cmake \
-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 \
-DLIB_SUFFIX=$LIBDIRSUFFIX \
-DENABLE_LCMS="ON" \
-DENABLE_POPPLER="ON" \
-DENABLE_POPPLER_CAIRO="ON" \
-DWITH_DBUS="OFF" \
-DWITH_GNOME_VFS="ON" \
-DWITH_SVG2="ON" \
-DWITH_LPETOOL="OFF" \
-DWITH_INKJAR="ON" \
-DWITH_OPENMP="ON" \
-DWITH_PROFILING="OFF" \
-DWITH_IMAGE_MAGICK="ON" \
-DWITH_LIBCDR="ON" \
-DWITH_LIBVISIO="ON" \
-DWITH_LIBWPG="ON" \
-DWITH_NLS="ON" \
-DWITH_GTK3_EXPERIMENTAL="OFF" \
-DWITH_GTKSPELL="OFF" \
-DENABLE_BINRELOC="OFF" \
-Wno-dev \
..
make_fn
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
strip_fn
mkdir_install_fn
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