at 23.11-beta 67 lines 2.6 kB view raw
1{ lib, mkDerivation, fetchFromGitHub, fetchpatch, cmake, pkg-config 2, qtbase, curl, libuv, glfw3, rapidjson }: 3 4mkDerivation rec { 5 pname = "mapbox-gl-native"; 6 version = "1.6.0"; 7 8 src = fetchFromGitHub { 9 owner = "mapbox"; 10 repo = "mapbox-gl-native"; 11 rev = "maps-v${version}"; 12 sha256 = "027rw23yvd5a6nl9b5hsanddc44nyb17l2whdcq9fxb9n6vcda4c"; 13 fetchSubmodules = true; 14 }; 15 16 patches = [ 17 # https://github.com/mapbox/mapbox-gl-native/pull/16591 18 (fetchpatch { 19 name = "add-support-for-qmapboxgl-installation.patch"; 20 url = "https://github.com/mapbox/mapbox-gl-native/commit/e18467d755f470b26f61f6893eddd76ecf0816e6.patch"; 21 sha256 = "0gs7wmkvyhf2db4cwbsq31sprsh1avi70ggvi32bk0wn3cw4d79b"; 22 }) 23 (fetchpatch { 24 name = "add-support-for-using-qmapboxgl-as-a-proper-cmake-dependency.patch"; 25 url = "https://github.com/mapbox/mapbox-gl-native/commit/ab27b9b8207754ef731b588d187c470ffb084455.patch"; 26 sha256 = "1lr5p1g4qaizs57vjqry9aq8k1ki59ks0y975chlnrm2sffp140r"; 27 }) 28 (fetchpatch { 29 name = "skip-license-check.patch"; 30 url = "https://git.alpinelinux.org/aports/plain/testing/mapbox-gl-native/0002-skip-license-check.patch?id=6751a93dca26b0b3ceec9eb151272253a2fe497e"; 31 sha256 = "1yybwzxbvn0lqb1br1fyg7763p2h117s6mkmywkl4l7qg9daa7ba"; 32 }) 33 (fetchpatch { 34 name = "fix-compilation.patch"; 35 url = "https://aur.archlinux.org/cgit/aur.git/plain/fix-compilation.patch?h=mapbox-gl-native"; 36 hash = "sha256-KgJHyoIdKdnQo+gedns3C+mEXlaTH/UtyQsaYR1T3iI="; 37 }) 38 (fetchpatch { 39 name = "fix-narrowing-conversion.patch"; 40 url = "https://github.com/mapbox/mapbox-gl-native/commit/2955d0e479f57a39a0af4a0fa7ca7683455cca58.patch"; 41 hash = "sha256-Jk7OLb9/mVtc2mm0AL1h9zcSiQ54jogNI+q6ojY0HEo="; 42 }) 43 ]; 44 45 postPatch = '' 46 # don't use vendored rapidjson 47 rm -r vendor/mapbox-base/extras/rapidjson 48 ''; 49 50 nativeBuildInputs = [ cmake pkg-config ]; 51 buildInputs = [ curl libuv glfw3 qtbase rapidjson ]; 52 53 cmakeFlags = [ 54 "-DMBGL_WITH_QT=ON" 55 "-DMBGL_WITH_QT_LIB_ONLY=ON" 56 "-DMBGL_WITH_QT_HEADLESS=OFF" 57 ]; 58 env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations -Wno-error=type-limits"; 59 60 meta = with lib; { 61 description = "Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL"; 62 homepage = "https://mapbox.com/mobile"; 63 license = licenses.bsd2; 64 maintainers = with maintainers; [ Thra11 dotlambda ]; 65 platforms = platforms.linux; 66 }; 67}