all: format .nix filex with nixfmt-rfc
This commit is contained in:
@@ -52,8 +52,8 @@ stdenv.mkDerivation {
|
||||
hash = "sha256-9WHiI2WlsgEhCPkrQoAunmF6lSb2n5RgQJ2+sdnSShM=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [makeWrapper];
|
||||
buildInputs = [dpkg];
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = [ dpkg ];
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
@@ -115,55 +115,57 @@ stdenv.mkDerivation {
|
||||
xorg.libxkbfile
|
||||
];
|
||||
|
||||
installPhase = let
|
||||
viberWrap = writeShellScriptBin "viberWrap" ''
|
||||
${bubblewrap}/bin/bwrap --bind / / \
|
||||
--dev /dev \
|
||||
--tmpfs $HOME \
|
||||
--bind $HOME/.ViberPC/ $HOME/.ViberPC \
|
||||
--bind $HOME/Downloads/ $HOME/Downloads \
|
||||
$@
|
||||
installPhase =
|
||||
let
|
||||
viberWrap = writeShellScriptBin "viberWrap" ''
|
||||
${bubblewrap}/bin/bwrap --bind / / \
|
||||
--dev /dev \
|
||||
--tmpfs $HOME \
|
||||
--bind $HOME/.ViberPC/ $HOME/.ViberPC \
|
||||
--bind $HOME/Downloads/ $HOME/Downloads \
|
||||
$@
|
||||
'';
|
||||
in
|
||||
''
|
||||
dpkg-deb -x $src $out
|
||||
mkdir -p $out/bin
|
||||
|
||||
# Soothe nix-build "suspicions"
|
||||
chmod -R g-w $out
|
||||
|
||||
for file in $(find $out -type f \( -perm /0111 -o -name \*.so\* \) ); do
|
||||
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$file" || true
|
||||
patchelf --set-rpath $libPath:$out/opt/viber/lib $file || true
|
||||
done
|
||||
|
||||
# qt.conf is not working, so override everything using environment variables
|
||||
wrapProgram $out/opt/viber/Viber \
|
||||
--set QT_PLUGIN_PATH "$out/opt/viber/plugins" \
|
||||
--set QT_XKB_CONFIG_ROOT "${xorg.xkeyboardconfig}/share/X11/xkb" \
|
||||
--set QTCOMPOSE "${xorg.libX11.out}/share/X11/locale" \
|
||||
--set QML2_IMPORT_PATH "$out/opt/viber/qml"
|
||||
|
||||
echo "#!${bash}/bin/bash" > $out/bin/viber
|
||||
echo "${viberWrap}/bin/viberWrap $out/opt/viber/Viber" >> $out/bin/viber
|
||||
chmod +x $out/bin/viber
|
||||
|
||||
mv $out/usr/share $out/share
|
||||
rm -rf $out/usr
|
||||
|
||||
# Fix the desktop link
|
||||
substituteInPlace $out/share/applications/viber.desktop \
|
||||
--replace /opt/viber/Viber $out/opt/viber/Viber \
|
||||
--replace /usr/share/ $out/share/
|
||||
'';
|
||||
in ''
|
||||
dpkg-deb -x $src $out
|
||||
mkdir -p $out/bin
|
||||
|
||||
# Soothe nix-build "suspicions"
|
||||
chmod -R g-w $out
|
||||
|
||||
for file in $(find $out -type f \( -perm /0111 -o -name \*.so\* \) ); do
|
||||
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$file" || true
|
||||
patchelf --set-rpath $libPath:$out/opt/viber/lib $file || true
|
||||
done
|
||||
|
||||
# qt.conf is not working, so override everything using environment variables
|
||||
wrapProgram $out/opt/viber/Viber \
|
||||
--set QT_PLUGIN_PATH "$out/opt/viber/plugins" \
|
||||
--set QT_XKB_CONFIG_ROOT "${xorg.xkeyboardconfig}/share/X11/xkb" \
|
||||
--set QTCOMPOSE "${xorg.libX11.out}/share/X11/locale" \
|
||||
--set QML2_IMPORT_PATH "$out/opt/viber/qml"
|
||||
|
||||
echo "#!${bash}/bin/bash" > $out/bin/viber
|
||||
echo "${viberWrap}/bin/viberWrap $out/opt/viber/Viber" >> $out/bin/viber
|
||||
chmod +x $out/bin/viber
|
||||
|
||||
mv $out/usr/share $out/share
|
||||
rm -rf $out/usr
|
||||
|
||||
# Fix the desktop link
|
||||
substituteInPlace $out/share/applications/viber.desktop \
|
||||
--replace /opt/viber/Viber $out/opt/viber/Viber \
|
||||
--replace /usr/share/ $out/share/
|
||||
'';
|
||||
dontStrip = true;
|
||||
dontPatchELF = true;
|
||||
|
||||
meta = {
|
||||
homepage = "https://www.viber.com";
|
||||
description = "An instant messaging and Voice over IP (VoIP) app";
|
||||
sourceProvenance = with lib.sourceTypes; [binaryNativeCode];
|
||||
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
||||
license = lib.licenses.unfree;
|
||||
platforms = ["x86_64-linux"];
|
||||
maintainers = with lib.maintainers; [jagajaga];
|
||||
platforms = [ "x86_64-linux" ];
|
||||
maintainers = with lib.maintainers; [ jagajaga ];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user