summaryrefslogtreecommitdiffstats
path: root/libs/wpewebkit/Makefile
blob: 783e8cf3098388eea30ddc3c8287577f689deac1 (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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
include $(TOPDIR)/rules.mk

PKG_NAME:=wpewebkit
PKG_VERSION:=2.54.0
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://wpewebkit.org/releases
PKG_HASH:=efa9bcc3cb891c2d88f50eec710d9ccee71cbdf1040420361eb98c17355eb452

PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_LICENSE:=LGPL-2.1-or-later BSD-2-Clause
PKG_LICENSE_FILES:=Source/WebCore/LICENSE-Apple Source/Webcore/LICENSE-LGPL-2.1

PKG_BUILD_DEPENDS:=unifdef/host ruby/host
PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_wpewebkit-minibrowser
CMAKE_INSTALL:=1

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk

CMAKE_BINARY_SUBDIR:=openwrt-build

# JavaScriptCore's baseline JIT on ARMv7 requires the hard-float ABI
# (CPU(ARM_HARDFP) / __ARM_PCS_VFP); soft-float arm_v7 targets must use
# the C_LOOP interpreter instead.
WPE_JIT:=$(if $(CONFIG_arm_v7),$(if $(CONFIG_SOFT_FLOAT),,y))$(CONFIG_aarch64)$(CONFIG_riscv64)$(CONFIG_x86_64)

CMAKE_OPTIONS += \
	-DBWRAP_EXECUTABLE=/usr/bin/bwrap \
	-DDBUS_PROXY_EXECUTABLE=/usr/bin/xdg-dbus-proxy \
	-DGLIB_COMPILE_RESOURCES_EXECUTABLE="$(STAGING_DIR_HOSTPKG)/bin/glib-compile-resources" \
	-DENABLE_ACCESSIBILITY=OFF \
	-DENABLE_API_TESTS=OFF \
	-DENABLE_BUBBLEWRAP_SANDBOX=ON \
	-DENABLE_INTROSPECTION=OFF \
	-DENABLE_DOCUMENTATION=OFF \
	-DENABLE_WEB_CRYPTO=ON \
	-DENABLE_JOURNALD_LOG=OFF \
	-DENABLE_MINIBROWSER=$(if $(CONFIG_PACKAGE_wpewebkit-minibrowser),ON,OFF) \
	-DENABLE_WPE_LEGACY_API=OFF \
	-DENABLE_WPE_PLATFORM=ON \
	-DENABLE_WPE_PLATFORM_WAYLAND=ON \
	-DENABLE_WPE_PLATFORM_DRM=ON \
	-DENABLE_SPELLCHECK=OFF \
	-DENABLE_SPEECH_SYNTHESIS=OFF \
	-DENABLE_TOUCH_EVENTS=ON \
	-DENABLE_JIT=$(if $(WPE_JIT),ON,OFF) \
	-DENABLE_C_LOOP=$(if $(WPE_JIT),OFF,ON) \
	-DENABLE_WEBGL=ON \
	-DENABLE_VIDEO=ON \
	-DPORT=WPE \
	-DUSE_ATK=OFF \
	-DUSE_LIBBACKTRACE=OFF \
	-DUSE_LIBHYPHEN=OFF \
	-DUSE_LIBSECRET=OFF \
	-DUSE_SOUP2=OFF \
	-DUSE_JPEGXL=OFF \
	-DUSE_WOFF2=OFF \
	-DUSE_AVIF=OFF \
	-DUSE_LCMS=OFF \
	-DUSE_SYSTEM_SYSPROF_CAPTURE=OFF

define Package/libwpewebkit
  SECTION:=libs
  CATEGORY:=Libraries
  TITLE:=WPEWebKit Library
  URL:=https://wpewebkit.org
  DEPENDS:=+bubblewrap +glib2 +gst1-mod-autodetect +gst1-mod-opengl \
	   +harfbuzz +icu-full-data +libatomic +libepoxy +libgcrypt \
	   +libgst1allocators +libgst1app +libgst1audio +libgst1fft \
	   +libgst1gl +libgst1pbutils +libgst1tag +libgst1transcoder \
	   +libgst1video +libinput +libmanette +libjpeg +libpng +libseccomp \
	   +libsoup3 +libsqlite3 +libstdcpp +libtasn1 +libudev +libwayland \
	   +libwebp +libxkbcommon +libxml2 +libxslt +zlib \
	   @(arm_v7||i386||i686||ARCH_64BIT)
endef

define Package/libwpewebkit/description
  WPE WebKit is the WebKit port for embedded and low-resource devices,
  suitable for projects requiring any kind of web integration, from
  hybrid HTML/CSS applications to full-fledged web browsers.
endef

define Package/wpewebkit-driver
  SECTION:=libs
  CATEGORY:=Libraries
  TITLE:=WebDriver service implementation for WPE WebKit
  URL:=https://wpewebkit.org
  DEPENDS:=+libwpewebkit
endef

define Package/wpewebkit-driver/description
  WebDriver is an automation API to control a web browser. It allows the
  user to create automated tests for web applications independently of the
  browser and platform.

  The WPEWebDriver binary provides the WebDriver service implementation
  for WPE WebKit. It works as a server, processing client requests to spawn
  and control the web browser. This driver is not tied to any specific
  browser and can be used with any WPE WebKit based browser, but it uses
  MiniBrowser as the default.
endef

define Package/wpewebkit-minibrowser
  SECTION:=libs
  CATEGORY:=Libraries
  TITLE:=WPE WebKit Mini Browser
  URL:=https://wpewebkit.org/
  DEPENDS:=+libwpewebkit
endef

define Package/wpewebkit-minibrowser/description
  Minimalistic Web browser based on WPE WebKit.
endef

define Build/InstallDev
	$(INSTALL_DIR) $(1)/usr/include/wpe-webkit-2.0/jsc \
		       $(1)/usr/include/wpe-webkit-2.0/wpe \
		       $(1)/usr/include/wpe-webkit-2.0/wpe-platform/wpe/drm \
		       $(1)/usr/include/wpe-webkit-2.0/wpe-platform/wpe/headless \
		       $(1)/usr/include/wpe-webkit-2.0/wpe-platform/wpe/wayland \
		       $(1)/usr/include/wpe-webkit-2.0/wpe-platform/wpe \
		       $(1)/usr/lib/pkgconfig
	$(CP) $(PKG_INSTALL_DIR)/usr/include/wpe-webkit-2.0/jsc/*.h \
		       $(1)/usr/include/wpe-webkit-2.0/jsc
	$(CP) $(PKG_INSTALL_DIR)/usr/include/wpe-webkit-2.0/wpe/*.h \
		       $(1)/usr/include/wpe-webkit-2.0/wpe
	$(CP) $(PKG_INSTALL_DIR)/usr/include/wpe-webkit-2.0/wpe-platform/wpe/*.h \
		       $(1)/usr/include/wpe-webkit-2.0/wpe-platform/wpe
	$(CP) $(PKG_INSTALL_DIR)/usr/include/wpe-webkit-2.0/wpe-platform/wpe/drm/*.h \
		       $(1)/usr/include/wpe-webkit-2.0/wpe-platform/wpe/drm
	$(CP) $(PKG_INSTALL_DIR)/usr/include/wpe-webkit-2.0/wpe-platform/wpe/headless/*.h \
		       $(1)/usr/include/wpe-webkit-2.0/wpe-platform/wpe/headless
	$(CP) $(PKG_INSTALL_DIR)/usr/include/wpe-webkit-2.0/wpe-platform/wpe/wayland/*.h \
		       $(1)/usr/include/wpe-webkit-2.0/wpe-platform/wpe/wayland
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
		       $(1)/usr/lib/pkgconfig
endef

define Package/libwpewebkit/install
	$(INSTALL_DIR) $(1)/usr/lib/wpe-webkit-2.0/injected-bundle
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so* $(1)/usr/lib
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/wpe-webkit-2.0/injected-bundle/*.so \
		$(1)/usr/lib/wpe-webkit-2.0/injected-bundle
	$(INSTALL_DIR) $(1)/usr/libexec/wpe-webkit-2.0
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/libexec/wpe-webkit-2.0/WPEGPUProcess \
		$(1)/usr/libexec/wpe-webkit-2.0
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/libexec/wpe-webkit-2.0/WPENetworkProcess \
		$(1)/usr/libexec/wpe-webkit-2.0
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/libexec/wpe-webkit-2.0/WPEWebProcess \
		$(1)/usr/libexec/wpe-webkit-2.0
	$(INSTALL_DIR) $(1)/usr/share/wpe-webkit-2.0
	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/wpe-webkit-2.0/inspector.gresource \
		$(1)/usr/share/wpe-webkit-2.0
endef

define Package/wpewebkit-driver/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/WPEWebDriver $(1)/usr/bin
endef

define Package/wpewebkit-minibrowser/install
	$(INSTALL_DIR) $(1)/usr/libexec/wpe-webkit-2.0
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/libexec/wpe-webkit-2.0/MiniBrowser \
		$(1)/usr/libexec/wpe-webkit-2.0
endef

$(eval $(call BuildPackage,libwpewebkit))
$(eval $(call BuildPackage,wpewebkit-driver))
$(eval $(call BuildPackage,wpewebkit-minibrowser))