nixpkgs-suyu/pkgs/applications/networking/instant-messengers/rambox/default.nix

65 lines
2 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, dpkg, makeWrapper
2016-10-03 15:24:35 +02: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 15:24:35 +02:00
2016-10-12 08:54:47 +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:54:47 +02:00
2017-11-01 15:09:54 +01:00
version = "0.5.13";
2017-07-05 03:42:23 +02:00
runtimeDeps = [
udev libnotify
];
deps = (with xorg; [
libXi libXcursor libXdamage libXrandr libXcomposite libXext libXfixes
libXrender libX11 libXtst libXScrnSaver libxcb
]) ++ [
gtk2 atk glib pango gdk_pixbuf cairo freetype fontconfig dbus
gnome2.GConf nss nspr alsaLib cups expat stdenv.cc.cc
] ++ runtimeDeps;
2016-10-12 08:54:47 +02:00
in stdenv.mkDerivation rec {
2016-10-03 15:24:35 +02:00
name = "rambox-${version}";
src = fetchurl {
2017-09-07 20:10:50 +02:00
url = "https://github.com/saenzramiro/rambox/releases/download/${version}/Rambox_${version}-${bits}.deb";
2016-10-03 18:57:50 +02:00
sha256 = if bits == "x64" then
2017-11-01 15:09:54 +01:00
"0bn562fr1wsnn3xsd4q2rrxi6c56vckrkfmjl2dqb30hpmj2vn0d" else
"180ndvkil5mk5idwnn7spfygnhhll6pjc342pfzgmzk46a723qs4";
2016-10-03 15:24:35 +02:00
};
2017-04-23 20:10:35 +02:00
# don't remove runtime deps
dontPatchELF = true;
2016-10-03 15:24:35 +02:00
buildInputs = [ dpkg makeWrapper ];
2017-09-07 20:10:50 +02:00
unpackPhase = "dpkg-deb -x $src .";
2016-10-03 15:24:35 +02:00
installPhase = ''
2017-09-07 20:10:50 +02:00
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" opt/Rambox/rambox
patchelf --set-rpath "$out/opt/Rambox:${stdenv.lib.makeLibraryPath deps}" opt/Rambox/rambox
2016-10-03 15:24:35 +02:00
2017-09-07 20:10:50 +02:00
mkdir -p $out/bin
cp -r opt $out
ln -s $out/opt/Rambox/rambox $out/bin
2016-10-12 08:54:47 +02:00
2017-09-07 20:10:50 +02:00
# provide resources
cp -r usr/share $out
substituteInPlace $out/share/applications/rambox.desktop \
--replace Exec=\"/opt/Rambox/rambox\" Exec=rambox
2016-10-03 15:24:35 +02:00
'';
postFixup = ''
2017-09-07 20:10:50 +02:00
paxmark m $out/opt/Rambox/rambox
wrapProgram $out/opt/Rambox/rambox --prefix PATH : ${xdg_utils}/bin
'';
2016-10-03 15:24:35 +02:00
meta = with stdenv.lib; {
description = "Free and Open Source messaging and emailing app that combines common web applications into one";
homepage = http://rambox.pro;
license = licenses.mit;
2017-09-07 20:10:50 +02:00
maintainers = [ maintainers.gnidorah ];
2016-10-03 18:57:50 +02:00
platforms = ["i686-linux" "x86_64-linux"];
hydraPlatforms = [];
2016-10-03 15:24:35 +02:00
};
}