librewolf: 132.0.1 -> 132.0.1-1 (#355483)
[NixPkgs.git] / pkgs / by-name / wa / waylyrics / package.nix
blobdac4db24559ea152b38e4b4621f1faac6e62a5b7
1 { lib
2 , rustPlatform
3 , fetchFromGitHub
4 , pkg-config
5 , wrapGAppsHook4
6 , openssl
7 , dbus
8 }:
10 rustPlatform.buildRustPackage rec {
11   pname = "waylyrics";
12   version = "0.3.16";
14   src = fetchFromGitHub {
15     owner = "waylyrics";
16     repo = "waylyrics";
17     rev = "v${version}";
18     hash = "sha256-/hwx4fe1yjfsLYxsQkUMXrqWhAgp/VJ74N1eSiXuJ54=";
19   };
21   cargoHash = "sha256-Os7djeTDChNWXWbmDuJWJnf7E+U/V14Jg4cLOMAKhu4=";
23   nativeBuildInputs = [ pkg-config wrapGAppsHook4 ];
24   buildInputs = [ openssl dbus ];
26   checkFlags = [
27     "--skip=tests::netease_lyric::get_netease_lyric" # Requires network access
28   ];
30   WAYLYRICS_THEME_PRESETS_DIR = "${placeholder "out"}/share/waylyrics/themes";
32   postInstall = ''
33     # Install themes
34     install -d $WAYLYRICS_THEME_PRESETS_DIR
35     cp -vr themes/* $WAYLYRICS_THEME_PRESETS_DIR
36     # Install desktop entry
37     install -Dm644 metainfo/io.github.waylyrics.Waylyrics.desktop -t $out/share/applications
38     # Install schema
39     install -Dm644 metainfo/io.github.waylyrics.Waylyrics.gschema.xml -t $out/share/gsettings-schemas/$name/glib-2.0/schemas
40     glib-compile-schemas $out/share/gsettings-schemas/$name/glib-2.0/schemas/
41     # Install metainfo
42     install -Dm644 metainfo/io.github.waylyrics.Waylyrics.metainfo.xml -t $out/share/metainfo
43     # Install icons
44     install -d $out/share/icons
45     cp -vr res/icons/hicolor $out/share/icons/hicolor
46     # Install translations
47     pushd locales
48     for po in $(find . -type f -name '*.po')
49     do
50       install -d $(dirname "$out/share/locale/$po")
51       msgfmt -o $out/share/locale/''${po%.po}.mo $po
52     done
53     popd
54   '';
56   meta = with lib; {
57     description = "Desktop lyrics with QQ and NetEase Music source";
58     mainProgram = "waylyrics";
59     homepage = "https://github.com/waylyrics/waylyrics";
60     license = with licenses; [ mit cc-by-40 ];
61     maintainers = with maintainers; [ shadowrz aleksana ];
62     platforms = platforms.linux;
63   };