[NixOS] Fix gitter derivation

This commit is contained in:
Ivan Malison 2018-07-13 17:52:59 -07:00
parent 0026359c8e
commit 35d25058bd
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8
2 changed files with 21 additions and 16 deletions

View File

@ -313,8 +313,7 @@ in
# Define a user account. Don't forget to set a password with passwd. # Define a user account. Don't forget to set a password with passwd.
users.extraUsers = let users.extraUsers = let
extraGroups = [ extraGroups = [
"wheel" "disk" "audio" "video" "wheel" "disk" "audio" "video" "networkmanager" "systemd-journal"
"networkmanager" "systemd-journal"
]; ];
userDefaults = { userDefaults = {
inherit extraGroups; inherit extraGroups;

View File

@ -5,7 +5,19 @@
, libnotify, libpulseaudio, libxcb, makeDesktopItem, makeWrapper, nspr, nss , libnotify, libpulseaudio, libxcb, makeDesktopItem, makeWrapper, nspr, nss
, nwjs, pango, systemd }: , nwjs, pango, systemd }:
stdenv.mkDerivation rec { let gitterDirectorySuffix = "opt/gitter";
doELFPatch = target: ''
patchelf --set-interpreter ${stdenv.cc.bintools.dynamicLinker} \
--set-rpath "$out/${gitterDirectorySuffix}/lib:${libPath}" \
$out/${gitterDirectorySuffix}/${target}
'';
libPath = stdenv.lib.makeLibraryPath [
alsaLib atk cairo cups dbus expat fontconfig freetype gdk_pixbuf glib
gnome3.gconf gtk3 libX11 libXScrnSaver libXcomposite libXcursor libXdamage
libXext libXfixes libXi libXrandr libXrender libXtst libappindicator-gtk3
libcxx libnotify libpulseaudio libxcb nspr nss pango stdenv.cc.cc systemd
];
in stdenv.mkDerivation rec {
pname = "gitter"; pname = "gitter";
version = "4.1.0"; version = "4.1.0";
name = "${pname}-${version}"; name = "${pname}-${version}";
@ -19,24 +31,18 @@ stdenv.mkDerivation rec {
unpackPhase = "dpkg -x $src ."; unpackPhase = "dpkg -x $src .";
libPath = stdenv.lib.makeLibraryPath [
alsaLib atk cairo cups dbus expat fontconfig freetype gdk_pixbuf glib
gnome3.gconf gtk3 libX11 libXScrnSaver libXcomposite libXcursor libXdamage
libXext libXfixes libXi libXrandr libXrender libXtst libappindicator-gtk3
libcxx libnotify libpulseaudio libxcb nspr nss pango stdenv.cc.cc systemd
];
gitterDirectorySuffix = "opt/gitter";
installPhase = '' installPhase = ''
mkdir -p $out/{bin,opt/gitter,share/pixmaps} mkdir -p $out/{bin,opt/gitter,share/pixmaps}
mv ./opt/Gitter/linux64/* $out/opt/gitter mv ./opt/Gitter/linux64/* $out/opt/gitter
patchelf --debug --set-interpreter ${stdenv.cc.bintools.dynamicLinker} \ ${doELFPatch "Gitter"}
--set-rpath "$out/${gitterDirectorySuffix}/lib:${libPath}" \ ${doELFPatch "nacl_helper"}
$out/${gitterDirectorySuffix}/Gitter ${doELFPatch "minidump_stackwalk"}
${doELFPatch "nwjc"}
${doELFPatch "chromedriver"}
${doELFPatch "payload"}
patchelf --debug --set-rpath "$out/${gitterDirectorySuffix}/lib:${libPath}" \ patchelf --set-rpath "$out/${gitterDirectorySuffix}/lib:${libPath}" \
$out/${gitterDirectorySuffix}/lib/libnw.so $out/${gitterDirectorySuffix}/lib/libnw.so
wrapProgram $out/${gitterDirectorySuffix}/Gitter --prefix LD_LIBRARY_PATH : ${libPath} wrapProgram $out/${gitterDirectorySuffix}/Gitter --prefix LD_LIBRARY_PATH : ${libPath}