From 00fd796a2efb9ffdf59546ccaa8dfcfb44ad3708 Mon Sep 17 00:00:00 2001 From: Bart Ribbers Date: Wed, 24 Feb 2021 22:58:35 +0100 Subject: [PATCH] main/mapbox-gl-native: upgrade to 1.6.0 (MR 1997) Fix previous version not building anymore, as seen on v21.03 branch: https://builds.sr.ht/~postmarketos/job/433826 --- ...d-support-for-qmapboxgl-installation.patch | 113 ++++++++++++++++++ .../0002-versioned-libraries.patch | 91 ++++++++++++++ main/mapbox-gl-native/APKBUILD | 46 +++---- 3 files changed, 229 insertions(+), 21 deletions(-) create mode 100644 main/mapbox-gl-native/0001-add-support-for-qmapboxgl-installation.patch create mode 100644 main/mapbox-gl-native/0002-versioned-libraries.patch diff --git a/main/mapbox-gl-native/0001-add-support-for-qmapboxgl-installation.patch b/main/mapbox-gl-native/0001-add-support-for-qmapboxgl-installation.patch new file mode 100644 index 000000000..a34f3ca98 --- /dev/null +++ b/main/mapbox-gl-native/0001-add-support-for-qmapboxgl-installation.patch @@ -0,0 +1,113 @@ +From e18467d755f470b26f61f6893eddd76ecf0816e6 Mon Sep 17 00:00:00 2001 +From: Rinigus +Date: Sun, 22 Nov 2020 18:47:41 +0200 +Subject: [PATCH] [build][qt] Add support for qmapboxgl installation + +Adds install target for Qt version of the library. Allows to +select which parts of Qt platform are built +--- + platform/qt/qt.cmake | 58 +++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 54 insertions(+), 4 deletions(-) + +diff --git a/platform/qt/qt.cmake b/platform/qt/qt.cmake +index 8184d5079c5..858833a85a5 100644 +--- a/platform/qt/qt.cmake ++++ b/platform/qt/qt.cmake +@@ -1,9 +1,16 @@ + # Note: Using Sqlite instead of QSqlDatabase for better compatibility. + ++option(MBGL_WITH_QT_LIB_ONLY "Build only qmapboxgl library" OFF) ++option(MBGL_WITH_QT_HEADLESS "Build Mapbox GL Qt with headless support" ON) ++ ++include(GNUInstallDirs) + find_package(Qt5Gui REQUIRED) + find_package(Qt5Network REQUIRED) +-find_package(Qt5OpenGL REQUIRED) +-find_package(Qt5Widgets REQUIRED) ++ ++if(MBGL_WITH_QT_HEADLESS OR NOT MBGL_WITH_QT_LIB_ONLY) ++ find_package(Qt5OpenGL REQUIRED) ++ find_package(Qt5Widgets REQUIRED) ++endif() + + if(CMAKE_SYSTEM_NAME STREQUAL "Windows") + add_definitions("-DQT_COMPILING_QIMAGE_COMPAT_CPP") +@@ -50,7 +57,6 @@ target_sources( + ${PROJECT_SOURCE_DIR}/platform/qt/src/async_task_impl.hpp + ${PROJECT_SOURCE_DIR}/platform/qt/src/number_format.cpp + ${PROJECT_SOURCE_DIR}/platform/qt/src/gl_functions.cpp +- ${PROJECT_SOURCE_DIR}/platform/qt/src/headless_backend_qt.cpp + $<$:${PROJECT_SOURCE_DIR}/platform/qt/src/http_file_source.cpp> + $<$:${PROJECT_SOURCE_DIR}/platform/qt/src/http_file_source.hpp> + $<$:${PROJECT_SOURCE_DIR}/platform/qt/src/http_request.cpp> +@@ -68,6 +74,15 @@ target_sources( + ${PROJECT_SOURCE_DIR}/platform/qt/src/utf.cpp + ) + ++if(MBGL_WITH_QT_HEADLESS OR NOT MBGL_WITH_QT_LIB_ONLY) ++ target_sources( ++ mbgl-core ++ PRIVATE ++ ${PROJECT_SOURCE_DIR}/platform/qt/src/headless_backend_qt.cpp ++ ) ++endif() ++ ++ + target_compile_definitions( + mbgl-core + PRIVATE QT_IMAGE_DECODERS +@@ -91,11 +106,18 @@ target_link_libraries( + Qt5::Core + Qt5::Gui + Qt5::Network +- Qt5::OpenGL + mbgl-vendor-nunicode + mbgl-vendor-sqlite + ) + ++if(MBGL_WITH_QT_HEADLESS) ++ target_link_libraries( ++ mbgl-core ++ PRIVATE ++ Qt5::OpenGL ++ ) ++endif() ++ + add_library( + qmapboxgl SHARED + ${PROJECT_SOURCE_DIR}/platform/qt/include/qmapbox.hpp +@@ -141,6 +163,34 @@ target_link_libraries( + mbgl-core + ) + ++# install library and headers ++install( ++ DIRECTORY include/mbgl ++ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" ++ COMPONENT development ++) ++ ++install( ++ TARGETS qmapboxgl ++ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shared NAMELINK_SKIP ++ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT development ++) ++ ++install( ++ FILES ++ platform/qt/include/QMapbox ++ platform/qt/include/QMapboxGL ++ platform/qt/include/qmapbox.hpp ++ platform/qt/include/qmapboxgl.hpp ++ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/qt5" ++ COMPONENT development ++) ++ ++# stop here if only library is requested ++if(MBGL_WITH_QT_LIB_ONLY) ++ return() ++endif() ++ + add_executable( + mbgl-qt + ${PROJECT_SOURCE_DIR}/platform/qt/app/main.cpp diff --git a/main/mapbox-gl-native/0002-versioned-libraries.patch b/main/mapbox-gl-native/0002-versioned-libraries.patch new file mode 100644 index 000000000..3e7b020fa --- /dev/null +++ b/main/mapbox-gl-native/0002-versioned-libraries.patch @@ -0,0 +1,91 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ad989ba83..8f6f143ad 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,5 @@ + cmake_minimum_required(VERSION 3.10 FATAL_ERROR) +-project("Mapbox GL Native" LANGUAGES CXX C) ++project("Mapbox GL Native" LANGUAGES CXX C VERSION 1.6.0) + + set_property(GLOBAL PROPERTY USE_FOLDERS ON) + set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER Core) +diff --git a/platform/qt/QMapboxGLConfig.cmake.in b/platform/qt/QMapboxGLConfig.cmake.in +new file mode 100644 +index 000000000..ecd3127a5 +--- /dev/null ++++ b/platform/qt/QMapboxGLConfig.cmake.in +@@ -0,0 +1,13 @@ ++@PACKAGE_INIT@ ++ ++include(CMakeFindDependencyMacro) ++find_dependency(Qt5Gui @REQUIRED_QT_VERSION@) ++find_dependency(Qt5Network @REQUIRED_QT_VERSION@) ++ ++if(MBGL_WITH_QT_HEADLESS OR NOT MBGL_WITH_QT_LIB_ONLY) ++ find_dependency(Qt5OpenGL @REQUIRED_QT_VERSION@) ++ find_dependency(Qt5Network @REQUIRED_QT_VERSION@) ++endif() ++ ++include("${CMAKE_CURRENT_LIST_DIR}/QMapboxGLTargets.cmake") ++@PACKAGE_INCLUDE_QCHTARGETS@ +diff --git a/platform/qt/qt.cmake b/platform/qt/qt.cmake +index 858833a85..fbf9ce6ee 100644 +--- a/platform/qt/qt.cmake ++++ b/platform/qt/qt.cmake +@@ -145,8 +145,9 @@ target_include_directories( + ) + + target_include_directories( +- qmapboxgl +- PUBLIC ${PROJECT_SOURCE_DIR}/platform/qt/include ++ qmapboxgl PUBLIC ++ $ ++ $ + ) + + target_compile_definitions( +@@ -172,7 +173,8 @@ install( + + install( + TARGETS qmapboxgl +- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shared NAMELINK_SKIP ++ EXPORT QMapboxGLTargets ++ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shared + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT development + ) + +@@ -186,6 +188,34 @@ install( + COMPONENT development + ) + ++set_target_properties(qmapboxgl PROPERTIES ++ EXPORT_NAME QMapboxGL ++ SOVERSION ${PROJECT_VERSION_MAJOR} ++ VERSION ${PROJECT_VERSION}) ++ ++include(CMakePackageConfigHelpers) ++set(CMAKECONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/qmapboxgl/) ++ ++configure_package_config_file( ++ "platform/qt/QMapboxGLConfig.cmake.in" ++ "${CMAKE_CURRENT_BINARY_DIR}/QMapboxGLConfig.cmake" ++ INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} ++ PATH_VARS CMAKE_INSTALL_PREFIX CMAKE_INSTALL_INCLUDEDIR ++ CMAKE_INSTALL_LIBDIR NO_CHECK_REQUIRED_COMPONENTS_MACRO) ++write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/QMapboxGLConfigVersion.cmake ++ VERSION ${qmapboxgl_VERSION} ++ COMPATIBILITY AnyNewerVersion) ++ ++install(EXPORT QMapboxGLTargets ++ DESTINATION ${CMAKECONFIG_INSTALL_DIR} ++ COMPONENT development) ++ ++install(FILES ++ "${CMAKE_CURRENT_BINARY_DIR}/QMapboxGLConfig.cmake" ++ "${CMAKE_CURRENT_BINARY_DIR}/QMapboxGLConfigVersion.cmake" ++ DESTINATION ${CMAKECONFIG_INSTALL_DIR} ++ COMPONENT development) ++ + # stop here if only library is requested + if(MBGL_WITH_QT_LIB_ONLY) + return() diff --git a/main/mapbox-gl-native/APKBUILD b/main/mapbox-gl-native/APKBUILD index cc4013358..4c9d18ecf 100644 --- a/main/mapbox-gl-native/APKBUILD +++ b/main/mapbox-gl-native/APKBUILD @@ -1,36 +1,40 @@ # Contributor: Bart Ribbers # Maintainer: Bart Ribbers pkgname=mapbox-gl-native -pkgver=1.5.0.3 +pkgver=1.6.0 pkgrel=0 -_commit="0d63f5661ed15d43fbbf0462d82c85e634a2e8d7" -_commit_mapbox="974c87bd9cc25b7f0a2fc31adcc51df4db694270" pkgdesc="Mapbox GL Native" -url="https://github.com/rinigus/pkg-mapbox-gl-native" +url="https://github.com/mapbox/mapbox-gl-native" arch="all !armhf" -license="MIT" -makedepends="qt5-qtbase-dev icu-dev" -source="mapbox-gl-native-lib-$_commit.pro::https://raw.githubusercontent.com/rinigus/pkg-mapbox-gl-native/$_commit/mapbox-gl-native-lib.pro - $pkgname-$_commit_mapbox.tar.gz::https://github.com/rinigus/mapbox-gl-native/archive/$_commit_mapbox.tar.gz" +license="BSD-2-Clause" +makedepends=" + cmake + qt5-qtbase-dev + icu-dev + " +source="https://github.com/pmsourcedump/tarballs/raw/master/mapbox-gl-native-vendored-1.6.0.tar.bz2 + 0001-add-support-for-qmapboxgl-installation.patch + 0002-versioned-libraries.patch + " options="!check" # No tests subpackages="$pkgname-dev" -builddir="$srcdir/$pkgname-$_commit_mapbox" - -prepare() { - default_prepare - - mv "$srcdir"/mapbox-gl-native-lib-$_commit.pro \ - "$builddir"/mapbox-gl-native-lib.pro -} build() { - qmake-qt5 "CONFIG+=posix" mapbox-gl-native-lib.pro - make + cmake -B build \ + -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DMBGL_WITH_WERROR=OFF \ + -DMBGL_WITH_QT=ON \ + -DMBGL_WITH_QT_LIB_ONLY=ON \ + -DMBGL_WITH_QT_HEADLESS=OFF + cmake --build build } package() { - INSTALL_ROOT="$pkgdir" make install + DESTDIR="$pkgdir" cmake --install build } -sha512sums="e12b3be5d302fffe88f02a9e1a8858a6c4603924fc6faab4b2706bc9b5f792222c4b16da835fe773fadc50192f49e53f92ebf0d71088b1af299acb63fbaf3b09 mapbox-gl-native-lib-0d63f5661ed15d43fbbf0462d82c85e634a2e8d7.pro -86d50d52a2f3c8c9929e556498de6cf4cd955fd366455f533567e0d2fb35c24e03f597ea3d06821042b1ee8387c1ba23a4e3e0f70046183a84330e351251721a mapbox-gl-native-974c87bd9cc25b7f0a2fc31adcc51df4db694270.tar.gz" +sha512sums="c4698c5d36f3f629f18d3b546f9a2aee4209723ccec0c552dbe3e6f44c84462f1a87e862ea012309a04caf85a1d59ba85c18814de79b577a3d1a45a3f9d50909 mapbox-gl-native-vendored-1.6.0.tar.bz2 +8383f99c49b26f66c72080864e05a4216f3f2e03045a2ad3aca1ff9ed9c16f214236ef3fcd71f85ade071da000eca07cec75d4411400d5d5112f1e45d3a2a769 0001-add-support-for-qmapboxgl-installation.patch +433c0a8bc6fc34cc86184e2c979fb6bd5a88dbbf69ed383eccb38d99dcbb6d67c5f9ccb615a8b347680a48bd74a4d387172fffd9cf12d089f6ffa27420587cf5 0002-versioned-libraries.patch"