2021-12-06 16:07:01 +00:00
|
|
|
{ stdenv, lib, qt5, fetchurl, autoPatchelfHook, dpkg, glibc, cpio, xar, undmg, gtk3, pango }:
|
|
|
|
let
|
|
|
|
pname = "synology-drive-client";
|
|
|
|
baseUrl = "https://global.download.synology.com/download/Utility/SynologyDriveClient";
|
2022-04-27 09:35:20 +00:00
|
|
|
buildNumber = "12920";
|
|
|
|
version = "3.1.0";
|
2021-12-06 16:07:01 +00:00
|
|
|
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";
|
2022-06-26 10:26:21 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2021-12-06 16:07:01 +00:00
|
|
|
license = licenses.unfree;
|
2022-01-22 01:22:15 +00:00
|
|
|
maintainers = with maintainers; [ jcouyang MoritzBoehme ];
|
2021-12-06 16:07:01 +00:00
|
|
|
platforms = [ "x86_64-linux" "x86_64-darwin" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
linux = qt5.mkDerivation {
|
2022-01-22 01:22:15 +00:00
|
|
|
inherit pname version meta;
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "${baseUrl}/${version}-${buildNumber}/Ubuntu/Installer/x86_64/synology-drive-client-${buildNumber}.x86_64.deb";
|
2022-04-27 09:35:20 +00:00
|
|
|
sha256 = "sha256-UAO/LwqPchIMhjdQP4METjVorMJsbvIDRkp4JxtZgOs=";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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 {
|
2022-01-22 01:22:15 +00:00
|
|
|
inherit pname version meta;
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "${baseUrl}/${version}-${buildNumber}/Mac/Installer/synology-drive-client-${buildNumber}.dmg";
|
2022-04-27 09:35:20 +00:00
|
|
|
sha256 = "15wici8ycil1mfh5cf89rfan4kb93wfkdsd4kmpvzjj4bnddwlxa";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|