Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Dec 2016 01:16:11 +0000 (UTC)
From:      "Jason E. Hale" <jhale@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r427751 - in head: . editors editors/focuswriter editors/focuswriter-qt4 editors/focuswriter/files
Message-ID:  <201612040116.uB41GBKu019962@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhale
Date: Sun Dec  4 01:16:10 2016
New Revision: 427751
URL: https://svnweb.freebsd.org/changeset/ports/427751

Log:
  - Update to 1.6.2
  - Require c++11 library
  - Add upstreamed patch for QPrinter initialization on first usage,
    to remove startup delay
  - Qt 4.x support was dropped upstream, so editors/focuswriter-qt4 is removed
  
  PR:		214827
  Submitted by:	<yamagi@yamagi.org> (initial version)
  Patched by:	lightside <lightside@gmx.com> (maintainer)

Added:
  head/editors/focuswriter/files/
  head/editors/focuswriter/files/patch-QPrinter.diff   (contents, props changed)
Deleted:
  head/editors/focuswriter-qt4/
Modified:
  head/MOVED
  head/editors/Makefile
  head/editors/focuswriter/Makefile
  head/editors/focuswriter/distinfo
  head/editors/focuswriter/pkg-plist   (contents, props changed)

Modified: head/MOVED
==============================================================================
--- head/MOVED	Sun Dec  4 00:41:52 2016	(r427750)
+++ head/MOVED	Sun Dec  4 01:16:10 2016	(r427751)
@@ -8816,3 +8816,4 @@ x11-servers/mga_hal||2016-11-28|Support 
 audio/lv2core|audio/lv2|2016-11-30|Has expired: Superseded by audio/lv2
 java/jakarta-struts||2016-12-01|Has expired: Port is unmaintained and has known security vulnerabilites
 www/rubygem-url-mount|www/rubygem-url_mount|2016-12-03|Rename to match our rubygems naming
+editors/focuswriter-qt4|editors/focuswriter|2016-12-03|Qt4 support was dropped, use editors/focuswriter instead

Modified: head/editors/Makefile
==============================================================================
--- head/editors/Makefile	Sun Dec  4 00:41:52 2016	(r427750)
+++ head/editors/Makefile	Sun Dec  4 01:16:10 2016	(r427751)
@@ -55,7 +55,6 @@
     SUBDIR += fileobj
     SUBDIR += flim
     SUBDIR += focuswriter
-    SUBDIR += focuswriter-qt4
     SUBDIR += fpc-ide
     SUBDIR += fte
     SUBDIR += fxite

Modified: head/editors/focuswriter/Makefile
==============================================================================
--- head/editors/focuswriter/Makefile	Sun Dec  4 00:41:52 2016	(r427750)
+++ head/editors/focuswriter/Makefile	Sun Dec  4 01:16:10 2016	(r427751)
@@ -2,9 +2,8 @@
 # $FreeBSD$
 
 PORTNAME=	focuswriter
-PORTVERSION=	1.5.7
+PORTVERSION=	1.6.2
 DISTVERSIONPREFIX=	v
-PORTREVISION=	1
 CATEGORIES=	editors
 
 MAINTAINER=	lightside@gmx.com
@@ -20,7 +19,10 @@ LIB_DEPENDS=	libhunspell-1.5.so:textproc
 USE_GITHUB=	yes
 GH_ACCOUNT=	gottcode
 
-USES=		desktop-file-utils pkgconfig qmake
+USES=		compiler:c++11-lib desktop-file-utils pkgconfig qmake
+USE_GL=		gl
+USE_QT5=	concurrent core gui multimedia network printsupport widgets \
+		buildtools_build linguisttools_build
 INSTALLS_ICONS=	yes
 
 LIBS+=		-lz
@@ -28,21 +30,23 @@ LIBS+=		-lz
 PORTDATA=	*
 PORTDOCS=	CREDITS NEWS README
 
