2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2022-09-09 14:08:57 +00:00
|
|
|
, fetchpatch
|
2022-08-21 13:32:41 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
2021-12-06 16:07:01 +00:00
|
|
|
, glib
|
2022-08-21 13:32:41 +00:00
|
|
|
, gtk4
|
|
|
|
, appstream-glib
|
|
|
|
, desktop-file-utils
|
|
|
|
, libxml2
|
|
|
|
, wrapGAppsHook4
|
2021-12-06 16:07:01 +00:00
|
|
|
, openssl
|
2022-08-21 13:32:41 +00:00
|
|
|
, dbus
|
|
|
|
, libadwaita
|
2021-12-06 16:07:01 +00:00
|
|
|
, gst_all_1
|
2022-08-21 13:32:41 +00:00
|
|
|
, Foundation
|
|
|
|
, SystemConfiguration
|
2021-12-06 16:07:01 +00:00
|
|
|
}:
|
2022-08-21 13:32:41 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-12-06 16:07:01 +00:00
|
|
|
pname = "netease-cloud-music-gtk";
|
2022-09-09 14:08:57 +00:00
|
|
|
version = "2.0.2";
|
2022-08-21 13:32:41 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gmg137";
|
2022-08-21 13:32:41 +00:00
|
|
|
repo = pname;
|
2021-12-06 16:07:01 +00:00
|
|
|
rev = version;
|
2022-09-09 14:08:57 +00:00
|
|
|
hash = "sha256-0pmuzdRQBdUS4ORh3zJQWb/hbhk7SY3P4QMwoy4Mgp8=";
|
2022-08-21 13:32:41 +00:00
|
|
|
};
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "add-cargo-lock-for-2.0.2.patch";
|
|
|
|
url = "https://github.com/gmg137/netease-cloud-music-gtk/commit/21b5d40d49e661fe7bd35ed10bb8b883ef7fcd9f.patch";
|
|
|
|
hash = "sha256-pSgc+yJQMNyLPYUMc1Kp/Kr+++2tH8srIM5PgVeoZ+E=";
|
|
|
|
})
|
|
|
|
];
|
2022-08-21 13:32:41 +00:00
|
|
|
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
inherit src patches;
|
2022-09-09 14:08:57 +00:00
|
|
|
hash = "sha256-7Z5i5Xqtk4ZbBXSVYg1e05ENa2swC88Ctd2paE60Yyo=";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2022-08-21 13:32:41 +00:00
|
|
|
meson
|
|
|
|
ninja
|
2021-12-06 16:07:01 +00:00
|
|
|
pkg-config
|
2022-08-21 13:32:41 +00:00
|
|
|
glib # glib-compile-resources
|
|
|
|
gtk4 # gtk4-update-icon-cache
|
|
|
|
appstream-glib # appstream-util
|
|
|
|
desktop-file-utils # update-desktop-database
|
|
|
|
libxml2 # xmllint
|
|
|
|
wrapGAppsHook4
|
|
|
|
] ++ (with rustPlatform; [
|
|
|
|
cargoSetupHook
|
|
|
|
rust.cargo
|
|
|
|
rust.rustc
|
|
|
|
]);
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
openssl
|
2022-08-21 13:32:41 +00:00
|
|
|
dbus
|
|
|
|
libadwaita
|
2021-12-06 16:07:01 +00:00
|
|
|
] ++ (with gst_all_1; [
|
|
|
|
gstreamer
|
|
|
|
gst-plugins-base
|
|
|
|
gst-plugins-good
|
|
|
|
gst-plugins-bad
|
|
|
|
gst-plugins-ugly
|
2022-08-21 13:32:41 +00:00
|
|
|
]) ++ lib.optionals stdenv.isDarwin [
|
|
|
|
Foundation
|
|
|
|
SystemConfiguration
|
|
|
|
];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2022-08-21 13:32:41 +00:00
|
|
|
description = "A Rust + GTK based netease cloud music player";
|
2021-12-06 16:07:01 +00:00
|
|
|
homepage = "https://github.com/gmg137/netease-cloud-music-gtk";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ diffumist ];
|
2022-08-21 13:32:41 +00:00
|
|
|
mainProgram = "netease-cloud-music-gtk4";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
}
|