nixpkgs/pkgs/applications/networking/instant-messengers/franz/default.nix

73 lines
2.1 KiB
Nix
Raw Normal View History

2016-10-12 08:38:15 +02:00
{ stdenv, fetchurl, makeDesktopItem
2016-10-03 15:26:16 +02:00
, xorg, gtk2, atk, glib, pango, gdk_pixbuf, cairo, freetype, fontconfig
, gnome2, dbus, nss, nspr, alsaLib, cups, expat, udev, libnotify }:
2016-10-12 08:38:15 +02:00
let
2016-10-03 18:57:50 +02:00
bits = if stdenv.system == "x86_64-linux" then "x64"
else "ia32";
2016-10-12 08:38:15 +02:00
2016-10-03 15:26:16 +02:00
version = "4.0.4";
2016-10-12 08:38:15 +02:00
desktopItem = makeDesktopItem rec {
name = "Franz";
exec = name;
icon = "franz";
desktopName = name;
genericName = "Franz messenger";
categories = "Network;";
};
in stdenv.mkDerivation rec {
2016-10-03 15:26:16 +02:00
name = "franz-${version}";
src = fetchurl {
2016-10-12 08:38:15 +02:00
url = "https://github.com/meetfranz/franz-app/releases/download/${version}/Franz-linux-${bits}-${version}.tgz";
2016-10-03 18:57:50 +02:00
sha256 = if bits == "x64" then
"0ssym0jfrig474g6j67g1jfybjkxnyhbqqjvrs8z6ihwlyd3rrk5" else
"16l9jma2hiwzl9l41yhrwribcgmxca271rq0cfbbm9701mmmciyy";
2016-10-03 15:26:16 +02:00
};
2017-04-23 20:10:35 +02:00
# don't remove runtime deps
dontPatchELF = true;
2016-10-03 15:26:16 +02:00
2017-04-23 20:10:35 +02:00
deps = (with xorg; [
libXi libXcursor libXdamage libXrandr libXcomposite libXext libXfixes
libXrender libX11 libXtst libXScrnSaver
]) ++ [
gtk2 atk glib pango gdk_pixbuf cairo freetype fontconfig dbus
gnome2.GConf nss nspr alsaLib cups expat stdenv.cc.cc
# runtime deps
] ++ [
udev libnotify
2016-10-03 15:26:16 +02:00
];
unpackPhase = ''
tar xzf $src
'';
installPhase = ''
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" Franz
2017-04-23 20:10:35 +02:00
patchelf --set-rpath "$out/opt/franz:${stdenv.lib.makeLibraryPath deps}" Franz
2016-10-03 15:26:16 +02:00
2017-04-23 20:10:35 +02:00
mkdir -p $out/bin $out/opt/franz
cp -r * $out/opt/franz
ln -s $out/opt/franz/Franz $out/bin
2016-10-12 08:38:15 +02:00
2017-04-23 20:10:35 +02:00
# provide desktop item and icon
2016-10-12 08:38:15 +02:00
mkdir -p $out/share/applications $out/share/pixmaps
ln -s ${desktopItem}/share/applications/* $out/share/applications
2017-04-23 20:10:35 +02:00
ln -s $out/opt/franz/resources/app.asar.unpacked/assets/franz.png $out/share/pixmaps
2016-10-03 15:26:16 +02:00
'';
postFixup = ''
2017-04-23 20:10:35 +02:00
paxmark m $out/opt/franz/Franz
'';
2016-10-03 15:26:16 +02:00
meta = with stdenv.lib; {
description = "A free messaging app that combines chat & messaging services into one application";
homepage = http://meetfranz.com;
license = licenses.free;
maintainers = [ stdenv.lib.maintainers.gnidorah ];
2016-10-03 18:57:50 +02:00
platforms = ["i686-linux" "x86_64-linux"];
hydraPlatforms = [];
2016-10-03 15:26:16 +02:00
};
}