-OPTIONS_DEFINE=		DOCS
-OPTIONS_DEFAULT=	QT5
-OPTIONS_SINGLE=		QT
-OPTIONS_SINGLE_QT=	QT4 QT5
-QT_DESC=		Qt toolkit
-
-QT4_RUN_DEPENDS=	${LOCALBASE}/lib/libSDL2_mixer.so:audio/sdl2_mixer
-QT4_USE=	QT4=corelib,gui,network,moc_build,rcc_build
-QT5_USE=	QT5=concurrent,core,gui,multimedia,network,printsupport,widgets,buildtools_build
-QT5_USE+=	GL=gl
+OPTIONS_DEFINE=	DOCS
+
+.include <bsd.port.pre.mk>
 
 post-patch:
 	@${REINPLACE_CMD} -e '/PKGCONFIG/s/ zlib// ; \
 		/INSTALLS/s/man //' \
 		${WRKSRC}/focuswriter.pro
+.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1000054
+	@${REINPLACE_CMD} -e 's/std::lround/lround/g' \
+		${WRKSRC}/src/daily_progress_dialog.cpp \
+		${WRKSRC}/src/scene_list.cpp \
+		${WRKSRC}/src/theme_dialog.cpp \
+		${WRKSRC}/src/fileformats/docx_reader.cpp \
+		${WRKSRC}/src/fileformats/odt_reader.cpp \
+		${WRKSRC}/src/fileformats/rtf_reader.cpp
+.endif
 
 do-install-DOCS-on:
 	(cd ${WRKSRC} && ${COPYTREE_SHARE} "${PORTDOCS}" ${STAGEDIR}${DOCSDIR})
@@ -51,4 +55,4 @@ post-install:
 	${INSTALL_MAN} ${WRKSRC}/resources/unix/focuswriter.1 \
 		${STAGEDIR}${PREFIX}/man/man1
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>

Modified: head/editors/focuswriter/distinfo
==============================================================================
--- head/editors/focuswriter/distinfo	Sun Dec  4 00:41:52 2016	(r427750)
+++ head/editors/focuswriter/distinfo	Sun Dec  4 01:16:10 2016	(r427751)
@@ -1,3 +1,3 @@
-TIMESTAMP = 1468697342
-SHA256 (gottcode-focuswriter-v1.5.7_GH0.tar.gz) = 83d3e093360dfb8855602cb5b65a4c5249ada511031c76bdcee73e3dd0b09250
-SIZE (gottcode-focuswriter-v1.5.7_GH0.tar.gz) = 5621646
+TIMESTAMP = 1480811966
+SHA256 (gottcode-focuswriter-v1.6.2_GH0.tar.gz) = dcc2c9fe081421c8fad9e7c653134f93659a28b0071e9925f9094c246520de3d
+SIZE (gottcode-focuswriter-v1.6.2_GH0.tar.gz) = 10326671

