Skip to content

Build installs Python module in wrong place #341

Description

@flyn-org

I maintain the pocketsphinx package for Fedora, and I am presently trying to package the recent 5.0.0. release. I cannot figure out how to cause cmake to install the Python module in the correct place. I wrote the following patch, which aims to fix this:

diff -u --recursive pocketsphinx-5.0.0-vanilla/cython/CMakeLists.txt pocketsphinx-5.0.0/cython/CMakeLists.txt
--- pocketsphinx-5.0.0-vanilla/cython/CMakeLists.txt	2022-10-05 08:52:38.000000000 -0500
+++ pocketsphinx-5.0.0/cython/CMakeLists.txt	2023-05-15 17:00:54.298758625 -0500
@@ -19,7 +19,7 @@
   _pocketsphinx INTERFACE ${CMAKE_BINARY_DIR}/include
   )
 python_extension_module(_pocketsphinx)
-install(TARGETS _pocketsphinx LIBRARY DESTINATION cython/pocketsphinx)
+install(TARGETS _pocketsphinx LIBRARY DESTINATION ${CMAKE_INSTALL_PYDIR}/pocketsphinx)
 if(NOT USE_INSTALLED_POCKETSPHINX)
-  install(DIRECTORY ${PROJECT_SOURCE_DIR}/model DESTINATION cython/pocketsphinx)
+  install(DIRECTORY ${PROJECT_SOURCE_DIR}/model DESTINATION ${CMAKE_INSTALL_PYDIR}/pocketsphinx)
 endif()

With this patch applied, I can build pocketsphinx by providiing cmake with this argument: -DCMAKE_INSTALL_PYDIR="/usr/lib64/python3.11/site-packages/". Does this make sense? I would be happy to establish a pull request, but I wasn't sure I was going about this right.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions