FS#76683 - [ogre] No python bindings

Attached to Project: Community Packages
Opened by Paul Melis (paulmelis) - Sunday, 27 November 2022, 18:16 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Wednesday, 07 December 2022, 07:32 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sven-Hendrik Haase (Svenstaro)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

In 13.5.2-1 no Python bindings are available, even though having `python` package installed suggests as much in the post-install.
It seems -DOGRE_BUILD_COMPONENT_PYTHON=ON is missing in the build file. Adding this to `PKGBUILD` and doing a build locally indeed adds Python bindings, but then installs them in /usr/lib/python3.10/dist-packages, strange.

Additional info:
* package version 13.5.2-1, including python installed

melis@juggle 17:49:/usr/lib$ pacman -Qi ogre
Name : ogre
Version : 13.5.2-1
Description : Scene-oriented, flexible 3D engine written in C++
Architecture : x86_64
URL : http://www.ogre3d.org
Licenses : custom:MIT
Groups : None
Provides : None
Depends On : freeimage freetype2 libxaw libxrandr sdl2 glu pugixml zlib
Optional Deps : python: python bindings [installed]
Required By : None
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 216.33 MiB
Packager : Sven-Hendrik Haase <svenstaro@gmail.com>
Build Date : Mon 21 Nov 2022 12:23:56 PM CET
Install Date : Sun 27 Nov 2022 05:45:24 PM CET
Install Reason : Explicitly installed
Install Script : Yes
Validated By : Signature


Steps to reproduce:
This task depends upon

Closed by  Sven-Hendrik Haase (Svenstaro)
Wednesday, 07 December 2022, 07:32 GMT
Reason for closing:  Fixed
Comment by loqs (loqs) - Sunday, 27 November 2022, 22:52 GMT
The default appears to be to build the python bindings [1]. It seems swig is required to build the python bindings [2]. The site directory has to be specified [3].
Please try the attached diff.

[1] https://github.com/OGRECave/ogre/blob/v13.5.2/CMakeLists.txt#L341
[2] https://github.com/OGRECave/ogre/blob/v13.5.2/Components/Python/CMakeLists.txt#L1
[3] https://github.com/OGRECave/ogre/commit/f3a5cfb11d85be211cebb4645dc538663c3aa568
Comment by Paul Melis (paulmelis) - Monday, 28 November 2022, 14:44 GMT
Well, the patch definitely helps in building the Python bindings. But the PYTHON_SITE_PACKAGES option seems to be ignored: even though `python -c "import sysconfig; print(sysconfig.get_paths()[\"platlib\"])"` evaluates to `/usr/lib/python3.10/site-packages` here, the bindings still end up in `/usr/lib/python3.10/dist-packages`
Comment by loqs (loqs) - Monday, 28 November 2022, 17:44 GMT
PYTHON_SITE_PACKAGES was not set as a CACHE variable so it could not be set.
Comment by Paul Melis (paulmelis) - Tuesday, 29 November 2022, 09:12 GMT
This almost works. The latest patch strips off the `/Ogre/` destination dir for the Python files, breaking the Ogre Python package. Attaching the PKGBUILD that works for me, based on your patch, updated for 13.5.3 (released a few days ago).
   PKGBUILD (1.7 KiB)
Comment by Sven-Hendrik Haase (Svenstaro) - Tuesday, 29 November 2022, 18:25 GMT
Thanks for the PKGBUILD. Check the new package in repos.

Loading...