From 3b9e993adb4f3c463d1a8131d61f373d75d2a067 Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Mon, 2 Sep 2024 15:07:16 +0200 Subject: [PATCH 1/2] maintainers: add nezia --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 493e2848ddf0..0327afbfff7c 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -14660,6 +14660,12 @@ githubId = 7845120; name = "Alex Martens"; }; + nezia = { + email = "anthony@nezia.dev"; + github = "nezia1"; + githubId = 43719748; + name = "Anthony Rodriguez"; + }; ngerstle = { name = "Nicholas Gerstle"; email = "ngerstle@gmail.com"; From 0ffaf9bfca26065fe3fb13cc4624fe6ec500c699 Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Mon, 2 Sep 2024 19:12:11 +0200 Subject: [PATCH 2/2] bolt-launcher: init at 0.9.0 Added bolt-launcher, an alternative launcher for Runescape 3 / Old School Runescape. https://github.com/Adamcake/Bolt/releases/tag/0.9.0 bolt-launcher: add plugin loader for rs3 Building the app with luajit, which allows for Runescape 3 plugin loading. bolt-launcher: add runescape 3 dependencies Added Runescape 3 dependencies inside the buildFHSEnv, so that it can be used by the binary (downloaded from the internet by bolt-launcher itself, hence why the fhs env is needed here). bolt-launcher: fix dependency issues Added libbolt-plugin.so into $out/lib, which allows the program to use the Runescape 3 plugin loader. Also updated the mainProgram as well as runScript so that the program can be ran from nix run instead of just being able to be ran manually. Add feature flags for RS3 and HDOSAndRuneLite as well as .desktop and icon file support (#1) * Add enable flags for RS3 and HDOSAndRuneLite * Add .desktop and icon * Fix formatting w/ nixfmt * Remove enableHDOSAndRuneLite feature flag * Fix formatting Co-authored-by: Thomas King --- pkgs/by-name/bo/bolt-launcher/package.nix | 214 ++++++++++++++++++++++ 1 file changed, 214 insertions(+) create mode 100644 pkgs/by-name/bo/bolt-launcher/package.nix diff --git a/pkgs/by-name/bo/bolt-launcher/package.nix b/pkgs/by-name/bo/bolt-launcher/package.nix new file mode 100644 index 000000000000..aa14f6cd5911 --- /dev/null +++ b/pkgs/by-name/bo/bolt-launcher/package.nix @@ -0,0 +1,214 @@ +{ + lib, + stdenv, + fetchFromGitHub, + makeWrapper, + cmake, + ninja, + libarchive, + libz, + libcef, + luajit, + xorg, + mesa, + glib, + nss, + nspr, + atk, + at-spi2-atk, + libdrm, + expat, + libxkbcommon, + gtk3, + jdk17, + pango, + cairo, + alsa-lib, + dbus, + at-spi2-core, + cups, + systemd, + buildFHSEnv, + makeDesktopItem, + copyDesktopItems, + enableRS3 ? false, +}: +let + cef = libcef.overrideAttrs (oldAttrs: { + installPhase = + let + gl_rpath = lib.makeLibraryPath [ + stdenv.cc.cc.lib + ]; + rpath = lib.makeLibraryPath [ + glib + nss + nspr + atk + at-spi2-atk + libdrm + expat + xorg.libxcb + libxkbcommon + xorg.libX11 + xorg.libXcomposite + xorg.libXdamage + xorg.libXext + xorg.libXfixes + xorg.libXrandr + mesa + gtk3 + pango + cairo + alsa-lib + dbus + at-spi2-core + cups + xorg.libxshmfence + systemd + ]; + in + '' + mkdir -p $out/lib/ $out/share/cef/ + cp libcef_dll_wrapper/libcef_dll_wrapper.a $out/lib/ + cp -r ../Resources/* $out/lib/ + cp -r ../Release/* $out/lib/ + patchelf --set-rpath "${rpath}" $out/lib/libcef.so + patchelf --set-rpath "${gl_rpath}" $out/lib/libEGL.so + patchelf --set-rpath "${gl_rpath}" $out/lib/libGLESv2.so + cp ../Release/*.bin $out/share/cef/ + cp -r ../Resources/* $out/share/cef/ + cp -r ../include $out + cp -r ../libcef_dll $out + cp -r ../cmake $out + ''; + }); +in +let + bolt = stdenv.mkDerivation (finalAttrs: { + pname = "bolt-launcher"; + version = "0.9.0"; + + src = fetchFromGitHub { + owner = "AdamCake"; + repo = "bolt"; + rev = finalAttrs.version; + fetchSubmodules = true; + hash = "sha256-LIlRDcUWbQwIhFjtqYF+oVpTOPZ7IT0vMgysEVyJ1k8="; + }; + + nativeBuildInputs = [ + cmake + ninja + luajit + makeWrapper + copyDesktopItems + ]; + + buildInputs = [ + mesa + xorg.libX11 + xorg.libxcb + libarchive + libz + cef + jdk17 + ]; + + cmakeFlags = [ + "-D CMAKE_BUILD_TYPE=Release" + "-D BOLT_LUAJIT_INCLUDE_DIR=${luajit}/include" + "-G Ninja" + ]; + + preConfigure = '' + mkdir -p cef/dist/Release cef/dist/Resources cef/dist/include + + ln -s ${cef}/lib/* cef/dist/Release + + ln -s ${cef}/share/cef/*.pak cef/dist/Resources + ln -s ${cef}/share/cef/icudtl.dat cef/dist/Resources + ln -s ${cef}/share/cef/locales cef/dist/Resources + + ln -s ${cef}/include/* cef/dist/include + ln -s ${cef}/libcef_dll cef/dist/libcef_dll + + ln -s ${cef}/cmake cef/dist/cmake + ln -s ${cef}/CMakeLists.txt cef/dist + ''; + + postFixup = '' + makeWrapper "$out/opt/bolt-launcher/bolt" "$out/bin/${finalAttrs.pname}-${finalAttrs.version}" \ + --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 { + inherit (bolt) name version; + + targetPkgs = + pkgs: + [ bolt ] + ++ (with pkgs; [ + xorg.libSM + xorg.libXxf86vm + xorg.libX11 + glib + pango + cairo + gdk-pixbuf + libz + libcap + libsecret + 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."; + 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; + mainProgram = "${bolt.name}"; + }; +}