Skip to content

Commit

Permalink
www/surf: update webkit2gtk3 API version to 4.1
Browse files Browse the repository at this point in the history
 - turn static REINPLACE_CMD into patch as per policy

Pull Request:	freebsd#266
  • Loading branch information
clausecker committed May 24, 2024
1 parent 7b2c9cf commit 1c3d3da
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 16 deletions.
19 changes: 3 additions & 16 deletions www/surf/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PORTNAME= surf
DISTVERSION= 2.1
PORTREVISION= 3
PORTREVISION= 4
CATEGORIES= www
MASTER_SITES= http://dl.suckless.org/${PORTNAME}/
PKGNAMESUFFIX= -browser
Expand All @@ -12,8 +12,8 @@ WWW= https://surf.suckless.org
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE

LIB_DEPENDS= libwebkit2gtk-4.0.so:www/webkit2-gtk3 \
libsoup-2.4.so:devel/libsoup \
LIB_DEPENDS= libwebkit2gtk-4.1.so:www/webkit2-gtk3 \
libsoup-3.0.so:devel/libsoup3 \
libgcr-base-3.so:security/gcr
RUN_DEPENDS= dmenu:x11/dmenu \
curl:ftp/curl \
Expand Down Expand Up @@ -51,19 +51,6 @@ post-extract:
.endif

post-patch:
@${REINPLACE_CMD} -e \
'/^PREFIX/s| =| ?=| ; \
/^X11/s|/usr/X11R6/|$${LOCALBASE}/| ; \
/^GTKINC/s| =| ?=| ; \
/^GTKLIB/s| =| ?=| ; \
/^INCS/s|-I/usr/include || ; \
/^LIBS/s|-L/usr/lib -lc || ; \
/^CPPFLAGS/s| =| +=| ; \
/^CFLAGS/s| =| +=| ; \
/^CFLAGS/s|-Os || ; \
/^LDFLAGS/s| =| +=| ; \
/^LDFLAGS/s|-g || ; \
/^CC/s| =| ?=|' ${WRKSRC}/config.mk
@${REINPLACE_CMD} -e 's|st -e|xterm -e|' ${WRKSRC}/config.def.h

post-install:
Expand Down
34 changes: 34 additions & 0 deletions www/surf/files/patch-config.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
--- config.mk.orig 2021-05-09 22:34:33 UTC
+++ config.mk
@@ -4,7 +4,7 @@ VERSION = 2.1
# Customize below to fit your system

# paths
-PREFIX = /usr/local
+PREFIX ?= /usr/local
MANPREFIX = $(PREFIX)/share/man
LIBPREFIX = $(PREFIX)/lib
LIBDIR = $(LIBPREFIX)/surf
@@ -12,17 +12,17 @@ X11LIB = `pkg-config --libs x11`
X11INC = `pkg-config --cflags x11`
X11LIB = `pkg-config --libs x11`

-GTKINC = `pkg-config --cflags gtk+-3.0 gcr-3 webkit2gtk-4.0`
-GTKLIB = `pkg-config --libs gtk+-3.0 gcr-3 webkit2gtk-4.0`
-WEBEXTINC = `pkg-config --cflags webkit2gtk-4.0 webkit2gtk-web-extension-4.0 gio-2.0`
-WEBEXTLIBS = `pkg-config --libs webkit2gtk-4.0 webkit2gtk-web-extension-4.0 gio-2.0`
+GTKINC ?= `pkg-config --cflags gtk+-3.0 gcr-3 webkit2gtk-4.1`
+GTKLIB ?= `pkg-config --libs gtk+-3.0 gcr-3 webkit2gtk-4.1`
+WEBEXTINC = `pkg-config --cflags webkit2gtk-4.1 webkit2gtk-web-extension-4.1 gio-2.0`
+WEBEXTLIBS = `pkg-config --libs webkit2gtk-4.1 webkit2gtk-web-extension-4.1 gio-2.0`

# includes and libs
INCS = $(X11INC) $(GTKINC)
LIBS = $(X11LIB) $(GTKLIB) -lgthread-2.0

# flags
-CPPFLAGS = -DVERSION=\"$(VERSION)\" -DGCR_API_SUBJECT_TO_CHANGE \
+CPPFLAGS += -DVERSION=\"$(VERSION)\" -DGCR_API_SUBJECT_TO_CHANGE \
-DLIBPREFIX=\"$(LIBPREFIX)\" -DWEBEXTDIR=\"$(LIBDIR)\" \
-D_DEFAULT_SOURCE
SURFCFLAGS = -fPIC $(INCS) $(CPPFLAGS)

0 comments on commit 1c3d3da

Please sign in to comment.