mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-07 04:34:46 +00:00
tdesktop: Fix the execution in a pure environment
Telegram was crashing when executed within a pure environment (nix-shell -p tdesktop --pure). Setting the environment variables QT_PLUGIN_PATH and XDG_RUNTIME_DIR should resolve this issue. Fix #33729.
This commit is contained in:
parent
9593eadcc7
commit
a03b2b99af
@ -1,5 +1,5 @@
|
|||||||
{ mkDerivation, lib, fetchgit, fetchpatch
|
{ mkDerivation, lib, fetchgit, fetchpatch
|
||||||
, pkgconfig, gyp, cmake, gcc7
|
, pkgconfig, gyp, cmake, gcc7, makeWrapper
|
||||||
, qtbase, qtimageformats, gtk3, libappindicator-gtk3
|
, qtbase, qtimageformats, gtk3, libappindicator-gtk3
|
||||||
, dee, ffmpeg, openalSoft, minizip, libopus, alsaLib, libpulseaudio, range-v3
|
, dee, ffmpeg, openalSoft, minizip, libopus, alsaLib, libpulseaudio, range-v3
|
||||||
}:
|
}:
|
||||||
@ -31,7 +31,7 @@ mkDerivation rec {
|
|||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig gyp cmake gcc7 ];
|
nativeBuildInputs = [ pkgconfig gyp cmake gcc7 makeWrapper ];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
qtbase qtimageformats gtk3 libappindicator-gtk3
|
qtbase qtimageformats gtk3 libappindicator-gtk3
|
||||||
@ -107,6 +107,13 @@ mkDerivation rec {
|
|||||||
for icon_size in 16 32 48 64 128 256 512; do
|
for icon_size in 16 32 48 64 128 256 512; do
|
||||||
install -Dm644 "../../../Telegram/Resources/art/icon''${icon_size}.png" "$out/share/icons/hicolor/''${icon_size}x''${icon_size}/apps/telegram-desktop.png"
|
install -Dm644 "../../../Telegram/Resources/art/icon''${icon_size}.png" "$out/share/icons/hicolor/''${icon_size}x''${icon_size}/apps/telegram-desktop.png"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# This is necessary to run Telegram in a pure environment.
|
||||||
|
wrapProgram $out/bin/telegram-desktop \
|
||||||
|
--prefix QT_PLUGIN_PATH : "${qtbase}/${qtbase.qtPluginPrefix}" \
|
||||||
|
--set XDG_RUNTIME_DIR "XDG-RUNTIME-DIR"
|
||||||
|
sed -i $out/bin/telegram-desktop \
|
||||||
|
-e "s,'XDG-RUNTIME-DIR',\"\''${XDG_RUNTIME_DIR:-/run/user/\$(id --user)}\","
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
Loading…
Reference in New Issue
Block a user