530f90d862
The motivation comes from PR #108787: AppImage is the official and using it should avoid some issues. Also, migrating both packages (instead of only rambox-pro like #108787) can make maintaining both packages better. There is now a `mkRambox` function that abstract most of the build process.
31 lines
884 B
Nix
31 lines
884 B
Nix
{ pname, version, src, meta, desktopName ? "Rambox" }:
|
|
|
|
{ appimageTools, stdenv, lib, fetchurl, makeDesktopItem }:
|
|
|
|
let
|
|
name = "${pname}-${version}";
|
|
|
|
desktopItem = (makeDesktopItem {
|
|
inherit desktopName;
|
|
name = pname;
|
|
exec = pname;
|
|
icon = pname;
|
|
type = "Application";
|
|
categories = "Network;";
|
|
});
|
|
|
|
appimageContents = appimageTools.extractType2 {
|
|
inherit name src;
|
|
};
|
|
in appimageTools.wrapType2 rec {
|
|
inherit name src meta;
|
|
|
|
extraInstallCommands = ''
|
|
mkdir -p $out/share/applications $out/share/icons/hicolor/256x256/apps
|
|
# CE uses rambox-<version>, Pro uses rambox
|
|
mv $out/bin/rambox* $out/bin/${pname}
|
|
install -Dm644 ${appimageContents}/usr/share/icons/hicolor/256x256/apps/rambox*.png $out/share/icons/hicolor/256x256/apps/${pname}.png
|
|
install -Dm644 ${desktopItem}/share/applications/* $out/share/applications
|
|
'';
|
|
}
|