From a714be76007bc66d023a558b1e62c20abb2cc0f5 Mon Sep 17 00:00:00 2001 From: huantian Date: Thu, 17 Nov 2022 18:12:54 -0700 Subject: [PATCH] r2modman: init at 3.1.39 --- pkgs/tools/games/r2modman/default.nix | 55 +++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 57 insertions(+) create mode 100644 pkgs/tools/games/r2modman/default.nix diff --git a/pkgs/tools/games/r2modman/default.nix b/pkgs/tools/games/r2modman/default.nix new file mode 100644 index 0000000000000..d4c3e371ab7ff --- /dev/null +++ b/pkgs/tools/games/r2modman/default.nix @@ -0,0 +1,55 @@ +{ lib, stdenv, fetchurl, dpkg, makeWrapper, steam-run }: + +stdenv.mkDerivation rec { + pname = "r2modman"; + version = "3.1.39"; + + src = fetchurl { + url = "https://github.com/ebkr/r2modmanPlus/releases/download/v${version}/r2modman_${version}_amd64.deb "; + sha256 = "sha256-Wy3C7acAD5g//DVua+8v3jGF3qHXnu/3vR2e0wcHCKk="; + }; + + nativeBuildInputs = [ + dpkg + makeWrapper + ]; + + unpackCmd = "dpkg -x $curSrc src"; + + installPhase = '' + runHook preInstall + + mkdir $out + cp -r opt/ usr/share/ $out + + mkdir $out/bin + ln -s $out/opt/r2modman/r2modman $out/bin/ + + substituteInPlace $out/share/applications/r2modman.desktop \ + --replace /opt/ $out/opt/ + + runHook postInstall + ''; + + # Wrap program with steam-run, as it needs steam's dependencies + # to interact with steam and run games. + postFixup = '' + mv $out/opt/r2modman/r2modman $out/opt/r2modman/.r2modman-unwrapped + makeWrapper ${steam-run}/bin/steam-run $out/opt/r2modman/r2modman \ + --add-flags $out/opt/r2modman/.r2modman-unwrapped \ + --add-flags --no-sandbox \ + --prefix LD_LIBRARY_PATH : $out/opt/r2modman \ + --argv0 r2modman + ''; + + meta = with lib; { + description = "A simple and easy to use mod manager for several games using Thunderstore"; + homepage = "https://github.com/ebkr/r2modmanPlus"; + downloadPage = "https://github.com/ebkr/r2modmanPlus/releases"; + changelog = "https://github.com/ebkr/r2modmanPlus/releases/tag/v${version}"; + license = licenses.mit; + maintainers = with maintainers; [ huantian ]; + platforms = [ "x86_64-linux" ]; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9a756970de6d7..58c104e35d6f3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1407,6 +1407,8 @@ with pkgs; quich = callPackage ../tools/misc/quich { } ; + r2modman = callPackage ../tools/games/r2modman { }; + redfang = callPackage ../tools/networking/redfang { }; scarab = callPackage ../tools/games/scarab { };