summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2020-04-10 22:54:06 +0200
committerFlorian Klink <flokli@flokli.de>2020-04-11 12:51:32 +0200
commit435ff3118e8bbf9b74989fb2884caaddc35f747d (patch)
treebd511ec56a045921a2a0f8a3d9150625b0c90538 /pkgs/applications
parentfb689fc5f2afc9ceb80003e64639977c6a59e4ab (diff)
downloadnixpkgs-435ff3118e8bbf9b74989fb2884caaddc35f747d.tar
nixpkgs-435ff3118e8bbf9b74989fb2884caaddc35f747d.tar.gz
nixpkgs-435ff3118e8bbf9b74989fb2884caaddc35f747d.tar.bz2
nixpkgs-435ff3118e8bbf9b74989fb2884caaddc35f747d.tar.lz
nixpkgs-435ff3118e8bbf9b74989fb2884caaddc35f747d.tar.xz
nixpkgs-435ff3118e8bbf9b74989fb2884caaddc35f747d.tar.zst
nixpkgs-435ff3118e8bbf9b74989fb2884caaddc35f747d.zip
subsurface: 4.8.2 -> 4.9.3
This bumps subsurface to 4.9.3.

As the subsurface-specific libdivecomputer source is shipped as a git
submodule these days, we can avoid having to fetch a separate tarball
that needs to be kept in sync (and is only uploaded for each release).

This also applies a patch on top of 4.9.3 to properly handle libgit2
versions 1.0 and later - conditional code for older libgit versions has
been removed upstream, but that's a nontrivial backport, which is why
this patch was added.
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/misc/subsurface/0001-core-fix-libgit-ifdef-to-handle-libgit2-v1.0-and-onw.patch41
-rw-r--r--pkgs/applications/misc/subsurface/default.nix24
2 files changed, 56 insertions, 9 deletions
diff --git a/pkgs/applications/misc/subsurface/0001-core-fix-libgit-ifdef-to-handle-libgit2-v1.0-and-onw.patch b/pkgs/applications/misc/subsurface/0001-core-fix-libgit-ifdef-to-handle-libgit2-v1.0-and-onw.patch
new file mode 100644
index 00000000000..027e3f493e1
--- /dev/null
+++ b/pkgs/applications/misc/subsurface/0001-core-fix-libgit-ifdef-to-handle-libgit2-v1.0-and-onw.patch
@@ -0,0 +1,41 @@
+From dfa4bcafec4425659a409550085417af3c5c787b Mon Sep 17 00:00:00 2001
+From: Florian Klink <flokli@flokli.de>
+Date: Sat, 11 Apr 2020 12:38:38 +0200
+Subject: [PATCH] core: fix libgit ifdef to handle libgit2 v1.0 and onwards
+
+Conditional code for older libgit versions was removed in
+https://github.com/Subsurface-divelog/subsurface/pull/2737,
+but it's a non-trivial backport, and master currently isn't really ready
+for a release.
+
+So instead ship a patch fixing the one broken libgit2 conditional until
+a 4.10 release has been made.
+
+Note the inverted logic - the if branch now handles the old libgit
+condition, and the else branch the newer versions, consistent with how
+it's done in the rest of the subsurface codebase.
+---
+ core/git-access.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/core/git-access.c b/core/git-access.c
+index 3688cb90c..9997fc8fd 100644
+--- a/core/git-access.c
++++ b/core/git-access.c
+@@ -359,10 +359,10 @@ static int try_to_git_merge(git_repository *repo, git_reference **local_p, git_r
+ 	}
+ 
+ 	git_merge_init_options(&merge_options, GIT_MERGE_OPTIONS_VERSION);
+-#if !LIBGIT2_VER_MAJOR && LIBGIT2_VER_MINOR > 23
+-	merge_options.flags = GIT_MERGE_FIND_RENAMES;
+-#else
++#if !LIBGIT2_VER_MAJOR && LIBGIT2_VER_MINOR <= 22
+ 	merge_options.tree_flags = GIT_MERGE_TREE_FIND_RENAMES;
++#else
++	merge_options.flags = GIT_MERGE_FIND_RENAMES;
+ #endif
+ 	merge_options.file_favor = GIT_MERGE_FILE_FAVOR_UNION;
+ 	merge_options.rename_threshold = 100;
+-- 
+2.25.1
+
diff --git a/pkgs/applications/misc/subsurface/default.nix b/pkgs/applications/misc/subsurface/default.nix
index 960b7b9eeef..d4b2f8cad30 100644
--- a/pkgs/applications/misc/subsurface/default.nix
+++ b/pkgs/applications/misc/subsurface/default.nix
@@ -4,16 +4,22 @@
 }:
 
 let
-  version = "4.8.2";
+  version = "4.9.3";
+
+  subsurfaceSrc = (fetchFromGitHub {
+    owner = "Subsurface-divelog";
+    repo = "subsurface";
+    rev = "v${version}";
+    sha256 = "1i07f7appifx9j205x5a7ng01wsipxr6n9a3692pm60jli2nsir5";
+    fetchSubmodules = true;
+  });
 
   libdc = stdenv.mkDerivation {
     pname = "libdivecomputer-ssrf";
     inherit version;
 
-    src = fetchurl {
-      url = "https://subsurface-divelog.org/downloads/libdivecomputer-subsurface-branch-${version}.tgz";
-      sha256 = "167qan59raibmilkc574gdqxfjg2f5ww2frn86xzk2kn4qg8190w";
-    };
+    src = subsurfaceSrc;
+    sourceRoot = "source/libdivecomputer";
 
     nativeBuildInputs = [ autoreconfHook ];
 
@@ -70,10 +76,10 @@ in stdenv.mkDerivation {
   pname = "subsurface";
   inherit version;
 
-  src = fetchurl {
-    url = "https://subsurface-divelog.org/downloads/Subsurface-${version}.tgz";
-    sha256 = "1fzrq6rqb6pzs36wxar2453cl509dqpcy9w7nq4gw7b1v2331wfy";
-  };
+  src = subsurfaceSrc;
+
+  # remove with the 4.10 release
+  patches = [ ./0001-core-fix-libgit-ifdef-to-handle-libgit2-v1.0-and-onw.patch ];
 
   buildInputs = [
     libdc googlemaps