git: 72561bebe5e8 - main - deskutils/easystroke: Update, take maintainership

From: Guido Falsi <madpilot_at_FreeBSD.org>
Date: Thu, 18 Aug 2022 19:33:57 UTC
The branch main has been updated by madpilot:

URL: https://cgit.FreeBSD.org/ports/commit/?id=72561bebe5e841d560f2aefcf4cd8ac92b6be9c1

commit 72561bebe5e841d560f2aefcf4cd8ac92b6be9c1
Author:     Guido Falsi <madpilot@FreeBSD.org>
AuthorDate: 2022-08-18 19:33:08 +0000
Commit:     Guido Falsi <madpilot@FreeBSD.org>
CommitDate: 2022-08-18 19:33:08 +0000

    deskutils/easystroke: Update, take maintainership
    
    - Move to github
    - Use last upstream commit, which includes fixes not present in release
    - Properly use grettext and intltool
    - Install appdata file provided in upstream repository
    - Fix error in desktop file [1]
    - Point WWW to github page
    - Import patch to fix sporadic crash [2]
    - Sort plist
    - Take maintainership
    
    obtained from:  https://github.com/thjaeger/easystroke/pull/19/commits/a255b2af291a494ad43b9de9c891613eb2bb6027 [1],
                    https://github.com/thjaeger/easystroke/pull/10/commits/140b9cae66ba874bf0994eea71210baf417a136e [2]
---
 deskutils/easystroke/Makefile                      | 18 ++++++----
 deskutils/easystroke/distinfo                      |  5 +--
 deskutils/easystroke/files/patch-Makefile          | 42 +++++++++++-----------
 deskutils/easystroke/files/patch-actiondb.cc       |  6 ++--
 .../easystroke/files/patch-easystroke.desktop.in   | 11 ++++++
 deskutils/easystroke/files/patch-win.cc            | 22 ++++++++++++
 deskutils/easystroke/pkg-descr                     |  2 +-
 deskutils/easystroke/pkg-plist                     | 31 ++++++++--------
 8 files changed, 88 insertions(+), 49 deletions(-)

diff --git a/deskutils/easystroke/Makefile b/deskutils/easystroke/Makefile
index e20af0beda99..6ac1643460ad 100644
--- a/deskutils/easystroke/Makefile
+++ b/deskutils/easystroke/Makefile
@@ -1,10 +1,9 @@
 PORTNAME=	easystroke
-PORTVERSION=	0.6.0
-PORTREVISION=	26
+DISTVERSION=	0.6.0-9
+DISTVERSIONSUFFIX=	-gf7c1614
 CATEGORIES=	deskutils
-MASTER_SITES=	SF
 
-MAINTAINER=	ports@FreeBSD.org
+MAINTAINER=	madpilot@FreeBSD.org
 COMMENT=	Gesture-recognition application for X11
 
 LICENSE=	ISCL
@@ -18,15 +17,18 @@ LIB_DEPENDS=	libdbus-1.so:devel/dbus \
 		libdbus-glib-1.so:devel/dbus-glib \
 		libboost_serialization.so:devel/boost-libs
 
-USES=		compiler:c++11-lang gettext gmake gnome pkgconfig xorg
-USE_GNOME=	gtkmm30
+USES=		compiler:c++11-lang gettext-tools gmake gnome pkgconfig xorg
+USE_GNOME=	gtkmm30 intltool
 USE_XORG=	x11 xext xfixes xi xtst
 USE_CXXSTD=	c++11
 
+USE_GITHUB=	yes
+GH_ACCOUNT=	thjaeger
+
 OPTIONS_DEFINE=	NLS
 OPTIONS_SUB=	yes
 
-NLS_BUILD_DEPENDS=	intltool-merge:textproc/intltool
+NLS_USES=	gettext-runtime
 NLS_ALL_TARGET=		easystroke.desktop all man
 # This builds easystroke without translations
 NLS_ALL_TARGET_OFF=	man
