如何编译安装Debian Deepin Music?

Debian-Like

1 前言

一个问题,一篇文章,一出故事。
笔者使用默认安装的Deepin Music感觉不够完美,于是尝试自己编译安装。

2 最佳实践

2.1 安装前的准备

2.1.1 部署编译环境

apt install -y gcc g++ make cmake

2.1.2 部署编译环境

apt remove -y deepin-music

2.1.3 准备软件包

cd ~
wget  -O deepin-music-6.2.12.tar.gz https://codeload.github.com/linuxdeepin/deepin-music/tar.gz/refs/tags/6.2.12
tar -xf deepin-music-6.2.12.tar.gz

以上命令用于演示,如果你不能下载或者需要其他版本,请从如下链接下载,
https://github.com/linuxdeepin/deepin-music/releases

2.2 编译安装

2.2.1 预编译软件包

cd ~/deepin-music-6.2.12/
mkdir Build
cd Build
cmake .. -DCMAKE_INSTALL_BINDIR=/usr/bin \
        -DCMAKE_INSTALL_SBINDIR=/usr/sbin \
        -DCMAKE_INSTALL_LIBEXECDIR=/usr/libexec \
        -DCMAKE_INSTALL_SYSCONFDIR=/etc \
        -DCMAKE_INSTALL_LOCALSTATEDIR=/var \
        -DCMAKE_INSTALL_LIBDIR=/usr/lib64 \
        -DCMAKE_INSTALL_INCLUDEDIR=/usr/include \
        -DCMAKE_INSTALL_DATAROOTDIR=/usr/share \
        -DCMAKE_INSTALL_INFODIR=/usr/share/info \
        -DCMAKE_INSTALL_LOCALEDIR=/usr/share/locale \
        -DCMAKE_INSTALL_MANDIR=/usr/share/man \
        -DCMAKE_INSTALL_DOCDIR=/usr/share/doc/deepin-music

如果遇到如下错误提示,

CMake Error at /usr/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)                                                                    
Call Stack (most recent call first):                                                                                           
  /usr/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)                               
  /usr/share/cmake-3.25/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args)                                     
  CMakeLists.txt:46 (find_package) 

你可以使用如下命令解决依赖关系,

apt install -y pkg-config

如果遇到如下错误提示,

CMake Error at CMakeLists.txt:56 (find_package):
  By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has                                                       
  asked CMake to find a package configuration file provided by "Qt5", but                                                      
  CMake did not find one.                                                                                                      
                                                                                                                               
  Could not find a package configuration file provided by "Qt5" with any of                                                    
  the following names:                                                                                                         
                                                                                                                               
    Qt5Config.cmake                                                                                                            
    qt5-config.cmake                                                                                                           
                                                                                                                               
  Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR"                                                   
  to a directory containing one of the above files.  If "Qt5" provides a                                                       
  separate development package or SDK, be sure it has been installed. 

你可以使用如下命令解决依赖关系,

apt install -y qtbase5-dev

如果遇到如下错误提示,

CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake:28 (find_package):
  Could not find a package configuration file provided by "Qt5Multimedia"                                                                    
  with any of the following names:                                                                                                           
                                                                                                                                             
    Qt5MultimediaConfig.cmake                                                                                                                
    qt5multimedia-config.cmake                                                                                                               
                                                                                                                                             
  Add the installation prefix of "Qt5Multimedia" to CMAKE_PREFIX_PATH or set                                                                 
  "Qt5Multimedia_DIR" to a directory containing one of the above files.  If                                                                  
  "Qt5Multimedia" provides a separate development package or SDK, be sure it                                                                 
  has been installed.                                                                                                                        
Call Stack (most recent call first):                                                                                                         
  CMakeLists.txt:56 (find_package) 

你可以使用如下命令解决依赖关系,

apt install -y qtmultimedia5-dev

如果遇到如下错误提示,

--   Package 'dtkwidget', required by 'virtual:world', not found
--   Package 'dtkgui', required by 'virtual:world', not found
--   Package 'dtkcore', required by 'virtual:world', not found
CMake Error at /usr/share/cmake-3.25/Modules/FindPkgConfig.cmake:607 (message):
  A required package was not found                                                                                                           
Call Stack (most recent call first):                                                                                                         
  /usr/share/cmake-3.25/Modules/FindPkgConfig.cmake:829 (_pkg_check_modules_internal)                                                        
  src/libdmusic/CMakeLists.txt:25 (pkg_check_modules)  

你可以使用如下命令解决依赖关系,

apt install -y libdtkwidget-dev

如果遇到如下错误提示,

