summaryrefslogtreecommitdiff
path: root/www/webkitgtk4/Makefile
blob: 26d51b4e6f2d21bf0fda9d9513de6c378a3b0b9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# patches/patch-Source_JavaScriptCore_javascriptcoregtk_pc_in
# patches/patch-Source_WebKit_gtk_webkit2gtk-web-extension_pc_in
# patches/patch-Source_WebKit_gtk_webkit2gtk_pc_in
USE_WXNEEDED =		Yes

BROKEN-alpha =		GCC 5.0.0 is required to build WebKitGTK+, use a newer GCC version or clang
BROKEN-hppa =		GCC 5.0.0 is required to build WebKitGTK+, use a newer GCC version or clang
BROKEN-arm =		JavaScriptCore/runtime/MachineContext.h, various sigcontext-related

PORTROACH =		limitw:1,even

COMMENT =		GTK+ port of the WebKit rendering engine

V =			2.36.0
DISTNAME =		webkitgtk-${V}
PKGNAME =		webkitgtk4-${V}
REVISION =		1

EXTRACT_SUFX =		.tar.xz
API =			4.0
SUBST_VARS =		API
DPB_PROPERTIES =	parallel

SHARED_LIBS +=  javascriptcoregtk-${API}     3.6 # 18.13.3
SHARED_LIBS +=  webkit2gtk-${API}            3.6 # 37.37.2

CATEGORIES =		www

HOMEPAGE =		https://webkitgtk.org/

MAINTAINER =		Antoine Jacoutot <ajacoutot@openbsd.org>

# LGPLv2 and BSD
PERMIT_PACKAGE =	Yes

WANTLIB += ${COMPILER_LIBCXX} EGL GL X11 Xcomposite Xdamage Xrender
WANTLIB += Xt atk-1.0 c cairo cairo-gobject enchant-2 fontconfig
WANTLIB += freetype gcrypt gdk-3 gdk_pixbuf-2.0 gio-2.0 glib-2.0
WANTLIB += gmodule-2.0 gobject-2.0 gpg-error gstapp-1.0 gstaudio-1.0
WANTLIB += gstbase-1.0 gstfft-1.0 gstgl-1.0 gstpbutils-1.0 gstreamer-1.0
WANTLIB += gsttag-1.0 gstvideo-1.0 gtk-3 harfbuzz harfbuzz-icu
WANTLIB += hyphen icudata icui18n icuuc intl jpeg lcms2 m notify
WANTLIB += openjp2 pango-1.0 pangocairo-1.0 png secret-1 soup-2.4
WANTLIB += sqlite3 tasn1 webp webpdemux woff2dec xml2 xslt z

MASTER_SITES =		https://webkitgtk.org/releases/

MODULES =		devel/cmake \
			lang/python \
			lang/ruby \
			x11/gnome

COMPILER =		base-clang ports-gcc

MODRUBY_RUNDEP =	No
MODPY_RUNDEP =		No
MODPY_ADJ_FILES =	Tools/glib/generate-inspector-gresource-manifest.py
MODGNOME_TOOLS =	gobject-introspection

# XXX set DEBUG=-g1 because libWebCoreGTK.a is too big (4.1G)
# https://bugs.webkit.org/show_bug.cgi?id=140384
# ld.lld: error: lib/libWebCoreGTK.a:
# could not get the member for symbol WebCore::WorkerThread::runEventLoop():
# truncated or malformed archive (terminator characters in archive member "ar" not the correct "`\n" values for the archive member header for 12__retguard_29)
DEBUG_PACKAGES =	${BUILD_PACKAGES}
DEBUG =			-g1

NO_TEST =		Yes

BUILD_DEPENDS =		devel/bison \
			devel/gettext,-tools \
			devel/gperf \
			geo/geoclue2

RUN_DEPENDS =		geo/geoclue2 \
			multimedia/gstreamer1/plugins-good

LIB_DEPENDS =		archivers/woff2 \
			devel/harfbuzz,-icu \
			devel/libnotify \
			devel/libsoup \
			graphics/libwebp \
			graphics/openjp2 \
			multimedia/gstreamer1/plugins-base \
			textproc/enchant2 \
			textproc/hyphen \
			textproc/libxslt \
			x11/gnome/libsecret \
			x11/gtk+3

CONFIGURE_ENV =		WK_USE_CCACHE=NO
CONFIGURE_ARGS =	-DPORT=GTK \
			-DENABLE_MINIBROWSER=ON \
			-DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \
			-DCMAKE_SHARED_LINKER_FLAGS="${LDFLAGS}" \
			-DENABLE_JOURNALD_LOG=OFF \
			-DUSE_SOUP2=ON

# XXX broken at run time
#CONFIGURE_ARGS +=	-DUSE_SYSTEM_MALLOC=ON

# required for faking a better user-agent
.if ${MACHINE_ARCH} == "amd64"
CPUARCH =		x86_64
.else
CPUARCH =		${ARCH}
.endif
CONFIGURE_ARGS +=	-DUSER_AGENT_BRANDING="Linux ${CPUARCH}"

# needs Wayland (libwpe -> WPEBackend-fdo -> Wayland)
CONFIGURE_ARGS +=	-DUSE_WPE_RENDERER=OFF

# Needs GUdev
CONFIGURE_ARGS +=	-DENABLE_GAMEPAD=OFF

# sync with Source/JavaScriptCore/assembler/MacroAssembler.h
# native support for riscv64 in LLInt fails to link with relocation errors
.if ${MACHINE_ARCH} != "aarch64" && ${MACHINE_ARCH} != "amd64" && \
    ${MACHINE_ARCH} != "arm" && ${MACHINE_ARCH} != "i386" && \
    ${MACHINE_ARCH} != "mips64" && ${MACHINE_ARCH} != "mips64el"
# #error "The MacroAssembler is not supported on this platform."
CONFIGURE_ARGS +=	-DENABLE_JIT=OFF
CONFIGURE_ARGS +=	-DENABLE_C_LOOP=ON
.endif


# we don't want an allocation of 1GB, it's above the default ulimit
.if ${MACHINE_ARCH} == "amd64"
CXXFLAGS +=		-DFIXED_EXECUTABLE_MEMORY_POOL_SIZE_IN_MB=512
.endif
CXXFLAGS +=		-DSTRUCTURE_HEAP_ADDRESS_SIZE_IN_MB=256

# XXX fatal error: 'X11/Xlib.h' file not found
CXXFLAGS +=		-I${X11BASE}/include

.include <bsd.port.arch.mk>

# disable thin archives for bfd
.if !${PROPERTIES:Mlld}
CONFIGURE_ARGS +=	-DUSE_THIN_ARCHIVES=FALSE
.endif

.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "i386"
# Don't make LLVM run out of memory
DPB_PROPERTIES =       lonesome
LDFLAGS +=		-Wl,--no-keep-memory
.endif

post-extract:
	ln -sf ${MODPY_BIN} ${WRKDIR}/bin/python
	ln -sf ${RUBY} ${WRKDIR}/bin/ruby

pre-configure:
	${SUBST_CMD} ${WRKSRC}/Source/cmake/WebKitCommon.cmake

.include <bsd.port.mk>