8 , libayatana-appindicator
24 , commandLineArgs ? ""
28 sources = import ./sources.nix;
30 x86_64-linux = fetchurl {
31 url = "https://dldir1.qq.com/qqfile/qq/QQNT/${sources.urlhash}/linuxqq_${sources.version}_amd64.deb";
32 hash = sources.amd64_hash;
34 aarch64-linux = fetchurl {
35 url = "https://dldir1.qq.com/qqfile/qq/QQNT/${sources.urlhash}/linuxqq_${sources.version}_arm64.deb";
36 hash = sources.arm64_hash;
39 src = srcs.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
43 version = sources.version;
70 runtimeDependencies = map lib.getLib [
79 cp -r usr/share $out/share
80 substituteInPlace $out/share/applications/qq.desktop \
81 --replace "/opt/QQ/qq" "$out/bin/qq" \
82 --replace "/usr/share" "$out/share"
83 makeShellWrapper $out/opt/QQ/qq $out/bin/qq \
84 --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" \
85 --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libGL ]}" \
86 --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \
87 --add-flags ${lib.escapeShellArg commandLineArgs} \
88 "''${gappsWrapperArgs[@]}"
90 # Remove bundled libraries
91 rm -r $out/opt/QQ/resources/app/sharp-lib
93 # https://aur.archlinux.org/cgit/aur.git/commit/?h=linuxqq&id=f7644776ee62fa20e5eb30d0b1ba832513c77793
94 rm -r $out/opt/QQ/resources/app/libssh2.so.1
96 # https://github.com/microcai/gentoo-zh/commit/06ad5e702327adfe5604c276635ae8a373f7d29e
97 ln -s ${libayatana-appindicator}/lib/libayatana-appindicator3.so \
98 $out/opt/QQ/libappindicator3.so
100 ln -s ${libnotify}/lib/libnotify.so \
101 $out/opt/QQ/libnotify.so
106 passthru.updateScript = ./update.sh;
109 homepage = "https://im.qq.com/linuxqq/";
110 description = "Messaging app";
111 platforms = [ "x86_64-linux" "aarch64-linux" ];
112 license = licenses.unfree;
113 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
114 maintainers = with lib.maintainers; [ fee1-dead ];