void-packages/srcpkgs/libical/patches/fix-cross.patch

57 lines
2.2 KiB
Diff

--- a/src/libical-glib/CMakeLists.txt.orig
+++ b/src/libical-glib/CMakeLists.txt
@@ -1,25 +1,9 @@
add_definitions(-Dlibical_ical_EXPORTS)
# build ical-glib-src-generator
-add_executable(ical-glib-src-generator
- tools/generator.c
- tools/generator.h
- tools/xml-parser.c
- tools/xml-parser.h
-)
-
-target_compile_options(ical-glib-src-generator PUBLIC ${GLIB_CFLAGS} ${LIBXML_CFLAGS} -DG_LOG_DOMAIN=\"src-generator\")
-target_link_libraries(ical-glib-src-generator ${GLIB_LIBRARIES} ${LIBXML_LIBRARIES})
-
-install(
- TARGETS ical-glib-src-generator
- EXPORT IcalGlibSrcGenerator
- RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/libical
-)
-install(
- EXPORT IcalGlibSrcGenerator
- NAMESPACE native-
- DESTINATION ${LIB_INSTALL_DIR}/cmake/LibIcal
+add_custom_command(
+ OUTPUT ${EXECUTABLE_OUTPUT_PATH}/ical-glib-src-generator
+ COMMAND /usr/bin/cc ${CMAKE_CURRENT_SOURCE_DIR}/tools/generator.c ${CMAKE_CURRENT_SOURCE_DIR}/tools/xml-parser.c -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2 -I${CMAKE_CURRENT_SOURCE_DIR}/tools/ -lxml2 -lglib-2.0 -o ${EXECUTABLE_OUTPUT_PATH}/ical-glib-src-generator
)
list(APPEND API_FILES
@@ -72,22 +56,10 @@
list(APPEND xml_files ${xml_file_fullpath})
endforeach()
-if(CMAKE_CROSSCOMPILING)
- # import native ical-glib-src-generator when cross-compiling
- set(IMPORT_ICAL_GLIB_SRC_GENERATOR "ICAL_GLIB_SRC_GENERATOR-NOTFOUND"
- CACHE FILEPATH
- "Path to exported ical-glib-src-generator target from native build"
- )
- include(${IMPORT_ICAL_GLIB_SRC_GENERATOR})
- set(ical-glib-src-generator_EXE native-ical-glib-src-generator)
-else()
- set(ical-glib-src-generator_EXE ical-glib-src-generator)
-endif()
-
add_custom_command (
OUTPUT ${LIBICAL_GLIB_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/libical-glib-private.h ${CMAKE_CURRENT_BINARY_DIR}/i-cal-forward-declarations.h
- COMMAND ${ical-glib-src-generator_EXE} "${CMAKE_CURRENT_SOURCE_DIR}/tools" "${CMAKE_CURRENT_SOURCE_DIR}/api"
- DEPENDS ${ical-glib-src-generator_EXE} ${xml_files}
+ COMMAND ${EXECUTABLE_OUTPUT_PATH}/ical-glib-src-generator "${CMAKE_CURRENT_SOURCE_DIR}/tools" "${CMAKE_CURRENT_SOURCE_DIR}/api"
+ DEPENDS ${EXECUTABLE_OUTPUT_PATH}/ical-glib-src-generator ${xml_files}
)
configure_file(