From 86b624c474b9b9edbe937078887b1fc2136335e5 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Sun, 27 Aug 2023 21:42:46 -0400 Subject: [PATCH] lensfun: add cmake build patch Signed-off-by: Rui Chen --- lensfun/0.3.4.patch | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 lensfun/0.3.4.patch diff --git a/lensfun/0.3.4.patch b/lensfun/0.3.4.patch new file mode 100644 index 00000000..40faeab4 --- /dev/null +++ b/lensfun/0.3.4.patch @@ -0,0 +1,38 @@ +diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt +index 2f6f8f1..8e4cf24 100644 +--- a/apps/CMakeLists.txt ++++ b/apps/CMakeLists.txt +@@ -22,25 +22,23 @@ ENDIF(INSTALL_HELPER_SCRIPTS) + # Inspired by http://bloerg.net/2012/11/10/cmake-and-distutils.html + + FIND_PROGRAM(PYTHON "python3") +-IF(PYTHON) ++FIND_PROGRAM(PIP "pip3") ++IF(PYTHON AND PIP) + SET(SETUP_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in") + SET(SETUP_PY "${CMAKE_CURRENT_BINARY_DIR}/setup.py") + SET(DEPS_IN "${CMAKE_CURRENT_SOURCE_DIR}/lensfun/__init__.py.in") + SET(DEPS "${CMAKE_CURRENT_BINARY_DIR}/lensfun/__init__.py") +- SET(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/build/timestamp") + + CONFIGURE_FILE(${SETUP_PY_IN} ${SETUP_PY}) + CONFIGURE_FILE(${DEPS_IN} ${DEPS}) + +- ADD_CUSTOM_COMMAND(OUTPUT ${OUTPUT} +- COMMAND ${PYTHON} ${SETUP_PY} build +- COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT} +- DEPENDS ${DEPS_IN}) +- +- ADD_CUSTOM_TARGET(python-package ALL DEPENDS ${OUTPUT}) ++ ADD_CUSTOM_TARGET(python-package ALL ++ COMMAND ${PIP} install . ++ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ++ COMMENT "Installing python package using pip") + + IF(NOT DEFINED SETUP_PY_INSTALL_PREFIX) + SET(SETUP_PY_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + ENDIF() +- INSTALL(CODE "execute_process(COMMAND ${PYTHON} ${SETUP_PY} install --prefix=\$ENV{DESTDIR}${SETUP_PY_INSTALL_PREFIX})") +-ENDIF(PYTHON) ++ INSTALL(CODE "execute_process(COMMAND ${PIP} install . --prefix=\$ENV{DESTDIR}${SETUP_PY_INSTALL_PREFIX} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})") ++ENDIF(PYTHON AND PIP)