2024-02-29 20:09:43 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
|
|
|
, wrapGAppsHook4
|
|
|
|
, openssl
|
|
|
|
, dbus
|
|
|
|
}:
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "waylyrics";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "0.3.10";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2024-05-15 15:35:15 +00:00
|
|
|
owner = "waylyrics";
|
2024-02-29 20:09:43 +00:00
|
|
|
repo = "waylyrics";
|
|
|
|
rev = "v${version}";
|
2024-06-05 15:53:02 +00:00
|
|
|
hash = "sha256-JqCnVkqua/qOZjE+XKj3PyrGwqk7IToYOhLN78fKdq0=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
cargoHash = "sha256-fVwY+lkfg/O1sPM0C7NOdb8/pln96vBcmCAWh0pEPHI=";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
nativeBuildInputs = [ pkg-config wrapGAppsHook4 ];
|
|
|
|
buildInputs = [ openssl dbus ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
checkFlags = [
|
|
|
|
"--skip=tests::netease_lyric::get_netease_lyric" # Requires network access
|
|
|
|
];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
WAYLYRICS_THEME_PRESETS_DIR = "${placeholder "out"}/share/waylyrics/themes";
|
|
|
|
|
|
|
|
postInstall = ''
|
2024-02-29 20:09:43 +00:00
|
|
|
# Install themes
|
|
|
|
install -d $WAYLYRICS_THEME_PRESETS_DIR
|
|
|
|
cp -vr themes/* $WAYLYRICS_THEME_PRESETS_DIR
|
|
|
|
# Install desktop entry
|
2024-05-15 15:35:15 +00:00
|
|
|
install -Dm644 metainfo/io.github.waylyrics.Waylyrics.desktop -t $out/share/applications
|
2023-07-15 17:15:38 +00:00
|
|
|
# Install schema
|
2024-05-15 15:35:15 +00:00
|
|
|
install -Dm644 metainfo/io.github.waylyrics.Waylyrics.gschema.xml -t $out/share/gsettings-schemas/$name/glib-2.0/schemas
|
2023-07-15 17:15:38 +00:00
|
|
|
glib-compile-schemas $out/share/gsettings-schemas/$name/glib-2.0/schemas/
|
2024-05-15 15:35:15 +00:00
|
|
|
# Install metainfo
|
|
|
|
install -Dm644 metainfo/io.github.waylyrics.Waylyrics.metainfo.xml -t $out/share/metainfo
|
2023-07-15 17:15:38 +00:00
|
|
|
# Install icons
|
2024-02-29 20:09:43 +00:00
|
|
|
install -d $out/share/icons
|
|
|
|
cp -vr res/icons/hicolor $out/share/icons/hicolor
|
2024-04-21 15:54:59 +00:00
|
|
|
# Install translations
|
|
|
|
pushd locales
|
|
|
|
for po in $(find . -type f -name '*.po')
|
|
|
|
do
|
|
|
|
install -d $(dirname "$out/share/locale/$po")
|
|
|
|
msgfmt -o $out/share/locale/''${po%.po}.mo $po
|
|
|
|
done
|
|
|
|
popd
|
2023-07-15 17:15:38 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-02-29 20:09:43 +00:00
|
|
|
description = "Desktop lyrics with QQ and NetEase Music source";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "waylyrics";
|
2024-05-15 15:35:15 +00:00
|
|
|
homepage = "https://github.com/waylyrics/waylyrics";
|
2024-02-29 20:09:43 +00:00
|
|
|
license = with licenses; [ mit cc-by-40 ];
|
|
|
|
maintainers = with maintainers; [ shadowrz aleksana ];
|
2023-07-15 17:15:38 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|