diff --git a/pkgs/by-name/qc/qcm/package.nix b/pkgs/by-name/qc/qcm/package.nix new file mode 100644 index 000000000000..6e99a64e4bba --- /dev/null +++ b/pkgs/by-name/qc/qcm/package.nix @@ -0,0 +1,57 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +, pkg-config +, qt6 +, curl +, ffmpeg +, cubeb +}: + +stdenv.mkDerivation rec { + pname = "qcm"; + version = "1.0.2"; + + src = fetchFromGitHub { + owner = "hypengw"; + repo = "Qcm"; + rev = "v${version}"; + fetchSubmodules = true; + hash = "sha256-6QivAQqOuWIldx2Rh5nNsj0gia3AOUm6vy9aqyJ1G6k="; + }; + + patches = [ ./remove_cubeb_vendor.patch ]; + + nativeBuildInputs = [ + cmake + pkg-config + qt6.wrapQtAppsHook + ]; + + buildInputs = [ + qt6.qtbase + qt6.qtdeclarative + qt6.qtwayland + curl + ffmpeg + cubeb + ] ++ cubeb.passthru.backendLibs; + + qtWrapperArgs = [ + "--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath cubeb.passthru.backendLibs}" + ]; + + postInstall = '' + rm -r $out/{include,lib/cmake} + ''; + + meta = with lib; { + description = "An unofficial Qt client for netease cloud music"; + homepage = "https://github.com/hypengw/Qcm"; + license = licenses.gpl2Plus; + mainProgram = "Qcm"; + maintainers = with maintainers; [ aleksana ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/by-name/qc/qcm/remove_cubeb_vendor.patch b/pkgs/by-name/qc/qcm/remove_cubeb_vendor.patch new file mode 100644 index 000000000000..298424856414 --- /dev/null +++ b/pkgs/by-name/qc/qcm/remove_cubeb_vendor.patch @@ -0,0 +1,33 @@ +diff --git a/player/CMakeLists.txt b/player/CMakeLists.txt +index c160e10..62c2611 100644 +--- a/player/CMakeLists.txt ++++ b/player/CMakeLists.txt +@@ -25,4 +25,4 @@ target_include_directories( + target_link_libraries( + player + PUBLIC core error asio_helper PkgConfig::LIBAV +- PRIVATE ctre cubeb::cubeb) ++ PRIVATE ctre cubeb) +diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt +index 45345d3..f797b48 100644 +--- a/third_party/CMakeLists.txt ++++ b/third_party/CMakeLists.txt +@@ -41,10 +41,7 @@ option(USE_SANITIZERS "" OFF) + set(USE_WINMM + OFF + CACHE BOOL "") +-add_subdirectory(cubeb EXCLUDE_FROM_ALL) +-set_property(TARGET cubeb PROPERTY MSVC_RUNTIME_LIBRARY +- "MultiThreaded$<$:Debug>") +-add_library(cubeb::cubeb ALIAS cubeb) ++find_package(cubeb REQUIRED) + + option(KDSingleApplication_QT6 "" ON) + option(KDSingleApplication_STATIC "" ON) +@@ -55,4 +52,4 @@ add_subdirectory(KDSingleApplication) + + + add_library(pegtl INTERFACE) +-target_include_directories(pegtl INTERFACE PEGTL/include) +\ No newline at end of file ++target_include_directories(pegtl INTERFACE PEGTL/include)