depot/third_party/nixpkgs/pkgs/by-name/ne/netease-cloud-music-gtk/package.nix
Default email c7cb07f092 Project import generated by Copybara.
GitOrigin-RevId: 1536926ef5621b09bba54035ae2bb6d806d72ac8
2024-02-29 21:09:43 +01:00

88 lines
1.8 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, cargo
, meson
, ninja
, pkg-config
, glib
, gtk4
, appstream-glib
, desktop-file-utils
, libxml2
, rustc
, wrapGAppsHook4
, openssl
, dbus
, libadwaita
, glib-networking
, gst_all_1
, libsoup_3
}:
stdenv.mkDerivation rec {
pname = "netease-cloud-music-gtk";
version = "2.3.0";
src = fetchFromGitHub {
owner = "gmg137";
repo = pname;
rev = version;
hash = "sha256-/HvP82QqN+dWb5XJelsayeo4sz/pVvCKQ9RKQJv7PAI=";
};
cargoDeps = rustPlatform.importCargoLock {
lockFile = ./Cargo.lock;
outputHashes = {
"netease-cloud-music-api-1.3.0" = "sha256-SzMu+klhcLi+jDYc9RZUWrBph5TjfddV0STHaijuQ8Q=";
};
};
postPatch = ''
cp ${./Cargo.lock} Cargo.lock
'';
nativeBuildInputs = [
meson
ninja
pkg-config
glib # glib-compile-resources
gtk4 # gtk4-update-icon-cache
appstream-glib # appstream-util
desktop-file-utils # update-desktop-database
libxml2 # xmllint
wrapGAppsHook4
rustPlatform.cargoSetupHook
cargo
rustc
];
buildInputs = [
openssl
dbus
libadwaita
glib-networking
] ++ (with gst_all_1; [
gstreamer
gst-plugins-base
gst-plugins-good
gst-plugins-bad
gst-plugins-ugly
]);
# FIXME: gst-plugins-good missing libsoup breaks streaming
# (https://github.com/nixos/nixpkgs/issues/271960)
preFixup = ''
gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libsoup_3 ]}")
'';
meta = with lib; {
description = "A Rust + GTK based netease cloud music player";
homepage = "https://github.com/gmg137/netease-cloud-music-gtk";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ diffumist aleksana ];
mainProgram = "netease-cloud-music-gtk4";
platforms = platforms.linux;
};
}