From 86b915e6ed8ef9a4d36f97f9275db3e976d1656a Mon Sep 17 00:00:00 2001 From: Sizhe Zhao Date: Sat, 14 Jun 2025 16:23:33 +0800 Subject: [PATCH] wechat: init at 4.0.1.11 --- pkgs/by-name/we/wechat/package.nix | 56 ++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 pkgs/by-name/we/wechat/package.nix diff --git a/pkgs/by-name/we/wechat/package.nix b/pkgs/by-name/we/wechat/package.nix new file mode 100644 index 0000000000000..4824c76ed428e --- /dev/null +++ b/pkgs/by-name/we/wechat/package.nix @@ -0,0 +1,56 @@ +{ + lib, + appimageTools, + fetchurl, + stdenvNoCC, +}: + +let + inherit (stdenvNoCC.hostPlatform) system; + pname = "wechat"; + version = "4.0.1.11"; + sources = { + aarch64-linux = fetchurl { + url = "https://web.archive.org/web/20250512112413if_/https://dldir1v6.qq.com/weixin/Universal/Linux/WeChatLinux_arm64.AppImage"; + hash = "sha256-Rg+FWNgOPC02ILUskQqQmlz1qNb9AMdvLcRWv7NQhGk="; + }; + x86_64-linux = fetchurl { + url = "https://web.archive.org/web/20250512110825if_/https://dldir1v6.qq.com/weixin/Universal/Linux/WeChatLinux_x86_64.AppImage"; + hash = "sha256-gBWcNQ1o1AZfNsmu1Vi1Kilqv3YbR+wqOod4XYAeVKo="; + }; + }; + src = appimageTools.extract { + inherit pname version; + src = sources.${system}; + postExtract = '' + patchelf --replace-needed libtiff.so.5 libtiff.so $out/opt/wechat/wechat + ''; + }; +in + +appimageTools.wrapAppImage { + inherit pname version src; + + extraInstallCommands = '' + mkdir -p $out/share/applications + cp ${src}/wechat.desktop $out/share/applications/ + mkdir -p $out/share/pixmaps + cp ${src}/wechat.png $out/share/pixmaps/ + + substituteInPlace $out/share/applications/wechat.desktop --replace-fail AppRun wechat + ''; + + meta = { + description = "Messaging and calling app"; + homepage = "https://www.wechat.com/en/"; + downloadPage = "https://linux.weixin.qq.com/en"; + license = lib.licenses.unfree; + sourceProvenance = [ lib.sourceTypes.binaryNativeCode ]; + maintainers = with lib.maintainers; [ prince213 ]; + mainProgram = "wechat"; + platforms = [ + "aarch64-linux" + "x86_64-linux" + ]; + }; +}