void-packages/srcpkgs/kauth/patches/crossbuild-support.patch

46 lines
2.4 KiB
Diff

diff --git KF5AuthConfig.cmake.in KF5AuthConfig.cmake.in
index 0895e60..59fe53b 100644
--- KF5AuthConfig.cmake.in
+++ KF5AuthConfig.cmake.in
@@ -17,8 +17,8 @@ include("${CMAKE_CURRENT_LIST_DIR}/KF5AuthMacros.cmake")
if(NOT "${KAUTH_BACKEND_NAME}" STREQUAL "FAKE")
if(CMAKE_CROSSCOMPILING AND KF5_HOST_TOOLING)
- find_file(TARGETSFILE KF5Auth/KF5AuthToolsTargets.cmake PATHS ${KF5_HOST_TOOLING} ${CMAKE_CURRENT_LIST_DIR} NO_DEFAULT_PATH)
- include("${TARGETSFILE}")
+ find_file(TARGETSFILE_AUTH KF5Auth/KF5AuthToolsTargets.cmake PATHS ${KF5_HOST_TOOLING} ${CMAKE_CURRENT_LIST_DIR} NO_DEFAULT_PATH)
+ include("${TARGETSFILE_AUTH}")
else()
include("${CMAKE_CURRENT_LIST_DIR}/KF5AuthToolsTargets.cmake")
endif()
--- cmake/KF5AuthMacros.cmake 2018-08-26 14:57:02.703186769 +0200
+++ cmake/KF5AuthMacros.cmake 2018-08-26 14:58:26.469054620 +0200
@@ -63,12 +63,21 @@
set(_output ${CMAKE_CURRENT_BINARY_DIR}/${HELPER_ID}.policy)
get_filename_component(_input ${ACTIONS_FILE} ABSOLUTE)
- add_custom_command(OUTPUT ${_output}
- COMMAND KF5::kauth-policy-gen ${_input} ${_output}
- MAIN_DEPENDENCY ${_input}
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- COMMENT "Generating ${HELPER_ID}.policy"
- DEPENDS KF5::kauth-policy-gen)
+ if(CMAKE_CROSSCOMPILING)
+ add_custom_command(OUTPUT ${_output}
+ COMMAND "/usr/lib/libexec/kauth/kauth-policy-gen" ${_input} ${_output}
+ MAIN_DEPENDENCY ${_input}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMENT "Generating ${HELPER_ID}.policy"
+ DEPENDS KF5::kauth-policy-gen)
+ else()
+ add_custom_command(OUTPUT ${_output}
+ COMMAND KF5::kauth-policy-gen ${_input} ${_output}
+ MAIN_DEPENDENCY ${_input}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMENT "Generating ${HELPER_ID}.policy"
+ DEPENDS KF5::kauth-policy-gen)
+ endif()
add_custom_target(${HELPER_ID}.policy-customtarget ALL COMMENT "actions for ${HELPER_ID}" DEPENDS ${_output})
install(FILES ${_output} DESTINATION ${KAUTH_POLICY_FILES_INSTALL_DIR})