nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at 22.05 62 lines 2.3 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 ]; 39 40 postPatch = '' 41 # don't use vendored rapidjson 42 rm -r vendor/mapbox-base/extras/rapidjson 43 ''; 44 45 nativeBuildInputs = [ cmake pkg-config ]; 46 buildInputs = [ curl libuv glfw3 qtbase rapidjson ]; 47 48 cmakeFlags = [ 49 "-DMBGL_WITH_QT=ON" 50 "-DMBGL_WITH_QT_LIB_ONLY=ON" 51 "-DMBGL_WITH_QT_HEADLESS=OFF" 52 ]; 53 NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations -Wno-error=type-limits"; 54 55 meta = with lib; { 56 description = "Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL"; 57 homepage = "https://mapbox.com/mobile"; 58 license = licenses.bsd2; 59 maintainers = with maintainers; [ Thra11 dotlambda ]; 60 platforms = platforms.linux; 61 }; 62}