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 {