2018-06-01 13:53:30 +01:00
|
|
|
{ stdenv, lib, fetchurl, dpkg, wrapGAppsHook
|
2018-07-09 23:34:32 +01:00
|
|
|
, gnome2, gtk3, atk, cairo, pango, gdk_pixbuf, glib, freetype, fontconfig
|
2018-06-01 13:53:30 +01:00
|
|
|
, dbus, libX11, xorg, libXi, libXcursor, libXdamage, libXrandr, libXcomposite
|
|
|
|
, libXext, libXfixes, libXrender, libXtst, libXScrnSaver, nss, nspr, alsaLib
|
2018-09-25 13:28:14 +01:00
|
|
|
, cups, expat, udev, libnotify
|
2018-08-04 15:01:44 +01:00
|
|
|
# Unfortunately this also overwrites the UI language (not just the spell
|
|
|
|
# checking language!):
|
|
|
|
, hunspellDicts, spellcheckerLanguage ? null # E.g. "de_DE"
|
|
|
|
# For a full list of available languages:
|
|
|
|
# $ cat pkgs/development/libraries/hunspell/dictionaries.nix | grep "dictFileName =" | awk '{ print $3 }'
|
2017-11-07 12:26:45 +00:00
|
|
|
}:
|
2018-06-01 13:53:30 +01:00
|
|
|
|
2017-11-07 12:26:45 +00:00
|
|
|
let
|
2018-08-04 15:01:44 +01:00
|
|
|
customLanguageWrapperArgs = (with lib;
|
|
|
|
let
|
|
|
|
# E.g. "de_DE" -> "de-de" (spellcheckerLanguage -> hunspellDict)
|
|
|
|
spellLangComponents = splitString "_" spellcheckerLanguage;
|
|
|
|
hunspellDict = elemAt spellLangComponents 0 + "-" + toLower (elemAt spellLangComponents 1);
|
|
|
|
in if spellcheckerLanguage != null
|
|
|
|
then ''
|
|
|
|
--set HUNSPELL_DICTIONARIES "${hunspellDicts.${hunspellDict}}/share/hunspell" \
|
|
|
|
--set LC_MESSAGES "${spellcheckerLanguage}"''
|
|
|
|
else "");
|
2017-11-07 12:26:45 +00:00
|
|
|
rpath = lib.makeLibraryPath [
|
|
|
|
alsaLib
|
|
|
|
atk
|
|
|
|
cairo
|
|
|
|
cups
|
|
|
|
dbus
|
|
|
|
expat
|
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
gdk_pixbuf
|
|
|
|
glib
|
2018-07-09 23:34:32 +01:00
|
|
|
gnome2.GConf
|
2018-06-01 01:50:37 +01:00
|
|
|
gtk3
|
2018-05-28 11:53:20 +01:00
|
|
|
pango
|
2018-09-25 13:28:14 +01:00
|
|
|
libnotify
|
2017-11-07 12:26:45 +00:00
|
|
|
libX11
|
|
|
|
libXScrnSaver
|
|
|
|
libXcomposite
|
|
|
|
libXcursor
|
|
|
|
libXdamage
|
|
|
|
libXext
|
|
|
|
libXfixes
|
|
|
|
libXi
|
|
|
|
libXrandr
|
|
|
|
libXrender
|
|
|
|
libXtst
|
|
|
|
nspr
|
|
|
|
nss
|
|
|
|
stdenv.cc.cc
|
|
|
|
udev
|
2018-03-13 10:16:03 +00:00
|
|
|
xorg.libxcb
|
2017-11-07 12:26:45 +00:00
|
|
|
];
|
|
|
|
|
2018-06-01 13:53:30 +01:00
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
name = "signal-desktop-${version}";
|
2018-11-27 19:03:36 +00:00
|
|
|
version = "1.18.1";
|
2017-11-07 12:26:45 +00:00
|
|
|
|
2018-06-01 13:53:30 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://updates.signal.org/desktop/apt/pool/main/s/signal-desktop/signal-desktop_${version}_amd64.deb";
|
2018-11-27 19:03:36 +00:00
|
|
|
sha256 = "1gak6nhv5gk37iv1bfmjx6wf0p1vcln5y29i6fkzmvcrp3j2cmfh";
|
2018-06-01 13:53:30 +01:00
|
|
|
};
|
2017-11-07 12:26:45 +00:00
|
|
|
|
2018-06-01 13:53:30 +01:00
|
|
|
phases = [ "unpackPhase" "installPhase" ];
|
2017-11-07 12:26:45 +00:00
|
|
|
|
2018-06-01 13:53:30 +01:00
|
|
|
nativeBuildInputs = [ dpkg wrapGAppsHook ];
|
2017-11-07 12:26:45 +00:00
|
|
|
|
2018-06-01 13:53:30 +01:00
|
|
|
unpackPhase = "dpkg-deb -x $src .";
|
2017-11-07 12:26:45 +00:00
|
|
|
|
2018-06-01 13:53:30 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -R opt $out
|
2017-11-07 12:26:45 +00:00
|
|
|
|
2018-06-01 13:53:30 +01:00
|
|
|
mv ./usr/share $out/share
|
|
|
|
mv $out/opt/Signal $out/libexec
|
|
|
|
rmdir $out/opt
|
2017-11-07 12:26:45 +00:00
|
|
|
|
2018-06-01 13:53:30 +01:00
|
|
|
chmod -R g-w $out
|
2017-11-07 12:26:45 +00:00
|
|
|
|
2018-06-01 13:53:30 +01:00
|
|
|
# Patch signal
|
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
--set-rpath ${rpath}:$out/libexec $out/libexec/signal-desktop
|
|
|
|
wrapProgram $out/libexec/signal-desktop \
|
|
|
|
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
|
2018-08-04 15:01:44 +01:00
|
|
|
${customLanguageWrapperArgs} \
|
2018-06-01 13:53:30 +01:00
|
|
|
"''${gappsWrapperArgs[@]}"
|
|
|
|
|
|
|
|
# Symlink to bin
|
|
|
|
mkdir -p $out/bin
|
|
|
|
ln -s $out/libexec/signal-desktop $out/bin/signal-desktop
|
2017-11-07 12:26:45 +00:00
|
|
|
|
2018-06-01 13:53:30 +01:00
|
|
|
# Fix the desktop link
|
|
|
|
substituteInPlace $out/share/applications/signal-desktop.desktop \
|
|
|
|
--replace /opt/Signal/signal-desktop $out/bin/signal-desktop
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Private, simple, and secure messenger";
|
|
|
|
longDescription = ''
|
|
|
|
Signal Desktop is an Electron application that links with your
|
|
|
|
"Signal Android" or "Signal iOS" app.
|
|
|
|
'';
|
|
|
|
homepage = https://signal.org/;
|
|
|
|
license = lib.licenses.gpl3;
|
|
|
|
maintainers = with lib.maintainers; [ ixmatus primeos ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|