@@ -0,0 +1,45 @@
1+{ lib, mkDerivation, fetchurl, autoPatchelfHook, dpkg, glibc, gnome }:
2+
3+mkDerivation rec {
4+ pname = "synology-drive";
5+ subVersion = "12674";
6+ version = "3.0.1-${subVersion}";
7+
8+ src = fetchurl {
9+ url = "https://global.download.synology.com/download/Utility/SynologyDriveClient/${version}/Ubuntu/Installer/x86_64/synology-drive-client-${subVersion}.x86_64.deb";
10+ sha256 = "1yyv6zgszsym22kf4jvlan7n9lw09fw24fyrh7c8pzbb2029gp8a";
11+ };
12+
13+ nativeBuildInputs = [ autoPatchelfHook dpkg ];
14+
15+ buildInputs = [ glibc gnome.nautilus ];
16+
17+ unpackPhase = ''
18+ mkdir -p $out
19+ dpkg -x $src $out
20+ '';
21+
22+ installPhase = ''
23+ # synology-drive executable
24+ cp -av $out/usr/* $out
25+ rm -rf $out/usr
26+
27+ runHook postInstall
28+ '';
29+
30+ postInstall = ''
31+ substituteInPlace $out/bin/synology-drive --replace /opt $out/opt
32+ '';
33+
34+ meta = with lib; {
35+ homepage = "https://www.synology.com/";
36+ description = "Synchronize files between client and Synology NAS.";
37+ longDescription = ''
38+ Drive for PC, the desktop utility of the DSM add-on package.
39+ Drive, allows you to sync and share files owned by you or shared by others between a centralized Synology NAS and multiple client computers.
40+ '';
41+ license = licenses.unfree;
42+ maintainers = with maintainers; [ MoritzBoehme ];
43+ platforms = [ "x86_64-linux" ];
44+ };
45+}