chromium,chromedriver: 129.0.6668.91 -> 129.0.6668.100
[NixPkgs.git] / pkgs / by-name / sp / spotube / package.nix
blobbdadcf424ee8630aab116af2d21828ebd536fa85
2   lib,
3   stdenv,
4   fetchurl,
6   autoPatchelfHook,
7   dpkg,
8   makeBinaryWrapper,
9   makeWrapper,
10   undmg,
11   wrapGAppsHook3,
13   glib-networking,
14   gtk3,
15   libappindicator,
16   libnotify,
17   libsoup_3,
18   mpv-unwrapped,
19   xdg-user-dirs,
20   webkitgtk_4_1,
23 let
24   pname = "spotube";
25   version = "3.8.2";
27   meta = {
28     description = "Open source, cross-platform Spotify client compatible across multiple platforms";
29     longDescription = ''
30       Spotube is an open source, cross-platform Spotify client compatible across
31       multiple platforms utilizing Spotify's data API and YouTube (or Piped.video or JioSaavn)
32       as an audio source, eliminating the need for Spotify Premium
33     '';
34     downloadPage = "https://github.com/KRTirtho/spotube/releases";
35     homepage = "https://spotube.krtirtho.dev/";
36     license = lib.licenses.bsdOriginal;
37     mainProgram = "spotube";
38     maintainers = with lib.maintainers; [ tomasajt ];
39     platforms = [
40       "x86_64-linux"
41       "x86_64-darwin"
42       "aarch64-darwin"
43     ];
44     sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
45   };
47   fetchArtifact =
48     { filename, hash }:
49     fetchurl {
50       url = "https://github.com/KRTirtho/spotube/releases/download/v${version}/${filename}";
51       inherit hash;
52     };
54   darwin = stdenv.mkDerivation {
55     inherit pname version meta;
57     src = fetchArtifact {
58       filename = "Spotube-macos-universal.dmg";
59       hash = "sha256-2nqWHQDxJ0PcwTiLAa8YZffqwsdnepMpXvpqRPX5JxM=";
60     };
62     sourceRoot = ".";
64     nativeBuildInputs = [
65       undmg
66       makeBinaryWrapper
67     ];
69     installPhase = ''
70       runHook preInstall
71       mkdir -p $out/Applications $out/bin
72       cp -r spotube.app $out/Applications
73       makeBinaryWrapper $out/Applications/spotube.app/Contents/MacOS/spotube $out/bin/spotube
74       runHook postInstall
75     '';
76   };
78   linux = stdenv.mkDerivation {
79     inherit pname version meta;
81     src = fetchArtifact {
82       filename = "Spotube-linux-x86_64.deb";
83       hash = "sha256-kDPNWbspmORClVMH91Lt3dLVsRwGxiBtB49CHSHxQxI=";
84     };
86     nativeBuildInputs = [
87       autoPatchelfHook
88       dpkg
89       makeWrapper
90       wrapGAppsHook3
91     ];
93     buildInputs = [
94       glib-networking
95       gtk3
96       libappindicator
97       libnotify
98       libsoup_3
99       mpv-unwrapped
100       webkitgtk_4_1
101     ];
103     dontWrapGApps = true;
105     installPhase = ''
106       runHook preInstall
107       mkdir -p $out
108       cp -r usr/* $out
109       runHook postInstall
110     '';
112     preFixup = ''
113       patchelf $out/share/spotube/lib/libmedia_kit_native_event_loop.so \
114           --replace-needed libmpv.so.1 libmpv.so
115     '';
117     postFixup = ''
118       makeWrapper $out/share/spotube/spotube $out/bin/spotube \
119           "''${gappsWrapperArgs[@]}" \
120           --prefix LD_LIBRARY_PATH : $out/share/spotube/lib:${lib.makeLibraryPath [ mpv-unwrapped ]} \
121           --prefix PATH : ${lib.makeBinPath [ xdg-user-dirs ]}
122     '';
123   };
125 if stdenv.hostPlatform.isDarwin then darwin else linux