Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature flags for RS3 and HDOSAndRuneLite as well as .desktop and icon file support #1

Merged
merged 5 commits into from
Dec 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 44 additions & 7 deletions pkgs/by-name/bo/bolt-launcher/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
ninja,
libarchive,
libz,
jdk17,
libcef,
luajit,
xorg,
Expand All @@ -21,6 +20,7 @@
expat,
libxkbcommon,
gtk3,
jdk17,
pango,
cairo,
alsa-lib,
Expand All @@ -29,6 +29,9 @@
cups,
systemd,
buildFHSEnv,
makeDesktopItem,
copyDesktopItems,
enableRS3 ? false,
}:
let
cef = libcef.overrideAttrs (oldAttrs: {
Expand Down Expand Up @@ -99,6 +102,7 @@ let
ninja
luajit
makeWrapper
copyDesktopItems
];

buildInputs = [
Expand Down Expand Up @@ -135,11 +139,26 @@ let

postFixup = ''
makeWrapper "$out/opt/bolt-launcher/bolt" "$out/bin/${finalAttrs.pname}-${finalAttrs.version}" \
--set JAVA_HOME "${jdk17}"
ls -al $out/bin
--set JAVA_HOME ${jdk17}
mkdir -p $out/lib
cp $out/usr/local/lib/libbolt-plugin.so $out/lib
mkdir -p $out/share/icons/hicolor/256x256/apps
cp ../icon/256.png $out/share/icons/hicolor/256x256/apps/${finalAttrs.pname}.png
'';

desktopItems = [
(makeDesktopItem {
type = "Application";
terminal = false;
name = "Bolt";
desktopName = "Bolt Launcher";
genericName = finalAttrs.pname;
comment = "An alternative launcher for RuneScape";
exec = "${finalAttrs.pname}-${finalAttrs.version}";
icon = finalAttrs.pname;
categories = [ "Game" ];
})
];
});
in
buildFHSEnv {
Expand All @@ -156,19 +175,37 @@ buildFHSEnv {
pango
cairo
gdk-pixbuf
gtk2-x11
libz
libcap
libsecret
openssl_1_1
SDL2
libGL
]);
])
++ lib.optionals enableRS3 (
with pkgs;
[
gtk2-x11
openssl_1_1
]
);

extraInstallCommands = ''
mkdir -p $out/share/applications
mkdir -p $out/share/icons/hicolor/256x256/apps

ln -s ${bolt}/share/applications/*.desktop $out/share/applications/

ln -s ${bolt}/share/icons/hicolor/256x256/apps/*.png $out/share/icons/hicolor/256x256/apps/
'';

runScript = "${bolt.name}";

meta = {
homepage = "https://github.com/Adamcake/Bolt";
description = "An alternative launcher for RuneScape";
description = "An alternative launcher for RuneScape.";
longDescription = ''
Bolt Launcher supports HDOS/RuneLite by default with an optional feature flag for RS3 (enableRS3).
'';
license = lib.licenses.agpl3Plus;
maintainers = with lib.maintainers; [ nezia ];
platforms = lib.platforms.linux;
Expand Down
Loading