Skip to content

Commit

Permalink
bartender: add passthru.updateScript, format with `nixfmt-rfc-style…
Browse files Browse the repository at this point in the history
…`, 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
  • Loading branch information
DontEatOreo authored Dec 12, 2024
1 parent f5413b0 commit 0d7a6a0
Showing 1 changed file with 39 additions and 10 deletions.
49 changes: 39 additions & 10 deletions pkgs/by-name/ba/bartender/package.nix
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -32,17 +40,38 @@ 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 = ''
Bartender is an award-winning app for macOS that superpowers your menu bar, giving you total control over your menu bar items, what's displayed, and when, with menu bar items only showing when you need them.
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;
};
})

0 comments on commit 0d7a6a0

Please sign in to comment.