Skip to content

Commit 4cfbdd1

Browse files
committed
package/cog: build cog 0.16 with wpewebkit 2.38
Version 0.16 includes gamepad support, which is only available with WPE WebKit 2.38. While it would be possible to build also Cog 0.16. The changes are a bit involved due to Cog switching to Meson, which requires keeping two sets of configuration flags in parallel (using the COG_CONF_OPTS_{MESON,CMAKE} variables, and then choosing among them along with {meson,cmake}package at the end of the Make fragment. Signed-off-by: Adrian Perez de Castro <[email protected]>
1 parent 1252603 commit 4cfbdd1

File tree

2 files changed

+49
-16
lines changed

2 files changed

+49
-16
lines changed

package/cog/cog.hash

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,10 @@ md5 69d72ac046a0fc485ea7b61b96e7e7fc cog-0.14.1.tar.xz
88
sha1 6236972b0ae0bce38a0a017610f161b349723862 cog-0.14.1.tar.xz
99
sha256 fb91104e25e1dde27189c91c70acc356e387f47acebaa8997e01ce5879c3a600 cog-0.14.1.tar.xz
1010

11+
# From https://wpewebkit.org/releases/cog-0.16.0.tar.xz.sums
12+
md5 2705472ea4f333290973722c0862b21d cog-0.16.0.tar.xz
13+
sha1 ef16e5e3d91d0da056fe5e4f596c211af7453b4e cog-0.16.0.tar.xz
14+
sha256 2956f719d36c9a6368f63901a0d1ceaf4d27f529f7df441b3748c36d72906fc6 cog-0.16.0.tar.xz
15+
1116
# Hashes for license files:
1217
sha256 e6c42d93c68b292bcccf6d2ec3e13da85df90b718ba27c2c2a01053a9d009252 COPYING

package/cog/cog.mk

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,32 @@
44
#
55
################################################################################
66

7-
ifeq ($(BR2_PACKAGE_WPEWEBKIT2_28)$(BR2_PACKAGE_WPEWEBKIT2_38),y)
7+
ifeq ($(BR2_PACKAGE_WPEWEBKIT2_38),y)
8+
COG_VERSION = 0.16.0
9+
else
10+
ifeq ($(BR2_PACKAGE_WPEWEBKIT2_28),y)
811
COG_VERSION = 0.14.1
912
else
1013
COG_VERSION = 0.6.0
11-
endif
14+
endif # BR2_PACKAGE_WPEWEBKIT2_28
15+
endif # BR2_PACKAGE_WPEWEBKIT2_38
1216

1317
COG_SITE = https://wpewebkit.org/releases
1418
COG_SOURCE = cog-$(COG_VERSION).tar.xz
1519
COG_INSTALL_STAGING = YES
1620
COG_DEPENDENCIES = dbus wpewebkit
1721
COG_LICENSE = MIT
1822
COG_LICENSE_FILES = COPYING
19-
COG_CONF_OPTS = \
23+
COG_CONF_OPTS_CMAKE = \
2024
-DCOG_BUILD_PROGRAMS=ON \
2125
-DINSTALL_MAN_PAGES=OFF \
2226
-DCOG_HOME_URI='$(call qstrip,$(BR2_PACKAGE_COG_PROGRAMS_HOME_URI))'
27+
COG_CONF_OPTS_MESON = \
28+
-Ddocumentation=false \
29+
-Dmanpages=false \
30+
-Dprograms=true \
31+
-Dcog_home_uri='$(call qstrip,$(BR2_PACKAGE_COG_PROGRAMS_HOME_URI))' \
32+
-Dplatforms='$(subst $(space),$(comma),$(strip $(COG_PLATFORMS_LIST)))'
2333

2434
# Add the wpebackend-fdo dependency if any of the backends which
2535
# need it have been selected (i.e. the expansion is non-empty.)
@@ -29,44 +39,51 @@ endif
2939

3040
ifeq ($(BR2_PACKAGE_WPEWEBKIT2_28)$(BR2_PACKAGE_WPEWEBKIT2_38),y)
3141
COG_FDO_PLATFORM_CMAKE_OPTION = COG_PLATFORM_WL
32-
COG_CONF_OPTS += \
42+
COG_CONF_OPTS_CMAKE += \
3343
-DCOG_PLATFORM_GTK4=OFF \
3444
-DCOG_PLATFORM_X11=OFF
3545
else
3646
COG_FDO_PLATFORM_CMAKE_OPTION = COG_PLATFORM_FDO
3747
endif # BR2_PACKAGE_WPEWEBKIT2_38
3848

3949
ifeq ($(BR2_PACKAGE_LIBSOUP_VERSION_2),y)
40-
COG_CONF_OPTS += -DUSE_SOUP2=ON
50+
COG_CONF_OPTS_CMAKE += -DUSE_SOUP2=ON
51+
COG_CONF_OPTS_MESON += -Dsoup2=enabled
4152
else
42-
COG_CONF_OPTS += -DUSE_SOUP2=OFF
53+
COG_CONF_OPTS_CMAKE += -DUSE_SOUP2=OFF
54+
COG_CONF_OPTS_MESON += -Dsoup2=disabled
4355
endif # BR2_PACKAGE_LIBSOUP_VERSION_2
4456

4557
ifeq ($(BR2_PACKAGE_WESTON),y)
46-
COG_CONF_OPTS += -DCOG_WESTON_DIRECT_DISPLAY=ON
58+
COG_CONF_OPTS_CMAKE += -DCOG_WESTON_DIRECT_DISPLAY=ON
59+
COG_CONF_OPTS_MESON += -Dwayland_weston_direct_display=true
4760
COG_DEPENDENCIES += weston
4861
else
49-
COG_CONF_OPTS += -DCOG_WESTON_DIRECT_DISPLAY=OFF
62+
COG_CONF_OPTS_CMAKE += -DCOG_WESTON_DIRECT_DISPLAY=OFF
63+
COG_CONF_OPTS_MESON += -Dwayland_weston_direct_display=false
5064
endif
5165

5266
ifeq ($(BR2_PACKAGE_COG_PLATFORM_HEADLESS),y)
53-
COG_CONF_OPTS += -DCOG_PLATFORM_HEADLESS=ON
67+
COG_CONF_OPTS_CMAKE += -DCOG_PLATFORM_HEADLESS=ON
68+
COG_PLATFORMS_LIST += headless
5469
else
55-
COG_CONF_OPTS += -DCOG_PLATFORM_HEADLESS=OFF
70+
COG_CONF_OPTS_CMAKE += -DCOG_PLATFORM_HEADLESS=OFF
5671
endif
5772

5873
ifeq ($(BR2_PACKAGE_COG_PLATFORM_FDO),y)
59-
COG_CONF_OPTS += -D$(COG_FDO_PLATFORM_CMAKE_OPTION)=ON
74+
COG_CONF_OPTS_CMAKE += -D$(COG_FDO_PLATFORM_CMAKE_OPTION)=ON
75+
COG_PLATFORMS_LIST += wayland
6076
COG_DEPENDENCIES += libxkbcommon wayland-protocols wayland
6177
else
62-
COG_CONF_OPTS += -D$(COG_FDO_PLATFORM_CMAKE_OPTION)=OFF
78+
COG_CONF_OPTS_CMAKE += -D$(COG_FDO_PLATFORM_CMAKE_OPTION)=OFF
6379
endif
6480

6581
ifeq ($(BR2_PACKAGE_COG_PLATFORM_DRM),y)
66-
COG_CONF_OPTS += -DCOG_PLATFORM_DRM=ON
82+
COG_CONF_OPTS_CMAKE += -DCOG_PLATFORM_DRM=ON
83+
COG_PLATFORMS_LIST += drm
6784
COG_DEPENDENCIES += libdrm libinput libgbm libegl udev
6885
else
69-
COG_CONF_OPTS += -DCOG_PLATFORM_DRM=OFF
86+
COG_CONF_OPTS_CMAKE += -DCOG_PLATFORM_DRM=OFF
7087
endif
7188

7289
ifeq ($(BR2_PACKAGE_COG_USE_SYSTEM_DBUS),y)
@@ -75,9 +92,11 @@ define COG_INSTALL_DBUS_POLICY
7592
$(INSTALL) -D -m 0644 $(@D)/com.igalia.Cog.conf $(TARGET_DIR)/usr/share/dbus-1/system.d/
7693
endef
7794
COG_POST_INSTALL_TARGET_HOOKS += COG_INSTALL_DBUS_POLICY
78-
COG_CONF_OPTS += -DCOG_DBUS_SYSTEM_BUS=ON
95+
COG_CONF_OPTS_CMAKE += -DCOG_DBUS_SYSTEM_BUS=ON
96+
COG_CONF_OPTS_MESON += -Dcog_dbus_control=system
7997
else
80-
COG_CONF_OPTS += -DCOG_DBUS_SYSTEM_BUS=OFF
98+
COG_CONF_OPTS_CMAKE += -DCOG_DBUS_SYSTEM_BUS=OFF
99+
COG_CONF_OPTS_MESON += -Dcog_dbus_control=user
81100
endif # BR2_PACKAGE_COG_USE_SYSTEM_DBUS
82101

83102
# WPE WebKit 2.28 has been patched to use libsoup3, but the pkg-config
@@ -98,4 +117,13 @@ define COG_INSTALL_SETTINGS
98117
endef
99118
COG_POST_INSTALL_TARGET_HOOKS += COG_INSTALL_SETTINGS
100119

120+
ifeq ($(BR2_PACKAGE_WPEWEBKIT2_38),y)
121+
ifeq ($(BR2_PACKAGE_LIBMANETTE),y)
122+
COG_DEPENDENCIES += libmanette
123+
endif
124+
COG_CONF_OPTS = $(COG_CONF_OPTS_MESON)
125+
$(eval $(meson-package))
126+
else # !BR2_PACKAGE_WPEWEBKIT2_38
127+
COG_CONF_OPTS = $(COG_CONF_OPTS_CMAKE)
101128
$(eval $(cmake-package))
129+
endif # BR2_PACKAGE_WPEWEBKIT2_38

0 commit comments

Comments
 (0)