Merge pull request #75269 from cawilliamson/master

rambox-pro: fix missing icons, autostart and clean up dir layout
This commit is contained in:
Jörg Thalheim 2020-05-20 09:29:20 +01:00 committed by GitHub
commit 7182b94bd6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,22 +16,31 @@ stdenv.mkDerivation rec {
}; };
installPhase = '' installPhase = ''
mkdir -p $out/bin $out/opt/RamboxPro $out/share/applications mkdir -p $out/{bin,resources/dist/renderer/assets/images/app,share/applications,share/icons/hicolor/256x256/apps}
asar e resources/app.asar $out/opt/RamboxPro/resources/app.asar.unpacked
ln -s ${desktopItem}/share/applications/* $out/share/applications asar e resources/app.asar $out/resources
substituteInPlace "$out/resources/dist/electron/main.js" \
--replace ",isHidden:" ",path:\"$out/bin/ramboxpro\",isHidden:"
cp $desktopItem/share/applications/* $out/share/applications
cp $out/resources/dist/electron/imgs/256x256.png $out/share/icons/hicolor/256x256/apps/ramboxpro.png
cp $out/resources/dist/electron/imgs/256x256.png $out/resources/dist/renderer/assets/images/app/icon.png
''; '';
postFixup = '' postFixup = ''
makeWrapper ${electron}/bin/electron $out/bin/ramboxpro \ makeWrapper ${electron}/bin/electron $out/bin/ramboxpro \
--add-flags "$out/opt/RamboxPro/resources/app.asar.unpacked --without-update" \ --add-flags "$out/resources --without-update" \
--prefix PATH : ${xdg_utils}/bin --prefix PATH : ${xdg_utils}/bin
''; '';
desktopItem = makeDesktopItem { desktopItem = makeDesktopItem {
name = "rambox-pro"; name = "rambox-pro";
exec = "ramboxpro"; exec = "ramboxpro";
icon = "ramboxpro";
type = "Application"; type = "Application";
desktopName = "Rambox Pro"; desktopName = "Rambox Pro";
categories = "Network;";
}; };
meta = with stdenv.lib; { meta = with stdenv.lib; {