public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michael Weber" <xmw@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: www-client/netsurf/, www-client/netsurf/files/
Date: Tue, 11 Aug 2015 14:15:15 +0000 (UTC)	[thread overview]
Message-ID: <1439302512.7d92c734e256d255b72a4a25881493e3923cd0e4.xmw@gentoo> (raw)

commit:     7d92c734e256d255b72a4a25881493e3923cd0e4
Author:     Michael Weber <xmw <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 11 14:14:57 2015 +0000
Commit:     Michael Weber <xmw <AT> gentoo <DOT> org>
CommitDate: Tue Aug 11 14:15:12 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d92c734

www-client/netsurf: fix USE=pdf-writer (bug 555904, bug 555906, thanks Oschtan).

Package-Manager: portage-2.2.20

 .../netsurf/files/netsurf-3.2-pdf-writer.patch     | 90 ++++++++++++++++++++++
 .../netsurf/files/netsurf-3.3-pdf-writer.patch     | 85 ++++++++++++++++++++
 www-client/netsurf/netsurf-3.2-r1.ebuild           |  3 +-
 www-client/netsurf/netsurf-3.3-r1.ebuild           |  3 +-
 4 files changed, 179 insertions(+), 2 deletions(-)

diff --git a/www-client/netsurf/files/netsurf-3.2-pdf-writer.patch b/www-client/netsurf/files/netsurf-3.2-pdf-writer.patch
new file mode 100644
index 0000000..92179dc
--- /dev/null
+++ b/www-client/netsurf/files/netsurf-3.2-pdf-writer.patch
@@ -0,0 +1,90 @@
+--- netsurf-3.2/desktop/save_pdf/pdf_plotters.c
++++ netsurf-3.2/desktop/save_pdf/pdf_plotters.c
+@@ -426,11 +428,11 @@
+ 
+ 		switch(content_get_type(content)){
+ 		/*Handle "embeddable" types of images*/
+-		case CONTENT_JPEG:
+- 			image = HPDF_LoadJpegImageFromMem(pdf_doc,
+- 					(const HPDF_BYTE *) source_data,
+- 					source_size);
+- 			break;
++		//case CONTENT_JPEG:
++ 		//	image = HPDF_LoadJpegImageFromMem(pdf_doc,
++ 		//			(const HPDF_BYTE *) source_data,
++ 		//			source_size);
++ 		//	break;
+ 
+ 		/*Disabled until HARU PNG support will be more stable.
+ 
+@@ -676,7 +678,7 @@
+ 
+ 
+ #ifndef PDF_DEBUG
+-	if (option_enable_PDF_compression)
++	if (nsoption_bool(enable_PDF_compression))
+ 		HPDF_SetCompressionMode(pdf_doc, HPDF_COMP_ALL); /*Compression on*/
+ #endif
+ 	HPDF_SetInfoAttr(pdf_doc, HPDF_INFO_CREATOR, user_agent_string());
+@@ -750,7 +752,7 @@
+ 	assert(settings->output != NULL);
+ 
+ 	/*Encryption on*/
+-	if (option_enable_PDF_password)
++	if (nsoption_bool(enable_PDF_password))
+ 		PDF_Password(&owner_pass, &user_pass,
+ 				(void *)settings->output);
+ 	else
+@@ -765,7 +767,7 @@
+ {
+ 	bool success = false;
+ 
+-	if (option_enable_PDF_password && owner_pass != NULL ) {
++	if (nsoption_bool(enable_PDF_password) && owner_pass != NULL ) {
+ 		HPDF_SetPassword(pdf_doc, owner_pass, user_pass);
+ 		HPDF_SetEncryptionMode(pdf_doc, HPDF_ENCRYPT_R3, 16);
+ 		free(owner_pass);
+--- netsurf-3.2/gtk/gui.c
++++ netsurf-3.2/gtk/gui.c
+@@ -740,9 +740,11 @@
+ 
+ #ifdef WITH_PDF_EXPORT
+ 
++#include <glade/glade-xml.h>
++
+ void PDF_Password(char **owner_pass, char **user_pass, char *path)
+ {
+-	GladeXML *x = glade_xml_new(glade_password_file_location, NULL, NULL);
++	GladeXML *x = glade_xml_new(glade_file_location->password, NULL, NULL);
+ 	GtkWindow *wnd = GTK_WINDOW(glade_xml_get_widget(x, "wndPDFPassword"));
+ 	GtkButton *ok, *no;
+ 	void **data = malloc(5 * sizeof(void *));
+--- netsurf-3.2/gtk/scaffolding.c
++++ netsurf-3.2/gtk/scaffolding.c
+@@ -711,14 +711,14 @@
+ 
+ 	free(url_name);
+ 
+-	strncpy(dirname, option_downloads_directory, PATH_MAX);
++	strncpy(dirname, nsoption_charp(downloads_directory), PATH_MAX);
+ 	strncat(dirname, "/", PATH_MAX - strlen(dirname));
+ 	dirname[PATH_MAX - 1] = '\0';
+ 
+ 	/* this way the scale used by PDF functions is synchronized with that
+ 	 * used by the all-purpose print interface
+ 	 */
+-	haru_nsfont_set_scale((float)option_export_scale / 100);
++	haru_nsfont_set_scale((float)nsoption_int(export_scale) / 100);
+ 
+ 	save_dialog = gtk_file_chooser_dialog_new("Export to PDF", g->window,
+ 		GTK_FILE_CHOOSER_ACTION_SAVE,
+--- netsurf-3.2/gtk/Makefile.target
++++ netsurf-3.2/gtk/Makefile.target
+@@ -62,6 +62,7 @@
+ $(eval $(call pkg_config_find_and_add,gtk+-$(NETSURF_GTK_MAJOR).0,GTK-$(NETSURF_GTK_MAJOR)))
+ $(eval $(call pkg_config_find_and_add,gthread-2.0,GThread2))
+ $(eval $(call pkg_config_find_and_add,gmodule-2.0,GModule2))
++$(eval $(call pkg_config_find_and_add,libglade-2.0,GLADE))
+ 
+ 
+ CFLAGS += $(GTKCFLAGS)

diff --git a/www-client/netsurf/files/netsurf-3.3-pdf-writer.patch b/www-client/netsurf/files/netsurf-3.3-pdf-writer.patch
new file mode 100644
index 0000000..e2c709e
--- /dev/null
+++ b/www-client/netsurf/files/netsurf-3.3-pdf-writer.patch
@@ -0,0 +1,85 @@
+--- netsurf-3.3/desktop/font_haru.c
++++ netsurf-3.3/desktop/font_haru.c
+@@ -40,7 +40,7 @@
+ #include "css/utils.h"
+ 
+ #include "utils/nsoption.h"
+-#include "desktop/save_pdf/font_haru.h"
++#include "desktop/font_haru.h"
+ #include "desktop/font.h"
+ #include "utils/log.h"
+ 
+--- netsurf-3.3/desktop/save_pdf.c
++++ netsurf-3.3/desktop/save_pdf.c
+@@ -57,6 +57,8 @@
+ 
+ #include "content/hlcache.h"
+ #include "utils/nsoption.h"
++#include "desktop/gui_misc.h"
++#include "desktop/gui_internal.h"
+ #include "desktop/plotters.h"
+ #include "desktop/print.h"
+ #include "desktop/printer.h"
+@@ -450,11 +452,11 @@
+ 
+ 		switch(content_get_type(content)){
+ 		/*Handle "embeddable" types of images*/
+-		case CONTENT_JPEG:
+- 			image = HPDF_LoadJpegImageFromMem(pdf_doc,
+- 					(const HPDF_BYTE *) source_data,
+- 					source_size);
+- 			break;
++		//case CONTENT_JPEG:
++ 		//	image = HPDF_LoadJpegImageFromMem(pdf_doc,
++ 		//			(const HPDF_BYTE *) source_data,
++ 		//			source_size);
++ 		//	break;
+ 
+ 		/*Disabled until HARU PNG support will be more stable.
+ 
+@@ -700,7 +702,7 @@
+ 
+ 
+ #ifndef PDF_DEBUG
+-	if (option_enable_PDF_compression)
++	if (nsoption_bool(enable_PDF_compression))
+ 		HPDF_SetCompressionMode(pdf_doc, HPDF_COMP_ALL); /*Compression on*/
+ #endif
+ 	HPDF_SetInfoAttr(pdf_doc, HPDF_INFO_CREATOR, user_agent_string());
+@@ -774,7 +776,7 @@
+ 	assert(settings->output != NULL);
+ 
+ 	/*Encryption on*/
+-	if (option_enable_PDF_password)
++	if (nsoption_bool(enable_PDF_password))
+ 		guit->browser->pdf_password(&owner_pass, &user_pass,
+ 				(void *)settings->output);
+ 	else
+@@ -789,7 +791,7 @@
+ {
+ 	bool success = false;
+ 
+-	if (option_enable_PDF_password && owner_pass != NULL ) {
++	if (nsoption_bool(enable_PDF_password) && owner_pass != NULL ) {
+ 		HPDF_SetPassword(pdf_doc, owner_pass, user_pass);
+ 		HPDF_SetEncryptionMode(pdf_doc, HPDF_ENCRYPT_R3, 16);
+ 		free(owner_pass);
+--- netsurf-3.3/gtk/scaffolding.c
++++ netsurf-3.3/gtk/scaffolding.c
+@@ -709,14 +709,14 @@
+ 
+ 	free(url_name);
+ 
+-	strncpy(dirname, option_downloads_directory, PATH_MAX);
++	strncpy(dirname, nsoption_charp(downloads_directory), PATH_MAX);
+ 	strncat(dirname, "/", PATH_MAX - strlen(dirname));
+ 	dirname[PATH_MAX - 1] = '\0';
+ 
+ 	/* this way the scale used by PDF functions is synchronized with that
+ 	 * used by the all-purpose print interface
+ 	 */
+-	haru_nsfont_set_scale((float)option_export_scale / 100);
++	haru_nsfont_set_scale((float)nsoption_int(export_scale) / 100);
+ 
+ 	save_dialog = gtk_file_chooser_dialog_new("Export to PDF", g->window,
+ 		GTK_FILE_CHOOSER_ACTION_SAVE,

diff --git a/www-client/netsurf/netsurf-3.2-r1.ebuild b/www-client/netsurf/netsurf-3.2-r1.ebuild
index b1789f8..8737637 100644
--- a/www-client/netsurf/netsurf-3.2-r1.ebuild
+++ b/www-client/netsurf/netsurf-3.2-r1.ebuild
@@ -55,7 +55,8 @@ DEPEND="${RDEPEND}
 PATCHES=( "${FILESDIR}"/${P}-CFLAGS.patch
 	"${FILESDIR}"/${PN}-3.0-framebuffer-pkgconfig.patch
 	"${FILESDIR}"/${P}-conditionally-include-image-headers.patch
-	"${FILESDIR}"/${P}-glibc2.20.patch )
+	"${FILESDIR}"/${P}-glibc2.20.patch
+	"${FILESDIR}"/${P}-pdf-writer.patch )
 DOCS=( fb.modes README Docs/USING-Framebuffer
 	Docs/ideas/{cache,css-engine,render-library}.txt )
 

diff --git a/www-client/netsurf/netsurf-3.3-r1.ebuild b/www-client/netsurf/netsurf-3.3-r1.ebuild
index b10a096..4c3e786 100644
--- a/www-client/netsurf/netsurf-3.3-r1.ebuild
+++ b/www-client/netsurf/netsurf-3.3-r1.ebuild
@@ -57,7 +57,8 @@ DEPEND="${RDEPEND}
 
 PATCHES=( "${FILESDIR}"/${P}-CFLAGS.patch
 	"${FILESDIR}"/${PN}-3.0-framebuffer-pkgconfig.patch
-	"${FILESDIR}"/${PN}-3.2-conditionally-include-image-headers.patch )
+	"${FILESDIR}"/${PN}-3.2-conditionally-include-image-headers.patch
+	"${FILESDIR}"/${P}-pdf-writer.patch )
 DOCS=( fb.modes README Docs/USING-Framebuffer
 	Docs/ideas/{cache,css-engine,render-library}.txt )
 


             reply	other threads:[~2015-08-11 14:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-11 14:15 Michael Weber [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-01-19  9:31 [gentoo-commits] repo/gentoo:master commit in: www-client/netsurf/, www-client/netsurf/files/ Michael Orlitzky
2018-10-21 20:54 Virgil Dupras
2017-02-05 12:18 Michael Weber
2017-01-31  0:47 Michael Weber
2017-01-24  1:16 Michael Weber
2016-03-02 23:00 Michael Weber
2015-08-10 21:38 Sergei Trofimovich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1439302512.7d92c734e256d255b72a4a25881493e3923cd0e4.xmw@gentoo \
    --to=xmw@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox