From 9ae845e3bf139905fedc55e629a127937f34ef80 Mon Sep 17 00:00:00 2001 From: Lily Foster Date: Fri, 21 Oct 2022 11:36:28 -0400 Subject: [PATCH 1/2] touchosc: add updateScript --- pkgs/applications/audio/touchosc/default.nix | 2 ++ pkgs/applications/audio/touchosc/update.sh | 33 ++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100755 pkgs/applications/audio/touchosc/update.sh diff --git a/pkgs/applications/audio/touchosc/default.nix b/pkgs/applications/audio/touchosc/default.nix index a0d577bf0f6b..8d3d29bbf8e1 100644 --- a/pkgs/applications/audio/touchosc/default.nix +++ b/pkgs/applications/audio/touchosc/default.nix @@ -96,6 +96,8 @@ stdenv.mkDerivation rec { runHook postInstall ''; + passthru.updateScript = ./update.sh; + meta = with lib; { homepage = "https://hexler.net/touchosc"; description = "Next generation modular control surface"; diff --git a/pkgs/applications/audio/touchosc/update.sh b/pkgs/applications/audio/touchosc/update.sh new file mode 100755 index 000000000000..f656a1df72d4 --- /dev/null +++ b/pkgs/applications/audio/touchosc/update.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p nix curl libxml2 jq common-updater-scripts + +set -euo pipefail + +nixpkgs="$(git rev-parse --show-toplevel || (printf 'Could not find root of nixpkgs repo\nAre we running from within the nixpkgs git repo?\n' >&2; exit 1))" + +attr="${UPDATE_NIX_ATTR_PATH:-touchosc}" +version="$(curl -sSL https://hexler.net/touchosc/appcast/linux | xmllint --xpath '/rss/channel/item/enclosure/@*[local-name()="version"]' - | cut -d= -f2- | tr -d '"' | head -n1)" + +findpath() { + path="$(nix --extra-experimental-features nix-command eval --json --impure -f "$nixpkgs" "$1.meta.position" | jq -r . | cut -d: -f1)" + outpath="$(nix --extra-experimental-features nix-command eval --json --impure --expr "builtins.fetchGit \"$nixpkgs\"")" + + if [ -n "$outpath" ]; then + path="${path/$(echo "$outpath" | jq -r .)/$nixpkgs}" + fi + + echo "$path" +} + +pkgpath="$(findpath "$attr")" + +sed -i -e "/version\s*=/ s|\"$UPDATE_NIX_OLD_VERSION\"|\"$version\"|" "$pkgpath" + +for system in aarch64-linux armv7l-linux x86_64-linux; do + url="$(nix --extra-experimental-features nix-command eval --json --impure --argstr system "$system" -f "$nixpkgs" "$attr".src.url | jq -r .)" + + curhash="$(nix --extra-experimental-features nix-command eval --json --impure --argstr system "$system" -f "$nixpkgs" "$attr".src.outputHash | jq -r .)" + newhash="$(nix --extra-experimental-features nix-command store prefetch-file --json "$url" | jq -r .hash)" + + sed -i -e "s|\"$curhash\"|\"$newhash\"|" "$pkgpath" +done From 6e8a52e8b6c68bfc94adaa619c5f3037fac1b643 Mon Sep 17 00:00:00 2001 From: Lily Foster Date: Fri, 21 Oct 2022 15:38:56 +0000 Subject: [PATCH 2/2] =?UTF-8?q?touchosc:=201.1.5.145=20=E2=86=92=201.1.6.1?= =?UTF-8?q?50?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/applications/audio/touchosc/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/audio/touchosc/default.nix b/pkgs/applications/audio/touchosc/default.nix index 8d3d29bbf8e1..dff52d125704 100644 --- a/pkgs/applications/audio/touchosc/default.nix +++ b/pkgs/applications/audio/touchosc/default.nix @@ -45,7 +45,7 @@ in stdenv.mkDerivation rec { pname = "touchosc"; - version = "1.1.5.145"; + version = "1.1.6.150"; suffix = { aarch64-linux = "linux-arm64"; @@ -56,9 +56,9 @@ stdenv.mkDerivation rec { src = fetchurl { url = "https://hexler.net/pub/${pname}/${pname}-${version}-${suffix}.deb"; hash = { - aarch64-linux = "sha256-3qbr9dveeDqP9psZNyN520B2JuG/R9yvpYX9CdqR7TI="; - armv7l-linux = "sha256-wns0hb+5s7cEbV+4crUWRJ1yU3pl1N0NJ0GWmM4Uvos="; - x86_64-linux = "sha256-LsrR46Epc8x0KTc2lbVN1rbb5KZXYTG8oygJ1BmsCC8="; + aarch64-linux = "sha256-sYkAFyXnmzgSzo68OF0oiv8tUvY+g1WCcY783OZO+RM="; + armv7l-linux = "sha256-GWpYW1262plxIzPVzBEh4Z3fQIhSmy0N9xAgwnjXrQE="; + x86_64-linux = "sha256-LUWlLEsTUqVoWAkjXC/zOziPqO85H8iIlwJU7eqLRcY="; }.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); };