Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Linux 下 NekoRay 无法在 /usr 等不可写目录启动 #57

Closed
chiyuki0325 opened this issue Sep 24, 2022 · 13 comments
Closed

Linux 下 NekoRay 无法在 /usr 等不可写目录启动 #57

chiyuki0325 opened this issue Sep 24, 2022 · 13 comments

Comments

@chiyuki0325
Copy link
Contributor

报错:

QSystemTrayIcon::setVisible: No Icon set
@chiyuki0325
Copy link
Contributor Author

使用 launcher 可以点动托盘图标,但 launcher 不会被编译出来

@chiyuki0325
Copy link
Contributor Author

需要把 go 部分一起编译 ... (话说为什么要把 core 和 Matsuri 放一起 ...? 好怪)

@chiyuki0325
Copy link
Contributor Author

在 /usr/bin 下 launcher 无法启动

@chiyuki0325 chiyuki0325 reopened this Sep 24, 2022
@chiyuki0325
Copy link
Contributor Author

图片

就连本体也无法启动 ... 看来是不能打包了

@chiyuki0325 chiyuki0325 changed the title Linux 下自行编译的 Nekoray 托盘图标点不动 Linux 下 NekoRay 无法在 /usr 等不可写目录启动 Sep 24, 2022
@arm64v8a
Copy link
Contributor

arm64v8a commented Sep 24, 2022

话说为什么要把 core 和 Matsuri 放一起 ...? 好怪

为了做内置的core,所以用了从 LibSagerNetCore 改的 libcore 库,允许两个项目共享部分代码,减少重复。

在 /usr/bin 下 launcher 无法启动

打包的话就不要带 launcher 了

/usr/bin/nekoray -appdata 这样可以把配置写到 $HOME/.config解决 No permission to write

没有专门适配 fhs 可能还有其他问题。

@chiyuki0325
Copy link
Contributor Author

launcher 还是不能用
它以为它在我编译的文件夹里,实际在 /usr/bin,会找不到文件
然而不用 launcher 托盘图标就点不动

@arm64v8a
Copy link
Contributor

开启 -appdata 后确实读不到图标,下版本修复吧

@arm64v8a
Copy link
Contributor

试试 1.11

1.9到1.11改动较多,建议参照actions的编译流程

@chiyuki0325
Copy link
Contributor Author

chiyuki0325 commented Sep 25, 2022

现在的情况是这样的:

  • launcher 在 /usr/bin 文件夹还是无法使用,似乎路径在编译的时候就已经写死了
    图片
  • nekoray 可以正常启动并显示托盘图标,但托盘图标右键菜单点不动,并会在启动时出现相同的报错 (QSystemTrayIcon::setVisible: No Icon set)

@arm64v8a
Copy link
Contributor

QSystemTrayIcon::setVisible: No Icon set

是写法问题,初始化 QSystemTrayIcon 的时间点还没设置图标,图标是后面才读入的。在 Windows 和 Arch Linux 上面是不影响使用的。

托盘图标右键菜单点不动

你是用本地的QT编译的吗,QT版本?

launcher

打包的话就不要带 launcher 了。这是release用的,用来实现更新、设置ld参数强制使用软件自带的QT(不然用户系统上面QT版本对不上就运无法运行)

包管理可以保证QT版本兼容,因此不需要launcher

后续版本我会给一个打包参数,启用后配置写 XDG CONFIG 目录,把GUI上的更新按钮也去掉。

最近重构比较多,可能要等等。

@chiyuki0325
Copy link
Contributor Author

chiyuki0325 commented Sep 29, 2022

Qt 版本是 5.15.6 (5.15.6+kde+r177-1.1),在开启 NKR_PACKAGE 编译参数之后,托盘图标仍然点不动
但使用 launcher 在可写目录启动自己编译的这个版本,托盘图标就能点得动 ...
看了下 launcher 的源码,就是直接启动,也没啥特别的啊 ... 神奇

@arm64v8a
Copy link
Contributor

arm64v8a commented Oct 2, 2022

PKGBUILD写的有问题

@arm64v8a arm64v8a closed this as completed Oct 2, 2022
@chiyuki0325
Copy link
Contributor Author

以我的水平,看来是不能让 Nekoray 上 AUR 了

貌似是因为自带的 3rdparty/ZxingQtReader.hpp 没跟上版本?

FAILED: CMakeFiles/nekoray.dir/ui/mainwindow.cpp.o
/usr/bin/c++ -DNKR_NO_GRPC -DNKR_PACKAGE -DNKR_VERSION=\"1.12-2022-10-01\" -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_WIDGETS_LIB -I/home/yidaozhan/仓库/arch-packages/nekoray-git/src/nekoray/build -I/home/yidaozhan/仓库/arch-packages/nekoray-git/src/nekoray -I/home/yidaozhan/仓库/arch-packages/nekoray-git/src/nekoray/build/nekoray_autogen/include -I/home/yidaozhan/仓库/arch-packages/nekoray-git/src/nekoray/3rdparty/QHotkey/QHotkey -isystem /usr/include/qt -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtCore -isystem /usr/lib/qt/mkspecs/linux-g++ -isystem /usr/include/qt/QtNetwork -isystem /usr/include/qt/QtSvg -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -fPIC -std=gnu++17 -MD -MT CMakeFiles/nekoray.dir/ui/mainwindow.cpp.o -MF CMakeFiles/nekoray.dir/ui/mainwindow.cpp.o.d -o CMakeFiles/nekoray.dir/ui/mainwindow.cpp.o -c '/home/yidaozhan/仓库/arch-packages/nekoray-git/src/nekoray/ui/mainwindow.cpp'
在從下述位置 include 的檔案: /usr/include/ZXing/ReadBarcode.h:10,
                 來自 /home/yidaozhan/仓库/arch-packages/nekoray-git/src/nekoray/3rdparty/ZxingQtReader.hpp:18,
                 來自 /home/yidaozhan/仓库/arch-packages/nekoray-git/src/nekoray/ui/mainwindow.cpp:26:
