Browse Source

xap/inkscape: Added.

slackware-14.2
Damien Goutte-Gattat 13 years ago
parent
commit
474177c57f
  1. 1
      xap/inkscape/inkscape-0.46.tar.gz.sha1
  2. 210
      xap/inkscape/inkscape-r19369-poppler-fix.diff
  3. 127
      xap/inkscape/inkscape.SlackBuild
  4. 12
      xap/inkscape/slack-desc

1
xap/inkscape/inkscape-0.46.tar.gz.sha1

@ -0,0 +1 @@
b7c53c6d2bc0de4ff24d4a6bee86359ff11bef27 inkscape-0.46.tar.gz

210
xap/inkscape/inkscape-r19369-poppler-fix.diff

@ -0,0 +1,210 @@
diff -Naur inkscape-0.46.old/config.h.in inkscape-0.46/config.h.in
--- inkscape-0.46.old/config.h.in 2008-03-11 05:47:22.000000000 +0100
+++ inkscape-0.46/config.h.in 2008-12-17 11:30:09.000000000 +0100
@@ -222,6 +222,9 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
+/* True iff libpoppler is 0.8.3 or newer. */
+#undef POPPLER_NEW_GFXFONT
+
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
diff -Naur inkscape-0.46.old/configure inkscape-0.46/configure
--- inkscape-0.46.old/configure 2008-03-11 05:47:08.000000000 +0100
+++ inkscape-0.46/configure 2008-12-17 10:48:56.000000000 +0100
@@ -13298,6 +13298,34 @@
fi
+ink_svd_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$POPPLER_CFLAGS $CPPFLAGS"
+{ echo "$as_me:$LINENO: checking whether libpoppler has new getNextChar" >&5
+echo $ECHO_N "checking whether libpoppler has new getNextChar... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include "GfxFont.h"
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Unicode ..u. int .uLen" >/dev/null 2>&1; then
+
+cat >>confdefs.h <<\_ACEOF
+#define POPPLER_NEW_GFXFONT /**/
+_ACEOF
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "yes" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "no" >&6; }
+fi
+rm -f conftest*
+
+CPPFLAGS="$ink_svd_CPPFLAGS"
+
with_inkboard="no"
diff -Naur inkscape-0.46.old/src/extension/internal/pdfinput/pdf-parser.cpp inkscape-0.46/src/extension/internal/pdfinput/pdf-parser.cpp
--- inkscape-0.46.old/src/extension/internal/pdfinput/pdf-parser.cpp 2008-03-11 05:20:21.000000000 +0100
+++ inkscape-0.46/src/extension/internal/pdfinput/pdf-parser.cpp 2008-12-17 10:35:51.000000000 +0100
@@ -2191,6 +2191,145 @@
}
}
+
+#ifdef POPPLER_NEW_GFXFONT
+
+void PdfParser::doShowText(GooString *s) {
+ GfxFont *font;
+ int wMode;
+ double riseX, riseY;
+ CharCode code;
+ Unicode *u = NULL;
+ double x, y, dx, dy, dx2, dy2, curX, curY, tdx, tdy, lineX, lineY;
+ double originX, originY, tOriginX, tOriginY;
+ double oldCTM[6], newCTM[6];
+ double *mat;
+ Object charProc;
+ Dict *resDict;
+ Parser *oldParser;
+ char *p;
+ int len, n, uLen, nChars, nSpaces, i;
+
+ font = state->getFont();
+ wMode = font->getWMode();
+
+ builder->beginString(state, s);
+
+ // handle a Type 3 char
+ if (font->getType() == fontType3 && 0) {//out->interpretType3Chars()) {
+ mat = state->getCTM();
+ for (i = 0; i < 6; ++i) {
+ oldCTM[i] = mat[i];
+ }
+ mat = state->getTextMat();
+ newCTM[0] = mat[0] * oldCTM[0] + mat[1] * oldCTM[2];
+ newCTM[1] = mat[0] * oldCTM[1] + mat[1] * oldCTM[3];
+ newCTM[2] = mat[2] * oldCTM[0] + mat[3] * oldCTM[2];
+ newCTM[3] = mat[2] * oldCTM[1] + mat[3] * oldCTM[3];
+ mat = font->getFontMatrix();
+ newCTM[0] = mat[0] * newCTM[0] + mat[1] * newCTM[2];
+ newCTM[1] = mat[0] * newCTM[1] + mat[1] * newCTM[3];
+ newCTM[2] = mat[2] * newCTM[0] + mat[3] * newCTM[2];
+ newCTM[3] = mat[2] * newCTM[1] + mat[3] * newCTM[3];
+ newCTM[0] *= state->getFontSize();
+ newCTM[1] *= state->getFontSize();
+ newCTM[2] *= state->getFontSize();
+ newCTM[3] *= state->getFontSize();
+ newCTM[0] *= state->getHorizScaling();
+ newCTM[2] *= state->getHorizScaling();
+ state->textTransformDelta(0, state->getRise(), &riseX, &riseY);
+ curX = state->getCurX();
+ curY = state->getCurY();
+ lineX = state->getLineX();
+ lineY = state->getLineY();
+ oldParser = parser;
+ p = s->getCString();
+ len = s->getLength();
+ while (len > 0) {
+ n = font->getNextChar(p, len, &code,
+ &u, &uLen,
+ &dx, &dy, &originX, &originY);
+ dx = dx * state->getFontSize() + state->getCharSpace();
+ if (n == 1 && *p == ' ') {
+ dx += state->getWordSpace();
+ }
+ dx *= state->getHorizScaling();
+ dy *= state->getFontSize();
+ state->textTransformDelta(dx, dy, &tdx, &tdy);
+ state->transform(curX + riseX, curY + riseY, &x, &y);
+ saveState();
+ state->setCTM(newCTM[0], newCTM[1], newCTM[2], newCTM[3], x, y);
+ //~ the CTM concat values here are wrong (but never used)
+ //out->updateCTM(state, 1, 0, 0, 1, 0, 0);
+ if (0){ /*!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy,
+ code, u, uLen)) {*/
+ ((Gfx8BitFont *)font)->getCharProc(code, &charProc);
+ if ((resDict = ((Gfx8BitFont *)font)->getResources())) {
+ pushResources(resDict);
+ }
+ if (charProc.isStream()) {
+ //parse(&charProc, gFalse); // TODO: parse into SVG font
+ } else {
+ error(getPos(), "Missing or bad Type3 CharProc entry");
+ }
+ //out->endType3Char(state);
+ if (resDict) {
+ popResources();
+ }
+ charProc.free();
+ }
+ restoreState();
+ // GfxState::restore() does *not* restore the current position,
+ // so we deal with it here using (curX, curY) and (lineX, lineY)
+ curX += tdx;
+ curY += tdy;
+ state->moveTo(curX, curY);
+ state->textSetPos(lineX, lineY);
+ p += n;
+ len -= n;
+ }
+ parser = oldParser;
+
+ } else {
+ state->textTransformDelta(0, state->getRise(), &riseX, &riseY);
+ p = s->getCString();
+ len = s->getLength();
+ while (len > 0) {
+ n = font->getNextChar(p, len, &code,
+ &u, &uLen,
+ &dx, &dy, &originX, &originY);
+
+ if (wMode) {
+ dx *= state->getFontSize();
+ dy = dy * state->getFontSize() + state->getCharSpace();
+ if (n == 1 && *p == ' ') {
+ dy += state->getWordSpace();
+ }
+ } else {
+ dx = dx * state->getFontSize() + state->getCharSpace();
+ if (n == 1 && *p == ' ') {
+ dx += state->getWordSpace();
+ }
+ dx *= state->getHorizScaling();
+ dy *= state->getFontSize();
+ }
+ state->textTransformDelta(dx, dy, &tdx, &tdy);
+ originX *= state->getFontSize();
+ originY *= state->getFontSize();
+ state->textTransformDelta(originX, originY, &tOriginX, &tOriginY);
+ builder->addChar(state, state->getCurX() + riseX, state->getCurY() + riseY,
+ dx, dy, tOriginX, tOriginY, code, n, u, uLen);
+ state->shift(tdx, tdy);
+ p += n;
+ len -= n;
+ }
+ }
+
+ builder->endString(state);
+}
+
+#else /* !POPPLER_NEW_GFXFONT */
+
void PdfParser::doShowText(GooString *s) {
GfxFont *font;
int wMode;
@@ -2325,6 +2464,9 @@
builder->endString(state);
}
+#endif /* POPPLER_NEW_GFXFONT */
+
+
//------------------------------------------------------------------------
// XObject operators
//------------------------------------------------------------------------