--   Package 'mpris-qt5', required by 'virtual:world', not found
CMake Error at /usr/share/cmake-3.25/Modules/FindPkgConfig.cmake:607 (message):
  A required package was not found                                                                                                           
Call Stack (most recent call first):                                                                                                         
  /usr/share/cmake-3.25/Modules/FindPkgConfig.cmake:829 (_pkg_check_modules_internal)                                                        
  src/music-player/CMakeLists.txt:87 (pkg_check_modules)  

你可以使用如下命令解决依赖关系,

apt install -y libmpris-qt5-dev

如果遇到如下错误提示,

--   Package 'mpris-qt5', required by 'virtual:world', not found
CMake Error at /usr/share/cmake-3.25/Modules/FindPkgConfig.cmake:607 (message):
  A required package was not found                                                                                                           
Call Stack (most recent call first):                                                                                                         
  /usr/share/cmake-3.25/Modules/FindPkgConfig.cmake:829 (_pkg_check_modules_internal)                                                        
  src/music-player/CMakeLists.txt:87 (pkg_check_modules)  

你可以使用如下命令解决依赖关系,

apt install -y libdbusextended-qt5-dev

如果遇到如下错误提示,

--   Package 'vlc-plugin', required by 'virtual:world', not found
CMake Error at /usr/share/cmake-3.25/Modules/FindPkgConfig.cmake:607 (message):
  A required package was not found                                                                                                           
Call Stack (most recent call first):                                                                                                         
  /usr/share/cmake-3.25/Modules/FindPkgConfig.cmake:829 (_pkg_check_modules_internal)                                                        
  src/music-player/CMakeLists.txt:89 (pkg_check_modules)    

你可以使用如下命令解决依赖关系,

apt install -y libvlc-dev libvlccore-dev

如果遇到如下错误提示,

--   Package 'gsettings-qt', required by 'virtual:world', not found
CMake Error at /usr/share/cmake-3.25/Modules/FindPkgConfig.cmake:607 (message):
  A required package was not found                                                                                                           
Call Stack (most recent call first):                                                                                                         
  /usr/share/cmake-3.25/Modules/FindPkgConfig.cmake:829 (_pkg_check_modules_internal)                                                        
  src/music-player/CMakeLists.txt:90 (pkg_check_modules)   

你可以使用如下命令解决依赖关系,

apt install -y libgsettings-qt-dev

如果遇到如下错误提示,

--   Package 'taglib', required by 'virtual:world', not found
CMake Error at /usr/share/cmake-3.25/Modules/FindPkgConfig.cmake:607 (message):
  A required package was not found                                                                                                           
Call Stack (most recent call first):                                                                                                         
  /usr/share/cmake-3.25/Modules/FindPkgConfig.cmake:829 (_pkg_check_modules_internal)                                                        
  src/music-player/CMakeLists.txt:95 (pkg_check_modules)  

你可以使用如下命令解决依赖关系,

apt install -y libgsettings-qt-dev

如果遇到如下错误提示,

--   Package 'taglib', required by 'virtual:world', not found
CMake Error at /usr/share/cmake-3.25/Modules/FindPkgConfig.cmake:607 (message):
  A required package was not found                                                                                                           
Call Stack (most recent call first):                                                                                                         
  /usr/share/cmake-3.25/Modules/FindPkgConfig.cmake:829 (_pkg_check_modules_internal)                                                        
  src/music-player/CMakeLists.txt:95 (pkg_check_modules) 

你可以使用如下命令解决依赖关系,

apt install -y libtag1-dev

如果遇到如下错误提示,

--   Package 'udisks2-qt5', required by 'virtual:world', not found
CMake Error at /usr/share/cmake-3.25/Modules/FindPkgConfig.cmake:607 (message):
  A required package was not found                                                                                                           
Call Stack (most recent call first):                                                                                                         
  /usr/share/cmake-3.25/Modules/FindPkgConfig.cmake:829 (_pkg_check_modules_internal)                                                        
  src/music-player/CMakeLists.txt:97 (pkg_check_modules)

你可以使用如下命令解决依赖关系,

apt install -y libudisks2-qt5-dev

如果遇到如下错误提示,

  Could not find a package configuration file provided by "KF5Codecs" with                                                                   
  any of the following names:                                                                                                                
                                                                                                                                             
    KF5CodecsConfig.cmake                                                                                                                    
    kf5codecs-config.cmake                                                                                                                   
                                                                                                                                             
  Add the installation prefix of "KF5Codecs" to CMAKE_PREFIX_PATH or set                                                                     
  "KF5Codecs_DIR" to a directory containing one of the above files.  If                                                                      
  "KF5Codecs" provides a separate development package or SDK, be sure it has                                                                 
  been installed.                                                                                                                            
                                                                                                                                             
                                                                                                                                             
