nexusmods-app: refactor "unfree" variant

Use `override` to pass a `_7zz` with RAR support to the package, instead
of having an `enableUnfree` package argument.

Use a different `pname` on the unfree package.

Use `_7zz.meta.unfree` internally.
This commit is contained in:
Matt Sturgeon 2024-07-31 20:09:14 +01:00
parent e54e9fac95
commit 1148136d36
No known key found for this signature in database
GPG Key ID: 4F91844CED1A8299
2 changed files with 7 additions and 9 deletions

View File

@ -12,13 +12,10 @@
libX11,
nexusmods-app,
runCommand,
enableUnfree ? false, # Set to true to support RAR format mods
pname ? "nexusmods-app",
}:
let
_7zzWithOptionalUnfreeRarSupport = _7zz.override { inherit enableUnfree; };
in
buildDotnetModule rec {
pname = "nexusmods-app";
inherit pname;
version = "0.4.1";
src = fetchFromGitHub {
@ -50,7 +47,7 @@ buildDotnetModule rec {
'';
postPatch = ''
ln --force --symbolic "${lib.getExe _7zzWithOptionalUnfreeRarSupport}" src/ArchiveManagement/NexusMods.FileExtractor/runtimes/linux-x64/native/7zz
ln --force --symbolic "${lib.getExe _7zz}" src/ArchiveManagement/NexusMods.FileExtractor/runtimes/linux-x64/native/7zz
# for some reason these tests fail (intermittently?) with a zero timestamp
touch tests/NexusMods.UI.Tests/WorkspaceSystem/*.verified.png
@ -84,7 +81,7 @@ buildDotnetModule rec {
"FullyQualifiedName!=NexusMods.UI.Tests.ImageCacheTests.Test_LoadAndCache_RemoteImage"
"FullyQualifiedName!=NexusMods.UI.Tests.ImageCacheTests.Test_LoadAndCache_ImageStoredFile"
]
++ lib.optionals (!enableUnfree) [
++ lib.optionals (!_7zz.meta.unfree) [
"FullyQualifiedName!=NexusMods.Games.FOMOD.Tests.FomodXmlInstallerTests.InstallsFilesSimple_UsingRar"
]
)

View File

@ -18792,8 +18792,9 @@ with pkgs;
nix-build-uncached = callPackage ../development/tools/misc/nix-build-uncached { };
nexusmods-app-unfree = callPackage ../by-name/ne/nexusmods-app/package.nix {
enableUnfree = true;
nexusmods-app-unfree = nexusmods-app.override {
pname = "nexusmods-app-unfree";
_7zz = _7zz-rar;
};
nmrpflash = callPackage ../development/embedded/nmrpflash { };