/usr/include/ZXing/Result.h:73:153: 附注:‘#pragma message: Warning: the return type of text() and ecLevel() will change to std::string. Please #define ZX_USE_UTF8 to transition before the next release.’
   73 |         "Warning: the return type of text() and ecLevel() will change to std::string. Please #define ZX_USE_UTF8 to transition before the next release.")
      |                                                                                                                                                         ^
/home/yidaozhan/仓库/arch-packages/nekoray-git/src/nekoray/3rdparty/ZxingQtReader.hpp: 在构造函数‘ZXingQt::Result::Result()’中:
/home/yidaozhan/仓库/arch-packages/nekoray-git/src/nekoray/3rdparty/ZxingQtReader.hpp:120:63: 错误:no matching function for call to ‘ZXing::Result::Result(ZXing::DecodeStatus)’
  120 |         Result() : ZXing::Result(ZXing::DecodeStatus::NotFound) {} // required for qmetatype machinery
      |                                                               ^
/usr/include/ZXing/Result.h:48:9: 附注:candidate: ‘ZXing::Result::Result(ZXing::DecoderResult&&, ZXing::Position&&, ZXing::BarcodeFormat)’
   48 |         Result(DecoderResult&& decodeResult, Position&& position, BarcodeFormat format);
      |         ^~~~~~
/usr/include/ZXing/Result.h:48:9: 附注: 备选需要 3 实参,但提供了 1 个
/usr/include/ZXing/Result.h:45:9: 附注:candidate: ‘ZXing::Result::Result(const std::string&, int, int, int, ZXing::BarcodeFormat, ZXing::SymbologyIdentifier, ZXing::Error, ZXing::ByteArray&&, bool, const std::string&)’
   45 |         Result(const std::string& text, int y, int xStart, int xStop, BarcodeFormat format, SymbologyIdentifier si, Error error = {},
      |         ^~~~~~
/usr/include/ZXing/Result.h:45:9: 附注: 备选需要 10 实参,但提供了 1 个
/usr/include/ZXing/Result.h:42:9: 附注:candidate: ‘ZXing::Result::Result()’
   42 |         Result() = default;
      |         ^~~~~~
/usr/include/ZXing/Result.h:42:9: 附注: 备选需要 0 实参,但提供了 1 个
/usr/include/ZXing/Result.h:30:7: 附注:candidate: ‘ZXing::Result::Result(const ZXing::Result&)’
   30 | class Result
      |       ^~~~~~
/usr/include/ZXing/Result.h:30:7: 附注:  no known conversion for argument 1 from ‘ZXing::DecodeStatus’ to ‘const ZXing::Result&’
/usr/include/ZXing/Result.h:30:7: 附注:candidate: ‘ZXing::Result::Result(ZXing::Result&&)’
/usr/include/ZXing/Result.h:30:7: 附注:  no known conversion for argument 1 from ‘ZXing::DecodeStatus’ to ‘ZXing::Result&&’
/home/yidaozhan/仓库/arch-packages/nekoray-git/src/nekoray/3rdparty/ZxingQtReader.hpp: 在构造函数‘ZXingQt::Result::Result(ZXing::Result&&)’中:
/home/yidaozhan/仓库/arch-packages/nekoray-git/src/nekoray/3rdparty/ZxingQtReader.hpp:124:89: 警告:‘const ZXing::ByteArray& ZXing::Result::rawBytes() const’ is deprecated [-Wdeprecated-declarations]
  124 |             _rawBytes = QByteArray(reinterpret_cast<const char*>(ZXing::Result::rawBytes().data()),
      |                                                                  ~~~~~~~~~~~~~~~~~~~~~~~^~
/usr/include/ZXing/Result.h:109:41: 附注:在此声明
  109 |         [[deprecated]] const ByteArray& rawBytes() const { return _rawBytes; }
      |                                         ^~~~~~~~
/home/yidaozhan/仓库/arch-packages/nekoray-git/src/nekoray/3rdparty/ZxingQtReader.hpp:125:64: 警告:‘const ZXing::ByteArray& ZXing::Result::rawBytes() const’ is deprecated [-Wdeprecated-declarations]
  125 |                                    Size(ZXing::Result::rawBytes()));
      |                                         ~~~~~~~~~~~~~~~~~~~~~~~^~
/usr/include/ZXing/Result.h:109:41: 附注:在此声明
  109 |         [[deprecated]] const ByteArray& rawBytes() const { return _rawBytes; }
      |                                         ^~~~~~~~
/home/yidaozhan/仓库/arch-packages/nekoray-git/src/nekoray/3rdparty/ZxingQtReader.hpp: 在成员函数‘ZXing::DecodeStatus ZXingQt::Result::status() const’中:
/home/yidaozhan/仓库/arch-packages/nekoray-git/src/nekoray/3rdparty/ZxingQtReader.hpp:134:93: 警告:‘ZXing::DecodeStatus ZXing::Result::status() const’ is deprecated [-Wdeprecated-declarations]
  134 |         DecodeStatus status() const { return static_cast<DecodeStatus>(ZXing::Result::status()); }
      |                                                                        ~~~~~~~~~~~~~~~~~~~~~^~
/usr/include/ZXing/Result.h:54:37: 附注:在此声明
   54 |         [[deprecated]] DecodeStatus status() const;
      |                                     ^~~~~~
[57/65] Building CXX object CMakeFiles/nekoray.dir/ui/dialog_manage_routes.cpp.o
ninja: build stopped: subcommand failed.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants