mattermost-desktop: refactor phases

This commit is contained in:
Ioannis Koutras 2019-02-25 11:13:49 +02:00
parent f3e367537e
commit 2e9c7418fe

View file

@ -1,9 +1,9 @@
{ stdenv, lib, fetchurl, gnome2, gtk3, pango, atk, cairo, gdk_pixbuf, glib,
{ stdenv, fetchurl, gnome2, gtk3, pango, atk, cairo, gdk_pixbuf, glib,
freetype, fontconfig, dbus, libX11, xorg, libXi, libXcursor, libXdamage,
libXrandr, libXcomposite, libXext, libXfixes, libXrender, libXtst,
libXScrnSaver, nss, nspr, alsaLib, cups, expat, udev }:
let
rpath = lib.makeLibraryPath [
rpath = stdenv.lib.makeLibraryPath [
alsaLib
atk
cairo
@ -54,28 +54,35 @@ in
else
throw "Mattermost-Desktop is not currently supported on ${stdenv.hostPlatform.system}";
phases = [ "unpackPhase" "installPhase" ];
dontBuild = true;
dontConfigure = true;
dontPatchELF = true;
installPhase = ''
mkdir -p $out
cp -R . $out
mkdir -p $out/share/mattermost-desktop
cp -R . $out/share/mattermost-desktop
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath ${rpath}:$out $out/mattermost-desktop
mkdir -p "$out/bin"
ln -s $out/share/mattermost-desktop/mattermost-desktop \
$out/bin/mattermost-desktop
patchShebangs $out/create_desktop_file.sh
$out/create_desktop_file.sh
patchShebangs $out/share/mattermost-desktop/create_desktop_file.sh
$out/share/mattermost-desktop/create_desktop_file.sh
rm $out/share/mattermost-desktop/create_desktop_file.sh
mkdir -p $out/share/applications
mv Mattermost.desktop $out/share/applications/Mattermost.desktop
mkdir -p $out/{bin,share/applications}
cp Mattermost.desktop $out/share/applications/Mattermost.desktop
ln -s $out/mattermost-desktop $out/bin/mattermost-desktop
patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${rpath}:$out/share/mattermost-desktop" \
$out/share/mattermost-desktop/mattermost-desktop
'';
meta = {
meta = with stdenv.lib; {
description = "Mattermost Desktop client";
homepage = https://about.mattermost.com/;
license = lib.licenses.asl20;
platforms = [
"x86_64-linux" "i686-linux"
];
license = licenses.asl20;
platforms = [ "x86_64-linux" "i686-linux" ];
maintainers = [ maintainers.joko ];
};
}