View | Details | Raw Unified | Return to bug 228968
Collapse All | Expand All

(-)Makefile (-15 / +19 lines)
Lines 2-8 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	wkhtmltopdf
4
PORTNAME=	wkhtmltopdf
5
PORTVERSION=	0.12.4
5
PORTVERSION=	0.12.5
6
CATEGORIES=	converters
6
CATEGORIES=	converters
7
7
8
MAINTAINER=	mm@FreeBSD.org
8
MAINTAINER=	mm@FreeBSD.org
Lines 28-36 Link Here
28
USE_PERL5=	build
28
USE_PERL5=	build
29
USE_LDCONFIG=	yes
29
USE_LDCONFIG=	yes
30
USE_GITHUB=	yes
30
USE_GITHUB=	yes
31
WKQT_TAGNAME=	c0cfa03
31
#WKQT_TAGNAME=	c0cfa03
32
WKQT_TAGNAME=	5db36ec
32
GH_TUPLE=	${PORTNAME}:qt:${WKQT_TAGNAME}:qt
33
GH_TUPLE=	${PORTNAME}:qt:${WKQT_TAGNAME}:qt
33
HAS_CONFIGURE=	yes
34
HAS_CONFIGURE=	yes
35
CXXFLAGS=-fno-color-diagnostics -std=gnu++98
34
36
35
PATCH_WRKSRC=		${WRKSRC}/qt
37
PATCH_WRKSRC=		${WRKSRC}/qt
36
CONFIGURE_WRKSRC=	${WRKSRC}/build/qt
38
CONFIGURE_WRKSRC=	${WRKSRC}/build/qt
Lines 58-81 Link Here
58
MAKE_ARGS=	INSTALL_ROOT="${STAGEDIR}${PREFIX}"
60
MAKE_ARGS=	INSTALL_ROOT="${STAGEDIR}${PREFIX}"
59
61
60
pre-patch:
62
pre-patch:
61
	@${RMDIR} ${WRKSRC}/qt
63
	${RMDIR} ${WRKSRC}/qt
62
	@${LN} -s ../qt-${WKQT_TAGNAME} ${WRKSRC}/qt
64
	${LN} -s ../qt-${WKQT_TAGNAME} ${WRKSRC}/qt
63
65
64
post-patch:
66
post-patch:
65
	@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \
