Skip to content

Commit

Permalink
add wemeet-bin-bwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
novel2430 committed May 8, 2024
1 parent ff3b6a0 commit 9e6f031
Show file tree
Hide file tree
Showing 2 changed files with 152 additions and 0 deletions.
1 change: 1 addition & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
zju-connect = pkgs.callPackage ./pkgs/zju-connect { };
wpsoffice-cn = pkgs.libsForQt5.callPackage ./pkgs/wpsoffice-cn { };
wechat-universal-bwrap = pkgs.callPackage ./pkgs/wechat-universal-bwrap { };
wemeet-bin-bwrap = pkgs.callPackage ./pkgs/wemeet-bin-bwrap { };
# some-qt5-package = pkgs.libsForQt5.callPackage ./pkgs/some-qt5-package { };
# ...
}
151 changes: 151 additions & 0 deletions pkgs/wemeet-bin-bwrap/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
{ stdenv, lib, autoPatchelfHook, fetchurl , buildFHSUserEnvBubblewrap, writeShellScript, makeWrapper, copyDesktopItems, makeDesktopItem
, dpkg
, alsa-lib
, libgcc
, glibc
, libglvnd
, libpulseaudio
, xorg
, openssl
, libsForQt5
, zlib
, wayland
, nss
, curl
}:
let
libraries = [
alsa-lib
libgcc
glibc
libglvnd
libpulseaudio
xorg.libX11
xorg.libXcomposite
xorg.libXdamage
xorg.xset
xorg.libXfixes
xorg.libXinerama
xorg.libXrandr
openssl
libsForQt5.qt5.qtbase
libsForQt5.qt5.qtdeclarative
libsForQt5.qt5.qtsvg
libsForQt5.qt5.qtwebchannel
libsForQt5.qt5.qtwebengine
libsForQt5.qt5.qtx11extras
libsForQt5.qt5.qtwayland
zlib
wayland
nss
curl
];
pkg-name = "wemeet-bin";
pkg-ver = "3.19.0.401";
wemeet-src = stdenv.mkDerivation rec {
name = "${pkg-name}";
version = "${pkg-ver}";

src = fetchurl {
url = "https://updatecdn.meeting.qq.com/cos/bb4001c715553579a8b3e496233331d4/TencentMeeting_0300000000_${version}_x86_64_default.publish.deb";
hash = "sha256-VN/rNn2zA21l6BSzLpQ5Bl9XB2hrMFIa0o0cy2vdLx8=";
};

nativeBuildInputs = [
dpkg
autoPatchelfHook
];
buildInputs = libraries;

unpackCmd = "dpkg -x $src .";
sourceRoot = ".";

dontWrapQtApps = true;

installPhase = ''
mkdir -p $out;
rm opt/wemeet/lib/libcurl.so
cp -r . $out
'';
};
startScript = writeShellScript "wemeet-start" ''
export LD_LIBRARY_PATH=/lib:/opt/wemeet/lib
echo $LD_LIBRARY_PATH
export XDG_SESSION_TYPE=x11
export EGL_PLATFORM=x11
export QT_QPA_PLATFORM=xcb
unset WAYLAND_DISPLAY
exec /opt/wemeet/bin/wemeetapp
'';
fhs = buildFHSUserEnvBubblewrap {
name = "${pkg-name}";
targetPkgs =
pkgs: [
wemeet-src
]
++
libraries;
runScript = startScript;
extraBwrapArgs = [
"--bind \$HOME/.local/share/wemeetapp{,}"
"--ro-bind-try \${HOME}/.fontconfig{,}"
"--ro-bind-try \${HOME}/.fonts{,}"
"--ro-bind-try \${HOME}/.config/fontconfig{,}"
"--ro-bind-try \${HOME}/.local/share/fonts{,}"
"--ro-bind-try \${HOME}/.icons{,}"
"--ro-bind-try \${HOME}/.local/share/.icons{,}"
];
};
in
stdenv.mkDerivation rec {
pname = "${pkg-name}-bwrap";
version = "${pkg-ver}";
dontUnpack = true;
nativeBuildInputs = [
makeWrapper
copyDesktopItems
];
desktopItems = [
(makeDesktopItem {
name = "${pkg-name}";
desktopName = "Tencent Meeting";
exec = "${pname} %U";
terminal = false;
icon = "${pkg-name}";
comment = "Tencent Meeting Linux Client";
categories = [ "Utility" "Network" "InstantMessaging" "Chat" ];
keywords = [
"wemeet"
"${pkg-name}"
"tencent"
"meeting"
];
extraConfig = {
"Name[zh_CN]" = "腾讯会议Linux客户端";
"Comment[zh_CN]" = "腾讯会议Linux客户端";
};
})
];
installPhase = ''
echo 'Installing icons...'
for res in 16 32 64 128 256; do
install -Dm644 \
${wemeet-src}/opt/wemeet/icons/hicolor/''${res}x''${res}/mimetypes/wemeetapp.png \
$out/share/icons/hicolor/''${res}x''${res}/apps/${pkg-name}.png
done
makeWrapper ${fhs}/bin/${pkg-name} $out/bin/${pname} \
--run "mkdir -p \$HOME/.local/share/wemeetapp"
runHook postInstall
'';

meta = with lib; {
description = ''
Tencent Meeting Linux Client
(Adapted from https://aur.archlinux.org/packages/wemeet-bin)
'';
homepage = "https://source.meeting.qq.com";
platforms = [ "x86_64-linux" ];
license = licenses.unfreeRedistributable;
};

}

0 comments on commit 9e6f031

Please sign in to comment.