ferdi: 5.6.0-beta.5 -> 5.6.0-beta.6, improve XWayland support

ChangeLog: 1886c8abed/CHANGELOG.md (560-beta6-2021-05-31)

Even though this isn't explicitly noted in the Changelog, this seems to
have fixed the Element integration for me.

Additionally, I added a (hacky) `xdg-open` wrapper which removes the
`GDK_BACKEND` variable to fix the XWayland integration[1]. The problem
is that if a Firefox is running with Wayland (`ferdi` is running under
X11) and `GDK_BACKEND=x11` is passed to the `xdg-open` (and thus
`firefox`) process, Firefox refuses to start since another instance of
it is running under Wayland (but attempts to start in X11 mode because of
`GDK_BACKEND=x11`).

[1] https://github.com/electron/electron/issues/28436
This commit is contained in:
Maximilian Bosch 2021-06-04 21:37:35 +02:00
parent 6f1857f2f2
commit cd4ad7d2fe
No known key found for this signature in database
GPG key ID: 091DBF4D1FC46B8E
2 changed files with 23 additions and 7 deletions

View file

@ -1,18 +1,33 @@
{ lib, mkFranzDerivation, fetchurl }: { lib, mkFranzDerivation, fetchurl, xorg, xdg-utils, buildEnv, writeShellScriptBin }:
mkFranzDerivation rec { let
mkFranzDerivation' = mkFranzDerivation.override {
xdg-utils = buildEnv {
name = "xdg-utils-for-ferdi";
paths = [
xdg-utils
(lib.hiPrio (writeShellScriptBin "xdg-open" ''
unset GDK_BACKEND
exec ${xdg-utils}/bin/xdg-open "$@"
''))
];
};
};
in
mkFranzDerivation' rec {
pname = "ferdi"; pname = "ferdi";
name = "Ferdi"; name = "Ferdi";
version = "5.6.0-beta.5"; version = "5.6.0-beta.6";
src = fetchurl { src = fetchurl {
url = "https://github.com/getferdi/ferdi/releases/download/v${version}/ferdi_${version}_amd64.deb"; url = "https://github.com/getferdi/ferdi/releases/download/v${version}/ferdi_${version}_amd64.deb";
sha256 = "sha256-fDUzYir53OQ3O4o9eG70sGD+FJ0/4SDNsTfh97WFRnQ="; sha256 = "sha256-Q1HSAEVcaxFyOq7oWqa6AJJpsBKRxbsKb9ydyK/gH/A=";
}; };
extraBuildInputs = [ xorg.libxshmfence ];
meta = with lib; { meta = with lib; {
description = "Combine your favorite messaging services into one application"; description = "Combine your favorite messaging services into one application";
homepage = "https://getferdi.com/"; homepage = "https://getferdi.com/";
license = licenses.asl20; license = licenses.asl20;
maintainers = [ maintainers.davidtwco ]; maintainers = with maintainers; [ davidtwco ma27 ];
platforms = [ "x86_64-linux" ]; platforms = [ "x86_64-linux" ];
hydraPlatforms = [ ]; hydraPlatforms = [ ];
}; };

View file

@ -28,7 +28,8 @@
# Helper function for building a derivation for Franz and forks. # Helper function for building a derivation for Franz and forks.
{ pname, name, version, src, meta }: { pname, name, version, src, meta, extraBuildInputs ? [] }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
inherit pname version src meta; inherit pname version src meta;
@ -36,7 +37,7 @@ stdenv.mkDerivation rec {
dontPatchELF = true; dontPatchELF = true;
nativeBuildInputs = [ autoPatchelfHook makeWrapper wrapGAppsHook dpkg ]; nativeBuildInputs = [ autoPatchelfHook makeWrapper wrapGAppsHook dpkg ];
buildInputs = (with xorg; [ buildInputs = extraBuildInputs ++ (with xorg; [
libXi libXi
libXcursor libXcursor
libXdamage libXdamage