Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Florian Franzmann (07b24360311deef5c9354bfe709d53940c9d90d7)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Florian Franzmann <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Florian Franzmann (07b24360311deef5c9354bfe709d53940c9d90d7)
  • Date: Sun, 5 Feb 2012 07:48:05 -0600

GIT changes to master grimoire by Florian Franzmann
<siflfran AT hawo.stw.uni-erlangen.de>:

gnome2-apps/xournal/BUILD | 1
gnome2-apps/xournal/DEPENDS | 6 -
gnome2-apps/xournal/HISTORY | 8 +
gnome2-apps/xournal/compilation_flags | 26 +++++
gnome2-apps/xournal/pdf-export-64.patch | 89 ++++++++++++++++++
gnome2-apps/xournal/poppler-api.patch | 158
++++++++++++++++++++++++++++++++
6 files changed, 286 insertions(+), 2 deletions(-)

New commits:
commit 07b24360311deef5c9354bfe709d53940c9d90d7
Author: Florian Franzmann <siflfran AT hawo.stw.uni-erlangen.de>
Commit: Florian Franzmann <siflfran AT hawo.stw.uni-erlangen.de>

gnome2-apps/xournal: fixed build errors

diff --git a/gnome2-apps/xournal/BUILD b/gnome2-apps/xournal/BUILD
new file mode 100755
index 0000000..4936557
--- /dev/null
+++ b/gnome2-apps/xournal/BUILD
@@ -0,0 +1 @@
+LIBS+=" -lz -lX11" default_build
diff --git a/gnome2-apps/xournal/DEPENDS b/gnome2-apps/xournal/DEPENDS
index dad48eb..e0285d9 100755
--- a/gnome2-apps/xournal/DEPENDS
+++ b/gnome2-apps/xournal/DEPENDS
@@ -1,6 +1,8 @@
-depends gtk+2 &&
+depends gtk+2 &&
depends libgnomecanvas &&
-depends poppler &&
+depends poppler &&
+depends zlib &&
+depends libx11 &&
optional_depends ghostscript \
"--with-ghostscript" \
"--without-ghostscript" \
diff --git a/gnome2-apps/xournal/HISTORY b/gnome2-apps/xournal/HISTORY
index a696a47..e61443b 100644
--- a/gnome2-apps/xournal/HISTORY
+++ b/gnome2-apps/xournal/HISTORY
@@ -1,3 +1,11 @@
+2012-02-05 Florian Franzmann <siflfran AT hawo.stw.uni-erlangen.de>
+ * PRE_BUILD: added
+ * compilation_flags: added patch from ubuntu to fix compilation issues
+ * pdf-export-64.patch, poppler-api.patch: added patches from archlinux
+ to fix compilation issues
+ * BUILD: added -lz and -lX11 to LIBS to fix linker issue
+ * DEPENDS: added dependencies on zlib and libx11
+
2011-05-17 Ismael Luceno <ismael AT sourcemage.org>
* DEPENDS, DETAILS: spell created

