Skip to content

Commit 1310ba6

Browse files
committed
mesa: build more drive vulkan
1 parent 1f390b7 commit 1310ba6

File tree

5 files changed

+59
-4
lines changed

5 files changed

+59
-4
lines changed

build-package.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ source "$TERMUX_SCRIPTDIR/scripts/build/setup/termux_setup_cmake.sh"
144144
# shellcheck source=scripts/build/setup/termux_setup_protobuf.sh
145145
source "$TERMUX_SCRIPTDIR/scripts/build/setup/termux_setup_protobuf.sh"
146146

147+
source "$TERMUX_SCRIPTDIR/scripts/build/setup/termux_setup_glslang.sh"
148+
147149
# Setup variables used by the build. Not to be overridden by packages.
148150
# shellcheck source=scripts/build/termux_step_setup_variables.sh
149151
source "$TERMUX_SCRIPTDIR/scripts/build/termux_step_setup_variables.sh"

packages/libvdpau/build.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
TERMUX_PKG_HOMEPAGE=libvdpau
2+
TERMUX_PKG_DESCRIPTION="Nvidia VDPAU library"
3+
TERMUX_PKG_LICENSE="MIT"
4+
TERMUX_PKG_MAINTAINER="@termux"
5+
TERMUX_PKG_VERSION=1.5
6+
TERMUX_PKG_SRCURL=https://gitlab.freedesktop.org/vdpau/libvdpau/-/archive/$TERMUX_PKG_VERSION/libvdpau-$TERMUX_PKG_VERSION.tar.gz
7+
TERMUX_PKG_SHA256=66490802f30426d30ff9e8af35263bbbbaa23b52d0a2d797d06959c3d19638fd
8+
TERMUX_PKG_DEPENDS="libxext"
9+
TERMUX_PKG_BUILD_DEPENDS="xorgproto"
10+
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
11+
--prefix=$TERMUX_PREFIX
12+
"
13+
14+
termux_step_pre_configure() {
15+
termux_setup_meson
16+
termux_setup_ninja
17+
}

packages/mesa/build.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ TERMUX_PKG_LICENSE="MIT"
44
TERMUX_PKG_LICENSE_FILE="docs/license.rst"
55
TERMUX_PKG_MAINTAINER="@termux"
66
TERMUX_PKG_VERSION=23.0.0
7-
TERMUX_PKG_REVISION=2
7+
TERMUX_PKG_REVISION=3
88
TERMUX_PKG_SRCURL=https://archive.mesa3d.org/mesa-${TERMUX_PKG_VERSION}.tar.xz
99
TERMUX_PKG_SHA256=01f3cff3763f09e0adabcb8011e4aebc6ad48f6a4dd4bae904fe918707d253e4
10-
TERMUX_PKG_DEPENDS="libandroid-shmem, libc++, libdrm, libexpat, libglvnd, libx11, libxext, libxfixes, libxshmfence, libxxf86vm, ncurses, zlib, zstd"
10+
TERMUX_PKG_DEPENDS="libandroid-shmem, libc++, libdrm, libexpat, libglvnd, libx11, libxext, libxfixes, libxshmfence, libxxf86vm, ncurses, zlib, zstd, glslang"
1111
TERMUX_PKG_SUGGESTS="mesa-dev"
1212
TERMUX_PKG_BUILD_DEPENDS="libllvm-static, libxrandr, llvm, llvm-tools, mlir, xorgproto"
1313
TERMUX_PKG_CONFLICTS="libmesa, ndk-sysroot (<= 25b)"
1414
TERMUX_PKG_REPLACES="libmesa"
15+
TERMUX_PKG_PYTHON_COMMON_DEPS="mako"
1516

1617
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
1718
--cmake-prefix-path $TERMUX_PREFIX
@@ -28,17 +29,19 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
2829
-Dshared-llvm=disabled
2930
-Dplatforms=x11
3031
-Dgallium-drivers=swrast,virgl
31-
-Dvulkan-drivers=swrast
32+
-Dvulkan-drivers=intel,swrast,virtio-experimental
33+
-Dvulkan-layers=device-select,intel-nullhw,overlay
3234
-Dosmesa=true
3335
-Dglvnd=true
3436
-Dxmlconfig=disabled
3537
"
3638

3739
termux_step_pre_configure() {
3840
termux_setup_cmake
41+
termux_setup_glslang
3942

4043
CPPFLAGS+=" -D__USE_GNU"
41-
LDFLAGS+=" -landroid-shmem"
44+
LDFLAGS+=" -landroid-shmem -lexpat"
4245

4346
_WRAPPER_BIN=$TERMUX_PKG_BUILDDIR/_wrapper/bin
4447
mkdir -p $_WRAPPER_BIN
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
termux_setup_glslang() {
2+
local GLSLANG_FOLDER
3+
4+
if [ "${TERMUX_PACKAGES_OFFLINE-false}" = "true" ]; then
5+
GLSLANG_FOLDER=${TERMUX_SCRIPTDIR}/build-tools/glslang-main-tot
6+
else
7+
GLSLANG_FOLDER=${TERMUX_COMMON_CACHEDIR}/glslang-main-tot
8+
fi
9+
10+
if [ "$TERMUX_ON_DEVICE_BUILD" = "false" ]; then
11+
if [ ! -d "$GLSLANG_FOLDER" ]; then
12+
mkdir -p "$GLSLANG_FOLDER"
13+
local GLSLANG_ZIP_FILE=$TERMUX_PKG_TMPDIR/glslang-main-linux-Release.zip
14+
termux_download https://github.com/KhronosGroup/glslang/releases/download/main-tot/glslang-main-linux-Release.zip \
15+
"$GLSLANG_ZIP_FILE" \
16+
b94d4f620e714bd7e213c3d7d255dc306bbf17d404dc29f693b48629201b3d3a
17+
unzip "$GLSLANG_ZIP_FILE" -d "$GLSLANG_FOLDER"
18+
fi
19+
export PATH=$GLSLANG_FOLDER/bin:$PATH
20+
else
21+
if [[ "$TERMUX_APP_PACKAGE_MANAGER" = "apt" && "$(dpkg-query -W -f '${db:Status-Status}\n' glslang 2>/dev/null)" != "installed" ]] ||
22+
[[ "$TERMUX_APP_PACKAGE_MANAGER" = "pacman" && ! "$(pacman -Q glslang 2>/dev/null)" ]]; then
23+
echo "Package 'cmake' is not installed."
24+
echo "You can install it with"
25+
echo
26+
echo " pkg install glslang"
27+
echo
28+
echo " pacman -S glslang"
29+
echo
30+
exit 1
31+
fi
32+
fi
33+
}

0 commit comments

Comments
 (0)