netease-cloud-music-gtk icon indicating copy to clipboard operation
netease-cloud-music-gtk copied to clipboard

关于Ubuntu18.04编译的依赖问题

Open yangxuanx opened this issue 5 years ago • 8 comments

编译依赖

Ubuntu在编译的时候,会由部分依赖缺失,作者给出的安装只是一部分,如下是全部依赖

sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
      gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
      gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \
      gstreamer1.0-libav libgtk-3-dev libatk1.0-dev libcogl-pango-dev \
      libssl-dev libcairo2-dev libgstreamer-plugins-bad1.0-dev

建议

由于Ubuntu的受众面比较广泛,作者是否可以将Ubuntu编译时需要的依赖写到READEME中

再次编译问题

当所有依赖安装完成,编译出现如下错误

error[E0432]: unresolved import `gtk::ModelButton`
  --> src/widgets/header.rs:17:76
   |
17 |     AboutDialog, Builder, Button, Dialog, Entry, Image, Label, MenuButton, ModelButton, Popover,
   |                                                                            ^^^^^^^^^^^ no `ModelButton` in the root. Did you mean to use `ToolButton`?

error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.
error: Could not compile `netease-cloud-music-gtk`.

To learn more, run the command again with --verbose.

解决编译错误

由于默认依赖的GTK版本较高,修改Cargo.toml中的default

[features]
default = ["gtk_3_22_30"]

yangxuanx avatar May 04 '19 08:05 yangxuanx

因为使用的不是 ubuntu 环境,所以无法确定具体依赖包名称,这个建议后边可以考虑加上。 不过一般来说选择自己编译的人解决依赖应该是不成问题的。

gmg137 avatar May 04 '19 11:05 gmg137

编译出现的问题已解决,修改Cargo.toml [features] default = ["gtk_3_22_30"] 默认的版本是gtk_3_24

yangxuanx avatar May 04 '19 12:05 yangxuanx

编译时可以直接用参数指定相应 features

cargo build --release --features gtk_...

gmg137 avatar May 04 '19 13:05 gmg137

WSL下, 使用清华源安装glib-2.0只能安装到2.56.4版本, 运行sudo apt update并没有任何更新. 如何获取所要求的的glib 2.58?

huangjj27 avatar May 13 '19 12:05 huangjj27

@huangjj27 wsl?Windows上没有必要用这个网易音乐软件吧:stuck_out_tongue_winking_eye:

ghost avatar May 13 '19 13:05 ghost

@huangjj27 WSL 可以运行 gui 程序吗???

想折腾可以尝试在 WSL 安装openSUSE Tumbleweed 或 arch,这两个都是滚动更新,可以保证依赖版本。没用过 WSL,不确支持与否。

gmg137 avatar May 13 '19 14:05 gmg137

想折腾可以尝试在 WSL 安装openSUSE Tumbleweed 或 arch,这两个都是滚动更新,可以保证依赖版本。没用过 WSL,不确支持与否。

你好! 并不是为了使用网易云而安装的程序, 只是为了搞清楚是否因为在home.rs中没有使用use rayon::prelude::*里的并发组件而导致了 主页卡住的bug #23

huangjj27 avatar May 13 '19 14:05 huangjj27

@huangjj27 WSL 可以运行 gui 程序吗???

想折腾可以尝试在 WSL 安装openSUSE Tumbleweed 或 arch,这两个都是滚动更新,可以保证依赖版本。没用过 WSL,不确支持与否。

WSL 支持运行 X 程序的

eatradish avatar May 18 '19 00:05 eatradish