python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / applications / misc / subsurface / default.nix
blob10d4ffc77b4b27cd7e2b0d2b58c7229d393a7a54
1 { lib, stdenv, fetchFromGitHub, autoreconfHook, cmake, wrapQtAppsHook, pkg-config, qmake
2 , curl, grantlee, libgit2, libusb-compat-0_1, libssh2, libxml2, libxslt, libzip, zlib
3 , qtbase, qtconnectivity, qtlocation, qtsvg, qttools, qtwebkit, libXcomposite
4 , bluez
5 }:
7 let
8   version = "5.0.2";
10   subsurfaceSrc = (fetchFromGitHub {
11     owner = "Subsurface";
12     repo = "subsurface";
13     rev = "v${version}";
14     sha256 = "1yay06m8p9qp2ghrg8dxavdq55y09apcgdnb7rihgs3hq86k539n";
15     fetchSubmodules = true;
16   });
18   libdc = stdenv.mkDerivation {
19     pname = "libdivecomputer-ssrf";
20     inherit version;
22     src = subsurfaceSrc;
24     prePatch = "cd libdivecomputer";
26     nativeBuildInputs = [ autoreconfHook ];
28     buildInputs = [ zlib ];
30     enableParallelBuilding = true;
32     meta = with lib; {
33       homepage = "http://www.libdivecomputer.org";
34       description = "A cross-platform and open source library for communication with dive computers from various manufacturers";
35       maintainers = with maintainers; [ mguentner ];
36       license = licenses.lgpl21;
37       platforms = platforms.all;
38     };
39   };
41   googlemaps = stdenv.mkDerivation rec {
42     pname = "googlemaps";
44     version = "2021-03-19";
46     src = fetchFromGitHub {
47       owner = "vladest";
48       repo = "googlemaps";
49       rev = "8f7def10c203fd3faa5ef96c5010a7294dca0759";
50       sha256 = "1irz398g45hk6xizwzd07qcx1ln8f7l6bhjh15f56yc20waqpx1x";
51     };
53     nativeBuildInputs = [ qmake ];
55     buildInputs = [ qtbase qtlocation libXcomposite ];
57     dontWrapQtApps = true;
59     pluginsSubdir = "lib/qt-${qtbase.qtCompatVersion}/plugins";
61     installPhase = ''
62       mkdir -p $out $(dirname ${pluginsSubdir}/geoservices)
63       mkdir -p ${pluginsSubdir}/geoservices
64       mv *.so ${pluginsSubdir}/geoservices
65       mv lib $out/
66     '';
68     meta = with lib; {
69       inherit (src.meta) homepage;
70       description = "QtLocation plugin for Google maps tile API";
71       maintainers = with maintainers; [ orivej ];
72       license = licenses.mit;
73       platforms = platforms.all;
74     };
75   };
77 in stdenv.mkDerivation {
78   pname = "subsurface";
79   inherit version;
81   src = subsurfaceSrc;
83   buildInputs = [
84     libdc googlemaps
85     curl grantlee libgit2 libssh2 libusb-compat-0_1 libxml2 libxslt libzip
86     qtbase qtconnectivity qtsvg qttools qtwebkit
87     bluez
88   ];
90   nativeBuildInputs = [ cmake wrapQtAppsHook pkg-config ];
92   cmakeFlags = [
93     "-DLIBDC_FROM_PKGCONFIG=ON"
94     "-DNO_PRINTING=OFF"
95   ];
97   passthru = { inherit version libdc googlemaps; };
99   meta = with lib; {
100     description = "A divelog program";
101     longDescription = ''
102       Subsurface can track single- and multi-tank dives using air, Nitrox or TriMix.
103       It allows tracking of dive locations including GPS coordinates (which can also
104       conveniently be entered using a map interface), logging of equipment used and
105       names of other divers, and lets users rate dives and provide additional notes.
106     '';
107     homepage = "https://subsurface-divelog.org";
108     license = licenses.gpl2;
109     maintainers = with maintainers; [ mguentner adisbladis ];
110     platforms = platforms.all;
111   };