127
xap/inkscape/inkscape.SlackBuild

@ -0,0 +1,127 @@
#!/bin/bash
# Build script for Slackware
# Damien Goutte-Gattat "gouttegd" < damien.goutte-gattat at e.ujf-grenoble.fr >
#
# Redistribution and use of this script, with or without modifications, 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.
#
# Latest inkscape sourcecode is available at:
# http://downloads.sourceforge.net/inkscape/
#
# Depends: l/gc,l/boost,gnome/gtkmm
# Source package infos
NAMESRC=${NAMESRC:-inkscape}
VERSION=${VERSION:-0.46}
ARCHIVE=${ARCHIVE:-$NAMESRC-$VERSION.tar.gz}
WGET=${WGET:-http://downloads.sourceforge.net/inkscape/$ARCHIVE}
# Built package infos
NAMETGZ=${NAMETGZ:-inkscape}
BUILD=${BUILD:-2GGD}
ARCH=${ARCH:-i486}
TARGET=${TARGET:-i486}
# Directories
TMP=${TMP:-/tmp}
OUT=${OUT:-$TMP/build}
PKG=${PKG:-$OUT/$NAMETGZ}
CWD=$(pwd)
set -e # Quit if a command returns non-zero
# Sanity checks
if [ $UID -eq 0 ]; then
echo "You should NOT run this script as ROOT!"
exit 1
fi
if [ ! -d $TMP ]; then
echo "$TMP does not exist or is not a directory!"
exit 1
fi
# Compilation flags
case "$ARCH" in
i?86)
CPUOPT="-O2 -march=$ARCH -mtune=i686"
;;
*)
CPUOPT="-O2"
;;
esac
# Get and verify the source archive
if [ ! -r $ARCHIVE ]; then
wget "$WGET"
fi
sha1sum -c $ARCHIVE.sha1
NAME=$(tar ft $ARCHIVE | head -1 | cut -d / -f 1)
# Extract
cd $TMP
echo "Building $ARCHIVE..."
tar xf $CWD/$ARCHIVE
cd $NAME
# Patch to compile against libpoppler >= 0.8.3
if [ -f $CWD/inkscape-r19369-poppler-fix.diff ]; then
patch -p1 < $CWD/inkscape-r19369-poppler-fix.diff
fi
# Compile
CFLAGS=$CPUOPT \
CXXFLAGS=$CPUOPT \
./configure \
--prefix=/usr \
--mandir=/usr/man \
--disable-dependency-tracking \
--enable-lcms \
--enable-poppler-cairo
make -j 3
make install DESTDIR=$PKG
# Strip binaries
find $PKG | xargs file | grep "ELF 32-bit LSB" | cut -d : -f 1 | \
xargs strip --strip-unneeded 2> /dev/null
# Compress man pages
find $PKG/usr/man -type f -exec gzip -9 {} \;
# Install the documentation
mkdir -p $PKG/usr/doc/$NAME
install -m 644 \
AUTHORS COPYING{,.LIB} ChangeLog HACKING.txt INSTALL NEWS \
README TRANSLATORS \
$PKG/usr/doc/$NAME
# Copy slack-desc file
install -D -m 644 $CWD/slack-desc $PKG/install/slack-desc
# Package the tree
cd $PKG
mkdir -p $OUT
PACKAGING="
chown root:root . -R
/sbin/makepkg -l y -c n $OUT/$NAMETGZ-$VERSION-$ARCH-$BUILD.tgz
rm -rf $PKG
rm -rf $TMP/$NAME
"
if type -p fakeroot ; then
echo "$PACKAGING" | fakeroot
else
su -c "$PACKAGING"
fi

12
xap/inkscape/slack-desc

@ -0,0 +1,12 @@
|-----handy-ruler------------------------------------------------------|
inkscape: inkscape (Vector drawing tool)
inkscape:
inkscape: Inkscape is an open source drawing tool with capabilities similar to
inkscape: Illustrator, Freehand, and CorelDraw that uses the W3C standard
inkscape: scalable vector graphics format (SVG).
inkscape:
inkscape:
inkscape:
inkscape:
inkscape:
inkscape:
Loading…
Cancel
Save