git: e1c65a93e348 - main - japanese/ebview-gtk2: Fix crashes immediately after startup

Kousuke Kannagi <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.ports
Message-ID <[email protected]>
The branch main has been updated by mce:

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

commit e1c65a93e348dddf2ab5a5b099f4d2fae262d0b2
Author:     Yasue Takeshi <[email protected]>
AuthorDate: 2026-07-30 02:43:59 +0000
Commit:     Kousuke Kannagi <[email protected]>
CommitDate: 2026-07-31 08:15:26 +0000

    japanese/ebview-gtk2: Fix crashes immediately after startup
    
    Since japanese/ebview was removed in 2014, remove CONFLICTS.
    Switch from REINPLACE_CMD to patchfile.
    
    PR:             297153
    Approved by:    fluffy (mentor)
    Co-authored-by: mce
---
 japanese/ebview-gtk2/Makefile                     | 15 ++++++---------
 japanese/ebview-gtk2/files/patch-src_ebview.c     | 11 +++++++++++
 japanese/ebview-gtk2/files/patch-src_preference.c | 20 ++++++++++++++++++++
 3 files changed, 37 insertions(+), 9 deletions(-)

diff --git a/japanese/ebview-gtk2/Makefile b/japanese/ebview-gtk2/Makefile
index 52fef9bad9c5..42ee8afc43af 100644
--- a/japanese/ebview-gtk2/Makefile
+++ b/japanese/ebview-gtk2/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	ebview
-PORTVERSION=	0.3.6
-PORTREVISION=	20
+DISTVERSION=	0.3.6
+PORTREVISION=	21
 CATEGORIES=	japanese
 MASTER_SITES=	SF
 PKGNAMESUFFIX=	-gtk2
@@ -10,18 +10,19 @@ COMMENT=	Electronic Book Viewer
 WWW=		https://ebview.sourceforge.net/
 
 LICENSE=	GPLv2+
+LICENSE_FILE=	${WRKSRC}/COPYING
 
 LIB_DEPENDS=	libeb.so:japanese/eb
 
-USES=		gettext gmake gnome localbase:ldflags pkgconfig
+USES=		gettext gmake gnome iconv:wchar_t localbase:ldflags pkgconfig \
+		xorg
 USE_CSTD=	gnu89
 USE_GNOME=	gtk20 pangox-compat
+USE_XORG=	x11
 
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=	--with-eb-conf=${LOCALBASE}/etc/eb.conf
 
-CONFLICTS=	ja-ebview
-
 SUB_FILES=	ebview.desktop
 
 OPTIONS_DEFINE=	DOCS
@@ -32,10 +33,6 @@ OPTIONS_DEFINE=	DOCS
 CFLAGS+=	-Wno-error=int-conversion
 .endif
 
-post-patch:
-	@${REINPLACE_CMD} -e 's|#define GTK_DISABLE_DEPRECATED 1||g' \
-		${WRKSRC}/src/ebview.c
-
 post-install:
 	(cd ${WRKDIR} && ${INSTALL_DATA} ${SUB_FILES} \
 		${STAGEDIR}${DESKTOPDIR})
diff --git a/japanese/ebview-gtk2/files/patch-src_ebview.c b/japanese/ebview-gtk2/files/patch-src_ebview.c
new file mode 100644
index 000000000000..2dfc1dd33b74
--- /dev/null
+++ b/japanese/ebview-gtk2/files/patch-src_ebview.c
@@ -0,0 +1,11 @@
+--- src/ebview.c.orig	2026-07-30 00:44:44 UTC
++++ src/ebview.c
+@@ -15,8 +15,6 @@
+  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+ 
+-#define GTK_DISABLE_DEPRECATED 1
+-
+ #define _GLOBAL
+ #include <signal.h>
+ #include <pthread.h>
diff --git a/japanese/ebview-gtk2/files/patch-src_preference.c b/japanese/ebview-gtk2/files/patch-src_preference.c
new file mode 100644
index 000000000000..da76afb00c1a
--- /dev/null
+++ b/japanese/ebview-gtk2/files/patch-src_preference.c
@@ -0,0 +1,20 @@
+--- src/preference.c.orig	2026-07-30 00:29:59 UTC
++++ src/preference.c
+@@ -27,7 +27,7 @@
+ #ifdef __WIN32__
+ #include <pango/pangowin32.h>
+ #else
+-#include <pango/pangox.h>
++#include <pango/pangocairo.h>
+ #endif
+ 
+ #include "dictbar.h"
+@@ -429,7 +429,7 @@ void  calculate_font_size(){
+ 		return;
+ 	}
+ 
+-	fontmap = pango_x_font_map_for_display(display);
++	fontmap = pango_cairo_font_map_get_default();
+ #endif
+ 
+ 	if(fontmap == NULL){
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.