From 47c0dd6a45e1370943f81260c5cfc2fc39a3c742 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Wed, 21 Aug 2024 11:09:32 +0100 Subject: [PATCH] nexusmods-app: define new constants - `NEXUSMODS_APP_USE_SYSTEM_EXTRACTOR` - `INSTALLATION_METHOD_PACKAGE_MANAGER` --- pkgs/by-name/ne/nexusmods-app/package.nix | 26 ++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/ne/nexusmods-app/package.nix b/pkgs/by-name/ne/nexusmods-app/package.nix index f950e0ba0a191..f16e6868a6813 100644 --- a/pkgs/by-name/ne/nexusmods-app/package.nix +++ b/pkgs/by-name/ne/nexusmods-app/package.nix @@ -47,6 +47,8 @@ buildDotnetModule rec { ''; postPatch = '' + # We still need this for the tests, even though we build with NEXUSMODS_APP_USE_SYSTEM_EXTRACTOR + # See https://github.com/Nexus-Mods/NexusMods.App/issues/1836 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 @@ -59,7 +61,10 @@ buildDotnetModule rec { "--set APPIMAGE ${placeholder "out"}/bin/${meta.mainProgram}" ]; - runtimeInputs = [ desktop-file-utils ]; + runtimeInputs = [ + _7zz + desktop-file-utils + ]; runtimeDeps = [ fontconfig @@ -70,6 +75,25 @@ buildDotnetModule rec { executables = [ meta.mainProgram ]; + # FIXME: should some of these go in dotnetTestFlags and/or dotnetFlags? + dotnetBuildFlags = + let + # From https://nexus-mods.github.io/NexusMods.App/developers/Contributing/#for-package-maintainers + constants = [ + # Tell the app it is a distro package; affects wording in update prompts + "INSTALLATION_METHOD_PACKAGE_MANAGER" + + # Don't include upstream's 7zz binary; we use the nixpkgs version + "NEXUSMODS_APP_USE_SYSTEM_EXTRACTOR" + ]; + in + [ + # From https://github.com/Nexus-Mods/NexusMods.App/blob/v0.5.3/src/NexusMods.App/app.pupnet.conf#L38 + "--property:Version=${version}" + "--property:TieredCompilation=true" + "--property:DefineConstants=${lib.strings.concatStringsSep "%3B" constants}" + ]; + doCheck = true; dotnetTestFlags = [