about summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers/feishu
diff options
context:
space:
mode:
authorBill Huang <bill.huang2001@gmail.com>2022-07-09 16:42:03 -0700
committerBill Huang <bill.huang2001@gmail.com>2022-07-16 01:43:44 -0700
commit4ec68389db085461debb5739600d009d22b4cf77 (patch)
treeea254e05a1a0eb7dcb1650af4cfbc8deaa6483fa /pkgs/applications/networking/instant-messengers/feishu
parente1ed913a9ffa7c9cc28067885ad0f70af50b7b4c (diff)
feishu: misc updates
also wrap vulcan

handle edge case
Diffstat (limited to 'pkgs/applications/networking/instant-messengers/feishu')
-rw-r--r--pkgs/applications/networking/instant-messengers/feishu/default.nix22
1 files changed, 17 insertions, 5 deletions
diff --git a/pkgs/applications/networking/instant-messengers/feishu/default.nix b/pkgs/applications/networking/instant-messengers/feishu/default.nix
index dd55b126f258a..9a6cf2d035809 100644
--- a/pkgs/applications/networking/instant-messengers/feishu/default.nix
+++ b/pkgs/applications/networking/instant-messengers/feishu/default.nix
@@ -1,4 +1,5 @@
-{ alsa-lib
+{ addOpenGLRunpath
+, alsa-lib
 , at-spi2-atk
 , at-spi2-core
 , atk
@@ -54,6 +55,9 @@
 , wayland
 , wrapGAppsHook
 , xdg-utils
+
+# for custom command line arguments, e.g. "--use-gl=desktop"
+, commandLineArgs ? ""
 }:
 
 stdenv.mkDerivation rec {
@@ -146,14 +150,19 @@ stdenv.mkDerivation rec {
     mkdir -p $out
     mv usr/share $out/
     mv opt/ $out/
-    chmod -R g-w $out
 
     substituteInPlace $out/share/applications/bytedance-feishu.desktop \
       --replace /usr/bin/bytedance-feishu-stable $out/opt/bytedance/feishu/bytedance-feishu
 
-    wrapProgram $out/opt/bytedance/feishu/feishu \
-      --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH" \
-      --prefix LD_LIBRARY_PATH : ${rpath}:$out/opt/bytedance/feishu
+    # Wrap feishu and vulcan
+    # Feishu is the main executable, vulcan is the builtin browser
+    for executable in $out/opt/bytedance/feishu/{feishu,vulcan/vulcan}; do
+      wrapProgram $executable \
+        --prefix XDG_DATA_DIRS    :  "$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH" \
+        --prefix LD_LIBRARY_PATH  :  ${rpath}:$out/opt/bytedance/feishu:${addOpenGLRunpath.driverLink}/share \
+        --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}" \
+        ${lib.optionalString (commandLineArgs!="") "--add-flags ${lib.escapeShellArg commandLineArgs}"}
+    done
 
     mkdir -p $out/share/icons/hicolor
     base="$out/opt/bytedance/feishu"
@@ -161,6 +170,9 @@ stdenv.mkDerivation rec {
       mkdir -p $out/share/icons/hicolor/''${size}x''${size}/apps
       ln -s $base/product_logo_$size.png $out/share/icons/hicolor/''${size}x''${size}/apps/bytedance-feishu.png
     done
+
+    mkdir -p $out/bin
+    ln -s $out/opt/bytedance/feishu/bytedance-feishu $out/bin/bytedance-feishu
   '';
 
   meta = with lib; {