naps2: 7.5.3 -> 8.2.1

Update NAPS2 from version 7.5.3 to version 8.2.1.

Release notes:
https://github.com/cyanfish/naps2/blob/master/CHANGELOG.md
https://github.com/cyanfish/naps2/releases/tag/v8.2.1

Change to File Permissions:
The file `$out/lib/naps2/_linux/tesseract` was present in v7.5.3, but
for OCR in the NAPS2 binary to work the file needs to be executable.
This has been implemented in this commit.
(_linux is _linuxarm on aarch64-linux)

Application of Patch 01-donate-button.patch:
The following upstream commit https://github.com/cyanfish/naps2/commit/13aab9806b20c7bca23811f48f3d0cd32fbc2139
changed the format of the Donate Button in the About Dialog form from
an image to text. The setting of the font can fail if the font is not
installed and thus the dialog is not shown. As such, try to update the
font and if it fails, fallback to the originally set font.

Application of Patch 02-button-dpi.patch:
When attempting to use the "Email PDF" button, the setting of the font
to be dpi aware can fail if the font is not installed and thus the
dialog is not shown. As such, try to update the font and if it fails,
fallback to the originally set font.

Removal of postPatch:
The patch is no longer required.

+82 -17
+14
pkgs/by-name/na/naps2/01-donate-button.patch
··· 1 + diff --git a/NAPS2.Lib/EtoForms/Ui/AboutForm.cs b/NAPS2.Lib/EtoForms/Ui/AboutForm.cs 2 + --- a/NAPS2.Lib/EtoForms/Ui/AboutForm.cs 3 + +++ b/NAPS2.Lib/EtoForms/Ui/AboutForm.cs 4 + @@ -26,8 +26,8 @@ public class AboutForm : EtoDialogBase 5 + _donateButton = C.Button(UiStrings.Donate, () => ProcessHelper.OpenUrl(DONATE_URL)); 6 + _donateButton.BackgroundColor = Color.FromRgb(0xfeda96); 7 + _donateButton.TextColor = Color.FromRgb(0x1b464e); 8 + - _donateButton.Font = new Font(_donateButton.Font.Family, _donateButton.Font.Size * 11 / 10, 9 + - FontStyle.Italic | FontStyle.Bold); 10 + + try { _donateButton.Font = new Font(_donateButton.Font.Family, _donateButton.Font.Size * 11 / 10, 11 + + FontStyle.Italic | FontStyle.Bold); } catch {}; 12 + EtoPlatform.Current.ConfigureDonateButton(_donateButton); 13 + 14 + _enableDebugLogging.Checked = config.Get(c => c.EnableDebugLogging);
+14
pkgs/by-name/na/naps2/02-button-dpi.patch
··· 1 + diff --git a/NAPS2.Lib/EtoForms/Layout/C.cs b/NAPS2.Lib/EtoForms/Layout/C.cs 2 + --- a/NAPS2.Lib/EtoForms/Layout/C.cs 3 + +++ b/NAPS2.Lib/EtoForms/Layout/C.cs 4 + @@ -121,8 +121,8 @@ public static class C 5 + if (flags.HasFlag(ButtonFlags.LargeText)) 6 + { 7 + var baseFontSize = button.Font.Size; 8 + - EtoPlatform.Current.AttachDpiDependency(button, 9 + - _ => button.Font = new Font(button.Font.Family, baseFontSize * 4 / 3)); 10 + + EtoPlatform.Current.AttachDpiDependency(button, _ => { 11 + + try { button.Font = new Font(button.Font.Family, baseFontSize * 4 / 3); } catch {}}); 12 + } 13 + EtoPlatform.Current.ConfigureImageButton(button, flags); 14 + return button;
+36 -6
pkgs/by-name/na/naps2/deps.json
··· 161 161 }, 162 162 { 163 163 "pname": "Microsoft.NETCore.Platforms", 164 + "version": "1.1.0", 165 + "hash": "sha256-FeM40ktcObQJk4nMYShB61H/E8B7tIKfl9ObJ0IOcCM=" 166 + }, 167 + { 168 + "pname": "Microsoft.NETCore.Platforms", 164 169 "version": "1.1.1", 165 170 "hash": "sha256-8hLiUKvy/YirCWlFwzdejD2Db3DaXhHxT7GSZx/znJg=" 166 171 }, ··· 173 178 "pname": "Microsoft.NETCore.Targets", 174 179 "version": "1.1.0", 175 180 "hash": "sha256-0AqQ2gMS8iNlYkrD+BxtIg7cXMnr9xZHtKAuN4bjfaQ=" 181 + }, 182 + { 183 + "pname": "Microsoft.NETCore.Targets", 184 + "version": "1.1.3", 185 + "hash": "sha256-WLsf1NuUfRWyr7C7Rl9jiua9jximnVvzy6nk2D2bVRc=" 176 186 }, 177 187 { 178 188 "pname": "Microsoft.NETCore.Targets", ··· 196 206 }, 197 207 { 198 208 "pname": "NAPS2.NTwain", 199 - "version": "1.0.0", 200 - "hash": "sha256-jXpUVhX8c9CutPJH5Q2JvJjPBRrV6gI0yI/mA8PgDSE=" 209 + "version": "1.0.1", 210 + "hash": "sha256-WSU/KBDz2zcnoYMH/38UsOMVB9+mOIJkqfKVzT58bGE=" 201 211 }, 202 212 { 203 213 "pname": "NAPS2.Pdfium.Binaries", 204 - "version": "1.1.0", 205 - "hash": "sha256-mg88JinIvTJZHtaPoEQbVsL5PBO5iUiNMvcQ4M2c2GY=" 214 + "version": "1.2.0", 215 + "hash": "sha256-wbOjJzCnTm+hN4uQEY8glfeuL1R8WEYQm1/obZ9tLmM=" 206 216 }, 207 217 { 208 218 "pname": "NAPS2.PdfSharp", ··· 211 221 }, 212 222 { 213 223 "pname": "NAPS2.Tesseract.Binaries", 214 - "version": "1.2.0", 215 - "hash": "sha256-4rtFr6ydc+LRgYK7asVRnMSigI2iwU2poG6TJ52eKlQ=" 224 + "version": "1.4.0", 225 + "hash": "sha256-cX+0nD7hLroL2pyRsB2mAErHLuG04B7fcm273BQpL5E=" 216 226 }, 217 227 { 218 228 "pname": "NAPS2.Wia", ··· 391 401 }, 392 402 { 393 403 "pname": "runtime.native.System.Security.Cryptography.OpenSsl", 404 + "version": "4.3.0", 405 + "hash": "sha256-Jy01KhtcCl2wjMpZWH+X3fhHcVn+SyllWFY8zWlz/6I=" 406 + }, 407 + { 408 + "pname": "runtime.native.System.Security.Cryptography.OpenSsl", 394 409 "version": "4.3.2", 395 410 "hash": "sha256-xqF6LbbtpzNC9n1Ua16PnYgXHU0LvblEROTfK4vIxX8=" 396 411 }, ··· 463 478 "pname": "runtime.unix.System.Runtime.Extensions", 464 479 "version": "4.3.0", 465 480 "hash": "sha256-l8S9gt6dk3qYG6HYonHtdlYtBKyPb29uQ6NDjmrt3V4=" 481 + }, 482 + { 483 + "pname": "SharpZipLib", 484 + "version": "1.3.3", 485 + "hash": "sha256-HWEQTKh9Ktwg/zIl079dAiH+ob2ShWFAqLgG6XgIMr4=" 466 486 }, 467 487 { 468 488 "pname": "SharpZipLib", ··· 476 496 }, 477 497 { 478 498 "pname": "SixLabors.Fonts", 499 + "version": "1.0.0-beta17", 500 + "hash": "sha256-KnHduFn5h/mtHCpCFKg+ZIZi6fKjz2H2sqTIzwXCqOI=" 501 + }, 502 + { 503 + "pname": "SixLabors.Fonts", 479 504 "version": "1.0.1", 480 505 "hash": "sha256-fox6f9Z5xunVXiy71KTSkb0DirMN00tuUlChyp96kiI=" 481 506 }, ··· 578 603 "pname": "System.Private.Uri", 579 604 "version": "4.3.0", 580 605 "hash": "sha256-fVfgcoP4AVN1E5wHZbKBIOPYZ/xBeSIdsNF+bdukIRM=" 606 + }, 607 + { 608 + "pname": "System.Private.Uri", 609 + "version": "4.3.2", 610 + "hash": "sha256-jB2+W3tTQ6D9XHy5sEFMAazIe1fu2jrENUO0cb48OgU=" 581 611 }, 582 612 { 583 613 "pname": "System.Reflection",
+18 -11
pkgs/by-name/na/naps2/package.nix
··· 14 14 15 15 buildDotnetModule rec { 16 16 pname = "naps2"; 17 - version = "7.5.3"; 17 + version = "8.2.1"; 18 18 19 19 src = fetchFromGitHub { 20 20 owner = "cyanfish"; 21 21 repo = "naps2"; 22 22 tag = "v${version}"; 23 - hash = "sha256-vX+ZyCQsYqJjgYaufWJRnzX8retiFK5QHSP40bbBaCc="; 23 + hash = "sha256-1OPFWmy9eDRnMJjYdzYubgfde7MNix8ZsSuN2ZHsvco="; 24 24 }; 25 25 26 + patches = [ 27 + ./01-donate-button.patch 28 + ./02-button-dpi.patch 29 + ]; 30 + 26 31 projectFile = "NAPS2.App.Gtk/NAPS2.App.Gtk.csproj"; 27 32 nugetDeps = ./deps.json; 28 33 29 - postPatch = '' 30 - substituteInPlace NAPS2.Images.Gtk/NAPS2.Images.Gtk.csproj \ 31 - --replace-fail TargetFramework TargetFrameworks \ 32 - ''; 33 - 34 34 dotnetFlags = [ 35 - "-p:TargetFrameworks=net8" 36 - "-p:EnablePreviewFeatures=true" 35 + "-p:TargetFrameworks=net9" 37 36 ]; 38 37 39 38 executables = [ "naps2" ]; 40 39 41 - dotnet-sdk = dotnetCorePackages.sdk_8_0; 42 - dotnet-runtime = dotnetCorePackages.runtime_8_0; 40 + dotnet-sdk = dotnetCorePackages.sdk_9_0; 41 + dotnet-runtime = dotnetCorePackages.runtime_9_0; 43 42 44 43 nativeBuildInputs = [ wrapGAppsHook3 ]; 45 44 ··· 60 59 install -D NAPS2.Lib/Icons/scanner-64-rev2.png $out/share/icons/hicolor/64x64/apps/com.naps2.Naps2.png 61 60 install -D NAPS2.Lib/Icons/scanner-72-rev1.png $out/share/icons/hicolor/72x72/apps/com.naps2.Naps2.png 62 61 install -D NAPS2.Lib/Icons/scanner-128.png $out/share/icons/hicolor/128x128/apps/com.naps2.Naps2.png 62 + case "${stdenv.hostPlatform.system}" in 63 + x86_64-linux) 64 + chmod a+x $out/lib/naps2/_linux/tesseract 65 + ;; 66 + aarch64-linux) 67 + chmod a+x $out/lib/naps2/_linuxarm/tesseract 68 + ;; 69 + esac 63 70 ''; 64 71 65 72 meta = {