2023-08-04 22:07:22 +00:00
|
|
|
{ stdenv
|
|
|
|
, meta
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
|
|
|
, mpv
|
|
|
|
, graphicsmagick
|
|
|
|
, electron_24
|
|
|
|
, makeDesktopItem
|
|
|
|
, makeWrapper
|
|
|
|
, pname
|
|
|
|
, appname
|
|
|
|
, version
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
icon = fetchurl {
|
|
|
|
url =
|
|
|
|
"https://github.com/jeffvli/feishin/raw/development/assets/icons/1024x1024.png";
|
|
|
|
sha256 = "sha256-8Qigt1CNMa3SDVK2cdqWJuMSl19yfy6nPQfME4qA48I=";
|
|
|
|
};
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "feishin";
|
|
|
|
desktopName = "Feishin";
|
|
|
|
comment = "Full-featured Subsonic/Jellyfin compatible desktop music player";
|
|
|
|
icon = "feishin";
|
|
|
|
exec = "feishin %u";
|
2023-10-19 13:55:26 +00:00
|
|
|
categories = [ "Audio" "AudioVideo" ];
|
2023-08-04 22:07:22 +00:00
|
|
|
mimeTypes = [ "x-scheme-handler/feishin" ];
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2023-10-19 13:55:26 +00:00
|
|
|
inherit pname version meta;
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/jeffvli/feishin/releases/download/v${version}/${appname}-${version}-linux-x64.tar.xz";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-uYswGxSXz2YddoFs5F7f+ywqAr7qXqp6WryQ7ENSawQ=";
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper graphicsmagick ];
|
|
|
|
|
|
|
|
# Installs mpv as a requirement
|
|
|
|
propagatedBuildInputs = [ mpv ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mkdir -p $out/share
|
|
|
|
cp -r resources $out/share/${pname}/
|
|
|
|
cp -r locales $out/share/${pname}/
|
|
|
|
|
|
|
|
makeWrapper ${electron_24}/bin/electron $out/bin/${pname} \
|
|
|
|
--add-flags $out/share/${pname}/app.asar
|
|
|
|
install -m 444 -D "${desktopItem}/share/applications/"* \
|
|
|
|
-t $out/share/applications/
|
|
|
|
for size in 16 24 32 48 64 128 256 512; do
|
|
|
|
mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps
|
|
|
|
gm convert -resize "$size"x"$size" ${icon} $out/share/icons/hicolor/"$size"x"$size"/apps/${appname}.png
|
|
|
|
done
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
shellHook = ''
|
|
|
|
set -x
|
|
|
|
export LD_LIBRARY_PATH=${mpv}/lib
|
|
|
|
set +x
|
|
|
|
'';
|
|
|
|
}
|