From 7cb6bb064a3250922f3916cabad2f185331d9f68 Mon Sep 17 00:00:00 2001 From: Jichao Ouyang Date: Sat, 20 Nov 2021 03:16:58 +1100 Subject: [PATCH] synology-drive-client: init at 3.0.2 (#144706) --- maintainers/maintainer-list.nix | 10 +++ .../synology-drive-client/default.nix | 68 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 80 insertions(+) create mode 100644 pkgs/applications/networking/synology-drive-client/default.nix diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 41018c41728b..43c1b669f2cd 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -5261,6 +5261,16 @@ githubId = 938744; name = "John Chadwick"; }; + jcouyang = { + email = "oyanglulu@gmail.com"; + github = "jcouyang"; + githubId = 1235045; + name = "Jichao Ouyang"; + keys = [{ + longkeyid = "rsa2048/0xDA8B833B52604E63"; + fingerprint = "A506 C38D 5CC8 47D0 DF01 134A DA8B 833B 5260 4E63"; + }]; + }; jcumming = { email = "jack@mudshark.org"; github = "jcumming"; diff --git a/pkgs/applications/networking/synology-drive-client/default.nix b/pkgs/applications/networking/synology-drive-client/default.nix new file mode 100644 index 000000000000..990e9691516d --- /dev/null +++ b/pkgs/applications/networking/synology-drive-client/default.nix @@ -0,0 +1,68 @@ +{ stdenv, lib, qt5, fetchurl, autoPatchelfHook, dpkg, glibc, cpio, xar, undmg, gtk3, pango }: +let + pname = "synology-drive-client"; + buildNumber = "12682"; + version = "3.0.2"; + baseUrl = "https://global.download.synology.com/download/Utility/SynologyDriveClient"; + meta = with lib; { + description = "Desktop application to synchronize files and folders between the computer and the Synology Drive server."; + homepage = "https://www.synology.com/en-global/dsm/feature/drive"; + license = licenses.unfree; + maintainers = with maintainers; [ jcouyang ]; + platforms = [ "x86_64-linux" "x86_64-darwin" ]; + }; + + linux = qt5.mkDerivation { + inherit pname version; + + src = fetchurl { + url = "${baseUrl}/${version}-${buildNumber}/Ubuntu/Installer/x86_64/synology-drive-client-${buildNumber}.x86_64.deb"; + sha256 = "19fd2r39lb7bb6vkxfxyq0gp3l7pk5wy9fl0r7qwhym2jpi8yv6l"; + }; + + nativeBuildInputs = [ autoPatchelfHook dpkg ]; + + buildInputs = [ glibc gtk3 pango ]; + + unpackPhase = '' + mkdir -p $out + dpkg -x $src $out + rm -rf $out/usr/lib/nautilus + rm -rf $out/opt/Synology/SynologyDrive/package/cloudstation/icon-overlay + ''; + + installPhase = '' + cp -av $out/usr/* $out + rm -rf $out/usr + runHook postInstall + ''; + + postInstall = '' + substituteInPlace $out/bin/synology-drive --replace /opt $out/opt + ''; + }; + + darwin = stdenv.mkDerivation { + inherit pname version; + + src = fetchurl { + url = "${baseUrl}/${version}-${buildNumber}/Mac/Installer/synology-drive-client-${buildNumber}.dmg"; + sha256 = "1mlv8gxzivgxm59mw1pd63yq9d7as79ihm7166qyy0h0b0m04q2m"; + }; + + nativeBuildInputs = [ cpio xar undmg ]; + + postUnpack = '' + xar -xf 'Install Synology Drive Client.pkg' + cd synology-drive.installer.pkg + gunzip -dc Payload | cpio -i + ''; + + sourceRoot = "."; + + installPhase = '' + mkdir -p $out/Applications/ + cp -R 'Synology Drive Client.app' $out/Applications/ + ''; + }; +in if stdenv.isDarwin then darwin else linux diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index abd47ed9a98d..92c89f83e8f0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -28132,6 +28132,8 @@ with pkgs; dropbox-cli = callPackage ../applications/networking/dropbox/cli.nix { }; + synology-drive-client = callPackage ../applications/networking/synology-drive-client { }; + maestral = with python3Packages; toPythonApplication maestral; maestral-gui = libsForQt5.callPackage ../applications/networking/maestral-qt { };