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