new package: panda3d

This commit is contained in:
Tee KOBAYASHI 2022-04-12 00:38:55 +09:00 committed by xtkoba
parent 75de073206
commit 74fa55c271
4 changed files with 89 additions and 0 deletions

34
packages/panda3d/build.sh Normal file
View File

@ -0,0 +1,34 @@
TERMUX_PKG_HOMEPAGE=https://www.panda3d.org/
TERMUX_PKG_DESCRIPTION="A framework for 3D rendering and game development for Python and C++ programs"
TERMUX_PKG_LICENSE="BSD 3-Clause"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=1.10.11
TERMUX_PKG_SRCURL=https://github.com/panda3d/panda3d/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=192b95135f91a1db493a839f9438207c8b51d2209d3a1d3b5f050c39931c4cd8
TERMUX_PKG_DEPENDS="libc++, python"
TERMUX_PKG_BUILD_DEPENDS="libandroid-glob"
TERMUX_PKG_BUILD_IN_SRC=true
termux_step_pre_configure() {
_PYTHON_VERSION=$(. $TERMUX_SCRIPTDIR/packages/python/build.sh; echo $_MAJOR_VERSION)
termux_setup_python_crossenv
pushd $TERMUX_PYTHON_CROSSENV_SRCDIR
_CROSSENV_PREFIX=$TERMUX_PKG_BUILDDIR/python-crossenv-prefix
python${_PYTHON_VERSION} -m crossenv \
$TERMUX_PREFIX/bin/python${_PYTHON_VERSION} \
${_CROSSENV_PREFIX}
popd
. ${_CROSSENV_PREFIX}/bin/activate
CFLAGS+=" $CPPFLAGS"
CXXFLAGS+=" $CPPFLAGS"
LDFLAGS+=" -Wl,-rpath=$TERMUX_PREFIX/lib/panda3d"
}
termux_step_make() {
python makepanda/makepanda.py --nothing
}
termux_step_make_install() {
python makepanda/installpanda.py --prefix $TERMUX_PREFIX
}

View File

@ -0,0 +1,20 @@
--- a/dtool/src/dtoolutil/filename.cxx
+++ b/dtool/src/dtoolutil/filename.cxx
@@ -561,7 +561,7 @@
#else
// Posix case.
- temp_directory = "/tmp";
+ temp_directory = "@TERMUX_PREFIX@/tmp";
#endif // WIN32
if (temp_directory.empty()) {
@@ -668,7 +668,7 @@
#elif defined(__FreeBSD__)
common_appdata_directory = "/usr/local/share";
#else
- common_appdata_directory = "/usr/share";
+ common_appdata_directory = "@TERMUX_PREFIX@/share";
#endif // WIN32
if (common_appdata_directory.empty()) {

View File

@ -0,0 +1,32 @@
--- a/makepanda/installpanda.py
+++ b/makepanda/installpanda.py
@@ -119,7 +119,7 @@
something like "lib" or "lib64" or in some cases, something
similar to "lib/x86_64-linux-gnu". """
- if sys.platform in ("darwin", "win32", "cygwin"):
+ if True:
return "lib"
# This one's a bit tricky. Some systems require us to install
@@ -182,7 +182,7 @@
# Write the Config.prc file.
Configrc = ReadFile(outputdir+"/etc/Config.prc")
Configrc = Configrc.replace("model-path $THIS_PRC_DIR/..", "model-path "+prefix+"/share/panda3d")
- if (sys.platform.startswith("freebsd")):
+ if True:
WriteFile(destdir+prefix+"/etc/Config.prc", Configrc)
oscmd("cp "+outputdir+"/etc/Confauto.prc "+destdir+prefix+"/etc/Confauto.prc")
else:
@@ -220,11 +220,6 @@
if os.path.isdir(outputdir+"/panda3d.dist-info"):
oscmd("cp -R "+outputdir+"/panda3d.dist-info "+destdir+python_version["platlib"])
- if (sys.platform.startswith("freebsd")):
- oscmd("echo '"+libdir+"/panda3d'> "+destdir+"/usr/local/libdata/ldconfig/panda3d")
- else:
- oscmd("echo '"+libdir+"/panda3d'> "+destdir+"/etc/ld.so.conf.d/panda3d.conf")
-
for base in os.listdir(outputdir+"/lib"):
if (not base.endswith(".a")) or base == "libp3pystub.a":
# We really need to specify -R in order not to follow symlinks on non-GNU

View File

@ -0,0 +1,3 @@
TERMUX_SUBPKG_DESCRIPTION="Python sample programs that use Panda3D"
TERMUX_SUBPKG_PLATFORM_INDEPENDENT=true
TERMUX_SUBPKG_INCLUDE="share/panda3d/samples/"