2022-04-27 09:35:20 +00:00
|
|
|
{ lib
|
|
|
|
, mkDerivation
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, qtbase
|
|
|
|
, curl
|
|
|
|
, libuv
|
|
|
|
, glfw3
|
|
|
|
, rapidjson
|
2023-02-16 17:41:37 +00:00
|
|
|
, stdenv
|
2022-04-27 09:35:20 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
mkDerivation rec {
|
|
|
|
pname = "maplibre-gl-native";
|
2023-01-11 07:51:40 +00:00
|
|
|
version = "2.0.1";
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "maplibre";
|
|
|
|
repo = "maplibre-gl-native";
|
2023-01-11 07:51:40 +00:00
|
|
|
rev = "qt-v${version}";
|
2022-04-27 09:35:20 +00:00
|
|
|
fetchSubmodules = true;
|
2023-01-11 07:51:40 +00:00
|
|
|
hash = "sha256-g5J873U/6mrl27iquPl3BdEGhMxkOdfP15dHr27wa48=";
|
2022-04-27 09:35:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
(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
|
|
|
|
rapidjson
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DMBGL_WITH_QT=ON"
|
|
|
|
"-DMBGL_WITH_QT_LIB_ONLY=ON"
|
|
|
|
"-DMBGL_WITH_QT_HEADLESS=OFF"
|
|
|
|
];
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
|
2023-02-16 17:41:37 +00:00
|
|
|
# Needed with GCC 12 but problematic with some old GCCs
|
|
|
|
"-Wno-error=use-after-free"
|
2023-03-04 12:14:45 +00:00
|
|
|
]);
|
2023-02-16 17:41:37 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Open-source alternative to Mapbox GL Native";
|
|
|
|
homepage = "https://maplibre.org/";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|