summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers/bluejeans/default.nix
blob: fb38255ea382ed99653bc7b3691afdd0ac64a6f8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{ stdenv, fetchurl, rpmextract, patchelf, libnotify, libcap, cairo, pango, fontconfig, udev, dbus
, gtk2, atk, expat, gdk-pixbuf, freetype, nspr, glib, nss, gconf, libX11, libXrender, libXtst, libXdamage
, libXi, libXext, libXfixes, libXcomposite, alsaLib, bash
}:

stdenv.mkDerivation rec {
  name = "bluejeans-${version}";
  version = "1.36.9";

  src =
    fetchurl {
      url = "https://swdl.bluejeans.com/desktop/linux/1.36/${version}/bluejeans-${version}.x86_64.rpm";
      sha256 = "0sbv742pzqd2cxn3kq10lfi16jah486i9kyrmi8l1rpb9fhyw2m1";
    };

  nativeBuildInputs = [ patchelf rpmextract ];

  libPath =
    stdenv.lib.makeLibraryPath
       [ libnotify libcap cairo pango fontconfig gtk2 atk expat gdk-pixbuf dbus udev.lib
         freetype nspr glib stdenv.cc stdenv.cc.cc.lib nss gconf libX11 libXrender libXtst libXdamage
         libXi libXext libXfixes libXcomposite alsaLib
       ];

  buildCommand = ''
    mkdir -p $out/bin/
    cd $out
    rpmextract $src
    patchelf \
      --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
      opt/bluejeans/bluejeans-bin
    patchelf \
      --set-rpath ${libPath} \
      opt/bluejeans/bluejeans-bin
    patchelf \
      --replace-needed libudev.so.0 libudev.so.1 \
      opt/bluejeans/bluejeans-bin
    ln -s $out/opt/bluejeans/bluejeans $out/bin/bluejeans
    substituteInPlace $out/bin/bluejeans \
      --replace '#!/bin/bash' '#!${bash}/bin/bash'
    chmod +x $out/bin/bluejeans
  '';

  meta = {
    description = "Video, audio, and web conferencing that works together with the collaboration tools you use every day.";
    license = stdenv.lib.licenses.unfree;
    platforms = [ "x86_64-linux" ];
  };
}