From 42f157fd07d870ef0cacd1f5c6a0ba4d6eaecf05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 20 Mar 2021 19:30:19 +0100 Subject: [PATCH 1/2] mapbox-gl-native: use upstream version, unvendor rapidjson, and move to libsForQt5 The first two patches are needed for mapbox-gl-qml. The third patch is required when building without the vendored rapidjson. --- .../libraries/mapbox-gl-native/default.nix | 38 +++++++++++++++---- pkgs/top-level/all-packages.nix | 2 - pkgs/top-level/qt5-packages.nix | 2 + 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/pkgs/development/libraries/mapbox-gl-native/default.nix b/pkgs/development/libraries/mapbox-gl-native/default.nix index e98903e3a83e..c71bf17a3c77 100644 --- a/pkgs/development/libraries/mapbox-gl-native/default.nix +++ b/pkgs/development/libraries/mapbox-gl-native/default.nix @@ -1,20 +1,44 @@ -{ lib, mkDerivation, fetchFromGitHub, cmake, pkg-config -, qtbase, curl, libuv, glfw3 }: +{ lib, mkDerivation, fetchFromGitHub, fetchpatch, cmake, pkg-config +, qtbase, curl, libuv, glfw3, rapidjson }: mkDerivation rec { pname = "mapbox-gl-native"; - version = "2020.06.07"; + version = "1.6.0"; src = fetchFromGitHub { owner = "mapbox"; repo = "mapbox-gl-native"; - rev = "e18467d755f470b26f61f6893eddd76ecf0816e6"; - sha256 = "1x271gg9h81jpi70pv63i6lsa1zg6bzja9mbz7bsa4s02fpqy7wh"; + rev = "maps-v${version}"; + sha256 = "027rw23yvd5a6nl9b5hsanddc44nyb17l2whdcq9fxb9n6vcda4c"; fetchSubmodules = true; }; + patches = [ + # https://github.com/mapbox/mapbox-gl-native/pull/16591 + (fetchpatch { + name = "add-support-for-qmapboxgl-installation.patch"; + url = "https://github.com/mapbox/mapbox-gl-native/commit/e18467d755f470b26f61f6893eddd76ecf0816e6.patch"; + sha256 = "0gs7wmkvyhf2db4cwbsq31sprsh1avi70ggvi32bk0wn3cw4d79b"; + }) + (fetchpatch { + name = "add-support-for-using-qmapboxgl-as-a-proper-cmake-dependency.patch"; + url = "https://github.com/mapbox/mapbox-gl-native/commit/ab27b9b8207754ef731b588d187c470ffb084455.patch"; + sha256 = "1lr5p1g4qaizs57vjqry9aq8k1ki59ks0y975chlnrm2sffp140r"; + }) + (fetchpatch { + name = "skip-license-check.patch"; + url = "https://git.alpinelinux.org/aports/plain/testing/mapbox-gl-native/0002-skip-license-check.patch?id=6751a93dca26b0b3ceec9eb151272253a2fe497e"; + sha256 = "1yybwzxbvn0lqb1br1fyg7763p2h117s6mkmywkl4l7qg9daa7ba"; + }) + ]; + + postPatch = '' + # don't use vendored rapidjson + rm -r vendor/mapbox-base/extras/rapidjson + ''; + nativeBuildInputs = [ cmake pkg-config ]; - buildInputs = [ curl libuv glfw3 qtbase ]; + buildInputs = [ curl libuv glfw3 qtbase rapidjson ]; cmakeFlags = [ "-DMBGL_WITH_QT=ON" @@ -27,7 +51,7 @@ mkDerivation rec { description = "Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL"; homepage = "https://mapbox.com/mobile"; license = licenses.bsd2; - maintainers = [ maintainers.Thra11 ]; + maintainers = with maintainers; [ Thra11 dotlambda ]; platforms = platforms.linux; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3b7831d87960..15aa3fae6a76 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16077,8 +16077,6 @@ in opencl-clang = callPackage ../development/libraries/opencl-clang { }; - mapbox-gl-native = libsForQt5.callPackage ../development/libraries/mapbox-gl-native { }; - mapbox-gl-qml = libsForQt5.callPackage ../development/libraries/mapbox-gl-qml { }; mapnik = callPackage ../development/libraries/mapnik { }; diff --git a/pkgs/top-level/qt5-packages.nix b/pkgs/top-level/qt5-packages.nix index 656a8a5c0f07..6517b717b1d0 100644 --- a/pkgs/top-level/qt5-packages.nix +++ b/pkgs/top-level/qt5-packages.nix @@ -115,6 +115,8 @@ in (kdeFrameworks // plasma5 // plasma5.thirdParty // kdeApplications // qt5 // kpmcore = callPackage ../development/libraries/kpmcore { }; + mapbox-gl-native = libsForQt5.callPackage ../development/libraries/mapbox-gl-native { }; + mauikit = callPackage ../development/libraries/mauikit { }; mlt = callPackage ../development/libraries/mlt/qt-5.nix { }; From cccebb6f372d2fdf5110e3db5cf9fb459fe9fda4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 21 Mar 2021 11:14:52 +0100 Subject: [PATCH 2/2] mapbox-gl-qml: 1.7.5 -> 1.7.6 and move to libsForQt5 --- .../libraries/mapbox-gl-qml/default.nix | 25 +++++++++++++------ pkgs/top-level/all-packages.nix | 2 -- pkgs/top-level/qt5-packages.nix | 2 ++ 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/pkgs/development/libraries/mapbox-gl-qml/default.nix b/pkgs/development/libraries/mapbox-gl-qml/default.nix index 1740b9ae580d..87e765766227 100644 --- a/pkgs/development/libraries/mapbox-gl-qml/default.nix +++ b/pkgs/development/libraries/mapbox-gl-qml/default.nix @@ -1,22 +1,31 @@ -{ lib, mkDerivation, fetchFromGitHub, qmake, qtbase, qtlocation, mapbox-gl-native }: +{ lib +, mkDerivation +, fetchFromGitHub +, cmake +, pkg-config +, curl +, qtbase +, qtlocation +, mapbox-gl-native +}: mkDerivation rec { pname = "mapbox-gl-qml"; - version = "1.7.5"; + version = "1.7.6"; src = fetchFromGitHub { owner = "rinigus"; repo = "mapbox-gl-qml"; rev = version; - sha256 = "1izwkfqn8jl83vihcxl2b159sqmkn1amxf92zw0h6psls2g9xhwx"; + sha256 = "sha256-E6Pkr8khzDbhmJxzK943+H6cDREgwAqMnJQ3hQWU7fw="; }; - nativeBuildInputs = [ qmake ]; - buildInputs = [ qtlocation mapbox-gl-native ]; + nativeBuildInputs = [ cmake pkg-config ]; + buildInputs = [ curl qtlocation mapbox-gl-native ]; postPatch = '' - substituteInPlace mapbox-gl-qml.pro \ - --replace '$$[QT_INSTALL_QML]' $out'/${qtbase.qtQmlPrefix}' + substituteInPlace src/CMakeLists.txt \ + --replace ' ''${QT_INSTALL_QML}' " $out/${qtbase.qtQmlPrefix}" ''; # Package expects qt5 subdirectory of mapbox-gl-native to be in the include path @@ -26,7 +35,7 @@ mkDerivation rec { description = "Unofficial Mapbox GL Native bindings for Qt QML"; homepage = "https://github.com/rinigus/mapbox-gl-qml"; license = licenses.lgpl3Only; - maintainers = [ maintainers.Thra11 ]; + maintainers = with maintainers; [ Thra11 dotlambda ]; platforms = platforms.linux; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 15aa3fae6a76..7a41963714e1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16077,8 +16077,6 @@ in opencl-clang = callPackage ../development/libraries/opencl-clang { }; - mapbox-gl-qml = libsForQt5.callPackage ../development/libraries/mapbox-gl-qml { }; - mapnik = callPackage ../development/libraries/mapnik { }; marisa = callPackage ../development/libraries/marisa {}; diff --git a/pkgs/top-level/qt5-packages.nix b/pkgs/top-level/qt5-packages.nix index 6517b717b1d0..bfc576e65549 100644 --- a/pkgs/top-level/qt5-packages.nix +++ b/pkgs/top-level/qt5-packages.nix @@ -117,6 +117,8 @@ in (kdeFrameworks // plasma5 // plasma5.thirdParty // kdeApplications // qt5 // mapbox-gl-native = libsForQt5.callPackage ../development/libraries/mapbox-gl-native { }; + mapbox-gl-qml = libsForQt5.callPackage ../development/libraries/mapbox-gl-qml { }; + mauikit = callPackage ../development/libraries/mauikit { }; mlt = callPackage ../development/libraries/mlt/qt-5.nix { };