Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add WPE WebKit packages #38

Merged
merged 4 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions frameworks/cage/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=cage
PKG_VERSION:=0.2.0

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/cage-kiosk/cage/releases/download/v0.2.0
PKG_HASH:=557c194d18af7202a9ec2e8be6dd7129f6c16d0f4528f4079ba26ccd57b6ef88

PKG_MAINTAINER:=Daniel Golle <[email protected]>
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE

PKG_INSTALL:=1
PKG_BUILD_DEPENDS:=wayland/host

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

define Package/cage
SECTION:=video-frameworks
CATEGORY:=Video
SUBMENU:=Frameworks and Toolkits
TITLE:=a Wayland kiosk
URL:=https://wayland.freedesktop.org/
DEPENDS:=+wlroots +xkeyboard-config
endef

define Package/cage/description
This is Cage, a Wayland kiosk. A kiosk runs a single, maximized application.
endef

MESON_ARGS += \
-Dman-pages=disabled

define Package/cage/conffiles
/etc/config/cage
endef

define Package/cage/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cage $(1)/usr/bin
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/cage.init $(1)/etc/init.d/cage
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/cage.config $(1)/etc/config/cage
endef

$(eval $(call BuildPackage,cage))
8 changes: 8 additions & 0 deletions frameworks/cage/files/cage.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
config cage
option noinput '0'
option nogpu '0'
option cmd '/usr/bin/cog'
option user 'cog'
list args '--scale=0.33'
list args 'http://localhost'
list env 'WEBKIT_INSPECTOR_HTTP_SERVER=0.0.0.0:12341'
46 changes: 46 additions & 0 deletions frameworks/cage/files/cage.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/sh /etc/rc.common
START=99

USE_PROCD=1

cage_append_command() {
procd_append_param command "$@"
}

cage_append_env() {
procd_append_param env "$@"
}

cage() {
local cfg="$1"
local cmd user args noinput nogpu
local cagedir="/tmp/run/cage"
config_get cmd "$cfg" 'cmd'
config_get noinput "$cfg" 'noinput' '0'
config_get nogpu "$cfg" 'nogpu' '0'
config_get user "$cfg" 'user' 'root'

mkdir -p -m 0700 "$cagedir"
chown ${user}:root "$cagedir"

procd_open_instance
procd_set_param command /usr/bin/cage
procd_append_param command "--"
procd_append_param command "$cmd"
config_list_foreach "$cfg" args cage_append_command
procd_set_param file /etc/config/cage
procd_set_param respawn
procd_set_param env "XDG_RUNTIME_DIR=$cagedir"
[ "$noinput" != "0" ] && procd_append_param env "WLR_LIBINPUT_NO_DEVICES=1"
[ "$nogpu" != "0" ] && procd_append_param env "WLR_RENDERER_ALLOW_SOFTWARE=1"
config_list_foreach "$cfg" env cage_append_env
procd_set_param user "$user"
procd_set_param stderr 1
procd_set_param stdout 1
procd_close_instance
}

start_service() {
config_load cage
config_foreach cage cage
}
61 changes: 61 additions & 0 deletions frameworks/wlroots/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
include $(TOPDIR)/rules.mk


PKG_NAME:=wlroots
PKG_VERSION:=0.18.1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://gitlab.freedesktop.org/$(PKG_NAME)/$(PKG_NAME)/-/archive/$(PKG_VERSION)
PKG_HASH:=10084bba57bf4162cd81eb79c2a0bee0d02c7ccd747eac0a7021b45b10bb821c

PKG_MAINTAINER:=Daniel Golle <[email protected]>
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE

PKG_INSTALL:=1
PKG_BUILD_DEPENDS:=wayland/host

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

define Package/wlroots
SECTION:=video-frameworks
CATEGORY:=Video
SUBMENU:=Frameworks and Toolkits
TITLE:=modules for building a Wayland compositor
URL:=https://gitlab.freedesktop.org/wlroots/wlroots
DEPENDS:=+libmesa +libdisplay-info +libdrm +libinput +libseat +libxkbcommon \
+libudev +pixman +libwayland +xkeyboard-config
endef

define Package/wlroots/description
Pluggable, composable, unopinionated modules for building a Wayland compositor;
or about 60,000 lines of code you were going to write anyway.
endef

