nixpkgs/pkgs/applications/networking/instant-messengers/hipchat/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

89 lines
2.3 KiB
Nix

{ lib, stdenv, fetchurl, xorg, freetype, fontconfig, openssl, glib, nss, nspr, expat
, alsaLib, dbus, zlib, libxml2, libxslt, makeWrapper, xkeyboard_config, systemd
, libGL, xcbutilkeysyms, xdg_utils, libtool }:
let
version = "4.30.5.1682";
rpath = stdenv.lib.makeLibraryPath [
xdg_utils
xorg.libXext
xorg.libSM
xorg.libICE
xorg.libX11
xorg.libXrandr
xorg.libXdamage
xorg.libXrender
xorg.libXfixes
xorg.libXcomposite
xorg.libXcursor
xorg.libxcb
xorg.libXi
xorg.libXScrnSaver
xorg.libXtst
freetype
fontconfig
openssl
glib
nss
nspr
dbus
alsaLib
zlib
libtool
libxml2
libxslt
expat
xcbutilkeysyms
systemd
libGL
] + ":${stdenv.cc.cc.lib}/lib64";
in stdenv.mkDerivation {
pname = "hipchat";
inherit version;
src = fetchurl {
url = "https://atlassian.artifactoryonline.com/artifactory/hipchat-apt-client/pool/HipChat4-${version}-Linux.deb";
sha256 = "03pz8wskafn848yvciq29kwdvqcgjrk6sjnm8nk9acl89xf0sn96";
};
buildInputs = [ makeWrapper ];
buildCommand = ''
ar x $src
tar xfvz data.tar.gz
mkdir -p $out/libexec/hipchat
d=$out/libexec/hipchat/lib
mv opt/HipChat4/* $out/libexec/hipchat/
mv usr/share $out
for file in $(find $d -type f); do
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $file || true
patchelf --set-rpath ${rpath}:$out/libexec/hipchat/lib:\$ORIGIN $file || true
done
patchShebangs $d/linuxbrowserlaunch.sh
substituteInPlace $out/share/applications/hipchat4.desktop \
--replace /opt/HipChat4/bin/HipChat4 $out/bin/hipchat
makeWrapper $d/HipChat.bin $out/bin/hipchat \
--run 'export HIPCHAT_LD_LIBRARY_PATH=$LD_LIBRARY_PATH' \
--run 'export HIPCHAT_QT_PLUGIN_PATH=$QT_PLUGIN_PATH' \
--set QT_XKB_CONFIG_ROOT ${xkeyboard_config}/share/X11/xkb \
--set QTWEBENGINEPROCESS_PATH $d/QtWebEngineProcess
makeWrapper $d/QtWebEngineProcess.bin $d/QtWebEngineProcess \
--set QT_PLUGIN_PATH "$d/plugins"
'';
meta = with lib; {
description = "Desktop client for HipChat services";
homepage = "http://www.hipchat.com";
license = licenses.unfree;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ puffnfresh ];
};
}