Description: Add the liblomiri-api include path needed by the connectivity API headers.
 The headers of liblomiri-connectivity-qt1 include <lomiri/util/DefinesPtrs.h>, which
 is provided by liblomiri-api. lomiri-connectivity-qt1.pc only advertises that
 dependency since version 1.99.0 ("Requires: liblomiri-api"), therefore the include
 directory reported by liblomiri-api.pc is added explicitly to the plugin target.
 This works with both header layouts: liblomiri-api 0.2.x installs its headers below
 the default /usr/include, while 0.3.x moved them to /usr/include/lomiri-api.
Author: tangxiaofeng <tangxiaofeng@kylinos.cn>
Forwarded: not-needed

--- lomiri-push-qml-0.3.1.orig/CMakeLists.txt
+++ lomiri-push-qml-0.3.1/CMakeLists.txt
@@ -40,6 +40,11 @@ find_package(Qt5Quick REQUIRED)
 
 find_package (PkgConfig)
 pkg_check_modules (CONNECTIVITY REQUIRED lomiri-connectivity-qt1)
+# connectivityqt/connectivity.h includes <lomiri/util/DefinesPtrs.h>, which is shipped
+# by liblomiri-api. lomiri-connectivity-qt1.pc only advertises that dependency since
+# version 1.99.0 ("Requires: liblomiri-api"), so the include directory reported by
+# liblomiri-api.pc is queried here as well.
+pkg_check_modules (LOMIRI_API liblomiri-api)
 
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 set(CMAKE_AUTOMOC ON)
--- lomiri-push-qml-0.3.1.orig/src/Lomiri/PushNotifications/CMakeLists.txt
+++ lomiri-push-qml-0.3.1/src/Lomiri/PushNotifications/CMakeLists.txt
@@ -20,6 +20,15 @@ add_library(${PLUGIN} MODULE ${PLUGIN_SR
 target_link_libraries(${PLUGIN} Qt5::Core Qt5::Gui Qt5::Qml Qt5::DBus)
 
 include_directories(${CONNECTIVITY_INCLUDE_DIRS})
+# The connectivity API headers include <lomiri/util/DefinesPtrs.h>, which is provided by
+# liblomiri-api. Not every lomiri-connectivity-qt1.pc version advertises that dependency
+# (the "Requires: liblomiri-api" entry was only added in 1.99.0), so the include directory
+# from liblomiri-api.pc is added explicitly. This is a no-op for liblomiri-api 0.2.x, whose
+# headers live below the default /usr/include, and it provides the required
+# -I/usr/include/lomiri-api for 0.3.x, where the headers moved there.
+if(LOMIRI_API_FOUND)
+    include_directories(${LOMIRI_API_INCLUDE_DIRS})
+endif()
 target_link_libraries(${PLUGIN} ${CONNECTIVITY_LDFLAGS})
 
 file(GLOB QML_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.qml qmldir *.js)