Added: head/editors/focuswriter/files/patch-QPrinter.diff
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/editors/focuswriter/files/patch-QPrinter.diff	Sun Dec  4 01:16:10 2016	(r427751)
@@ -0,0 +1,83 @@
+# Origin: https://github.com/gottcode/focuswriter/commit/e7311fb017782a0bbf017d0055f6f01b36233b89
+# Subject: FIXED: Possible delay on start when creating non-native printer.
+# Origin: https://github.com/gottcode/focuswriter/commit/1423754c4eae874857ce34613bddead8224ee887
+# Subject: FIXED: Memory leak from creating multiple printers.
+
+--- src/stack.cpp.orig	2016-10-13 09:37:59 UTC
++++ src/stack.cpp
+@@ -55,6 +55,7 @@
+ Stack::Stack(QWidget* parent) :
+ 	QWidget(parent),
+ 	m_symbols_dialog(0),
++	m_printer(0),
+ 	m_current_document(0),
+ 	m_footer_margin(0),
+ 	m_header_margin(0),
+@@ -78,17 +79,6 @@ Stack::Stack(QWidget* parent) :
+ 	m_find_dialog = new FindDialog(this);
+ 	connect(m_find_dialog, SIGNAL(findNextAvailable(bool)), this, SIGNAL(findNextAvailable(bool)));
+ 
+-	m_printer = new QPrinter(QPrinter::HighResolution);
+-#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
+-	m_printer->setPageSize(QPageSize(QPageSize::Letter));
+-	m_printer->setPageOrientation(QPageLayout::Portrait);
+-	m_printer->setPageMargins(QMarginsF(1.0, 1.0, 1.0, 1.0), QPageLayout::Inch);
+-#else
+-	m_printer->setPageSize(QPrinter::Letter);
+-	m_printer->setOrientation(QPrinter::Portrait);
+-	m_printer->setPageMargins(1.0, 1.0, 1.0, 1.0, QPrinter::Inch);
+-#endif
+-
+ 	connect(ActionManager::instance(), SIGNAL(insertText(QString)), this, SLOT(insertSymbol(QString)));
+ 
+ 	m_layout = new QGridLayout(this);
+@@ -397,6 +387,7 @@ void Stack::pasteUnformatted()
+ 
+ void Stack::pageSetup()
+ {
++	initPrinter();
+ 	QPageSetupDialog dialog(m_printer, this);
+ 	dialog.exec();
+ }
+@@ -405,6 +396,7 @@ void Stack::pageSetup()
+ 
+ void Stack::print()
+ {
++	initPrinter();
+ 	m_current_document->print(m_printer);
+ }
+ 
+@@ -835,3 +827,23 @@ void Stack::updateMenuIndexes()
+ }
+ 
+ //-----------------------------------------------------------------------------
++
++void Stack::initPrinter()
++{
++	if (m_printer) {
++		return;
++	}
++
++	m_printer = new QPrinter(QPrinter::HighResolution);
++#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
++	m_printer->setPageSize(QPageSize(QPageSize::Letter));
++	m_printer->setPageOrientation(QPageLayout::Portrait);
++	m_printer->setPageMargins(QMarginsF(1.0, 1.0, 1.0, 1.0), QPageLayout::Inch);
++#else
++	m_printer->setPageSize(QPrinter::Letter);
++	m_printer->setOrientation(QPrinter::Portrait);
++	m_printer->setPageMargins(1.0, 1.0, 1.0, 1.0, QPrinter::Inch);
++#endif
++}
++
++//-----------------------------------------------------------------------------
+--- src/stack.h.orig	2016-10-13 09:37:59 UTC
++++ src/stack.h
+@@ -140,6 +140,7 @@ private:
+ #if (QT_VERSION < QT_VERSION_CHECK(5,6,0))
+ 	qreal devicePixelRatioF() const { return devicePixelRatio(); }
+ #endif
++	void initPrinter();
+ 
+ private:
+ 	AlertLayer* m_alerts;

Modified: head/editors/focuswriter/pkg-plist
==============================================================================
--- head/editors/focuswriter/pkg-plist	Sun Dec  4 00:41:52 2016	(r427750)
+++ head/editors/focuswriter/pkg-plist	Sun Dec  4 01:16:10 2016	(r427751)
@@ -2,6 +2,7 @@ bin/focuswriter
 man/man1/focuswriter.1.gz
 share/appdata/focuswriter.appdata.xml
 share/applications/focuswriter.desktop
+share/icons/hicolor/1024x1024/apps/focuswriter.png
 share/icons/hicolor/128x128/apps/focuswriter.png
 share/icons/hicolor/16x16/apps/focuswriter.png
 share/icons/hicolor/22x22/apps/focuswriter.png
@@ -9,6 +10,7 @@ share/icons/hicolor/24x24/apps/focuswrit
 share/icons/hicolor/256x256/apps/focuswriter.png
 share/icons/hicolor/32x32/apps/focuswriter.png
 share/icons/hicolor/48x48/apps/focuswriter.png
+share/icons/hicolor/512x512/apps/focuswriter.png
 share/icons/hicolor/64x64/apps/focuswriter.png
 share/icons/hicolor/scalable/apps/focuswriter.svg
 share/pixmaps/focuswriter.xpm



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612040116.uB41GBKu019962>