Skip to content

Commit 61f52fd

Browse files
authored
Merge pull request #326415 from iivusly/lastfm-darwin
lastfm: init at 2.1.39
2 parents ee2d97a + 45e7510 commit 61f52fd

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

pkgs/by-name/la/lastfm/package.nix

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{ lib
2+
, fetchzip
3+
, stdenvNoCC
4+
, writeShellApplication
5+
, curl
6+
, xmlstarlet
7+
, common-updater-scripts
8+
}:
9+
10+
stdenvNoCC.mkDerivation (finalAttrs: {
11+
pname = "lastfm";
12+
version = "2.1.39";
13+
14+
src = fetchzip {
15+
extension = "zip";
16+
name = "Last.fm.app";
17+
url = "https://cdn.last.fm/client/Mac/Last.fm-${finalAttrs.version}.zip";
18+
hash = "sha256-jxFh0HbY4g5xcvAI20b92dL1FRvRqPwBBa0Cv9k63+s=";
19+
};
20+
21+
dontConfigure = true;
22+
dontBuild = true;
23+
24+
sourceRoot = ".";
25+
26+
installPhase = ''
27+
runHook preInstall
28+
29+
mkdir -p "$out/Applications"
30+
cp -r *.app "$out/Applications"
31+
32+
runHook postInstall
33+
'';
34+
35+
passthru.updateScript = lib.getExe (writeShellApplication {
36+
name = "lastfm-update-script";
37+
runtimeInputs = [
38+
curl
39+
xmlstarlet
40+
common-updater-scripts
41+
];
42+
text = ''
43+
url=$(curl --silent "https://cdn.last.fm/client/Mac/updates.xml")
44+
version=$(echo "$url" | xmlstarlet sel -t -v "substring-before(substring-after(//enclosure/@url, 'version='), '&')")
45+
update-source-version lastfm "$version"
46+
'';
47+
});
48+
49+
meta = {
50+
description = "Music services manager";
51+
homepage = "https://www.last.fm/";
52+
license = lib.licenses.unfree;
53+
maintainers = with lib.maintainers; [ iivusly ];
54+
platforms = lib.platforms.darwin;
55+
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
56+
};
57+
})

0 commit comments

Comments
 (0)