From 3ddf7e677ee1864267d857b5682264fa34169862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20G=C3=BCntner?= Date: Sun, 22 Sep 2024 11:55:05 +0200 Subject: [PATCH] subsurface: 5.0.10 -> 6.0.5231 subsurface changed from tagged releases to nightly builds from which a somewhat stable release is marked as a "weekly release" which is published on subsurface-divelog.org Currently there is no tag on the main repository pointing to the commit that was used to create the nightly build that was finally selected as the "weekly release". Upstream Documentation: - https://github.com/subsurface/subsurface/releases/tag/v4.9.4 - https://github.com/subsurface/nightly-builds/releases - https://subsurface-divelog.org/current-release/ --- pkgs/applications/misc/subsurface/default.nix | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/misc/subsurface/default.nix b/pkgs/applications/misc/subsurface/default.nix index e8cc4baf2757..4308f9769266 100644 --- a/pkgs/applications/misc/subsurface/default.nix +++ b/pkgs/applications/misc/subsurface/default.nix @@ -25,16 +25,17 @@ , qtwebengine , libXcomposite , bluez +, writeScript }: let - version = "5.0.10"; + version = "6.0.5231"; subsurfaceSrc = (fetchFromGitHub { owner = "Subsurface"; repo = "subsurface"; - rev = "v${version}"; - hash = "sha256-KzUBhFGvocaS1VrVT2stvKrj3uVxYka+dyYZUfkIoNs="; + rev = "38a0050ac33566dfd34bf94cf1d7ac66034e4118"; + hash = "sha256-6fNcBF/Ep2xs2z83ZQ09XNb/ZkhK1nUNLChV1x8qh0Y="; fetchSubmodules = true; }); @@ -136,7 +137,25 @@ stdenv.mkDerivation { "-DNO_PRINTING=OFF" ]; - passthru = { inherit version libdc googlemaps; }; + passthru = { + inherit version libdc googlemaps; + updateScript = writeScript "update-subsurface" '' + #!/usr/bin/env nix-shell + #!nix-shell -i bash -p git common-updater-scripts + + set -eu -o pipefail + tmpdir=$(mktemp -d) + pushd $tmpdir + git clone -b current https://github.com/subsurface/subsurface.git + cd subsurface + # this returns 6.0.????-local + new_version=$(./scripts/get-version.sh | cut -d '-' -f 1) + new_rev=$(git rev-list -1 HEAD) + popd + update-source-version subsurface "$new_version" --rev="$new_rev" + rm -rf $tmpdir + ''; + }; meta = with lib; { description = "Divelog program";