67
	${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \
66
		-e 's|/usr/X11R6/include|${LOCALBASE}/include/X11|g' \
68
		-e 's|/usr/X11R6/include|${LOCALBASE}/include/X11|g' \
67
		-e 's|/usr/X11R6/lib|${LOCALBASE}/lib|g' \
69
		-e 's|/usr/X11R6/lib|${LOCALBASE}/lib|g' \
68
		${PATCH_WRKSRC}/mkspecs/freebsd-g++/qmake.conf
70
		${PATCH_WRKSRC}/mkspecs/freebsd-g++/qmake.conf
69
	@${REINPLACE_CMD} -e "s|gcc|${CC}|g" -e "s|g++|${CXX}|g" \
71
	${REINPLACE_CMD} -e "s|gcc|${CC}|g" -e "s|g++|${CXX}|g" \
70
		${PATCH_WRKSRC}/mkspecs/common/g++-base.conf
72
		${PATCH_WRKSRC}/mkspecs/common/g++-base.conf
71
	@${REINPLACE_CMD} -e "s|share/man|man|g" \
73
	${REINPLACE_CMD} -e "s|share/man|man|g" \
72
		${WRKSRC}/src/image/image.pro \
74
		${WRKSRC}/src/image/image.pro \
73
		${WRKSRC}/src/pdf/pdf.pro
75
		${WRKSRC}/src/pdf/pdf.pro
74
	@${MKDIR} ${WRKSRC}/build/app ${WRKSRC}/build/qt \
76
	${ECHO} 'LIBS+= -lcrypto' >>${WRKSRC}/src/image/image.pro
77
	${ECHO} 'LIBS+= -lcrypto' >>${WRKSRC}/src/pdf/pdf.pro
78
	${MKDIR} ${WRKSRC}/build/app ${WRKSRC}/build/qt \
75
		${WRKSRC}/build/wkhtmltox
79
		${WRKSRC}/build/wkhtmltox
76
80
77
post-build:
81
post-build:
78
	@cd ${WRKSRC}/build/app && ${SETENV} ${MAKE_ENV} \
82
	cd ${WRKSRC}/build/app && ${SETENV} ${MAKE_ENV} \
79
		../qt/bin/qmake ../../wkhtmltopdf.pro && \
83
		../qt/bin/qmake ../../wkhtmltopdf.pro && \
80
		${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} \
84
		${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} \
81
		${_MAKE_JOBS} ${MAKE_ARGS:C,^${DESTDIRNAME}=.*,,g} \
85
		${_MAKE_JOBS} ${MAKE_ARGS:C,^${DESTDIRNAME}=.*,,g} \
Lines 84-97 Link Here
84
post-install:
88
post-install:
85
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/wkhtmltoimage \
89
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/wkhtmltoimage \
86
		${STAGEDIR}${PREFIX}/bin/wkhtmltopdf \
90
		${STAGEDIR}${PREFIX}/bin/wkhtmltopdf \
87
		${STAGEDIR}${PREFIX}/lib/libwkhtmltox.so.0.12.4
91
		${STAGEDIR}${PREFIX}/lib/libwkhtmltox.so.${PORTVERSION}
88
92
89
.include <bsd.port.pre.mk>
93
.include <bsd.port.pre.mk>
90
94
91
.if ${OPSYS} == FreeBSD
95
#.if ${OPSYS} == FreeBSD
92
.if ${COMPILER_TYPE:Mclang} && ${COMPILER_VERSION} >= 60
96
#.if ${COMPILER_TYPE:Mclang} && ${COMPILER_VERSION} >= 60
93
BROKEN=		Does not build
97
#BROKEN=		Does not build
94
.endif
98
#.endif
95
.endif
99
#.endif
96
100
97
.include <bsd.port.post.mk>
101
.include <bsd.port.post.mk>
(-)distinfo (-5 / +5 lines)
Lines 1-5 Link Here
1
TIMESTAMP = 1489939659
1
TIMESTAMP = 1528798989
2
SHA256 (wkhtmltopdf-wkhtmltopdf-0.12.4_GH0.tar.gz) = dd466f5c2504670459f3b8265de5697b9054f077e2f3e392e5172b5133080edf
2
SHA256 (wkhtmltopdf-wkhtmltopdf-0.12.5_GH0.tar.gz) = 861d6e61e2f5beb2d8daaade2cd5a85b84065ee9fac0d6d85000d8a7712a4621
3
SIZE (wkhtmltopdf-wkhtmltopdf-0.12.4_GH0.tar.gz) = 128695
3
SIZE (wkhtmltopdf-wkhtmltopdf-0.12.5_GH0.tar.gz) = 511181
4
SHA256 (wkhtmltopdf-qt-c0cfa03_GH0.tar.gz) = f313fdf8e0b7630f47a6bfba749bea128234379b311a8c609b1da450027eb4ee
4
SHA256 (wkhtmltopdf-qt-5db36ec_GH0.tar.gz) = 2b60944b46a4b0b9cdb9ce0339c3bf8f54c5ff9411cbc3c6a6ad01f88cc578e1
5
SIZE (wkhtmltopdf-qt-c0cfa03_GH0.tar.gz) = 172992697
5
SIZE (wkhtmltopdf-qt-5db36ec_GH0.tar.gz) = 172992377
(-)files/patch-clientcert (-129 lines)
Lines 1-129 Link Here
1
diff --git a/AUTHORS ../wkhtmltopdf-0.12.4/AUTHORS
2
index 62f43f4..1067b9b 100644
3
--- a/AUTHORS
4
+++ ../wkhtmltopdf-0.12.4/AUTHORS
5
@@ -38,3 +38,4 @@ Mehdi Abbad
6
 Lyes Amazouz
7
 Pascal Bach
8
 Mário Silva
9
+Jason Smith         <JasonParallel@gmail.com>
10
diff --git a/include/wkhtmltox/loadsettings.hh ../wkhtmltopdf-0.12.4/include/wkhtmltox/loadsettings.hh
11
index 5b9565f..3b9c765 100644
12
--- a/include/wkhtmltox/loadsettings.hh
13
+++ ../wkhtmltopdf-0.12.4/include/wkhtmltox/loadsettings.hh
14
@@ -67,6 +67,15 @@ struct DLL_PUBLIC LoadPage {
15
 	//! Password used for http auth login
16
 	QString password;
17
 
18
+	//! Path to the ssl client cert private key in OpenSSL PEM format
19
+	QString clientSslKeyPath;
20
+
21
+	//! Password to ssl client cert private key
22
+	QString clientSslKeyPassword;
23
+
24
+	//! Path to the ssl client cert public key in OpenSSL PEM format, optionally followed by intermediate ca and trusted certs
25
+	QString clientSslCrtPath;
26
+
27
 	//! How many milliseconds should we wait for a Javascript redirect
28
 	int jsdelay;
29
 
30
diff --git a/src/lib/loadsettings.hh ../wkhtmltopdf-0.12.4/src/lib/loadsettings.hh
31
index 20a5da2..bdd2739 100644
32
--- a/src/lib/loadsettings.hh
33
+++ ../wkhtmltopdf-0.12.4/src/lib/loadsettings.hh
34
@@ -70,6 +70,15 @@ struct DLL_PUBLIC LoadPage {
35
 	//! Password used for http auth login
36
 	QString password;
37
 
38
+	//! Path to the ssl client cert private key in OpenSSL PEM format
39
+	QString clientSslKeyPath;
40
+
41
+	//! Password to ssl client cert private key
42
+	QString clientSslKeyPassword;
43
+
44
+	//! Path to the ssl client cert public key in OpenSSL PEM format, optionally followed by intermediate ca and trusted certs
45
+	QString clientSslCrtPath;
46
+
47
 	//! How many milliseconds should we wait for a Javascript redirect
48
 	int jsdelay;
49
 
50
diff --git a/src/lib/multipageloader.cc ../wkhtmltopdf-0.12.4/src/lib/multipageloader.cc
51
index 7e61485..841dd6e 100644
52
--- a/src/lib/multipageloader.cc
53
+++ ../wkhtmltopdf-0.12.4/src/lib/multipageloader.cc
54
@@ -26,6 +26,13 @@
55
 #include <QNetworkDiskCache>
56
 #include <QTimer>
57
 #include <QUuid>
58
+#include <QList>
59
+#include <QByteArray>
60
+#if (QT_VERSION >= 0x050000 && !defined QT_NO_SSL) || !defined QT_NO_OPENSSL
61
+#include <QSslCertificate>
62
+#include <QSslKey>
63
+#include <QSslConfiguration>
64
+#endif
65
 #if QT_VERSION >= 0x050000
66
 #include <QUrlQuery>
67
 #endif
68
@@ -104,6 +111,33 @@ QNetworkReply * MyNetworkAccessManager::createRequest(Operation op, const QNetwo
69
 		foreach (const HT & j, settings.customHeaders)
70
 			r3.setRawHeader(j.first.toLatin1(), j.second.toLatin1());
71
 	}
72
+
73
+	#if (QT_VERSION >= 0x050000 && !defined QT_NO_SSL) || !defined QT_NO_OPENSSL
74
+	if(!settings.clientSslKeyPath.isEmpty() && !settings.clientSslKeyPassword.isEmpty()
75
+			&& !settings.clientSslCrtPath.isEmpty()){
76
+		bool success = true;
77
+		QSslConfiguration sslConfig = QSslConfiguration::defaultConfiguration();
78
+
79
+		QFile keyFile(settings.clientSslKeyPath);
80
+		if(keyFile.open(QFile::ReadOnly)){
81
+			QSslKey key(&keyFile, QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey, settings.clientSslKeyPassword.toUtf8());
82
+			sslConfig.setPrivateKey(key);
83
+			keyFile.close();
84
+			
85
+			QList<QSslCertificate> chainCerts =
86
+				QSslCertificate::fromPath(settings.clientSslCrtPath.toLatin1(),  QSsl::Pem, QRegExp::FixedString);
87
+			QList<QSslCertificate> cas =  sslConfig.caCertificates();
88
+			cas.append(chainCerts);
89
+			if(!chainCerts.isEmpty()){
90
+				sslConfig.setLocalCertificate(chainCerts.first());
91
+				sslConfig.setCaCertificates(cas);
92
+
93
+				r3.setSslConfiguration(sslConfig);
94
+			}
95
+		}
96
+	}
97
+	#endif
98
+
99
 	return QNetworkAccessManager::createRequest(op, r3, outgoingData);
100
 }
101
 
102
diff --git a/src/lib/reflect.cc ../wkhtmltopdf-0.12.4/src/lib/reflect.cc
103
index 32fc819..46e884c 100644
104
--- a/src/lib/reflect.cc
105
+++ ../wkhtmltopdf-0.12.4/src/lib/reflect.cc
106
@@ -57,6 +57,9 @@ ReflectImpl<LoadGlobal>::ReflectImpl(LoadGlobal & c) {
107
 ReflectImpl<LoadPage>::ReflectImpl(LoadPage & c) {
108
 	WKHTMLTOPDF_REFLECT(username);
109
 	WKHTMLTOPDF_REFLECT(password);
110
+	WKHTMLTOPDF_REFLECT(clientSslKeyPath);
111
+	WKHTMLTOPDF_REFLECT(clientSslKeyPassword);
112
+	WKHTMLTOPDF_REFLECT(clientSslCrtPath);
113
 	WKHTMLTOPDF_REFLECT(jsdelay);
114
 	WKHTMLTOPDF_REFLECT(windowStatus);
115
 	WKHTMLTOPDF_REFLECT(zoomFactor);
116
diff --git a/src/shared/commonarguments.cc ../wkhtmltopdf-0.12.4/src/shared/commonarguments.cc
117
index 3d45aaf..812f7b8 100644
118
--- a/src/shared/commonarguments.cc
119
+++ ../wkhtmltopdf-0.12.4/src/shared/commonarguments.cc
120
@@ -206,6 +206,9 @@ void CommandLineParserBase::addPageLoadArgs(LoadPage & s) {
121
 	addarg("bypass-proxy-for", 0, "Bypass proxy for host (repeatable)", new StringListSetter(s.bypassProxyForHosts, "value"));
122
 	addarg("username",0,"HTTP Authentication username", new QStrSetter(s.username, "username"));
123
 	addarg("password",0,"HTTP Authentication password", new QStrSetter(s.password, "password"));
124
+	addarg("ssl-key-path",0,"Path to ssl client cert private key in OpenSSL PEM format", new QStrSetter(s.clientSslKeyPath, "path"));
125
+	addarg("ssl-key-password",0,"Password to ssl client cert private key", new QStrSetter(s.clientSslKeyPassword, "password"));
126
+	addarg("ssl-crt-path",0,"Path to the ssl client cert public key in OpenSSL PEM format, optionally followed by intermediate ca and trusted certs", new QStrSetter(s.clientSslCrtPath, "path"));
127
 	addarg("load-error-handling", 0, "Specify how to handle pages that fail to load: abort, ignore or skip", new LoadErrorHandlingSetting(s.loadErrorHandling, "handler"));
128
 	addarg("load-media-error-handling", 0, "Specify how to handle media files that fail to load: abort, ignore or skip", new LoadErrorHandlingSetting(s.mediaLoadErrorHandling, "handler"));
129
 	addarg("custom-header",0,"Set an additional HTTP header (repeatable)", new MapSetter<>(s.customHeaders, "name", "value"));
(-)files/patch-src_3rdparty_webkit_Source_WebCore_html_HTMLImageElement.cpp (-21 lines)
Lines 1-21 Link Here
1
------------------------------------------------------------------------
2
r113848 | abecsi@webkit.org | 2012-04-11 11:23:19 +0000 (Wed, 11 Apr 2012) | 27 lines
3
4
Fix the build with gcc 4.7.0
5
https://bugs.webkit.org/show_bug.cgi?id=83584
6
[...]
7
* html/HTMLImageElement.cpp:
8
(WebCore::HTMLImageElement::createForJSConstructor): Fails because of -Werror=extra
9
[...]
10
11
--- src/3rdparty/webkit/Source/WebCore/html/HTMLImageElement.cpp.orig	2015-05-07 14:14:47 UTC
12
+++ src/3rdparty/webkit/Source/WebCore/html/HTMLImageElement.cpp
13
@@ -74,7 +74,7 @@ PassRefPtr<HTMLImageElement> HTMLImageEl
14
     RefPtr<HTMLImageElement> image = adoptRef(new HTMLImageElement(imgTag, document));
15
     if (optionalWidth)
16
         image->setWidth(*optionalWidth);
17
-    if (optionalHeight > 0)
18
+    if (optionalHeight)
19
         image->setHeight(*optionalHeight);
20
     return image.release();
21
 }
(-)pkg-plist (-1 / +1 lines)
Lines 7-12 Link Here
7
lib/libwkhtmltox.so
7
lib/libwkhtmltox.so
8
lib/libwkhtmltox.so.0
8
lib/libwkhtmltox.so.0
9
lib/libwkhtmltox.so.0.12
9
lib/libwkhtmltox.so.0.12
10
lib/libwkhtmltox.so.0.12.4
10
lib/libwkhtmltox.so.0.12.5
11
man/man1/wkhtmltoimage.1.gz
11
man/man1/wkhtmltoimage.1.gz
12
man/man1/wkhtmltopdf.1.gz
12
man/man1/wkhtmltopdf.1.gz

Return to bug 228968