#!/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=${VERSION:-0.92.3} 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 [[ -d /lib64 ]] && \ { ## set RPATH sed -i "s|ORIGIN/../lib/inkscape|ORIGIN/../lib$LIBDIRSUFFIX/inkscape|" CMakeLists.txt ## set output directory sed -i "s|/lib |/lib$LIBDIRSUFFIX |" CMakeLists.txt ## for dynamic lib sed -i "s|lib/inkscape|lib$LIBDIRSUFFIX/inkscape|" src/CMakeLists.txt ## for static libs sed -i "s|lib/inkscape|lib$LIBDIRSUFFIX/inkscape|" CMakeScripts/HelperMacros.cmake } ## only build for required locales { ## .. for po/LINGUAS LOCALES=$(cat po/LINGUAS) rm po/LINGUAS for locale in $I18N do [[ $LOCALES == *$locale* ]] && \ echo $locale >> po/LINGUAS done ## set up a directory to store the required locale files temporarily TEMP_DIR=$TMP_BUILD/tmp-$PRGNAM/loc_tmp mkdir $TEMP_DIR ## .. 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 translations for locale in $I18N do mv po/$locale.po $TEMP_DIR done rm -rf po/*.po mv $TEMP_DIR/* po/ ## .. 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 ## https://gitlab.com/inkscape/inkscape/commit/a600c6438fef2f4c06f9a4a7d933d99fb054a973 ## Fix compilation with poppler 0.64 echo $'--- src/extension/internal/pdfinput/pdf-parser.cpp +++ src/extension/internal/pdfinput/pdf-parser.cpp @@ -2585,1 +2585,1 @@ -void PdfParser::doShowText(GooString *s) { +void PdfParser::doShowText(const GooString *s) { @@ -2604,1 +2604,1 @@ - builder->beginString(state, s); + builder->beginString(state); @@ -2634,1 +2634,1 @@ - p = s->getCString(); + p = g_strdup(s->getCString()); @@ -2689,1 +2689,1 @@ - p = s->getCString(); + p = g_strdup(s->getCString()); @@ -2735,1 +2735,1 @@ - char *name = args[0].getName(); + char *name = g_strdup(args[0].getName()); --- src/extension/internal/pdfinput/pdf-parser.h +++ src/extension/internal/pdfinput/pdf-parser.h @@ -290,1 +290,1 @@ - void doShowText(GooString *s); + void doShowText(const GooString *s); --- src/extension/internal/pdfinput/svg-builder.cpp +++ src/extension/internal/pdfinput/svg-builder.cpp @@ -1023,1 +1023,1 @@ - _font_specification = font->getName()->getCString(); + _font_specification = g_strdup(font->getName()->getCString()); @@ -1364,1 +1364,1 @@ -void SvgBuilder::beginString(GfxState *state, GooString * /*s*/) { +void SvgBuilder::beginString(GfxState *state) { --- src/extension/internal/pdfinput/svg-builder.h +++ src/extension/internal/pdfinput/svg-builder.h @@ -32,1 +32,0 @@ -class GooString; @@ -139,1 +138,1 @@ - void beginString(GfxState *state, GooString *s); + void beginString(GfxState *state); ' | while read line do patch -p0 done ## https://gitlab.com/inkscape/inkscape/commit/10e8ae0ff522d3a9caeed9a7f137cdfd795ba0a3 ## Fix compilation with poppler 0.65.0 ## replace unused includes with one that is actually used echo $'--- src/extension/internal/pdfinput/pdf-parser.cpp +++ src/extension/internal/pdfinput/pdf-parser.cpp @@ -40,2 +40,1 @@ -#include "goo/GooTimer.h" -#include "goo/GooHash.h" +#include "goo/GooString.h" ' | while read line do patch -p0 done chown_fn listdocs_fn cd_builddir_fn ## default options have been pulled from CMakeLists.txt cmake \ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ -DCMAKE_C_FLAGS_RELEASE:STRING="$SLKCFLAGS" \ -DCMAKE_CXX_FLAGS_RELEASE:STRING="$SLKCFLAGS" \ -DCMAKE_C_COMPILER=$COMPILER \ -DCMAKE_CXX_COMPILER=$COMPILER_CXX \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr/local \ -DWITH_NLS="ON" \ -DWITH_DBUS="OFF" \ -DENABLE_LCMS="ON" \ -DWITH_GNOME_VFS="ON" \ -DWITH_SVG2="ON" \ -DWITH_LPETOOL="OFF" \ -DWITH_INKJAR="ON" \ -DWITH_OPENMP="ON" \ -DWITH_PROFILING="OFF" \ -DENABLE_POPPLER="ON" \ -DENABLE_POPPLER_CAIRO="ON" \ -DWITH_IMAGE_MAGICK="ON" \ -DWITH_LIBCDR="ON" \ -DWITH_LIBVISIO="ON" \ -DWITH_LIBWPG="ON" \ -DWITH_GTK3_EXPERIMENTAL="OFF" \ -DENABLE_BINRELOC="OFF" \ .. make_fn ## only package man pages for required locales { for locale in $I18N do mv $PKG/usr/local/share/man/man1/inkscape.$locale.1 $TEMP_DIR done rm $PKG/usr/local/share/man/man1/inkscape.*.1 mv $TEMP_DIR/* $PKG/usr/local/share/man/man1/ } || true 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 ':'. |-----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: $PRGNAM: $PRGNAM: With language support for: $PRGNAM: en $(echo $(cat ../po/LINGUAS)) $PRGNAM: $PRGNAM: Homepage: http://www.inkscape.org/ " > $PKG/install/slack-desc cat <> $PKG/install/doinst.sh # Update the desktop database: if [ -x usr/bin/update-desktop-database ]; then chroot . /usr/bin/update-desktop-database /usr/local/share/applications > /dev/null 2>&1 fi # Update hicolor theme cache: if [ -d usr/share/icons/hicolor ]; then if [ -x /usr/bin/gtk-update-icon-cache ]; then chroot . /usr/bin/gtk-update-icon-cache -f -t /usr/local/share/icons/hicolor 1> /dev/null 2> /dev/null fi fi EOINS makepkg_fn