summary refs log tree commit diff
path: root/pkgs/applications/misc/subsurface
diff options
context:
space:
mode:
authorPeter Hoeg <peter@speartail.com>2017-02-11 22:48:18 +0800
committerJoachim F <joachifm@users.noreply.github.com>2017-02-11 15:48:18 +0100
commit9550686be85b70be95967fbfcb4293ad3f44206b (patch)
treeed56a8332a5a7ab78eb3cc2b76666fbac373d029 /pkgs/applications/misc/subsurface
parente2834ca6113acc263ea7ed857fc1cdcf509510e2 (diff)
downloadnixlib-9550686be85b70be95967fbfcb4293ad3f44206b.tar
nixlib-9550686be85b70be95967fbfcb4293ad3f44206b.tar.gz
nixlib-9550686be85b70be95967fbfcb4293ad3f44206b.tar.bz2
nixlib-9550686be85b70be95967fbfcb4293ad3f44206b.tar.lz
nixlib-9550686be85b70be95967fbfcb4293ad3f44206b.tar.xz
nixlib-9550686be85b70be95967fbfcb4293ad3f44206b.tar.zst
nixlib-9550686be85b70be95967fbfcb4293ad3f44206b.zip
subsurface: 4.5.97 -> 4.6.0 (#22615)
We do a few more things:

 - libmarble and libdivecomputer with the subsurface patches have both been
   inlined for 2 reasons:
   a) nobody else is using these forks
   b) they need to be updated in lockstep with subsurface

 - instead of building libmarble against qtquick1, we now build using
   qtquickcontrols (qtquick2)

 - getting rid of qtquick1 also allows us to use the default qt (currently 5.6)

 - we get rid of some hacks to deal with library dependencies

 - instead of manually overriding various phases, we simply use cmakeFlags to
   pass proper parameters
Diffstat (limited to 'pkgs/applications/misc/subsurface')
-rw-r--r--pkgs/applications/misc/subsurface/default.nix103
1 files changed, 75 insertions, 28 deletions
diff --git a/pkgs/applications/misc/subsurface/default.nix b/pkgs/applications/misc/subsurface/default.nix
index 06b367fa6e78..bb23f46d7334 100644
--- a/pkgs/applications/misc/subsurface/default.nix
+++ b/pkgs/applications/misc/subsurface/default.nix
@@ -1,49 +1,97 @@
 {
   stdenv,
-  cmake,
+  cmake, doxygen, pkgconfig, autoreconfHook,
   curl,
   fetchgit,
   grantlee,
-  libdivecomputer,
   libgit2,
-  libmarble-ssrf,
+  libusb,
   libssh2,
   libxml2,
   libxslt,
   libzip,
-  pkgconfig,
-  qtbase,
-  qtconnectivity,
-  qttools,
-  qtwebkit,
+  qtbase, qtconnectivity, qtquickcontrols, qtscript, qtsvg, qttools, qtwebkit,
   sqlite
 }:
 
-stdenv.mkDerivation rec {
-  version = "4.5.97";
+let
+  version = "4.6.0";
+
+  libmarble = stdenv.mkDerivation rec {
+    name = "libmarble-ssrf-${version}";
+
+    src = fetchgit {
+      url    = "git://git.subsurface-divelog.org/marble";
+      rev    = "refs/tags/v${version}";
+      sha256 = "1dm2hdk6y36ls7pxbzkqmyc46hdy2cd5f6pkxa6nfrbhvk5f31zd";
+    };
+
+    buildInputs = [ qtbase qtquickcontrols qtscript qtwebkit ];
+    nativeBuildInputs = [ doxygen pkgconfig cmake ];
+
+    enableParallelBuilding = true;
+
+    cmakeFlags = [
+      "-DQTONLY=TRUE"
+      "-DQT5BUILD=ON"
+      "-DBUILD_MARBLE_TESTS=NO"
+      "-DWITH_DESIGNER_PLUGIN=NO"
+      "-DBUILD_MARBLE_APPS=NO"
+    ];
+
+    meta = with stdenv.lib; {
+      description = "Qt library for a slippy map with patches from the Subsurface project";
+      homepage = http://subsurface-divelog.org;
+      license = licenses.lgpl21;
+      maintainers = with maintainers; [ mguentner ];
+      platforms = platforms.all;
+    };
+  };
+
+  libdc = stdenv.mkDerivation rec {
+    name = "libdivecomputer-ssrf-${version}";
+
+    src = fetchgit {
+      url    = "git://subsurface-divelog.org/libdc";
+      rev    = "refs/tags/v${version}";
+      sha256 = "0s82c8bvqph9c9chwzd76iwrw968w7lgjm3pj4hmad1jim67bs6n";
+    };
+
+    nativeBuildInputs = [ autoreconfHook ];
+
+    enableParallelBuilding = true;
+
+    meta = with stdenv.lib; {
+      homepage = http://www.libdivecomputer.org;
+      description = "A cross-platform and open source library for communication with dive computers from various manufacturers";
+      maintainers = with maintainers; [ mguentner ];
+      license = licenses.lgpl21;
+      platforms = platforms.all;
+    };
+  };
+
+in stdenv.mkDerivation rec {
   name = "subsurface-${version}";
 
   src = fetchgit {
-    sha256 = "035ywhicadmr9sh7zhfxsvpchwa9sywccacbspfam39n2hpyqnmm";
-    url = "git://git.subsurface-divelog.org/subsurface";
-    rev = "72bcb6481f3b935444d7868a74599dda133f9b43";
-    branchName = "master";
+    url    = "git://git.subsurface-divelog.org/subsurface";
+    rev    = "refs/tags/v${version}";
+    sha256 = "1rk5n52p6cnyjrgi7ybhmvh7y31zxrjny0mqpnc1wql69f90h94c";
   };
 
-  buildInputs = [ qtbase libdivecomputer libmarble-ssrf libxslt
-                  libzip libxml2 grantlee qtwebkit qttools
-                  qtconnectivity libgit2 libssh2 curl ];
-  nativeBuildInputs = [ pkgconfig cmake ];
+  buildInputs = [
+    libdc libmarble
+    curl grantlee libgit2 libssh2 libusb libxml2 libxslt libzip
+    qtbase qtconnectivity qtsvg qttools qtwebkit
+  ];
+  nativeBuildInputs = [ cmake pkgconfig ];
 
-  #enableParallelBuilding = true; # fatal error: ui_mainwindow.h: No such file or directory
+  enableParallelBuilding = true;
 
-  # hack incoming...
-  preConfigure = ''
-    marble_libs=$(echo $(echo $CMAKE_LIBRARY_PATH | grep -o "/nix/store/[[:alnum:]]*-libmarble-ssrf-[a-zA-Z0-9\-]*/lib")/libssrfmarblewidget.so)
-    cmakeFlags="$cmakeFlags -DCMAKE_BUILD_TYPE=Debug \
-                            -DMARBLE_LIBRARIES=$marble_libs \
-                            -DNO_PRINTING=OFF"
-  '';
+  cmakeFlags = [
+    "-DMARBLE_LIBRARIES=${libmarble}/lib/libssrfmarblewidget.so"
+    "-DNO_PRINTING=OFF"
+  ];
 
   meta = with stdenv.lib; {
     description = "Subsurface is an open source divelog program that runs on Windows, Mac and Linux";
@@ -55,8 +103,7 @@ stdenv.mkDerivation rec {
     '';
     homepage = https://subsurface-divelog.org;
     license = licenses.gpl2;
-    maintainers = [ maintainers.mguentner ];
+    maintainers = with maintainers; [ mguentner ];
     platforms = platforms.all;
   };
-
 }