@@ -39,6 +41,8 @@ pre-build-NLS-off:
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
 	${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.desktop ${STAGEDIR}${PREFIX}/share/applications/
+	@${MKDIR} ${STAGEDIR}${PREFIX}/share/metainfo
+	${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.appdata.xml ${STAGEDIR}${PREFIX}/share/metainfo/
 	${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.svg ${STAGEDIR}${PREFIX}/share/pixmaps/
 	${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${STAGEDIR}${MAN1PREFIX}/man/man1
 
diff --git a/deskutils/easystroke/distinfo b/deskutils/easystroke/distinfo
index 191d9b47d873..0da37f20a468 100644
--- a/deskutils/easystroke/distinfo
+++ b/deskutils/easystroke/distinfo
@@ -1,2 +1,3 @@
-SHA256 (easystroke-0.6.0.tar.gz) = f4c37adbc4dd405a24badb9e6be20d3223b4087ff9caed2c15ff71674051d0fd
-SIZE (easystroke-0.6.0.tar.gz) = 121358
+TIMESTAMP = 1660820168
+SHA256 (thjaeger-easystroke-0.6.0-9-gf7c1614_GH0.tar.gz) = d9963d74dbf9448d2ce53a773f0a96bf38d55836bc13207e02a8effeccc15442
+SIZE (thjaeger-easystroke-0.6.0-9-gf7c1614_GH0.tar.gz) = 120662
diff --git a/deskutils/easystroke/files/patch-Makefile b/deskutils/easystroke/files/patch-Makefile
index 2233fd5ecf77..4113da28cad6 100644
--- a/deskutils/easystroke/files/patch-Makefile
+++ b/deskutils/easystroke/files/patch-Makefile
@@ -1,6 +1,6 @@
---- Makefile.orig	2013-03-27 15:52:38 UTC
+--- Makefile.orig	2016-07-05 18:32:44 UTC
 +++ Makefile
-@@ -12,19 +12,15 @@
+@@ -12,23 +12,15 @@
  #  OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  #  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  
@@ -10,29 +10,29 @@
  ICONDIR  = $(PREFIX)/share/icons/hicolor/scalable/apps
  MENUDIR  = $(PREFIX)/share/applications
  LOCALEDIR= $(PREFIX)/share/locale
- DFLAGS   =
+-DFLAGS   =
 -OFLAGS   = -O2
 -AOFLAGS  = -O3
--STROKEFLAGS  = -Wall -std=c99 $(DFLAGS)
--CXXFLAGS = -Wall $(DFLAGS) -DLOCALEDIR=\"$(LOCALEDIR)\" `pkg-config gtkmm-3.0 dbus-glib-1 --cflags`
--CFLAGS   = -Wall $(DFLAGS) -DLOCALEDIR=\"$(LOCALEDIR)\" `pkg-config gtk+-3.0 --cflags` -DGETTEXT_PACKAGE='"easystroke"'
+-STROKEFLAGS  = -Wall -std=c11 $(DFLAGS)
+-CXXSTD = -std=c++11
+ INCLUDES = $(shell pkg-config gtkmm-3.0 dbus-glib-1 --cflags)
+-CXXFLAGS = $(CXXSTD) -Wall $(DFLAGS) -DLOCALEDIR=\"$(LOCALEDIR)\" $(INCLUDES)
+-CFLAGS   = -std=c11 -Wall $(DFLAGS) -DLOCALEDIR=\"$(LOCALEDIR)\" $(INCLUDES) -DGETTEXT_PACKAGE='"easystroke"'
 -LDFLAGS  = $(DFLAGS)
-+STROKEFLAGS  = -Wall -std=c99 $(CFLAGS)
-+CXXFLAGS += -Wall $(DFLAGS) -DLOCALEDIR=\"$(LOCALEDIR)\" `pkg-config gtkmm-3.0 dbus-glib-1 --cflags`
-+CFLAGS   += -Wall $(DFLAGS) -DLOCALEDIR=\"$(LOCALEDIR)\" `pkg-config gtk+-3.0 --cflags` -DGETTEXT_PACKAGE='"easystroke"'
-+LDFLAGS  += $(DFLAGS)
++CXXFLAGS += -std=c++11 -Wall -DLOCALEDIR=\"$(LOCALEDIR)\" $(INCLUDES)
++CFLAGS   += -std=c11 -Wall -DLOCALEDIR=\"$(LOCALEDIR)\" $(INCLUDES) -DGETTEXT_PACKAGE='"easystroke"'
  
- LIBS     = $(DFLAGS) -lboost_serialization -lX11 -lXext -lXi -lXfixes -lXtst `pkg-config gtkmm-3.0 dbus-glib-1 --libs`
+-LIBS     = $(DFLAGS) -lboost_serialization -lX11 -lXext -lXi -lXfixes -lXtst `pkg-config gtkmm-3.0 dbus-glib-1 --libs`
++LIBS     = -lboost_serialization -lX11 -lXext -lXi -lXfixes -lXtst $(shell pkg-config gtkmm-3.0 dbus-glib-1 --libs)
  
-@@ -82,9 +78,9 @@ gui.c: gui.glade
- easystroke.desktop: easystroke.desktop.in $(MOFILES)
- 	intltool-merge po/ -d -u $< $@
+ BINARY   = easystroke
+ ICON     = easystroke.svg
+@@ -65,7 +57,7 @@ stroke.o: stroke.c
+ 	$(CXX) $(LDFLAGS) -o $@ $(OFILES) $(LIBS)
  
--desktop.c: easystroke.desktop
-+desktop.c:
- 	echo "const char *desktop_file = \"\\" > $@
--	sed 's/Exec=easystroke/Exec=%1$$s/' $< | sed 's/"/\\"/g' | sed 's/.*/&\\n\\/' >> $@
-+	sed 's/Exec=easystroke/Exec=%1$$s/' easystroke.desktop | sed 's/"/\\"/g' | sed 's/.*/&\\n\\/' >> $@
- 	echo "\";" >> $@
+ stroke.o: stroke.c
+-	$(CC) $(STROKEFLAGS) $(AOFLAGS) -MT $@ -MMD -MP -MF $*.Po -o $@ -c $<
++	$(CC) $(CFLAGS) $(AOFLAGS) -MT $@ -MMD -MP -MF $*.Po -o $@ -c $<
  
- po/POTFILES.in: $(CCFILES) $(HFILES)
+ %.o: %.c
+ 	$(CC) $(CFLAGS) $(OFLAGS) -MT $@ -MMD -MP -MF $*.Po -o $@ -c $<
diff --git a/deskutils/easystroke/files/patch-actiondb.cc b/deskutils/easystroke/files/patch-actiondb.cc
index cfbdf2ee92a4..2f8477eab77a 100644
--- a/deskutils/easystroke/files/patch-actiondb.cc
+++ b/deskutils/easystroke/files/patch-actiondb.cc
@@ -1,13 +1,13 @@
---- actiondb.cc.orig	2013-03-27 15:52:38 UTC
+--- actiondb.cc.orig	2016-07-05 18:32:44 UTC
 +++ actiondb.cc
-@@ -118,14 +118,9 @@ template<class Archive> void StrokeInfo::serialize(Arc
+@@ -119,14 +119,9 @@ void Command::run() {
  using namespace std;
  
  void Command::run() {
 -	pid_t pid = fork();
 -	switch (pid) {
 -		case 0:
--			execlp("/bin/sh", "sh", "-c", cmd.c_str(), NULL);
+-			execlp("/bin/sh", "sh", "-c", cmd.c_str(), nullptr);
 -			exit(1);
 -		case -1:
 -			printf(_("Error: can't execute command \"%s\": fork() failed\n"), cmd.c_str());
diff --git a/deskutils/easystroke/files/patch-easystroke.desktop.in b/deskutils/easystroke/files/patch-easystroke.desktop.in
new file mode 100644
index 000000000000..d6202fdc0e5f
--- /dev/null
+++ b/deskutils/easystroke/files/patch-easystroke.desktop.in
@@ -0,0 +1,11 @@
+--- easystroke.desktop.in.orig	2013-03-27 15:52:38 UTC
++++ easystroke.desktop.in
+@@ -6,7 +6,7 @@ Categories=GTK;Utility;Accessibility;
+ Exec=easystroke
+ Icon=easystroke
+ Categories=GTK;Utility;Accessibility;
+-Actions=About;Enable;Disable;Quit
++Actions=About;Enable;Disable;Quit;
+ _Comment=Control your desktop using mouse gestures
+ 
+ [Desktop Action About]
diff --git a/deskutils/easystroke/files/patch-win.cc b/deskutils/easystroke/files/patch-win.cc
new file mode 100644
index 000000000000..44bf69676acc
--- /dev/null
+++ b/deskutils/easystroke/files/patch-win.cc
@@ -0,0 +1,22 @@
+From 140b9cae66ba874bf0994eea71210baf417a136e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Kondor=20D=C3=A1niel?= <kondor.dani@gmail.com>
+Date: Sat, 22 Sep 2018 22:42:06 +0800
+Subject: [PATCH] fixed recurring crash when trying to render 0x0 tray icon
+
+---
+ win.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/win.cc b/win.cc
+index da41b0e8..36746430 100644
+--- win.cc
++++ win.cc
+@@ -275,7 +275,7 @@ void Win::timeout() {
+ }
+ 
+ void Win::set_icon(RStroke stroke, bool invert) {
+-	if (!icon)
++	if (!icon || icon->get_size() <= 0)
+ 		return;
+ 	icon->set(stroke->draw(icon->get_size(), 2.0, invert));
+ 	set_timeout(10000);
diff --git a/deskutils/easystroke/pkg-descr b/deskutils/easystroke/pkg-descr
index b838823e377d..ca601de275cd 100644
--- a/deskutils/easystroke/pkg-descr
+++ b/deskutils/easystroke/pkg-descr
@@ -7,4 +7,4 @@ modifiers and emulate a scroll wheel. The program was designed with
 Tablet PCs in mind and can be used effectively even without access to
 a keyboard.
 
-WWW: http://easystroke.sourceforge.net/
+WWW: https://github.com/thjaeger/easystroke
diff --git a/deskutils/easystroke/pkg-plist b/deskutils/easystroke/pkg-plist
index 4e07bcd400d5..7fc113ff15c8 100644
--- a/deskutils/easystroke/pkg-plist
+++ b/deskutils/easystroke/pkg-plist
@@ -1,21 +1,22 @@
+bin/easystroke
 man/man1/easystroke.1.gz
-share/pixmaps/easystroke.svg
-%%NLS%%share/locale/ru/LC_MESSAGES/easystroke.mo
-%%NLS%%share/locale/ko/LC_MESSAGES/easystroke.mo
-%%NLS%%share/locale/fi/LC_MESSAGES/easystroke.mo
+share/applications/easystroke.desktop
+%%NLS%%share/locale/ca/LC_MESSAGES/easystroke.mo
+%%NLS%%share/locale/cs/LC_MESSAGES/easystroke.mo
+%%NLS%%share/locale/de/LC_MESSAGES/easystroke.mo
 %%NLS%%share/locale/el/LC_MESSAGES/easystroke.mo
+%%NLS%%share/locale/es/LC_MESSAGES/easystroke.mo
+%%NLS%%share/locale/fi/LC_MESSAGES/easystroke.mo
+%%NLS%%share/locale/fr/LC_MESSAGES/easystroke.mo
+%%NLS%%share/locale/he/LC_MESSAGES/easystroke.mo
+%%NLS%%share/locale/hu/LC_MESSAGES/easystroke.mo
+%%NLS%%share/locale/it/LC_MESSAGES/easystroke.mo
 %%NLS%%share/locale/ja/LC_MESSAGES/easystroke.mo
-%%NLS%%share/locale/de/LC_MESSAGES/easystroke.mo
+%%NLS%%share/locale/ko/LC_MESSAGES/easystroke.mo
+%%NLS%%share/locale/pl/LC_MESSAGES/easystroke.mo
+%%NLS%%share/locale/ru/LC_MESSAGES/easystroke.mo
 %%NLS%%share/locale/vi/LC_MESSAGES/easystroke.mo
 %%NLS%%share/locale/zh_CN/LC_MESSAGES/easystroke.mo
-%%NLS%%share/locale/it/LC_MESSAGES/easystroke.mo
-%%NLS%%share/locale/ca/LC_MESSAGES/easystroke.mo
 %%NLS%%share/locale/zh_TW/LC_MESSAGES/easystroke.mo
-%%NLS%%share/locale/hu/LC_MESSAGES/easystroke.mo
-%%NLS%%share/locale/es/LC_MESSAGES/easystroke.mo
-%%NLS%%share/locale/pl/LC_MESSAGES/easystroke.mo
-%%NLS%%share/locale/fr/LC_MESSAGES/easystroke.mo
-%%NLS%%share/locale/he/LC_MESSAGES/easystroke.mo
-%%NLS%%share/locale/cs/LC_MESSAGES/easystroke.mo
-share/applications/easystroke.desktop
-bin/easystroke
+share/metainfo/easystroke.appdata.xml
+share/pixmaps/easystroke.svg