bartender: add passthru.updateScript, format with nixfmt-rfc-style, use lib.platforms.darwin, 5.2.3 -> 5.2.7 (#363633)

* bartender: use `lib.platforms.darwin`

* bartender: add `passthru.updateScript`

* bartender: format with `nixfmt-rfc-style`

* bartender: 5.2.3 -> 5.2.7

* bartender: replace `meta.changelog` url
This commit is contained in:
DontEatOreo
2024-12-12 01:22:45 -05:00
committed by GitHub
parent f5413b089b
commit 0d7a6a041d
+39 -10
View File
@@ -1,17 +1,25 @@
{ lib
, stdenvNoCC
, fetchurl
, _7zz
{
lib,
stdenvNoCC,
fetchurl,
_7zz,
curl,
cacert,
xmlstarlet,
writeShellApplication,
common-updater-scripts,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "bartender";
version = "5.2.3";
version = "5.2.7";
src = fetchurl {
name = "Bartender ${lib.versions.major finalAttrs.version}.dmg";
url = "https://www.macbartender.com/B2/updates/${builtins.replaceStrings [ "." ] [ "-" ] finalAttrs.version}/Bartender%20${lib.versions.major finalAttrs.version}.dmg";
hash = "sha256-G1XL6o5Rk/U5SsT/Q5vWaVSg0qerfzVizjFmudWAI3E=";
url = "https://www.macbartender.com/B2/updates/${
builtins.replaceStrings [ "." ] [ "-" ] finalAttrs.version
}/Bartender%20${lib.versions.major finalAttrs.version}.dmg";
hash = "sha256-TY6ioG80W8q6LC0FCMRQMJh4DiEKiM6htVf+irvmpnI=";
};
dontPatch = true;
@@ -32,6 +40,22 @@ stdenvNoCC.mkDerivation (finalAttrs: {
runHook postInstall
'';
passthru.updateScript = lib.getExe (writeShellApplication {
name = "bartender-update-script";
runtimeInputs = [
curl
cacert
xmlstarlet
common-updater-scripts
];
text = ''
version_major="${lib.versions.major finalAttrs.version}"
url="https://www.macbartender.com/B2/updates/AppcastB$version_major.xml"
version=$(curl -s "$url" | xmlstarlet sel -t -v '(//item)[last()]/sparkle:shortVersionString' -n)
update-source-version bartender "$version"
'';
});
meta = {
description = "Take control of your menu bar";
longDescription = ''
@@ -39,10 +63,15 @@ stdenvNoCC.mkDerivation (finalAttrs: {
Bartender improves your workflow with quick reveal, search, custom hotkeys and triggers, and lots more.
'';
homepage = "https://www.macbartender.com";
changelog = "https://www.macbartender.com/Bartender${lib.versions.major finalAttrs.version}/release_notes/";
changelog = "https://macbartender.com/B2/updates/${
builtins.replaceStrings [ "." ] [ "-" ] finalAttrs.version
}/rnotes.html";
license = [ lib.licenses.unfree ];
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
maintainers = with lib.maintainers; [ stepbrobd DimitarNestorov ];
platforms = [ "aarch64-darwin" "x86_64-darwin" ];
maintainers = with lib.maintainers; [
stepbrobd
DimitarNestorov
];
platforms = lib.platforms.darwin;
};
})