From 07bf7cc418aff2502f53620552c71d71bb6facc5 Mon Sep 17 00:00:00 2001 From: ern775 Date: Wed, 18 Jun 2025 20:58:30 +0300 Subject: [PATCH] nero-umu: init at 1.1.1 --- pkgs/by-name/ne/nero-umu/nerofs.patch | 57 +++++++++++++ pkgs/by-name/ne/nero-umu/neroprefix.patch | 11 +++ pkgs/by-name/ne/nero-umu/package.nix | 99 +++++++++++++++++++++++ 3 files changed, 167 insertions(+) create mode 100644 pkgs/by-name/ne/nero-umu/nerofs.patch create mode 100644 pkgs/by-name/ne/nero-umu/neroprefix.patch create mode 100644 pkgs/by-name/ne/nero-umu/package.nix diff --git a/pkgs/by-name/ne/nero-umu/nerofs.patch b/pkgs/by-name/ne/nero-umu/nerofs.patch new file mode 100644 index 000000000000..cb310004970f --- /dev/null +++ b/pkgs/by-name/ne/nero-umu/nerofs.patch @@ -0,0 +1,57 @@ +--- a/src/nerofs.cpp ++++ b/src/nerofs.cpp +@@ -173,31 +173,19 @@ + + QString NeroFS::GetIcoextract() + { +- // TODO: this is for flexibility in sandboxed environments(?) +- // idk what the "good" path should be for Flatpak, so... +- if(QDir("/usr/bin").exists("icoextract")) { +- return "/usr/bin/icoextract"; +- } else return ""; ++ return QStandardPaths::findExecutable("icoextract"); + } + + + QString NeroFS::GetIcoutils() + { +- // TODO: this is for flexibility in sandboxed environments(?) +- // idk what the "good" path should be for Flatpak, so... +- if(QDir("/usr/bin").exists("icotool")) { +- return "/usr/bin/icotool"; +- } else return ""; ++ return QStandardPaths::findExecutable("icotool"); + } + + + QString NeroFS::GetUmU() + { +- // TODO: this is for flexibility in sandboxed environments(?) +- // idk what the "good" path should be for Flatpak, so... +- if(QDir("/usr/bin").exists("umu-run")) { +- return "/usr/bin/umu-run"; +- } else return ""; ++ return QStandardPaths::findExecutable("umu-run"); + } + + QString NeroFS::GetWinetricks(const QString &runner) +@@ -207,17 +195,13 @@ + return protonsPath.path() + '/' + runner + "/protonfixes/winetricks"; + else { + // fall back to system winetricks +- if(QDir("/usr/bin").exists("winetricks")) +- return "/usr/bin/winetricks"; +- else return ""; ++ return QStandardPaths::findExecutable("winetricks"); + } + } else if(QDir(protonsPath.path() + '/' + currentRunner + "/protonfixes").exists("winetricks")) + return protonsPath.path() + '/' + currentRunner + "/protonfixes/winetricks"; + else { + // fall back to system winetricks +- if(QDir("/usr/bin").exists("winetricks")) +- return "/usr/bin/winetricks"; +- else return ""; ++ return QStandardPaths::findExecutable("winetricks"); + } + } + diff --git a/pkgs/by-name/ne/nero-umu/neroprefix.patch b/pkgs/by-name/ne/nero-umu/neroprefix.patch new file mode 100644 index 000000000000..733237d6cdf6 --- /dev/null +++ b/pkgs/by-name/ne/nero-umu/neroprefix.patch @@ -0,0 +1,11 @@ +--- a/src/neroprefixsettings.cpp ++++ b/src/neroprefixsettings.cpp +@@ -598,7 +598,7 @@ + tmpDir.mkdir("nero-manager"); + QProcess process; + process.setWorkingDirectory(tmpDir.path()+"/nero-manager"); +- process.start("/usr/bin/curl", { "-o", "bridge.zip", "-L", "https://github.com/EnderIce2/rpc-bridge/releases/latest/download/bridge.zip" }); ++ process.start(QStandardPaths::findExecutable("curl"), { "-o", "bridge.zip", "-L", "https://github.com/EnderIce2/rpc-bridge/releases/latest/download/bridge.zip" }); + printf("Downloading Discord RPC Bridge...\n"); + + NeroPrefixSettingsWindow::blockSignals(true); diff --git a/pkgs/by-name/ne/nero-umu/package.nix b/pkgs/by-name/ne/nero-umu/package.nix new file mode 100644 index 000000000000..a0374f0925ad --- /dev/null +++ b/pkgs/by-name/ne/nero-umu/package.nix @@ -0,0 +1,99 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + pkg-config, + qt6, + qt6Packages, + icu, + icoextract, + icoutils, + umu-launcher, + winetricks, + curl, + mangohud, + gamescope, + gamemode, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "nero-umu"; + version = "1.1.1"; + + src = fetchFromGitHub { + owner = "SeongGino"; + repo = "Nero-umu"; + tag = "v${finalAttrs.version}"; + hash = "sha256-sX/Z/b5stauut8qg6IV/DdsCIkdx1N3+y1jwoXHr1LY="; + }; + + #Replace quazip git submodule with pre-packaged quazip + postUnpack = '' + rmdir source/lib/quazip/ + ln -s ${qt6Packages.quazip.src} source/lib/quazip + ''; + + nativeBuildInputs = [ + cmake + qt6.wrapQtAppsHook + pkg-config + ]; + + buildInputs = [ + qt6.qtbase + qt6.qttools + qt6.qt5compat + qt6Packages.quazip + icu + ]; + + runtimeDeps = [ + icoextract + icoutils + winetricks + curl + umu-launcher + mangohud + gamescope + gamemode + ]; + + cmakeFlags = [ + (lib.cmakeFeature "NERO_QT_VERSION" "Qt6") + ]; + + #Fixes to be able to find binaries for nix + patches = [ + ./nerofs.patch + ./neroprefix.patch + ]; + + installPhase = '' + runHook preInstall + install -Dm755 "nero-umu" "$out/bin/nero-umu" + for size in 32 48 64 128; do + install -Dm644 "$src/img/ico/ico_"$size".png" "$out/share/icons/hicolor/"$size"x"$size"/apps/xyz.TOS.Nero.png" + done + install -Dm644 "$src/xyz.TOS.Nero.desktop" "$out/share/applications/xyz.TOS.Nero.desktop" + runHook postInstall + ''; + + preFixup = '' + qtWrapperArgs+=( + --prefix PATH : ${lib.makeBinPath finalAttrs.runtimeDeps} + ) + ''; + + meta = { + homepage = "https://github.com/SeongGino/Nero-umu"; + description = "Fast and efficient Proton prefix runner and manager using umu as backend"; + license = lib.licenses.gpl3Plus; + mainProgram = "nero-umu"; + platforms = [ "x86_64-linux" ]; + maintainers = with lib.maintainers; [ + ern775 + blghnks + keenanweaver + ]; + }; +})