From f709c8ec639c963fc314851107903df1e8794398 Mon Sep 17 00:00:00 2001 From: "Markus S. Wamser" Date: Wed, 19 Feb 2025 11:18:52 +0100 Subject: [PATCH] audiothekar: init at 1.0.1 --- pkgs/by-name/au/audiothekar/deps.json | 57 +++++++++++++++++++++++++ pkgs/by-name/au/audiothekar/package.nix | 56 ++++++++++++++++++++++++ pkgs/by-name/au/audiothekar/update.sh | 18 ++++++++ 3 files changed, 131 insertions(+) create mode 100644 pkgs/by-name/au/audiothekar/deps.json create mode 100644 pkgs/by-name/au/audiothekar/package.nix create mode 100755 pkgs/by-name/au/audiothekar/update.sh diff --git a/pkgs/by-name/au/audiothekar/deps.json b/pkgs/by-name/au/audiothekar/deps.json new file mode 100644 index 000000000000..69596e3ba375 --- /dev/null +++ b/pkgs/by-name/au/audiothekar/deps.json @@ -0,0 +1,57 @@ +[ + { + "pname": "GraphQL", + "version": "7.8.0", + "hash": "sha256-/wyyrDN/0FFoHF1abjUGccEFAYsH5sj3QnPXsKPbqsI=" + }, + { + "pname": "GraphQL-Parser", + "version": "8.4.2", + "hash": "sha256-wcXfsK4sQENAj3oRX9+5GlSAtyqA94l8Y5pSnyLCYHM=" + }, + { + "pname": "GraphQL.Analyzers", + "version": "7.8.0", + "hash": "sha256-6O9A1dBIbUzUNXdQT1hv0x9QnpYCFFmGL6r3LCkAjbg=" + }, + { + "pname": "GraphQL.Client", + "version": "6.1.0", + "hash": "sha256-snZ/7uvNQUwy1+p6X3m558Tl50J8W1C+HX5AA28gIv4=" + }, + { + "pname": "GraphQL.Client.Abstractions", + "version": "6.1.0", + "hash": "sha256-qRiGaJbKcCXY/78TTT38x02ljmWoIx82xG4ZZGbWqSU=" + }, + { + "pname": "GraphQL.Client.Abstractions.Websocket", + "version": "6.1.0", + "hash": "sha256-EmPuIS+gAwmsoh0EkQ3mO8tQACuxza6W4xR3DWiMyhw=" + }, + { + "pname": "GraphQL.Client.Serializer.SystemTextJson", + "version": "6.1.0", + "hash": "sha256-5U29jAhTkbsLQsZeSonSRFZzoVp9dmE7IoCVnr3TLT8=" + }, + { + "pname": "GraphQL.Primitives", + "version": "6.1.0", + "hash": "sha256-giNMmftzJu5LChFNU8Xqm6+q6l4vtXIEVF9LBKThBuI=" + }, + { + "pname": "GraphQL.SystemTextJson", + "version": "7.8.0", + "hash": "sha256-1/AjzAbg1jCYm0lTf20rVURMjm+m0ODeFkqdWqbH3aI=" + }, + { + "pname": "Spectre.Console", + "version": "0.49.1", + "hash": "sha256-tqSVojyuQjuB34lXo759NOcyLgNIw815mKXJPq5JFDo=" + }, + { + "pname": "System.Reactive", + "version": "6.0.0", + "hash": "sha256-hXB18OsiUHSCmRF3unAfdUEcbXVbG6/nZxcyz13oe9Y=" + } +] diff --git a/pkgs/by-name/au/audiothekar/package.nix b/pkgs/by-name/au/audiothekar/package.nix new file mode 100644 index 000000000000..c39867f7a575 --- /dev/null +++ b/pkgs/by-name/au/audiothekar/package.nix @@ -0,0 +1,56 @@ +{ + lib, + fetchFromGitHub, + buildDotnetModule, + dotnetCorePackages, + audiothekar, + testers, +}: + +buildDotnetModule rec { + pname = "audiothekar"; + version = "1.0.1"; + + src = fetchFromGitHub { + owner = "fxsth"; + repo = "audiothekar"; + tag = "v${version}"; + sha256 = "sha256-DZ4E8numXJdkvX5WYM6cioW5J89YuD9Hi8NfK+Z39cY="; + }; + + projectFile = "Audiothekar.sln"; + + doCheck = false; + + nugetDeps = ./deps.json; + + dotnet-sdk = dotnetCorePackages.sdk_8_0; + dotnet-runtime = dotnetCorePackages.runtime_8_0; + + postInstall = '' + install -m 644 -D -t "$out/share/doc/${pname}" License.md + ''; + + passthru = { + updateScript = ./update.sh; + tests.version = testers.testVersion { + package = audiothekar; + command = "audiothekar-cli --version"; + }; + }; + + meta = with lib; { + description = "Download-Client für die ARD-Audiothek"; + longDescription = '' + Audiothekar is a command line client to browse and download programs from + German public broadcast online offering at https://www.ardaudiothek.de/. + ''; + homepage = "https://github.com/fxsth/Audiothekar"; + license = licenses.mit; + maintainers = with maintainers; [ + wamserma + ]; + platforms = [ "x86_64-linux" ]; # needs some work to enable dotnet-sdk.meta.platforms; + mainProgram = "audiothekar-cli"; + }; +} diff --git a/pkgs/by-name/au/audiothekar/update.sh b/pkgs/by-name/au/audiothekar/update.sh new file mode 100755 index 000000000000..f21ef010d03f --- /dev/null +++ b/pkgs/by-name/au/audiothekar/update.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env nix-shell +#!nix-shell -I nixpkgs=./. -i bash -p curl jq common-updater-scripts +#shellcheck shell=bash + +set -eu -o pipefail + +version=$(curl -s ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \ + https://api.github.com/repos/fxsth/audiothekar/releases/latest | jq -e -r .tag_name | tail -c +2) +old_version=$(nix-instantiate --eval -A audiothekar.version | jq -e -r) + +if [[ $version == "$old_version" ]]; then + echo "New version same as old version, nothing to do." >&2 + exit 0 +fi + +update-source-version audiothekar "$version" + +$(nix-build -A audiothekar.fetch-deps --no-out-link)