72 lines
1.6 KiB
Nix
72 lines
1.6 KiB
Nix
{ stdenv
|
|
, buildFHSUserEnv
|
|
, fetchurl
|
|
, lib
|
|
, pkgs
|
|
, writeScript
|
|
}:
|
|
|
|
let
|
|
version = "4.3.3";
|
|
release = "4469";
|
|
cloudstation = stdenv.mkDerivation rec {
|
|
name = "cloudstation-unpack";
|
|
buildInputs = [
|
|
pkgs.dpkg
|
|
pkgs.qt5.qtbase
|
|
];
|
|
src = fetchurl {
|
|
url = "https://global.download.synology.com/download/Tools/CloudStationDrive/${version}-${release}/Ubuntu/Installer/x86_64/synology-cloud-station-drive-${release}.x86_64.deb";
|
|
sha256 = "0v84yb70knmmjzp7lyn6jgy5bnfsfd47wmqh29phybqg4zk3d47j";
|
|
};
|
|
unpackPhase = ''
|
|
dpkg-deb -x $src .
|
|
'';
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
cp -R opt/Synology/CloudStation/* $out/
|
|
ls -lah $out
|
|
chmod +x $out/lib/*
|
|
cp $out/lib/plugins/platforms/libqxcb.so $out/lib/plugins/
|
|
|
|
# fix xcb plugin
|
|
echo -e "[Paths]\nPlugins = ${pkgs.qt5.qtbase.bin}/${pkgs.qt5.qtbase.qtPluginPrefix}" > $out/bin/qt.conf
|
|
'';
|
|
dontWrapQtApps = true;
|
|
};
|
|
|
|
|
|
in buildFHSUserEnv {
|
|
name = "cloudstation";
|
|
|
|
targetPkgs = pkgs: with pkgs; with xorg; [
|
|
cloudstation
|
|
curl
|
|
dbus_libs
|
|
fontconfig
|
|
freetype
|
|
glib
|
|
libICE
|
|
libSM
|
|
libX11
|
|
libxcb
|
|
openssl
|
|
qt5.qtbase
|
|
qt5.qttools
|
|
qt5.qtwayland
|
|
qt5.qtx11extras
|
|
sqlite
|
|
stdenv.cc.cc.lib
|
|
xkeyboard_config
|
|
zlib
|
|
];
|
|
|
|
runScript = writeScript "cloudstation" ''
|
|
#!/usr/bin/env bash
|
|
export QT_PLUGIN_PATH="${pkgs.qt5.qtbase.bin}/${pkgs.qt5.qtbase.qtPluginPrefix}"
|
|
${cloudstation}/bin/launcher
|
|
|
|
export LD_LIBRARY_PATH="/home/stefan/.CloudStation/CloudStation.app/lib:$LD_LIBRARY_PATH"
|
|
~/.CloudStation/CloudStation.app/bin/cloud-drive-ui
|
|
'';
|
|
}
|