signal-desktop: Refactor the package description
Removed some redundancy (src check via meta.platforms) and made some changes according to our style-guide. I've changed meta.description and added meta.longDescription.
This commit is contained in:
parent
104994fdc4
commit
ab593d46dc
|
@ -1,8 +1,10 @@
|
||||||
{ stdenv, lib, fetchurl, dpkg, wrapGAppsHook, gnome3, gtk3, atk, cairo, pango, gdk_pixbuf, glib, freetype,
|
{ stdenv, lib, fetchurl, dpkg, wrapGAppsHook
|
||||||
fontconfig, dbus, libX11, xorg, libXi, libXcursor, libXdamage, libXrandr,
|
, gnome3, gtk3, atk, cairo, pango, gdk_pixbuf, glib, freetype, fontconfig
|
||||||
libXcomposite, libXext, libXfixes, libXrender, libXtst, libXScrnSaver, nss,
|
, dbus, libX11, xorg, libXi, libXcursor, libXdamage, libXrandr, libXcomposite
|
||||||
nspr, alsaLib, cups, expat, udev
|
, libXext, libXfixes, libXrender, libXtst, libXScrnSaver, nss, nspr, alsaLib
|
||||||
|
, cups, expat, udev
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
rpath = lib.makeLibraryPath [
|
rpath = lib.makeLibraryPath [
|
||||||
alsaLib
|
alsaLib
|
||||||
|
@ -36,57 +38,56 @@ let
|
||||||
xorg.libxcb
|
xorg.libxcb
|
||||||
];
|
];
|
||||||
|
|
||||||
in
|
in stdenv.mkDerivation rec {
|
||||||
stdenv.mkDerivation rec {
|
name = "signal-desktop-${version}";
|
||||||
name = "signal-desktop-${version}";
|
version = "1.12.0";
|
||||||
|
|
||||||
version = "1.12.0";
|
src = fetchurl {
|
||||||
|
url = "https://updates.signal.org/desktop/apt/pool/main/s/signal-desktop/signal-desktop_${version}_amd64.deb";
|
||||||
|
sha256 = "19c9pilx2qkpyqw3p167bfcizrpd4np5jxdcwqmpbcfibmrpmcsk";
|
||||||
|
};
|
||||||
|
|
||||||
src =
|
phases = [ "unpackPhase" "installPhase" ];
|
||||||
if stdenv.system == "x86_64-linux" then
|
|
||||||
fetchurl {
|
|
||||||
url = "https://updates.signal.org/desktop/apt/pool/main/s/signal-desktop/signal-desktop_${version}_amd64.deb";
|
|
||||||
sha256 = "19c9pilx2qkpyqw3p167bfcizrpd4np5jxdcwqmpbcfibmrpmcsk";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
throw "Signal for Desktop is not currently supported on ${stdenv.system}";
|
|
||||||
|
|
||||||
phases = [ "unpackPhase" "installPhase" ];
|
nativeBuildInputs = [ dpkg wrapGAppsHook ];
|
||||||
nativeBuildInputs = [ dpkg wrapGAppsHook ];
|
|
||||||
unpackPhase = "dpkg-deb -x $src .";
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out
|
|
||||||
cp -R opt $out
|
|
||||||
|
|
||||||
mv ./usr/share $out/share
|
unpackPhase = "dpkg-deb -x $src .";
|
||||||
mv $out/opt/Signal $out/libexec
|
|
||||||
rmdir $out/opt
|
|
||||||
|
|
||||||
chmod -R g-w $out
|
installPhase = ''
|
||||||
|
mkdir -p $out
|
||||||
|
cp -R opt $out
|
||||||
|
|
||||||
# Patch signal
|
mv ./usr/share $out/share
|
||||||
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
mv $out/opt/Signal $out/libexec
|
||||||
--set-rpath ${rpath}:$out/libexec $out/libexec/signal-desktop
|
rmdir $out/opt
|
||||||
wrapProgram $out/libexec/signal-desktop \
|
|
||||||
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
|
|
||||||
"''${gappsWrapperArgs[@]}"
|
|
||||||
|
|
||||||
# Symlink to bin
|
chmod -R g-w $out
|
||||||
mkdir -p $out/bin
|
|
||||||
ln -s $out/libexec/signal-desktop $out/bin/signal-desktop
|
|
||||||
|
|
||||||
# Fix the desktop link
|
# Patch signal
|
||||||
substituteInPlace $out/share/applications/signal-desktop.desktop \
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
||||||
--replace /opt/Signal/signal-desktop $out/bin/signal-desktop
|
--set-rpath ${rpath}:$out/libexec $out/libexec/signal-desktop
|
||||||
|
wrapProgram $out/libexec/signal-desktop \
|
||||||
|
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
|
||||||
|
"''${gappsWrapperArgs[@]}"
|
||||||
|
|
||||||
|
# Symlink to bin
|
||||||
|
mkdir -p $out/bin
|
||||||
|
ln -s $out/libexec/signal-desktop $out/bin/signal-desktop
|
||||||
|
|
||||||
|
# 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/;
|
||||||
meta = {
|
license = lib.licenses.gpl3;
|
||||||
description = "Signal Private Messenger for the Desktop.";
|
maintainers = with lib.maintainers; [ ixmatus primeos ];
|
||||||
homepage = https://signal.org/;
|
platforms = [ "x86_64-linux" ];
|
||||||
license = lib.licenses.gpl3;
|
};
|
||||||
maintainers = with lib.maintainers; [ ixmatus primeos ];
|
}
|
||||||
platforms = [
|
|
||||||
"x86_64-linux"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue