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

fix(main/panda3d): enable python package #21915

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
18 changes: 16 additions & 2 deletions packages/panda3d/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="A framework for 3D rendering and game development for Py
TERMUX_PKG_LICENSE="BSD 3-Clause"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="1.10.14"
TERMUX_PKG_REVISION=1
TERMUX_PKG_REVISION=2
TERMUX_PKG_SRCURL=https://github.com/panda3d/panda3d/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=3ff568db545102f87d3e1191ba6a2f3cdc97ff2f62056973cf354743dd880591
TERMUX_PKG_AUTO_UPDATE=true
Expand All @@ -16,12 +16,26 @@ termux_step_pre_configure() {
CFLAGS+=" $CPPFLAGS"
CXXFLAGS+=" $CPPFLAGS"
LDFLAGS+=" -Wl,-rpath=$TERMUX_PREFIX/lib/panda3d"

# makewheel.py requires ldd, host ldd does not work with bionic libraries.
mkdir "$TERMUX_PKG_TMPDIR/bin"
echo "#!/bin/bash" > "$TERMUX_PKG_TMPDIR/bin/ldd"
echo "readelf -d \$1 | grep \"NEEDED\" | awk '{ gsub(/\[|\]/, \"\", \$NF); print \$NF, \"NEEDED\" }'" >> "$TERMUX_PKG_TMPDIR/bin/ldd"
chmod +x "$TERMUX_PKG_TMPDIR/bin/ldd"
PATH="$TERMUX_PKG_TMPDIR/bin:$PATH"
}

termux_step_make() {
python makepanda/makepanda.py --nothing
python makepanda/makepanda.py --nothing --wheel --use-python
}

termux_step_make_install() {
python makepanda/installpanda.py --prefix $TERMUX_PREFIX

local _pyv="${TERMUX_PYTHON_VERSION/./}"
local _whl="panda3d-$TERMUX_PKG_VERSION-cp$_pyv-cp$_pyv-linux_$TERMUX_ARCH.whl"
pip install --no-deps --prefix=$TERMUX_PREFIX --force-reinstall $TERMUX_PKG_SRCDIR/$_whl

# For some reason it packages python libraries of host.
rm -rf $TERMUX_PREFIX/lib/python${TERMUX_PYTHON_VERSION}/site-packages/deploy_libs
}