diff --git a/gnome2-apps/xournal/compilation_flags
b/gnome2-apps/xournal/compilation_flags
new file mode 100644
index 0000000..6bf7eca
--- /dev/null
+++ b/gnome2-apps/xournal/compilation_flags
@@ -0,0 +1,26 @@
+--- a/po/Makefile.in.in
++++ b/po/Makefile.in.in
+@@ -95,6 +95,13 @@
+ $(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES)
+ $(XGETTEXT) --default-domain=$(GETTEXT_PACKAGE)
--directory=$(top_srcdir) \
+ --add-comments --keyword=_ --keyword=N_ \
++ --keyword=C_:1c,2 \
++ --keyword=NC_:1c,2 \
++ --keyword=g_dngettext:2,3 \
++ --flag=N_:1:pass-c-format \
++ --flag=C_:2:pass-c-format \
++ --flag=NC_:2:pass-c-format \
++ --flag=g_dngettext:2:pass-c-format \
+ --flag=g_strdup_printf:1:c-format \
+ --flag=g_string_printf:2:c-format \
+ --flag=g_string_append_printf:2:c-format \
+--- a/src/ttsubset/Makefile.in
++++ b/src/ttsubset/Makefile.in
+@@ -113,6 +113,7 @@
+ PACKAGE_NAME = @PACKAGE_NAME@
+ PACKAGE_STRING = @PACKAGE_STRING@
+ PACKAGE_TARNAME = @PACKAGE_TARNAME@
++PACKAGE_URL = @PACKAGE_URL@
+ PACKAGE_VERSION = @PACKAGE_VERSION@
+ PATH_SEPARATOR = @PATH_SEPARATOR@
+ PKG_CONFIG = @PKG_CONFIG@
diff --git a/gnome2-apps/xournal/pdf-export-64.patch
b/gnome2-apps/xournal/pdf-export-64.patch
new file mode 100644
index 0000000..9f7075c
--- /dev/null
+++ b/gnome2-apps/xournal/pdf-export-64.patch
@@ -0,0 +1,89 @@
+diff -aur old/src/xo-print.c new/src/xo-print.c
+--- old/src/xo-print.c 2009-09-28 23:36:54.000000000 +0200
++++ new/src/xo-print.c 2009-11-15 06:06:00.000000000 +0100
+@@ -761,7 +761,7 @@
+
+ make_xref(xref, xref->last+1, pdfbuf->len);
+ g_string_append_printf(pdfbuf,
+- "%d 0 obj\n<< /Length %d /Filter /FlateDecode /Type /Xobject "
++ "%d 0 obj\n<< /Length %zu /Filter /FlateDecode /Type /Xobject "
+ "/Subtype /Image /Width %d /Height %d /ColorSpace /DeviceRGB "
+ "/BitsPerComponent 8 >> stream\n",
+ xref->last, zpix->len, width, height);
+@@ -840,8 +840,10 @@
+ gboolean fallback, is_binary;
+ guchar encoding[256];
+ gushort glyphs[256];
+- int i, j, num, len1, len2;
+- gsize len;
++ int i, j, num;
++ guint32 len1, len2;
++ guint32 tt_len;
++ gsize t1_len;
+ TrueTypeFont *ttfnt;
+ char *seg1, *seg2;
+ char *fontdata, *p;
+@@ -862,14 +864,14 @@
+ }
+ font->num_glyphs_used = num-1;
+ if (OpenTTFont(font->filename, 0, &ttfnt) == SF_OK) {
+- if (CreateTTFromTTGlyphs_tomemory(ttfnt, (guint8**)&fontdata, &len,
glyphs, encoding, num,
++ if (CreateTTFromTTGlyphs_tomemory(ttfnt, (guint8**)&fontdata,
&tt_len, glyphs, encoding, num,
+ 0, NULL, TTCF_AutoName | TTCF_IncludeOS2) == SF_OK) {
+ make_xref(xref, xref->last+1, pdfbuf->len);
+ nobj_fontprog = xref->last;
+ g_string_append_printf(pdfbuf,
+- "%d 0 obj\n<< /Length %d /Length1 %d >> stream\n",
+- nobj_fontprog, (int)len, (int)len);
+- g_string_append_len(pdfbuf, fontdata, len);
++ "%d 0 obj\n<< /Length %u /Length1 %u >> stream\n",
++ nobj_fontprog, tt_len, tt_len);
++ g_string_append_len(pdfbuf, fontdata, tt_len);
+ g_string_append(pdfbuf, "endstream\nendobj\n");
+ g_free(fontdata);
+ }
+@@ -879,7 +881,7 @@
+ else fallback = TRUE;
+ } else {
+ // embed the font file: Type1 case
+- if (g_file_get_contents(font->filename, &fontdata, &len, NULL) &&
len>=8) {
++ if (g_file_get_contents(font->filename, &fontdata, &t1_len, NULL) &&
t1_len>=8) {
+ if (fontdata[0]==(char)0x80 && fontdata[1]==(char)0x01) {
+ is_binary = TRUE;
+ len1 = pfb_get_length((unsigned char *)fontdata+2);
+@@ -898,7 +900,7 @@
+ if (*p=='\n' || *p=='\r') p++;
+ if (*p=='\n' || *p=='\r') p++;
+ len1 = p-fontdata;
+- p = g_strrstr_len(fontdata, len, T1_SEGMENT_3_END);
++ p = g_strrstr_len(fontdata, t1_len, T1_SEGMENT_3_END);
+ if (p==NULL) fallback = TRUE;
+ else {
+ // rewind 512 zeros
+@@ -936,7 +938,7 @@
+ make_xref(xref, xref->last+1, pdfbuf->len);
+ nobj_fontprog = xref->last;
+ g_string_append_printf(pdfbuf,
+- "%d 0 obj\n<< /Length %d /Length1 %d /Length2 %d /Length3 0 >>
stream\n",
++ "%d 0 obj\n<< /Length %u /Length1 %u /Length2 %u /Length3 0 >>
stream\n",
+ nobj_fontprog, len1+len2, len1, len2);
+ g_string_append_len(pdfbuf, seg1, len1);
+ g_string_append_len(pdfbuf, seg2, len2);
+@@ -1258,7 +1260,7 @@
+ tmpstr = make_pdfprefix(pdfinfo.pages+(pg->bg->file_page_seq-1),
+ pg->width, pg->height);
+ g_string_append_printf(pdfbuf,
+- "%d 0 obj\n<< /Length %d >> stream\n%s\nendstream\nendobj\n",
++ "%d 0 obj\n<< /Length %zu >> stream\n%s\nendstream\nendobj\n",
+ n_obj_prefix, tmpstr->len, tmpstr->str);
+ g_string_free(tmpstr, TRUE);
+ g_string_prepend(pgstrm, "Q Q Q ");
+@@ -1276,7 +1278,7 @@
+
+ make_xref(&xref, xref.last+1, pdfbuf->len);
+ g_string_append_printf(pdfbuf,
+- "%d 0 obj\n<< /Length %d /Filter /FlateDecode>> stream\n",
++ "%d 0 obj\n<< /Length %zu /Filter /FlateDecode>> stream\n",
+ xref.last, zpgstrm->len);
+ g_string_append_len(pdfbuf, zpgstrm->str, zpgstrm->len);
+ g_string_free(zpgstrm, TRUE);
diff --git a/gnome2-apps/xournal/poppler-api.patch
b/gnome2-apps/xournal/poppler-api.patch
new file mode 100644
index 0000000..9e33c7f
--- /dev/null
+++ b/gnome2-apps/xournal/poppler-api.patch
@@ -0,0 +1,158 @@
+diff -aur old/src/xo-file.c new/src/xo-file.c
+--- old/src/xo-file.c 2009-09-29 09:36:05.000000000 +1000
++++ new/src/xo-file.c 2011-10-06 03:11:17.307822836 +1100
+@@ -975,6 +975,140 @@
+ g_free(req);
+ }
+
++/*
++ * Copied from
http://cgit.freedesktop.org/poppler/poppler/tree/glib/poppler-page.cc?h=poppler-0.16#n617
++ * as a temporary workaround to poppler removing depreciated functions
while we wait for
++ * upstream to rewrite against cairo
++ */
++static void
++copy_cairo_surface_to_pixbuf (cairo_surface_t *surface, GdkPixbuf *pixbuf)
++{
++ int cairo_width, cairo_height, cairo_rowstride;
++ unsigned char *pixbuf_data, *dst, *cairo_data;
++ int pixbuf_rowstride, pixbuf_n_channels;
++ unsigned int *src;
++ int x, y;
++
++ cairo_width = cairo_image_surface_get_width (surface);
++ cairo_height = cairo_image_surface_get_height (surface);
++ cairo_rowstride = cairo_image_surface_get_stride (surface);
++ cairo_data = cairo_image_surface_get_data (surface);
++
++ pixbuf_data = gdk_pixbuf_get_pixels (pixbuf);
++ pixbuf_rowstride = gdk_pixbuf_get_rowstride (pixbuf);
++ pixbuf_n_channels = gdk_pixbuf_get_n_channels (pixbuf);
++
++ if (cairo_width > gdk_pixbuf_get_width (pixbuf))
++ cairo_width = gdk_pixbuf_get_width (pixbuf);
++ if (cairo_height > gdk_pixbuf_get_height (pixbuf))
++ cairo_height = gdk_pixbuf_get_height (pixbuf);
++ for (y = 0; y < cairo_height; y++)
++ {
++ src = (unsigned int *) (cairo_data + y * cairo_rowstride);
++ dst = pixbuf_data + y * pixbuf_rowstride;
++ for (x = 0; x < cairo_width; x++)
++ {
++ dst[0] = (*src >> 16) & 0xff;
++ dst[1] = (*src >> 8) & 0xff;
++ dst[2] = (*src >> 0) & 0xff;
++ if (pixbuf_n_channels == 4)
++ dst[3] = (*src >> 24) & 0xff;
++ dst += pixbuf_n_channels;
++ src++;
++ }
++ }
++}
++
++static void
++_poppler_page_render_to_pixbuf (PopplerPage *page,
++ int src_x, int src_y,
++ int src_width, int src_height,
++ double scale,
++ int rotation,
++ gboolean printing,
++ GdkPixbuf *pixbuf)
++{
++ cairo_t *cr;
++ cairo_surface_t *surface;
++
++ surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
++ src_width, src_height);
++ cr = cairo_create (surface);
++ cairo_save (cr);
++ switch (rotation) {
++ case 90:
++ cairo_translate (cr, src_x + src_width, -src_y);
++ break;
++ case 180:
++ cairo_translate (cr, src_x + src_width, src_y + src_height);
++ break;
++ case 270:
++ cairo_translate (cr, -src_x, src_y + src_height);
++ break;
++ default:
++ cairo_translate (cr, -src_x, -src_y);
++ }
++
++ if (scale != 1.0)
++ cairo_scale (cr, scale, scale);
++
++ if (rotation != 0)
++ cairo_rotate (cr, rotation * G_PI / 180.0);
++
++ if (printing)
++ poppler_page_render_for_printing (page, cr);
++ else
++ poppler_page_render (page, cr);
++ cairo_restore (cr);
++
++ cairo_set_operator (cr, CAIRO_OPERATOR_DEST_OVER);
++ cairo_set_source_rgb (cr, 1., 1., 1.);
++ cairo_paint (cr);
++
++ cairo_destroy (cr);
++
++ copy_cairo_surface_to_pixbuf (surface, pixbuf);
++ cairo_surface_destroy (surface);
++}
++
++/**
++ * poppler_page_render_to_pixbuf:
++ * @page: the page to render from
++ * @src_x: x coordinate of upper left corner
++ * @src_y: y coordinate of upper left corner
++ * @src_width: width of rectangle to render
++ * @src_height: height of rectangle to render
++ * @scale: scale specified as pixels per point
++ * @rotation: rotate the document by the specified degree
++ * @pixbuf: pixbuf to render into
++ *
++ * First scale the document to match the specified pixels per point,
++ * then render the rectangle given by the upper left corner at
++ * (src_x, src_y) and src_width and src_height.
++ * This function is for rendering a page that will be displayed.
++ * If you want to render a page that will be printed use
++ * poppler_page_render_to_pixbuf_for_printing() instead
++ *
++ * Deprecated: 0.16
++ **/
++void
++poppler_page_render_to_pixbuf (PopplerPage *page,
++ int src_x, int src_y,
++ int src_width, int src_height,
++ double scale,
++ int rotation,
++ GdkPixbuf *pixbuf)
++{
++ g_return_if_fail (POPPLER_IS_PAGE (page));
++ g_return_if_fail (scale > 0.0);
++ g_return_if_fail (pixbuf != NULL);
++
++ _poppler_page_render_to_pixbuf (page, src_x, src_y,
++ src_width, src_height,
++ scale, rotation,
++ FALSE,
++ pixbuf);
++}
+ /* process a bg PDF request from the queue, and recurse */
+
+ gboolean bgpdf_scheduler_callback(gpointer data)
+diff -aur old/src/xo-file.h new/src/xo-file.h
+--- old/src/xo-file.h 2009-09-28 08:45:53.000000000 +1000
++++ new/src/xo-file.h 2011-10-06 03:11:17.311156160 +1100
+@@ -36,3 +36,10 @@
+ void init_config_default(void);
+ void load_config_from_file(void);
+ void save_config_to_file(void);
++
++void poppler_page_render_to_pixbuf (PopplerPage *page,
++ int src_x, int src_y,
++ int src_width, int src_height,
++ double scale,
++ int rotation,
++ GdkPixbuf *pixbuf);



  • [SM-Commit] GIT changes to master grimoire by Florian Franzmann (07b24360311deef5c9354bfe709d53940c9d90d7), Florian Franzmann, 02/05/2012

Archive powered by MHonArc 2.6.24.

Top of Page