Skip to content

Commit

Permalink
addpkg(main/termux-wsi-layer): 0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
twaik committed Dec 17, 2024
1 parent 963fc6b commit fe44e30
Show file tree
Hide file tree
Showing 5 changed files with 1,782 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/termux-wsi-layer/10_termux.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"file_format_version": "1.0.0",
"ICD": {
"library_path": "termux-wsi-layer.so"
}
}
20 changes: 20 additions & 0 deletions packages/termux-wsi-layer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
cmake_minimum_required(VERSION 3.29)
project(termux-wsi-layer C)

set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_C_STANDARD 11)
find_package(PkgConfig REQUIRED)
pkg_check_modules(X11 REQUIRED x11 x11-xcb xcb xcb-dri3 xcb-present)

add_library(termux-wsi-layer SHARED egl.c)
set_target_properties(termux-wsi-layer PROPERTIES PREFIX "")
target_compile_options(termux-wsi-layer PRIVATE ${X11_CFLAGS})
target_link_options(termux-wsi-layer PRIVATE -Wl,--no-as-needed -landroid -Wl,--as-needed -ggdb ${X11_LDFLAGS})

install(TARGETS termux-wsi-layer LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
install(FILES 10_termux.json DESTINATION ${CMAKE_INSTALL_PREFIX}/share/glvnd/egl_vendor.d)
add_custom_target(uninstall)
add_custom_command(TARGET uninstall POST_BUILD COMMAND rm ARGS -v -f
${CMAKE_INSTALL_PREFIX}/share/glvnd/egl_vendor.d/10_termux.json
${CMAKE_INSTALL_PREFIX}/lib/termux-wsi-layer.so
)
15 changes: 15 additions & 0 deletions packages/termux-wsi-layer/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
TERMUX_PKG_HOMEPAGE=https://termux.dev
TERMUX_PKG_DESCRIPTION="Termux's ICD/WSI wrapper for using with proprietary Android drivers"
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="0.0.1"
TERMUX_PKG_SKIP_SRC_EXTRACT=true
TERMUX_PKG_BUILD_DEPENDS="libglvnd, libxcb, libx11"
TERMUX_PKG_NO_STRIP=true

TERMUX_PKG_SRCDIR="$TERMUX_PREFIX/opt/termux-wsi-layer/src"

termux_step_pre_configure() {
mkdir -p "$TERMUX_PREFIX/opt/termux-wsi-layer/src"
cp -r "${TERMUX_PKG_BUILDER_DIR}/"{*.c,*.h,*.json,CMakeLists.txt} "$TERMUX_PREFIX/opt/termux-wsi-layer/src"
}
Loading

0 comments on commit fe44e30

Please sign in to comment.