diff --git a/pkgs/applications/audio/netease-cloud-music/default.nix b/pkgs/applications/audio/netease-cloud-music/default.nix new file mode 100644 index 000000000000000..9e673309c194aa3 --- /dev/null +++ b/pkgs/applications/audio/netease-cloud-music/default.nix @@ -0,0 +1,150 @@ +{ lib +, stdenv +, fetchurl +, dpkg +, autoPatchelfHook +, makeWrapper + # , qt5 +, xorg +, libdrm +, alsa-lib +, taglib +, vlc +, krb5 +, gtk2 +, gtk3 +, tcp_wrappers +, e2fsprogs +, gnutls +, avahi +, sqlite +, libogg +, libvorbis +, libsndfile +, libasyncns +, dbus-glib +, cups +, nspr +, gnome2 +, nss +, icu60 +, libinput +, mtdev +, libpulseaudio + # , libjpeg_original + # , double-conversion + # , eudev +}: +stdenv.mkDerivation rec { + pname = "netease-cloud-music"; + version = "1.2.1"; + src = fetchurl { + url = "https://d1.music.126.net/dmusic/netease-cloud-music_1.2.1_amd64_ubuntu_20190428.deb"; + sha256 = "sha256-HunwKELmwsjHnEiy6TIHT5whOo60I45eY/IEOFYv7Ls="; + curlOpts = "-AMozilla/5.0"; + }; + + nativeBuildInputs = [ + dpkg + autoPatchelfHook + makeWrapper + ]; + # some libraries' versions don't match, comment them + buildInputs = [ + stdenv.cc.cc.lib + # qt5.qtbase + # qt5.qtdeclarative + # qt5.qtwebchannel + # qt5.qtx11extras + # xorg.libXtst + xorg.libXScrnSaver + xorg.xcbutilkeysyms + xorg.xcbutilimage + xorg.xcbutilwm + xorg.xcbutilrenderutil + libdrm + alsa-lib + taglib + vlc + krb5 + gtk2 + gtk3 + tcp_wrappers + e2fsprogs + gnutls + avahi + sqlite + libogg + libvorbis + libsndfile + libasyncns + dbus-glib + cups + nspr + gnome2.GConf + nss + icu60 + libinput + mtdev + libpulseaudio + # libjpeg_original + # double-conversion + # eudev + ]; + + unpackPhase = '' + dpkg -x "$src" . + ''; + # Refer https://aur.archlinux.org/cgit/aur.git/tree/exclude.list?h=netease-cloud-music + # don't use NixOS's qt5 + # --set QT_PLUGIN_PATH "${qt5.qtbase}/${qt5.qtbase.qtPluginPrefix}" \ + # --set QT_QPA_PLATFORM_PLUGIN_PATH "${qt5.qtbase}/${qt5.qtbase.qtPluginPrefix}/platforms" \ + installPhase = '' + install -D opt/netease/netease-cloud-music/netease-cloud-music -t $out/bin + install -Dm644 \ + opt/netease/netease-cloud-music/libs/libdouble-conversion.so.1 \ + opt/netease/netease-cloud-music/libs/libjpeg.so.8 \ + opt/netease/netease-cloud-music/libs/libqcef.so.1.1.4 \ + opt/netease/netease-cloud-music/libs/libudev.so.1 \ + opt/netease/netease-cloud-music/libs/libXtst.so.6 \ + opt/netease/netease-cloud-music/libs/libQt5Core.so.5 \ + opt/netease/netease-cloud-music/libs/libQt5Gui.so.5 \ + opt/netease/netease-cloud-music/libs/libQt5XcbQpa.so.5 \ + opt/netease/netease-cloud-music/libs/libQt5Network.so.5 \ + opt/netease/netease-cloud-music/libs/libQt5Xml.so.5 \ + opt/netease/netease-cloud-music/libs/libQt5Qml.so.5 \ + opt/netease/netease-cloud-music/libs/libQt5Svg.so.5 \ + opt/netease/netease-cloud-music/libs/libQt5EglFSDeviceIntegration.so.5 \ + opt/netease/netease-cloud-music/libs/libQt5X11Extras.so.5 \ + opt/netease/netease-cloud-music/libs/libQt5DBus.so.5 \ + opt/netease/netease-cloud-music/libs/libQt5WebChannel.so.5 \ + opt/netease/netease-cloud-music/libs/libQt5Widgets.so.5 \ + -t $out/lib/netease-cloud-music + cp -r opt/netease/netease-cloud-music/plugins $out/lib/netease-cloud-music + cp -r opt/netease/netease-cloud-music/libs/qcef $out/lib/netease-cloud-music + cp -r usr/share $out + ''; + + preFixup = '' + rm -r * + ln -s libqcef.so.1.1.4 $out/lib/netease-cloud-music/libqcef.so.1 + ''; + postFixup = '' + wrapProgram $out/bin/netease-cloud-music \ + --set QT_PLUGIN_PATH "$out/lib/netease-cloud-music/plugins" \ + --set QT_QPA_PLATFORM_PLUGIN_PATH "$out/lib/netease-cloud-music/plugins/platforms" \ + --set QCEF_INSTALL_PATH "$out/lib/netease-cloud-music/qcef" \ + --set QT_XKB_CONFIG_ROOT "${xorg.xkeyboardconfig}/share/X11/xkb" \ + --set XDG_SESSION_TYPE x11 \ + --set QT_QPA_PLATFORM xcb \ + --unset WAYLAND_DISPLAY + ''; + + meta = with lib; { + description = "Client for Netease Cloud Music service"; + homepage = "https://music.163.com"; + platforms = [ "x86_64-linux" ]; + maintainers = with maintainers; [ mlatus Freed-Wu ]; + license = licenses.unfree; + }; +} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 4dfcec2635d70c2..9bde15957f26f43 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1142,7 +1142,6 @@ mapAliases ({ ncat = throw "'ncat' has been renamed to/replaced by 'nmap'"; # Converted to throw 2022-02-22 neap = throw "neap was removed from nixpkgs, as it relies on python2"; # Added 2022-01-12 neochat = libsForQt5.kdeGear.neochat; # added 2022-05-10 - netease-cloud-music = throw "netease-cloud-music has been removed together with deepin"; # Added 2020-08-31 nettools_mptcp = throw "'nettools_mptcp' has been moved to https://github.com/teto/mptcp-flake"; # Converted to throw 2022-10-04 networkmanager_fortisslvpn = throw "'networkmanager_fortisslvpn' has been renamed to/replaced by 'networkmanager-fortisslvpn'"; # Converted to throw 2022-02-22 networkmanager_iodine = throw "'networkmanager_iodine' has been renamed to/replaced by 'networkmanager-iodine'"; # Converted to throw 2022-02-22 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e569a2c5dacc18e..b37da783a0793f6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -29185,6 +29185,8 @@ with pkgs; netease-music-tui = callPackage ../applications/audio/netease-music-tui { }; + netease-cloud-music = callPackage ../applications/audio/netease-cloud-music { }; + netease-cloud-music-gtk = callPackage ../applications/audio/netease-cloud-music-gtk { inherit (darwin.apple_sdk.frameworks) Foundation SystemConfiguration; };