MESON_ARGS += \
-Dxcb-errors=disabled \
-Dxwayland=disabled \
-Dexamples=false \
-Drenderers=gles2 \
-Dbackends=drm,libinput \
-Dallocators=gbm \
-Dsession=enabled \
-Dcolor-management=disabled \
-Dlibliftoff=disabled

define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig
endef

define Package/wlroots/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
endef

$(eval $(call BuildPackage,wlroots))
66 changes: 66 additions & 0 deletions games/gzdoom/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=gzdoom
PKG_VERSION:=4.13.1
PKG_RELEASE:=1

PKG_SOURCE:=g$(PKG_VERSION).zip
PKG_SOURCE_URL:=https://github.com/ZDoom/gzdoom/archive/refs/tags/
PKG_HASH:=e584c6436f7ea2c9186324dc75a3f1eebf4302fbdd2f98db13550cff2dd393a3

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-g$(PKG_VERSION)
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-g$(PKG_VERSION)

PKG_MAINTAINER:=Daniel Golle <[email protected]>
PKG_LICENSE:=BSD-3c
PKG_LICENSE_FILES:=COPYING LICENSE

CMAKE_INSTALL:=1
PKG_BUILD_DEPENDS:=gzdoom/host vulkan-loader

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/cmake.mk

CMAKE_OPTIONS += \
-DHAVE_VULKAN=ON \
-DHAVE_GLES2=ON \
-DNO_OPENAL=ON \
-DFORCE_INTERNAL_BZIP2=ON \
-DSDL2_INCLUDE_DIR="$(STAGING_DIR)/usr/include/SDL2" \
-DIMPORT_EXECUTABLES="$(STAGING_DIR_HOSTPKG)/share/gzdoom/ImportExecutables.cmake" \
-DVULKAN_USE_XLIB=OFF \
-DVULKAN_USE_WAYLAND=ON

define Package/gzdoom
SECTION:=games
CATEGORY:=Games
TITLE:=GZDoom
URL:=https://zdoom.org/
DEPENDS:=+alsa-lib +glib2 +libbz2 +libstdcpp +libzmusic +libvpx +libsdl2 +USE_MUSL:musl-fts
endef

define Package/gzdoom/description
ZDoom is a family of enhanced ports of the Doom engine for running on modern
operating systems. Use this port of DOOM on systems with some sort of hardware
3D acceleration support.
endef

