git: 043f51cb65ad - main - www/vimb: Simplify generate version.h

From: Zsolt Udvari <uzsolt_at_FreeBSD.org>
Date: Fri, 27 Dec 2024 18:35:29 UTC
The branch main has been updated by uzsolt:

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

commit 043f51cb65ad079bc4c551a84689df0488d1a44c
Author:     mew14930xvi <mew14930xvi@inbox.lv>
AuthorDate: 2024-12-27 18:31:05 +0000
Commit:     Zsolt Udvari <uzsolt@FreeBSD.org>
CommitDate: 2024-12-27 18:31:05 +0000

    www/vimb: Simplify generate version.h
    
    Sometimes build fails because of "slow" git-generating of version.h. If it
    isn't enough should add MAKE_JOBS_UNSAFE=yes.
    Remove cairo from USE_GNOME.
    Switch to patch file (instead of post-patch target).
    
    PR:             283504
    Approved by:    submitter is maintainer
---
 www/vimb/Makefile              |  7 +------
 www/vimb/files/patch-Makefile  | 15 +++++++++++++++
 www/vimb/files/patch-config.mk | 23 +++++++++++++++++++++++
 3 files changed, 39 insertions(+), 6 deletions(-)

diff --git a/www/vimb/Makefile b/www/vimb/Makefile
index effc2642eeb9..c2ee02cb70bf 100644
--- a/www/vimb/Makefile
+++ b/www/vimb/Makefile
@@ -16,7 +16,7 @@ LIB_DEPENDS=	libsoup-2.4.so:devel/libsoup \
 USES=		compiler:c11 desktop-file-utils gmake gnome pkgconfig
 USE_GITHUB=	yes
 GH_ACCOUNT=	fanglingsu
-USE_GNOME=	cairo glib20 gtk30
+USE_GNOME=	glib20 gtk30
 
 MAKE_ARGS=	V=1 \
 		version="${DISTVERSION}"
@@ -32,11 +32,6 @@ OPTIONS_DEFINE=	GSTREAMER
 GSTREAMER_USES=	gstreamer
 GSTREAMER_USE=	GSTREAMER=good,libav
 
-post-patch:
-	@${REINPLACE_CMD} -e 's|gtk-4.1|gtk-4.0|' ${WRKSRC}/config.mk
-# .git/index needs to exist to generate version.h...
-	${MKDIR} ${WRKSRC}/.git/index
-
 post-install:
 	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/vimb \
 		${STAGEDIR}${PREFIX}/lib/vimb/webext_main.so
diff --git a/www/vimb/files/patch-Makefile b/www/vimb/files/patch-Makefile
new file mode 100644
index 000000000000..fe10629eb72a
--- /dev/null
+++ b/www/vimb/files/patch-Makefile
@@ -0,0 +1,15 @@
+--- Makefile.orig	2024-12-23 06:28:27 UTC
++++ Makefile
+@@ -3,10 +3,9 @@ all: version.h src.subdir-all
+ 
+ all: version.h src.subdir-all
+ 
+-version.h: Makefile $(wildcard .git/index)
++version.h:
+ 	@echo "create $@"
+-	$(Q)v="$$(git describe --tags 2>/dev/null)"; \
+-	echo "#define VERSION \"$${v:-$(version)}\"" > $@
++	echo "#define VERSION \"$(version)\"" > $@
+ 
+ options:
+ 	@echo "vimb build options:"
diff --git a/www/vimb/files/patch-config.mk b/www/vimb/files/patch-config.mk
new file mode 100644
index 000000000000..57ec376c8c17
--- /dev/null
+++ b/www/vimb/files/patch-config.mk
@@ -0,0 +1,23 @@
+--- config.mk.orig	2024-12-23 06:24:27 UTC
++++ config.mk
+@@ -18,7 +18,7 @@ DOCDIR  = doc
+ DOCDIR  = doc
+ 
+ # used libs
+-LIBS = gtk+-3.0 webkit2gtk-4.1
++LIBS = gtk+-3.0 webkit2gtk-4.0
+ 
+ # setup general used CFLAGS
+ CFLAGS   += -std=c99 -pipe -Wall -fPIC
+@@ -35,9 +35,9 @@ EXTTARGET   = webext_main.so
+ 
+ # flags used to build webextension
+ EXTTARGET   = webext_main.so
+-EXTCFLAGS   = ${CFLAGS} $(shell pkg-config --cflags webkit2gtk-web-extension-4.1)
++EXTCFLAGS   = ${CFLAGS} $(shell pkg-config --cflags webkit2gtk-web-extension-4.0)
+ EXTCPPFLAGS = $(CPPFLAGS)
+-EXTLDFLAGS  = ${LDFLAGS} $(shell pkg-config --libs webkit2gtk-web-extension-4.1) -shared
++EXTLDFLAGS  = ${LDFLAGS} $(shell pkg-config --libs webkit2gtk-web-extension-4.0) -shared
+ 
+ # flags used for the main application
+ CFLAGS     += $(shell pkg-config --cflags $(LIBS))