libglvnd: Enable SOVERSION suffix
This commit is contained in:
parent
924694aaec
commit
46c5cd3d74
|
@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="The GL Vendor-Neutral Dispatch library"
|
|||
TERMUX_PKG_LICENSE="custom"
|
||||
TERMUX_PKG_MAINTAINER="@termux"
|
||||
TERMUX_PKG_VERSION=1.6.0
|
||||
TERMUX_PKG_REVISION=1
|
||||
TERMUX_PKG_SRCURL=https://gitlab.freedesktop.org/glvnd/libglvnd/-/archive/v${TERMUX_PKG_VERSION}/libglvnd-v${TERMUX_PKG_VERSION}.tar.gz
|
||||
TERMUX_PKG_SHA256=efc756ffd24b24059e1c53677a9d57b4b237b00a01c54a6f1611e1e51661d70c
|
||||
TERMUX_PKG_DEPENDS="libc++, libx11, libxext"
|
||||
|
@ -16,21 +17,35 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
|
|||
-Ddispatch-tls=false
|
||||
"
|
||||
|
||||
termux_step_pre_configure() {
|
||||
# SOVERSION suffix is needed for SONAME of shared libs to avoid conflict
|
||||
# with system ones (in /system/lib64 or /system/lib):
|
||||
export TERMUX_MESON_ENABLE_SOVERSION=1
|
||||
}
|
||||
|
||||
termux_step_post_make_install() {
|
||||
patch --no-backup-if-mismatch -p1 -d $TERMUX_PREFIX/include \
|
||||
< $TERMUX_PKG_BUILDER_DIR/egl-not-android.diff
|
||||
}
|
||||
|
||||
termux_step_install_license() {
|
||||
install -Dm600 -t $TERMUX_PREFIX/share/doc/$TERMUX_PKG_NAME \
|
||||
$TERMUX_PKG_BUILDER_DIR/LICENSE
|
||||
}
|
||||
|
||||
termux_step_post_make_install() {
|
||||
termux_step_post_massage() {
|
||||
# A bunch of programs in the wild assume that the name of OpenGL shared
|
||||
# library is `libGL.so.1` and try to dlopen(3) it. In fact `sdl2` does
|
||||
# this. So please do not ever remove the symlink.
|
||||
ln -sf libGL.so ${TERMUX_PREFIX}/lib/libGL.so.1
|
||||
ln -sf libEGL.so ${TERMUX_PREFIX}/lib/libEGL.so.1
|
||||
ln -sf libGLESv1_CM.so ${TERMUX_PREFIX}/lib/libGLESv1_CM.so.1
|
||||
ln -sf libGLESv2.so ${TERMUX_PREFIX}/lib/libGLESv2.so.2
|
||||
ln -sf libGLX.so ${TERMUX_PREFIX}/lib/libGLX.so.0
|
||||
ln -sf libOpenGL.so ${TERMUX_PREFIX}/lib/libOpenGL.so.0
|
||||
|
||||
patch -p1 -d $TERMUX_PREFIX/include < $TERMUX_PKG_BUILDER_DIR/egl-not-android.diff
|
||||
# this. Also `libEGL.so` and some others need SOVERSION suffix to avoid
|
||||
# conflict with system ones. So let's check if SONAME is properly set.
|
||||
local n
|
||||
for n in GL EGL GLESv1_CM GLESv2; do
|
||||
local f="lib/lib${n}.so"
|
||||
if [ ! -e "${f}" ]; then
|
||||
termux_error_exit "Shared library ${f} does not exist."
|
||||
fi
|
||||
if ! readelf -d "${f}" | grep -q '(SONAME).*\[lib'"${n}"'\.so\.'; then
|
||||
termux_error_exit "SONAME for ${f} is not properly set."
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue