0
0
mirror of https://github.com/termux/termux-packages.git synced 2024-12-12 14:13:36 +00:00
Twaik Yont a338cd8a4f chore: moving pkg-config wrapping to a function [no ci]
There are 64 packages with such a code
```
	local _WRAPPER_BIN="${TERMUX_PKG_BUILDDIR}/_wrapper/bin"
	mkdir -p "${_WRAPPER_BIN}"
	if [[ "${TERMUX_ON_DEVICE_BUILD}" == "false" ]]; then
		sed "s|^export PKG_CONFIG_LIBDIR=|export PKG_CONFIG_LIBDIR=${TERMUX_PREFIX}/opt/glib/cross/lib/x86_64-linux-gnu/pkgconfig:|" \
			"${TERMUX_STANDALONE_TOOLCHAIN}/bin/pkg-config" \
			> "${_WRAPPER_BIN}/pkg-config"
		chmod +x "${_WRAPPER_BIN}/pkg-config"
		export PKG_CONFIG="${_WRAPPER_BIN}/pkg-config"
	fi
	export PATH="${_WRAPPER_BIN}:${PATH}"
```
In most cases this code is same, in some cases it is done for libwayland cross building. And it is not obvious what exactly happens here.
This commit makes it more obvious and easier to read.
[no ci]
2024-10-11 16:03:17 +03:00

55 lines
1.6 KiB
Bash

TERMUX_PKG_HOMEPAGE=https://www.mesa3d.org
TERMUX_PKG_DESCRIPTION="An open-source implementation of the OpenGL specification"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_LICENSE_FILE="docs/license.rst"
TERMUX_PKG_MAINTAINER="xMeM <haooy@outlook.com>"
TERMUX_PKG_VERSION="24.0.4"
TERMUX_PKG_SRCURL=https://archive.mesa3d.org/mesa-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=90febd30a098cbcd97ff62ecc3dcf5c93d76f7fa314de944cfce81951ba745f0
TERMUX_PKG_DEPENDS="libandroid-shmem, libc++, libdrm, libx11, libxcb, libxshmfence, libwayland, vulkan-loader-generic, zlib, zstd"
TERMUX_PKG_BUILD_DEPENDS="libwayland-protocols, libxrandr, xorgproto"
TERMUX_PKG_CONFLICTS="mesa-vulkan-icd-freedreno"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
--cmake-prefix-path $TERMUX_PREFIX
-Dcpp_rtti=false
-Dgbm=disabled
-Dopengl=false
-Dllvm=disabled
-Dshared-llvm=disabled
-Dplatforms=x11,wayland
-Dgallium-drivers=
-Dxmlconfig=disabled
-Dvulkan-drivers=freedreno
-Dfreedreno-kmds=msm,kgsl
"
TERMUX_PKG_BLACKLISTED_ARCHES="i686, x86_64"
termux_step_post_get_source() {
# Do not use meson wrap projects
rm -rf subprojects
}
termux_step_pre_configure() {
termux_setup_cmake
CPPFLAGS+=" -D__USE_GNU"
LDFLAGS+=" -landroid-shmem"
_WRAPPER_BIN=$TERMUX_PKG_BUILDDIR/_wrapper/bin
mkdir -p $_WRAPPER_BIN
if [ "$TERMUX_ON_DEVICE_BUILD" = "false" ]; then
sed 's|@CMAKE@|'"$(command -v cmake)"'|g' \
$TERMUX_PKG_BUILDER_DIR/cmake-wrapper.in \
> $_WRAPPER_BIN/cmake
chmod 0700 $_WRAPPER_BIN/cmake
termux_setup_wayland_cross_pkg_config_wrapper
fi
export PATH=$_WRAPPER_BIN:$PATH
}
termux_step_post_configure() {
rm -f $_WRAPPER_BIN/cmake
}