From 8f7ccf0124d5f8c2cd563a5c80dd18902b322781 Mon Sep 17 00:00:00 2001 From: Yuri Victorovich Date: Sun, 16 May 2021 10:51:05 -0700 Subject: [PATCH] devel/py-bullet3: Update 3.09 -> 3.17 Also: * Add missing dependencies * Add the test target based on the example from the documentation Reported by: portscout --- devel/py-bullet3/Makefile | 10 ++++++++-- devel/py-bullet3/distinfo | 6 +++--- devel/py-bullet3/files/test.py | 17 +++++++++++++++++ 3 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 devel/py-bullet3/files/test.py diff --git a/devel/py-bullet3/Makefile b/devel/py-bullet3/Makefile index 34906bb68480d..bcf9e9349e6c6 100644 --- a/devel/py-bullet3/Makefile +++ b/devel/py-bullet3/Makefile @@ -1,5 +1,5 @@ PORTNAME= bullet3 -DISTVERSION= 3.09 +DISTVERSION= 3.17 CATEGORIES= devel PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -9,8 +9,11 @@ COMMENT= Python version of 3D collision detection library Bullet LICENSE= ZLIB LICENSE_FILE= ${WRKSRC}/LICENSE.txt +RUN_DEPENDS= ${PYNUMPY} \ + ${PYTHON_PKGNAMEPREFIX}gym>0:math/py-gym@${PY_FLAVOR} + USES= compiler:c++11-lang gl localbase python:3.6+ -USE_PYTHON= autoplist distutils +USE_PYTHON= distutils autoplist USE_GL= gl glew USE_GITHUB= yes @@ -19,4 +22,7 @@ GH_ACCOUNT= bulletphysics post-install: @${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/pybullet*.so +do-test: install # test require graphical environment + @${PYTHON_CMD} ${FILESDIR}/test.py + .include diff --git a/devel/py-bullet3/distinfo b/devel/py-bullet3/distinfo index ac38f69c08282..86991172c2a33 100644 --- a/devel/py-bullet3/distinfo +++ b/devel/py-bullet3/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1614982042 -SHA256 (bulletphysics-bullet3-3.09_GH0.tar.gz) = f2feef9322329c0571d9066fede2db0ede92b19f7f7fdf54def3b4651f02af03 -SIZE (bulletphysics-bullet3-3.09_GH0.tar.gz) = 129274815 +TIMESTAMP = 1621185390 +SHA256 (bulletphysics-bullet3-3.17_GH0.tar.gz) = baa642c906576d4d98d041d0acb80d85dd6eff6e3c16a009b1abf1ccd2bc0a61 +SIZE (bulletphysics-bullet3-3.17_GH0.tar.gz) = 131995187 diff --git a/devel/py-bullet3/files/test.py b/devel/py-bullet3/files/test.py new file mode 100644 index 0000000000000..935f98e87108b --- /dev/null +++ b/devel/py-bullet3/files/test.py @@ -0,0 +1,17 @@ +import pybullet as p +import time +import pybullet_data + +physicsClient = p.connect(p.GUI)#or p.DIRECT for non-graphical version +p.setAdditionalSearchPath(pybullet_data.getDataPath()) #optionally +p.setGravity(0,0,-10) +planeId = p.loadURDF("plane.urdf") +cubeStartPos = [0,0,1] +cubeStartOrientation = p.getQuaternionFromEuler([0,0,0]) +boxId = p.loadURDF("r2d2.urdf",cubeStartPos, cubeStartOrientation) +for i in range (10000): + p.stepSimulation() + time.sleep(1./240.) +cubePos, cubeOrn = p.getBasePositionAndOrientation(boxId) +print(cubePos,cubeOrn) +p.disconnect()