Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

wechat-uos: init at 1.0.0.238 #293730

Merged
merged 1 commit into from
Mar 28, 2024
Merged

wechat-uos: init at 1.0.0.238 #293730

merged 1 commit into from
Mar 28, 2024

Conversation

pokon548
Copy link
Contributor

@pokon548 pokon548 commented Mar 6, 2024

Description of changes

Introduce official WeChat app.
Due to the possible legal reason, license.tar.gz is not provided by default. You need to find it for yourself.

Currently, WeChatAppEx will coredump without useful logs. So you are not able to use:
- Mini Apps
- Subscriptions
- Image Viewer
- etc.

Still looking for a way to fix that. Fixed.

If you find WeChat hangout cannot detect your microphone and speaker, please make sure:

  1. You are using PipeWire with PulseAudio emulation enabled.
  2. OR, you are using PulseAudio.

Warning: This app use openssl_1_1, which is EOL and possibly introduce security risks. Proceed with cautions.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@pokon548 pokon548 force-pushed the add-wechat-uos branch 11 times, most recently from 60e461b to a87dd97 Compare March 7, 2024 06:37
@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1 labels Mar 7, 2024
@pokon548 pokon548 marked this pull request as ready for review March 7, 2024 09:40
@pokon548 pokon548 force-pushed the add-wechat-uos branch 2 times, most recently from ec07734 to 80821e1 Compare March 7, 2024 10:01
@Cryolitia
Copy link
Member

ibus seems not work on Gnome + wayland

@pokon548
Copy link
Contributor Author

ibus seems not work on Gnome + wayland

According to #archlinux-cn-appearence, it seems to be an upstream issue. You may use fcitx5 + kimpanel instead.

@pokon548 pokon548 changed the title wechat-uos: init at 1.0.0.145 wechat-uos: init at 1.0.0.236 Mar 13, 2024
@pokon548 pokon548 force-pushed the add-wechat-uos branch 4 times, most recently from f7449a8 to 23552a1 Compare March 13, 2024 12:51
Copy link
Member

@bryango bryango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for packaging it! This is far more advanced than what I am capable of reviewing, but I hope by leaving a comment, I can encourage someone more qualified to take a look as well.

Question: why do we need to isolate wechat-uos-env into a separate derivation? What happens if we keep it within wechat?

pkgs/by-name/we/wechat-uos/package.nix Outdated Show resolved Hide resolved
@pokon548
Copy link
Contributor Author

pokon548 commented Mar 13, 2024

Thank you for packaging it! This is far more advanced than what I am capable of reviewing, but I hope by leaving a comment, I can encourage someone more qualified to take a look as well.

Thanks for your interests!

Question: why do we need to isolate wechat-uos-env into a separate derivation?

No (special) technical reason, just because it is a temporary workaround.

Currently, we mainly use fhs to put some files to make WeChat believe it runs on UOS and being licensed. These are in fact nothing to for WeChat itself works properly.

Leaving it in separate derivation may helps me remove that fhs env once WeChat neither detect OS type nor require licenses.

What happens if we keep it within wechat?

It would be fine.

@bryango
Copy link
Member

bryango commented Mar 13, 2024

Also, can confirm build success on {x86_64,aarch64}-linux.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/3627

@UlyssesZh
Copy link
Contributor

UlyssesZh commented Mar 18, 2024

