-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{ stdenv, fetchurl, alsa-lib, nss, libdrm, mesa, glib, nspr, atk, cups, dbus | ||
, gtk3, pango, cairo, gdk-pixbuf, xorg, expat, libxkbcommon, gnome, harfbuzzFull | ||
, dpkg, makeWrapper, autoPatchelfHook, patchelf, lsb-release, xdg-utils | ||
, xdg-user-dirs, lib, udev }: | ||
stdenv.mkDerivation (finalAttrs: { | ||
name = "SynologyChat"; | ||
version = "1.2.3-0232"; | ||
src = stdenv.mkDerivation rec { | ||
inherit (finalAttrs) version; | ||
name = finalAttrs.name + "-${version}-deb"; | ||
src = fetchurl { | ||
url = | ||
"https://global.download.synology.com/download/Utility/ChatClient/${version}/Ubuntu/x86_64/Synology%20Chat%20Client-${version}.deb"; | ||
sha512 = | ||
"f94117ef8b3bb299d96fbce6f7b802ae18cd436176502ea13864c79cc086169671ac6154901d3fd7ae57de11ddfa177d4bf148ae99bbd33963e3ec5317f2e4ef"; | ||
}; | ||
nativeBuildInputs = [ dpkg ]; | ||
sourceRoot = "."; | ||
unpackCmd = "dpkg-deb -x $src $out"; | ||
}; | ||
|
||
dontConfigure = true; | ||
dontBuild = true; | ||
|
||
binary = "$out/opt/Synology\\ Chat/synochat"; | ||
|
||
nativeBuildInputs = [ makeWrapper patchelf autoPatchelfHook ]; | ||
|
||
runtimeInputs = [ lsb-release xdg-utils xdg-user-dirs ]; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
mkdir -p $out/bin | ||
cp -R opt usr/share $out/ | ||
substituteInPlace $out/share/applications/synochat.desktop \ | ||
--replace 'Exec="/opt/Synology Chat/synochat"' "Exec=synochat" | ||
# fix the path in the desktop file | ||
runHook postInstall | ||
''; | ||
|
||
postFixup = '' | ||
makeWrapper ${finalAttrs.binary} $out/bin/synochat \ | ||
--prefix LD_LIBRARY_PATH : ${ | ||
lib.makeLibraryPath finalAttrs.buildInputs | ||
}:$out/opt/Synology\ Chat \ | ||
--prefix PATH : ${lib.makeBinPath finalAttrs.runtimeInputs} \ | ||
--add-flags "$out/opt/Synology Chat/resources/app.asar" | ||
''; | ||
buildInputs = [ | ||
stdenv.cc.cc | ||
stdenv.cc.cc.lib | ||
alsa-lib | ||
nss | ||
libdrm | ||
mesa | ||
glib | ||
nspr | ||
atk | ||
cups | ||
dbus | ||
gtk3 | ||
pango | ||
cairo | ||
gdk-pixbuf | ||
xorg.libX11 | ||
xorg.libXcomposite | ||
xorg.libXdamage | ||
xorg.libXext | ||
xorg.libXfixes | ||
xorg.libXrandr | ||
xorg.libxcb | ||
xorg.libXtst | ||
expat | ||
libxkbcommon | ||
gnome.gvfs | ||
harfbuzzFull | ||
udev | ||
]; | ||
meta = { | ||
license = lib.licenses.unfree; | ||
platforms = lib.platforms.linux; | ||
maintainers = [ lib.maintainers.shimun ]; | ||
mainProgram = "synochat"; | ||
}; | ||
}) |