2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchurl,
|
|
|
|
|
|
|
|
autoPatchelfHook,
|
|
|
|
dpkg,
|
|
|
|
makeBinaryWrapper,
|
|
|
|
makeWrapper,
|
|
|
|
undmg,
|
2024-05-15 15:35:15 +00:00
|
|
|
wrapGAppsHook3,
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
glib-networking,
|
|
|
|
gtk3,
|
2024-04-21 15:54:59 +00:00
|
|
|
libappindicator,
|
|
|
|
libnotify,
|
2024-09-19 14:19:46 +00:00
|
|
|
libsoup_3,
|
2024-04-21 15:54:59 +00:00
|
|
|
mpv-unwrapped,
|
|
|
|
xdg-user-dirs,
|
2024-09-19 14:19:46 +00:00
|
|
|
webkitgtk_4_1,
|
2024-02-07 01:22:34 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
pname = "spotube";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "3.8.1";
|
2024-02-07 01:22:34 +00:00
|
|
|
|
|
|
|
meta = {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Open source, cross-platform Spotify client compatible across multiple platforms";
|
2024-02-07 01:22:34 +00:00
|
|
|
longDescription = ''
|
|
|
|
Spotube is an open source, cross-platform Spotify client compatible across
|
|
|
|
multiple platforms utilizing Spotify's data API and YouTube (or Piped.video or JioSaavn)
|
|
|
|
as an audio source, eliminating the need for Spotify Premium
|
|
|
|
'';
|
|
|
|
downloadPage = "https://github.com/KRTirtho/spotube/releases";
|
2024-04-21 15:54:59 +00:00
|
|
|
homepage = "https://spotube.krtirtho.dev/";
|
2024-02-07 01:22:34 +00:00
|
|
|
license = lib.licenses.bsdOriginal;
|
|
|
|
mainProgram = "spotube";
|
|
|
|
maintainers = with lib.maintainers; [ tomasajt ];
|
2024-04-21 15:54:59 +00:00
|
|
|
platforms = [
|
|
|
|
"x86_64-linux"
|
|
|
|
"x86_64-darwin"
|
|
|
|
"aarch64-darwin"
|
|
|
|
];
|
2024-02-07 01:22:34 +00:00
|
|
|
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
fetchArtifact =
|
|
|
|
{ filename, hash }:
|
2024-02-07 01:22:34 +00:00
|
|
|
fetchurl {
|
|
|
|
url = "https://github.com/KRTirtho/spotube/releases/download/v${version}/${filename}";
|
|
|
|
inherit hash;
|
|
|
|
};
|
|
|
|
|
|
|
|
darwin = stdenv.mkDerivation {
|
|
|
|
inherit pname version meta;
|
|
|
|
|
|
|
|
src = fetchArtifact {
|
|
|
|
filename = "Spotube-macos-universal.dmg";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-NbKFvg50n/GByVU6/vNLmTTV9bhIhl3AxlwAcG60KVY=";
|
2024-02-07 01:22:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
undmg
|
|
|
|
makeBinaryWrapper
|
|
|
|
];
|
2024-02-07 01:22:34 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/Applications $out/bin
|
|
|
|
cp -r spotube.app $out/Applications
|
2024-04-21 15:54:59 +00:00
|
|
|
makeBinaryWrapper $out/Applications/spotube.app/Contents/MacOS/spotube $out/bin/spotube
|
2024-02-07 01:22:34 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
linux = stdenv.mkDerivation {
|
|
|
|
inherit pname version meta;
|
|
|
|
|
|
|
|
src = fetchArtifact {
|
|
|
|
filename = "Spotube-linux-x86_64.deb";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-R/yHXx29T/7NNc1L1AmevzXp1k98qnmvOEd3cfSlJuA=";
|
2024-02-07 01:22:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoPatchelfHook
|
|
|
|
dpkg
|
|
|
|
makeWrapper
|
2024-05-15 15:35:15 +00:00
|
|
|
wrapGAppsHook3
|
2024-02-07 01:22:34 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2024-09-19 14:19:46 +00:00
|
|
|
glib-networking
|
|
|
|
gtk3
|
2024-02-07 01:22:34 +00:00
|
|
|
libappindicator
|
|
|
|
libnotify
|
2024-09-19 14:19:46 +00:00
|
|
|
libsoup_3
|
2024-02-07 01:22:34 +00:00
|
|
|
mpv-unwrapped
|
2024-09-19 14:19:46 +00:00
|
|
|
webkitgtk_4_1
|
2024-02-07 01:22:34 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
dontWrapGApps = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
mkdir -p $out
|
|
|
|
cp -r usr/* $out
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
patchelf $out/share/spotube/lib/libmedia_kit_native_event_loop.so \
|
|
|
|
--replace-needed libmpv.so.1 libmpv.so
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
makeWrapper $out/share/spotube/spotube $out/bin/spotube \
|
|
|
|
"''${gappsWrapperArgs[@]}" \
|
|
|
|
--prefix LD_LIBRARY_PATH : $out/share/spotube/lib:${lib.makeLibraryPath [ mpv-unwrapped ]} \
|
|
|
|
--prefix PATH : ${lib.makeBinPath [ xdg-user-dirs ]}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
in
|
2024-09-26 11:04:55 +00:00
|
|
|
if stdenv.hostPlatform.isDarwin then darwin else linux
|