1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/by-name/wa/waylyrics/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

65 lines
1.9 KiB
Nix

{ lib
, rustPlatform
, fetchFromGitHub
, pkg-config
, wrapGAppsHook4
, openssl
, dbus
}:
rustPlatform.buildRustPackage rec {
pname = "waylyrics";
version = "0.3.16";
src = fetchFromGitHub {
owner = "waylyrics";
repo = "waylyrics";
rev = "v${version}";
hash = "sha256-/hwx4fe1yjfsLYxsQkUMXrqWhAgp/VJ74N1eSiXuJ54=";
};
cargoHash = "sha256-Os7djeTDChNWXWbmDuJWJnf7E+U/V14Jg4cLOMAKhu4=";
nativeBuildInputs = [ pkg-config wrapGAppsHook4 ];
buildInputs = [ openssl dbus ];
checkFlags = [
"--skip=tests::netease_lyric::get_netease_lyric" # Requires network access
];
WAYLYRICS_THEME_PRESETS_DIR = "${placeholder "out"}/share/waylyrics/themes";
postInstall = ''
# Install themes
install -d $WAYLYRICS_THEME_PRESETS_DIR
cp -vr themes/* $WAYLYRICS_THEME_PRESETS_DIR
# Install desktop entry
install -Dm644 metainfo/io.github.waylyrics.Waylyrics.desktop -t $out/share/applications
# Install schema
install -Dm644 metainfo/io.github.waylyrics.Waylyrics.gschema.xml -t $out/share/gsettings-schemas/$name/glib-2.0/schemas
glib-compile-schemas $out/share/gsettings-schemas/$name/glib-2.0/schemas/
# Install metainfo
install -Dm644 metainfo/io.github.waylyrics.Waylyrics.metainfo.xml -t $out/share/metainfo
# Install icons
install -d $out/share/icons
cp -vr res/icons/hicolor $out/share/icons/hicolor
# 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
'';
meta = with lib; {
description = "Desktop lyrics with QQ and NetEase Music source";
mainProgram = "waylyrics";
homepage = "https://github.com/waylyrics/waylyrics";
license = with licenses; [ mit cc-by-40 ];
maintainers = with maintainers; [ shadowrz aleksana ];
platforms = platforms.linux;
};
}