define Host/Install
$(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/share/gzdoom
$(INSTALL_DATA) $(HOST_BUILD_DIR)/ImportExecutables.cmake $(STAGING_DIR_HOSTPKG)/share/gzdoom
endef

define Host/Uninstall
$(RM) $(STAGING_DIR_HOSTPKG)/share/gzdoom/ImportExecutables.cmake
endef

define Package/gzdoom/install
$(INSTALL_DIR) $(1)/usr/share/games
$(CP) $(PKG_INSTALL_DIR)/usr/share/games/* $(1)/usr/share/games
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gzdoom $(1)/usr/bin
endef

$(eval $(call BuildPackage,gzdoom))
$(eval $(call HostBuild))
10 changes: 10 additions & 0 deletions games/gzdoom/patches/0002-fix-musl-fts.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -291,6 +291,7 @@ else()
if ( NOT HAVE_FTS )
include ( FindPkgConfig )
pkg_check_modules( MUSL_FTS musl-fts )
+ string(REPLACE ";" " " MUSL_FTS_LDFLAGS "${MUSL_FTS_LDFLAGS}")
if ( MUSL_FTS_FOUND )
set ( ALL_C_FLAGS "${ALL_C_FLAGS} ${MUSL_FTS_LDFLAGS}" )
else ( MUSL_FTS_FOUND )
12 changes: 12 additions & 0 deletions games/gzdoom/patches/0003-define-cpu_set_t.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
From https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/35711#note_243863
_GNU_SOURCE is needed for cpu_set_t, and affinity disable is needed to work around lack of pthread_attr_setaffinity_np
--- a/libraries/lzma/CMakeLists.txt
+++ b/libraries/lzma/CMakeLists.txt
@@ -1,6 +1,6 @@
make_release_only()

-set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DZ7_PPMD_SUPPORT" )
+set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE -DZ7_PPMD_SUPPORT -DZ7_AFFINITY_DISABLE" )

find_package(Threads)

33 changes: 33 additions & 0 deletions games/gzdoom/patches/100-openwrt-cross-build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -337,6 +337,7 @@ option(FORCE_INTERNAL_BZIP2 "Use interna
option(FORCE_INTERNAL_ASMJIT "Use internal asmjit" ON)
mark_as_advanced( FORCE_INTERNAL_ASMJIT )

+if( CMAKE_CROSSCOMPILING )
if (HAVE_VULKAN)
add_subdirectory( libraries/ZVulkan )
endif()
@@ -375,6 +376,7 @@ if( ${HAVE_VM_JIT} )
set( ASMJIT_LIBRARY asmjit )
endif()
endif()
+endif()

if( BZIP2_FOUND AND NOT FORCE_INTERNAL_BZIP2 )
message( STATUS "Using system bzip2 library, includes found at ${BZIP2_INCLUDE_DIR}" )
@@ -409,12 +411,14 @@ option( DYN_OPENAL "Dynamically load Ope
add_subdirectory( libraries/lzma )
add_subdirectory( libraries/miniz )
add_subdirectory( tools )
+if( CMAKE_CROSSCOMPILING )
add_subdirectory( wadsrc )
add_subdirectory( wadsrc_bm )
add_subdirectory( wadsrc_lights )
add_subdirectory( wadsrc_extra )
add_subdirectory( wadsrc_widepix )
add_subdirectory( src )
+endif()

if( NOT CMAKE_CROSSCOMPILING )
export(TARGETS ${CROSS_EXPORTS} FILE "${CMAKE_BINARY_DIR}/ImportExecutables.cmake" )
18 changes: 18 additions & 0 deletions games/gzdoom/patches/120-lzma-pthreads.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--- a/libraries/lzma/CMakeLists.txt
+++ b/libraries/lzma/CMakeLists.txt
@@ -2,8 +2,6 @@ make_release_only()

set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE -DZ7_PPMD_SUPPORT -D_7ZIP_AFFINITY_DISABLE" )

-find_package(Threads)
-
add_library( lzma STATIC
C/7zAlloc.c
C/7zArcIn.c
@@ -48,4 +46,5 @@ add_library( lzma STATIC
C/XzEnc.c
C/XzIn.c
)
-target_link_libraries( lzma Threads::Threads )
+
+target_link_libraries( lzma PUBLIC pthread )
49 changes: 49 additions & 0 deletions games/gzdoom/patches/no-execinfo.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -358,7 +358,7 @@ if( HAVE_VM_JIT AND UNIX )
if( HAVE_LIBEXECINFO )
set( ALL_C_FLAGS "${ALL_C_FLAGS} -lexecinfo" )
else( HAVE_LIBEXECINFO )
- set( HAVE_VM_JIT NO )
+ # set( HAVE_VM_JIT NO )
endif( HAVE_LIBEXECINFO )
set( CMAKE_REQUIRED_FLAGS )
endif( NOT HAVE_BACKTRACE )
--- a/src/common/scripting/jit/jit_runtime.cpp
+++ b/src/common/scripting/jit/jit_runtime.cpp
@@ -7,7 +7,6 @@
#include <DbgHelp.h>
#include <psapi.h>
#else
-#include <execinfo.h>
#include <cxxabi.h>
#include <cstring>
#include <cstdlib>
@@ -806,7 +805,7 @@ static int CaptureStackTrace(int max_fra
// JIT isn't supported here, so just do nothing.
return 0;//return RtlCaptureStackBackTrace(0, min(max_frames, 32), out_frames, nullptr);
#else
- return backtrace(out_frames, max_frames);
+ return 0;
#endif
}

@@ -868,7 +867,9 @@ class NativeSymbolResolver
public:
FString GetName(void *frame)
{
- FString s;
+ FString s = "no backtrace";
+ return s;
+ #if 0
char **strings;
void *frames[1] = { frame };
strings = backtrace_symbols(frames, 1);
@@ -925,6 +926,7 @@ public:

free(strings);
return s;
+ #endif
}
};
#endif
Loading
Loading