From 9deb411f36c92bbafd2a5114198c5cc96f960a04 Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Thu, 14 Dec 2023 18:13:18 -0500 Subject: [PATCH] Fix packaging of headers and pkgconfig .pc file. --- python-install-headers.patch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python-install-headers.patch b/python-install-headers.patch index 4bc734f..a57b0de 100644 --- a/python-install-headers.patch +++ b/python-install-headers.patch @@ -6,7 +6,7 @@ +# Find all include files. +include_files = [] -+for (path, directories, filenames) in os.walk('include/'): ++for (path, directories, filenames) in os.walk('mlpack/include/'): + for filename in filenames: + include_files.append(os.path.join('..', path, filename)) + @@ -17,7 +17,7 @@ install_requires=['cython>=0.24', 'numpy', 'pandas'], package_dir={ '': '.' }, # Might be superfluous. packages=['mlpack'], -+ package_data={ 'mlpack': include_files + ['../share/pkgconfig/mlpack.pc'] }, ++ package_data={ 'mlpack': include_files + ['../mlpack/share/pkgconfig/mlpack.pc'] }, + include_package_data=True, cmdclass={ 'build_ext': build_ext }, ext_modules = modules, @@ -32,16 +32,16 @@ +add_custom_command(TARGET python_copy PRE_BUILD + COMMAND ${CMAKE_COMMAND} ARGS -E copy_directory + ${CMAKE_SOURCE_DIR}/src/ -+ ${CMAKE_BINARY_DIR}/src/mlpack/bindings/python/include/) ++ ${CMAKE_BINARY_DIR}/src/mlpack/bindings/python/mlpack/include/) + +# Generate pkgconfig file for easy use of included headers. +add_custom_target(python_pkgconfig + COMMAND ${CMAKE_COMMAND} + -D GENERATE_CPP_IN=${CMAKE_SOURCE_DIR}/src/mlpack/bindings/python/mlpack.pc.in -+ -D GENERATE_CPP_OUT=${CMAKE_BINARY_DIR}/src/mlpack/bindings/python/share/pkgconfig/mlpack.pc ++ -D GENERATE_CPP_OUT=${CMAKE_BINARY_DIR}/src/mlpack/bindings/python/mlpack/share/pkgconfig/mlpack.pc + -D PACKAGE_VERSION="${PACKAGE_VERSION}" + -P "${CMAKE_SOURCE_DIR}/CMake/ConfigureFileOnly.cmake" -+ BYPRODUCTS "${CMAKE_BINARY_DIR}/src/mlpack/bindings/python/share/pkgconfig/mlpack.pc" ++ BYPRODUCTS "${CMAKE_BINARY_DIR}/src/mlpack/bindings/python/mlpack/share/pkgconfig/mlpack.pc" + COMMENT "Configuring Python mlpack.pc...") +add_dependencies(python_copy python_pkgconfig) +