-- Checking for module 'dtkwidget'
--   Found dtkwidget, version 5.5.23
-- Checking for module 'dtkcore'
--   Found dtkcore, version 5.5.33
-- Checking for module 'dtkgui'
--   Found dtkgui, version 5.5.23
CMake Error at src/music-player/CMakeLists.txt:126 (qt5_create_translation):
  Unknown CMake command "qt5_create_translation".  

你可以使用如下命令解决依赖关系,

apt install -y libkf5codecs-dev

如果遇到如下错误提示,

  Could not find a package configuration file provided by "Qt5LinguistTools"                                                                 
  with any of the following names:                                                                                                           
                                                                                                                                             
    Qt5LinguistToolsConfig.cmake                                                                                                             
    qt5linguisttools-config.cmake                                                                                                            
                                                                                                                                             
  Add the installation prefix of "Qt5LinguistTools" to CMAKE_PREFIX_PATH or                                                                  
  set "Qt5LinguistTools_DIR" to a directory containing one of the above                                                                      
  files.  If "Qt5LinguistTools" provides a separate development package or                                                                   
  SDK, be sure it has been installed.                                                                                                        
                                                                                                                                             
                                                                                                                                             
CMake Warning (dev) at /usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreMacros.cmake:44 (message):
  qt5_use_modules is not part of the official API, and might be removed in Qt                                                                
  6.                                                                                                                                         
Call Stack (most recent call first):                                                                                                         
  /usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreMacros.cmake:434 (_qt5_warn_deprecated)                                                     
  src/libdmusic/CMakeLists.txt:35 (qt5_use_modules)                                                                                          
This warning is for project developers.  Use -Wno-dev to suppress it.                                                                        
                                                                                                                                             
-- Checking for module 'dtkwidget'
--   Found dtkwidget, version 5.5.23
-- Checking for module 'dtkcore'
--   Found dtkcore, version 5.5.33
-- Checking for module 'dtkgui'
--   Found dtkgui, version 5.5.23
CMake Error at src/music-player/CMakeLists.txt:126 (qt5_create_translation):
  Unknown CMake command "qt5_create_translation". 

你可以使用如下命令解决依赖关系,

apt install -y qttools5-dev

如果遇到如下错误提示,

--   Package 'dframeworkdbus', required by 'virtual:world', not found
CMake Error at /usr/share/cmake-3.25/Modules/FindPkgConfig.cmake:607 (message):
  A required package was not found                                                                                                           
Call Stack (most recent call first):                                                                                                         
  /usr/share/cmake-3.25/Modules/FindPkgConfig.cmake:829 (_pkg_check_modules_internal)                                                        
  src/libmusic-plugin/CMakeLists.txt:25 (pkg_check_modules)  

你可以使用如下命令解决依赖关系,

apt install -y libdframeworkdbus-dev

2.2.2 编译软件包

cd ~/deepin-music-6.2.12/
make

如果遇到如下错误提示,

/root/deepin-music-6.2.12/src/libdmusic/metadetector.cpp:40:10: fatal error: libavcodec/avcodec.h: No such file or directory
   40 | #include 
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

你可以使用如下命令解决依赖关系,

apt install -y libavcodec-dev

如果遇到如下错误提示,

/root/deepin-music-6.2.12/src/libdmusic/metadetector.cpp:41:10: fatal error: libavformat/avformat.h: No such file or directory
   41 | #include 
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

你可以使用如下命令解决依赖关系,

apt install -y libavformat-dev

如果遇到如下错误提示,

/root/deepin-music-6.2.12/src/libdmusic/metadetector.cpp:52:10: fatal error: unicode/ucnv.h: No such file or directory
   52 | #include 
      |          ^~~~~~~~~~~~~~~~
compilation terminated.

你可以使用如下命令解决依赖关系,

apt install -y libicu-dev

2.2.3 安装软件包

cd ~/deepin-music-6.2.12/
make install
没有评论

发表回复

Debian-Like
如何安装Debian LibreOffice?

1 前言 一个问题,一篇文章,一出故事。 笔者最近发现FreeOffice需要注册,因此决定还是安装 …

Debian-Like
如何安装Debian FreeOffice

1 前言 一个问题,一篇文章,一出故事。 笔者最近发现FreeOffice貌似不错,于是想试用,于是 …

Debian-Like
如何熟悉Nikto Web服务器扫描工具?

1 前言 一个问题,一篇文章,一出故事。 笔者最近需要加固网站的安全,因此需要一个得力的Web服务器 …