3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/instant-messengers/franz/default.nix

76 lines
2.3 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, makeDesktopItem, makeWrapper
2016-10-03 14:26:16 +01:00
, xorg, gtk2, atk, glib, pango, gdk_pixbuf, cairo, freetype, fontconfig
, gnome2, dbus, nss, nspr, alsaLib, cups, expat, udev, libnotify, xdg_utils }:
2016-10-03 14:26:16 +01:00
2016-10-12 07:38:15 +01:00
let
2016-10-03 17:57:50 +01:00
bits = if stdenv.system == "x86_64-linux" then "x64"
else "ia32";
2016-10-12 07:38:15 +01:00
2016-10-03 14:26:16 +01:00
version = "4.0.4";
2016-10-12 07:38:15 +01:00
2017-07-05 02:42:08 +01:00
runtimeDeps = [
udev libnotify
];
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
] ++ runtimeDeps;
2016-10-12 07:38:15 +01:00
desktopItem = makeDesktopItem rec {
name = "Franz";
exec = name;
icon = "franz";
desktopName = name;
genericName = "Franz messenger";
categories = "Network;";
};
in stdenv.mkDerivation rec {
2016-10-03 14:26:16 +01:00
name = "franz-${version}";
src = fetchurl {
2016-10-12 07:38:15 +01:00
url = "https://github.com/meetfranz/franz-app/releases/download/${version}/Franz-linux-${bits}-${version}.tgz";
2016-10-03 17:57:50 +01:00
sha256 = if bits == "x64" then
"0ssym0jfrig474g6j67g1jfybjkxnyhbqqjvrs8z6ihwlyd3rrk5" else
"16l9jma2hiwzl9l41yhrwribcgmxca271rq0cfbbm9701mmmciyy";
2016-10-03 14:26:16 +01:00
};
2017-04-23 19:10:35 +01:00
# don't remove runtime deps
dontPatchELF = true;
2016-10-03 14:26:16 +01:00
buildInputs = [ makeWrapper ];
2016-10-03 14:26:16 +01:00
unpackPhase = ''
tar xzf $src
'';
installPhase = ''
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" Franz
2017-04-23 19:10:35 +01:00
patchelf --set-rpath "$out/opt/franz:${stdenv.lib.makeLibraryPath deps}" Franz
2016-10-03 14:26:16 +01:00
2017-04-23 19:10:35 +01:00
mkdir -p $out/bin $out/opt/franz
cp -r * $out/opt/franz
ln -s $out/opt/franz/Franz $out/bin
2016-10-12 07:38:15 +01:00
2017-04-23 19:10:35 +01:00
# provide desktop item and icon
2016-10-12 07:38:15 +01:00
mkdir -p $out/share/applications $out/share/pixmaps
ln -s ${desktopItem}/share/applications/* $out/share/applications
2017-04-23 19:10:35 +01:00
ln -s $out/opt/franz/resources/app.asar.unpacked/assets/franz.png $out/share/pixmaps
2016-10-03 14:26:16 +01:00
'';
postFixup = ''
2017-04-23 19:10:35 +01:00
paxmark m $out/opt/franz/Franz
wrapProgram $out/opt/franz/Franz --prefix PATH : ${xdg_utils}/bin
'';
2016-10-03 14:26:16 +01: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;
2017-07-05 02:42:08 +01:00
maintainers = [ maintainers.gnidorah ];
2016-10-03 17:57:50 +01:00
platforms = ["i686-linux" "x86_64-linux"];
hydraPlatforms = [];
2016-10-03 14:26:16 +01:00
};
}