From c83f685cfa6eea50cd271f2e621cbda343589e9f Mon Sep 17 00:00:00 2001 From: "Miao, ZhiCheng" Date: Sun, 31 Dec 2023 09:31:52 +0200 Subject: [PATCH 1/2] insync: bugfix of 3.8.6.50504 other changes: - moved under pkgs/by-name/ - applied a hugly workaround to the start command's deamon crashing issue in the fhs wrapper. --- .../in/insync/package.nix} | 57 +++++++++---------- pkgs/top-level/all-packages.nix | 2 - 2 files changed, 27 insertions(+), 32 deletions(-) rename pkgs/{applications/networking/insync/default.nix => by-name/in/insync/package.nix} (65%) diff --git a/pkgs/applications/networking/insync/default.nix b/pkgs/by-name/in/insync/package.nix similarity index 65% rename from pkgs/applications/networking/insync/default.nix rename to pkgs/by-name/in/insync/package.nix index 844b8648d6c8..fb004a6a3e0d 100644 --- a/pkgs/applications/networking/insync/default.nix +++ b/pkgs/by-name/in/insync/package.nix @@ -1,22 +1,27 @@ { lib , writeShellScript -, buildFHSEnvBubblewrap +, buildFHSEnv , stdenvNoCC , fetchurl , autoPatchelfHook , dpkg , nss +, cacert +, alsa-lib , libvorbis , libdrm , libGL , wayland , xkeyboard_config , libthai +, libsForQt5 }: let pname = "insync"; + # Find a binary from https://www.insynchq.com/downloads/linux#ubuntu. version = "3.8.6.50504"; + ubuntu-dist = "mantic_amd64"; meta = with lib; { platforms = ["x86_64-linux"]; sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; @@ -35,7 +40,6 @@ let Known bug(s): 1) Currently the system try icon does not render correctly. - 2) libqtvirtualkeyboardplugin does not have necessary Qt library shipped from vendor. ''; mainProgram = "insync"; }; @@ -45,22 +49,27 @@ let inherit version meta; src = fetchurl { - # Find a binary from https://www.insynchq.com/downloads/linux#ubuntu. - url = "https://cdn.insynchq.com/builds/linux/insync_${version}-lunar_amd64.deb"; - sha256 = "sha256-BxTFtQ1rAsOuhKnH5vsl3zkM7WOd+vjA4LKZGxl4jk0="; + url = "https://cdn.insynchq.com/builds/linux/insync_${version}-${ubuntu-dist}.deb"; + sha256 = "sha256-QfSfTJjMTWShQETlUQqXQTYT7mBNhmj0HHoT5bjF0o8="; }; + nativeBuildInputs = [ + dpkg + autoPatchelfHook + libsForQt5.qt5.wrapQtAppsHook + ]; + buildInputs = [ nss + alsa-lib libvorbis libdrm libGL wayland libthai + libsForQt5.qt5.qtvirtualkeyboard ]; - nativeBuildInputs = [ autoPatchelfHook dpkg ]; - unpackPhase = '' dpkg-deb --fsys-tarfile $src | tar -x --no-same-permissions --no-same-owner ''; @@ -71,15 +80,6 @@ let mkdir -p $out cp -R usr/* $out/ - # use system glibc - rm $out/lib/insync/{libgcc_s.so.1,libstdc++.so.6} - - # remove badly packaged plugins - rm $out/lib/insync/PySide2/plugins/platforminputcontexts/libqtvirtualkeyboardplugin.so - - # remove the unused vendor wrapper - rm $out/bin/insync - runHook postInstall ''; @@ -87,31 +87,28 @@ let dontStrip = true; }; -in buildFHSEnvBubblewrap { +in buildFHSEnv { name = pname; inherit meta; targetPkgs = pkgs: with pkgs; [ - insync-pkg + cacert libudev0-shim + insync-pkg ]; - runScript = writeShellScript "insync-wrapper.sh" '' - # QT_STYLE_OVERRIDE was used to suppress a QT warning, it should have no actual effect for this binary. - echo Unsetting QT_STYLE_OVERRIDE=$QT_STYLE_OVERRIDE - echo Unsetting QT_QPA_PLATFORMTHEME=$QT_QPA_PLATFORMTHEME - unset QT_STYLE_OVERRIDE - unset QPA_PLATFORMTHEME + extraInstallCommands = '' + cp -rsHf "${insync-pkg}"/share $out + ''; + runScript = writeShellScript "insync-wrapper.sh" '' # xkb configuration needed: https://github.com/NixOS/nixpkgs/issues/236365 export XKB_CONFIG_ROOT=${xkeyboard_config}/share/X11/xkb/ - echo XKB_CONFIG_ROOT=$XKB_CONFIG_ROOT - # For debuging: + # For debugging: # export QT_DEBUG_PLUGINS=1 - # find -L /usr/share -name "*insync*" - exec /usr/lib/insync/insync "$@" + QT_QPA_PLATFORMTHEME=hicolor QT_STYLE_OVERRIDE=hicolor LC_TIME=C exec /usr/lib/insync/insync "$@" ''; # As intended by this bubble wrap, share as much namespaces as possible with user. @@ -121,6 +118,6 @@ in buildFHSEnvBubblewrap { unshareNet = false; unshareUts = false; unshareCgroup = false; - # Since "insync start" command starts a daemon, this daemon should die with it. - dieWithParent = false; + + dieWithParent = true; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b682c3501ecd..e2cdc1cc0323 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -34742,8 +34742,6 @@ with pkgs; myfitnesspal = with python3Packages; toPythonApplication myfitnesspal; - insync = callPackage ../applications/networking/insync { }; - lemurs = callPackage ../applications/display-managers/lemurs { }; libstrangle = callPackage ../tools/X11/libstrangle { From f7b7bf991245f944a8bafc05518054289279c8e3 Mon Sep 17 00:00:00 2001 From: hellwolf Date: Mon, 25 Mar 2024 19:53:19 +0200 Subject: [PATCH 2/2] insync: 3.8.6.50504 -> 3.8.7.50516 --- pkgs/by-name/in/insync/package.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/in/insync/package.nix b/pkgs/by-name/in/insync/package.nix index fb004a6a3e0d..b8206c38ce90 100644 --- a/pkgs/by-name/in/insync/package.nix +++ b/pkgs/by-name/in/insync/package.nix @@ -20,7 +20,7 @@ let pname = "insync"; # Find a binary from https://www.insynchq.com/downloads/linux#ubuntu. - version = "3.8.6.50504"; + version = "3.8.7.50516"; ubuntu-dist = "mantic_amd64"; meta = with lib; { platforms = ["x86_64-linux"]; @@ -50,7 +50,7 @@ let src = fetchurl { url = "https://cdn.insynchq.com/builds/linux/insync_${version}-${ubuntu-dist}.deb"; - sha256 = "sha256-QfSfTJjMTWShQETlUQqXQTYT7mBNhmj0HHoT5bjF0o8="; + sha256 = "sha256-U7BcgghbdR7r9WiZpEOka+BzXwnxrzL6p4imGESuB/k="; }; nativeBuildInputs = [ @@ -92,7 +92,6 @@ in buildFHSEnv { inherit meta; targetPkgs = pkgs: with pkgs; [ - cacert libudev0-shim insync-pkg ]; @@ -108,7 +107,7 @@ in buildFHSEnv { # For debugging: # export QT_DEBUG_PLUGINS=1 - QT_QPA_PLATFORMTHEME=hicolor QT_STYLE_OVERRIDE=hicolor LC_TIME=C exec /usr/lib/insync/insync "$@" + exec /usr/lib/insync/insync "$@" ''; # As intended by this bubble wrap, share as much namespaces as possible with user.