I am on GNOME + X11. Noticed some bugs (items with asterisks are possible to be the intended behaviors):

  • Cannot scroll using Wacom tablet (driver: xf86-input-wacom). This a bug of all Qt apps. However scrolling works in the image view window (it can zoom the picture), pretty curious. It also works in the in-built browser.
  • Cannot resize image view window.
  • * Cannot change the keyboard shortcut for screenshots.
  • Command line reports /usr/bin/lsblk not found. I don't know why WeChat wants to use this, but maybe we can write a script that produces dummy outputs in the FHS env in place of /usr/bin/lsblk.
  • * There is not any UI response when I click someone's avatar.
  • The app cannot detect my speaker and microphone (so voice calling and notification sound don't work). Strangely, the in-built browser can play sound (such as short videos (视频号)).

By the way, ibus works for me.

@gou4shi1
Copy link
Contributor

Failed to input chinese with fcitix-5 + i3

@running-grass
Copy link
Contributor

running-grass commented Mar 19, 2024

Failed to input chinese with fcitix-5 + i3

I can be used on hyprland(xwayland) + fcitx5

@pokon548
Copy link
Contributor Author

pokon548 commented Mar 19, 2024

  • Cannot scroll using Wacom tablet (driver: xf86-input-wacom). This a bug of all Qt apps. However scrolling works in the image view window (it can zoom the picture), pretty curious.

Image Viewer belongs to WeChatAppEx (Chromium-based apps). This is expected.

  • Cannot resize image view window.
  • Cannot change the keyboard shortcut for screenshots.

Yes, can also reproduced. Can you confirm whether these functions are working on UOS?

  • Command line reports /usr/bin/lsblk not found. I don't know why WeChat wants to use this, but maybe we can write a script that produces dummy outputs in the FHS env in place of /usr/bin/lsblk.

Yes it is technically possible. From my understanding, this is because WeChat is trying to collect system info and identify whether your OS is secure. Unfortunately due to the potential ToS violation and legal reason, I may not add additional wrapper to solve this. You are welcome to write your owns' in personal config.

  • There is not any UI response when I click someone's avatar.

Yes, there is no response. Also reproduced on GNOME + X11 environment. Can you confirm whether this function is working on UOS?

  • The app cannot detect my speaker and microphone (so voice calling and notification sound don't work).

Reproduced. Looks like an package issue. Will investigate soon. Looks like WeChat does not support PipeWire (without pulseaudio support) as media backend. Both microphone and speaker works when I am using PulseAudio.

@pokon548
Copy link
Contributor Author

Failed to input chinese with fcitix-5 + i3

Will try to investigate. However I do not use i3 environment, so it may take some time.

@pokon548
Copy link
Contributor Author

  • The app cannot detect my speaker and microphone (so voice calling and notification sound don't work).

I have pushed a new commit to resolve this. For this commit to work, you need to make sure your system either:

@pokon548 pokon548 force-pushed the add-wechat-uos branch 4 times, most recently from 79a38a6 to 83ccaf1 Compare March 19, 2024 06:42
@pokon548
Copy link
Contributor Author

Failed to input chinese with fcitix-5 + i3

I have tried to fix this by adding qt5compat into dependency. Can you verify whether this fix works for you?

@pokon548 pokon548 changed the title wechat-uos: init at 1.0.0.236 wechat-uos: init at 1.0.0.238 Mar 19, 2024
@Cryolitia Cryolitia added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Mar 25, 2024
@Cryolitia
Copy link
Member

Cryolitia commented Mar 25, 2024

ibus seems not work on Gnome + wayland

now works, good job

@Cryolitia Cryolitia added 12.approvals: 2 This PR was reviewed and approved by two reputable people and removed 12.approvals: 1 This PR was reviewed and approved by one reputable person labels Mar 25, 2024
@wegank wegank merged commit ce595b4 into NixOS:master Mar 28, 2024
27 checks passed
@gou4shi1
Copy link
Contributor

gou4shi1 commented Apr 7, 2024

Failed to input chinese with fcitix-5 + i3

I have tried to fix this by adding qt5compat into dependency. Can you verify whether this fix works for you?

It was caused by the lack of QT_IM_MODULE in my ~/.profile, I have fixed it, thanks.

@Ziqi-Yang
Copy link

Ziqi-Yang commented Apr 9, 2024

I cannot manage to get fcitx5 work. My WM is Hyprland (v0.37.1).
I have these environment variable settings in Hyprland configuration:

        "GDK_BACKEND,wayland,x11"
        "QT_QPA_PLATFORM,wayland;xcb"
        "SDL_VIDEODRIVER,wayland"
        "CLUTTER_BACKEND,wayland"

IME related environment variable is set by home manager's fcitx5 settings, which can be found here

  i18n.inputMethod = {
    enabled = "fcitx5";
    fcitx5.addons = with pkgs; [ fcitx5-rime fcitx5-chinese-addons];
  };

Neither rime nor default chinese-addons works.

@Ziqi-Yang
Copy link

Ziqi-Yang commented Apr 10, 2024

Hyprland / Wayland

After some testing, I find environment variable QT_IM_MODULES(note the tailing S. The variable is introduced in qt 6.7)should be set to wayland。A recommend setting is QT_IM_MODULES="wayland;fcitx;ibus"reference.
The source of error: (It may be reported by fcitx5).
satty-2024-04-10_16-58-26

Besides, IDW why Wechat will call lsblk @pokon548 . Here is the command log when I open wechat-uos using command line:

❯ env QT_IM_MODULES="wayland" wechat-uos
libpng warning: iCCP: known incorrect sRGB profile

(WeChatAppEx:339617): Gtk-WARNING **: 17:05:56.222: Could not load a pixbuf from icon theme.
This may indicate that pixbuf loaders or the mime database could not be found.
sh: line 1: /usr/bin/lsblk: No such file or directory
sh: line 1: /usr/bin/lsblk: No such file or directory

Edit0:
After extensive testing, I find the problem has no business with QT_IM_MODULES environment variable. It is only related to QT_IM_MODULE environment variable (must set it to fcitx, which home-manager do it for you already). The problem is that only when I launch wechat-uos from console or from wofi/rofi-wayland which is also launched from console can wechat-uos works properly


Edit 1:
with environment variable(home.sessionVariables) QT_IM_MODULE=fcitx
hyprland shortcut key -> kitty/alacritty -> wechat-uos: can work properly
hyprland shortcut key -> rofi-wayland +drun -> wechat-uos: cannot
hyprland shortcut key -> rofi-wayland +run -> wechat-uos: cannot
hyprland shortcut key -> rofi-wayland +drun -> kitty/alacritty -> wechat-uos: can
hyprland shortcut key -> kitty/alacritty -> rofi-wayland +run -> wechat-uos: can
hyprland shortcut key -> kitty/alacritty -> rofi-wayland +run -> rofi-wayland +drun -> wechat-uos: can

current solution: open a terminal -> rofi-wayland +drun -> wechat-uos -> close terminal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1 11.by: package-maintainer This PR was created by the maintainer of the package it changes 12.approvals: 2 This PR was reviewed and approved by two reputable people
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants