Merge pull request #184214 from MoritzBoehme/synology-drive-client

This commit is contained in:
Sandro 2022-08-02 15:28:15 +02:00 committed by GitHub
commit dddd0bdfde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,9 +1,9 @@
{ stdenv, lib, qt5, fetchurl, autoPatchelfHook, dpkg, glibc, cpio, xar, undmg, gtk3, pango }: { stdenv, lib, writeScript, qt5, fetchurl, autoPatchelfHook, dpkg, glibc, cpio, xar, undmg, gtk3, pango, libxcb }:
let let
pname = "synology-drive-client"; pname = "synology-drive-client";
baseUrl = "https://global.download.synology.com/download/Utility/SynologyDriveClient"; baseUrl = "https://global.download.synology.com/download/Utility/SynologyDriveClient";
buildNumber = "12920"; version = "3.1.0-12923";
version = "3.1.0"; buildNumber = with lib; last (splitString "-" version);
meta = with lib; { meta = with lib; {
description = "Desktop application to synchronize files and folders between the computer and the Synology Drive server."; 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"; homepage = "https://www.synology.com/en-global/dsm/feature/drive";
@ -12,18 +12,29 @@ let
maintainers = with maintainers; [ jcouyang MoritzBoehme ]; maintainers = with maintainers; [ jcouyang MoritzBoehme ];
platforms = [ "x86_64-linux" "x86_64-darwin" ]; platforms = [ "x86_64-linux" "x86_64-darwin" ];
}; };
passthru.updateScript = writeScript "update-synology-drive-client" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl common-updater-scripts
set -eu -o pipefail
version="$(curl -s https://www.synology.com/en-uk/releaseNote/SynologyDriveClient \
| grep -oP '(?<=data-version=")(\d.){2}\d-\d{5}' \
| head -1)"
update-source-version synology-drive-client "$version"
'';
linux = qt5.mkDerivation { linux = qt5.mkDerivation {
inherit pname version meta; inherit pname version meta passthru;
src = fetchurl { src = fetchurl {
url = "${baseUrl}/${version}-${buildNumber}/Ubuntu/Installer/x86_64/synology-drive-client-${buildNumber}.x86_64.deb"; url = "${baseUrl}/${version}/Ubuntu/Installer/x86_64/synology-drive-client-${buildNumber}.x86_64.deb";
sha256 = "sha256-UAO/LwqPchIMhjdQP4METjVorMJsbvIDRkp4JxtZgOs="; sha256 = "sha256-gL08uJbA2S+SuP1afMBmcJMIcu7QRzdiXgIMxSZQl/I=";
}; };
nativeBuildInputs = [ autoPatchelfHook dpkg ]; nativeBuildInputs = [ autoPatchelfHook dpkg ];
buildInputs = [ glibc gtk3 pango ]; buildInputs = [ glibc gtk3 pango libxcb ];
unpackPhase = '' unpackPhase = ''
mkdir -p $out mkdir -p $out
@ -44,11 +55,11 @@ let
}; };
darwin = stdenv.mkDerivation { darwin = stdenv.mkDerivation {
inherit pname version meta; inherit pname version meta passthru;
src = fetchurl { src = fetchurl {
url = "${baseUrl}/${version}-${buildNumber}/Mac/Installer/synology-drive-client-${buildNumber}.dmg"; url = "${baseUrl}/${version}/Mac/Installer/synology-drive-client-${buildNumber}.dmg";
sha256 = "15wici8ycil1mfh5cf89rfan4kb93wfkdsd4kmpvzjj4bnddwlxa"; sha256 = "0pwm2xi1b9p9zmhy4dhix3aas49i183wxslyidfwvlaphic9qkxm";
}; };
nativeBuildInputs = [ cpio xar undmg ]; nativeBuildInputs = [ cpio xar undmg ];