naps2: 7.5.3 -> 8.2.1 (#434597)

This commit is contained in:
Alexis Hildebrandt
2025-09-16 22:15:41 +02:00
committed by GitHub
4 changed files with 82 additions and 17 deletions
@@ -0,0 +1,14 @@
diff --git a/NAPS2.Lib/EtoForms/Ui/AboutForm.cs b/NAPS2.Lib/EtoForms/Ui/AboutForm.cs
--- a/NAPS2.Lib/EtoForms/Ui/AboutForm.cs
+++ b/NAPS2.Lib/EtoForms/Ui/AboutForm.cs
@@ -26,8 +26,8 @@ public class AboutForm : EtoDialogBase
_donateButton = C.Button(UiStrings.Donate, () => ProcessHelper.OpenUrl(DONATE_URL));
_donateButton.BackgroundColor = Color.FromRgb(0xfeda96);
_donateButton.TextColor = Color.FromRgb(0x1b464e);
- _donateButton.Font = new Font(_donateButton.Font.Family, _donateButton.Font.Size * 11 / 10,
- FontStyle.Italic | FontStyle.Bold);
+ try { _donateButton.Font = new Font(_donateButton.Font.Family, _donateButton.Font.Size * 11 / 10,
+ FontStyle.Italic | FontStyle.Bold); } catch {};
EtoPlatform.Current.ConfigureDonateButton(_donateButton);
_enableDebugLogging.Checked = config.Get(c => c.EnableDebugLogging);
+14
View File
@@ -0,0 +1,14 @@
diff --git a/NAPS2.Lib/EtoForms/Layout/C.cs b/NAPS2.Lib/EtoForms/Layout/C.cs
--- a/NAPS2.Lib/EtoForms/Layout/C.cs
+++ b/NAPS2.Lib/EtoForms/Layout/C.cs
@@ -121,8 +121,8 @@ public static class C
if (flags.HasFlag(ButtonFlags.LargeText))
{
var baseFontSize = button.Font.Size;
- EtoPlatform.Current.AttachDpiDependency(button,
- _ => button.Font = new Font(button.Font.Family, baseFontSize * 4 / 3));
+ EtoPlatform.Current.AttachDpiDependency(button, _ => {
+ try { button.Font = new Font(button.Font.Family, baseFontSize * 4 / 3); } catch {}});
}
EtoPlatform.Current.ConfigureImageButton(button, flags);
return button;
+36 -6
View File
@@ -159,6 +159,11 @@
"version": "2.1.30",
"hash": "sha256-5gx6yqwbWsWWKOmldsLnN5o8fXQf2rbSUknSEhs1c0w="
},
{
"pname": "Microsoft.NETCore.Platforms",
"version": "1.1.0",
"hash": "sha256-FeM40ktcObQJk4nMYShB61H/E8B7tIKfl9ObJ0IOcCM="
},
{
"pname": "Microsoft.NETCore.Platforms",
"version": "1.1.1",
@@ -174,6 +179,11 @@
"version": "1.1.0",
"hash": "sha256-0AqQ2gMS8iNlYkrD+BxtIg7cXMnr9xZHtKAuN4bjfaQ="
},
{
"pname": "Microsoft.NETCore.Targets",
"version": "1.1.3",
"hash": "sha256-WLsf1NuUfRWyr7C7Rl9jiua9jximnVvzy6nk2D2bVRc="
},
{
"pname": "Microsoft.NETCore.Targets",
"version": "2.0.0",
@@ -196,13 +206,13 @@
},
{
"pname": "NAPS2.NTwain",
"version": "1.0.0",
"hash": "sha256-jXpUVhX8c9CutPJH5Q2JvJjPBRrV6gI0yI/mA8PgDSE="
"version": "1.0.1",
"hash": "sha256-WSU/KBDz2zcnoYMH/38UsOMVB9+mOIJkqfKVzT58bGE="
},
{
"pname": "NAPS2.Pdfium.Binaries",
"version": "1.1.0",
"hash": "sha256-mg88JinIvTJZHtaPoEQbVsL5PBO5iUiNMvcQ4M2c2GY="
"version": "1.2.0",
"hash": "sha256-wbOjJzCnTm+hN4uQEY8glfeuL1R8WEYQm1/obZ9tLmM="
},
{
"pname": "NAPS2.PdfSharp",
@@ -211,8 +221,8 @@
},
{
"pname": "NAPS2.Tesseract.Binaries",
"version": "1.2.0",
"hash": "sha256-4rtFr6ydc+LRgYK7asVRnMSigI2iwU2poG6TJ52eKlQ="
"version": "1.4.0",
"hash": "sha256-cX+0nD7hLroL2pyRsB2mAErHLuG04B7fcm273BQpL5E="
},
{
"pname": "NAPS2.Wia",
@@ -389,6 +399,11 @@
"version": "4.3.0",
"hash": "sha256-2IhBv0i6pTcOyr8FFIyfPEaaCHUmJZ8DYwLUwJ+5waw="
},
{
"pname": "runtime.native.System.Security.Cryptography.OpenSsl",
"version": "4.3.0",
"hash": "sha256-Jy01KhtcCl2wjMpZWH+X3fhHcVn+SyllWFY8zWlz/6I="
},
{
"pname": "runtime.native.System.Security.Cryptography.OpenSsl",
"version": "4.3.2",
@@ -464,6 +479,11 @@
"version": "4.3.0",
"hash": "sha256-l8S9gt6dk3qYG6HYonHtdlYtBKyPb29uQ6NDjmrt3V4="
},
{
"pname": "SharpZipLib",
"version": "1.3.3",
"hash": "sha256-HWEQTKh9Ktwg/zIl079dAiH+ob2ShWFAqLgG6XgIMr4="
},
{
"pname": "SharpZipLib",
"version": "1.4.2",
@@ -474,6 +494,11 @@
"version": "1.3.1",
"hash": "sha256-FtRIcfLYXxUftEhq8kHgNNkahde6Fv2hPVGZNezCW1Y="
},
{
"pname": "SixLabors.Fonts",
"version": "1.0.0-beta17",
"hash": "sha256-KnHduFn5h/mtHCpCFKg+ZIZi6fKjz2H2sqTIzwXCqOI="
},
{
"pname": "SixLabors.Fonts",
"version": "1.0.1",
@@ -579,6 +604,11 @@
"version": "4.3.0",
"hash": "sha256-fVfgcoP4AVN1E5wHZbKBIOPYZ/xBeSIdsNF+bdukIRM="
},
{
"pname": "System.Private.Uri",
"version": "4.3.2",
"hash": "sha256-jB2+W3tTQ6D9XHy5sEFMAazIe1fu2jrENUO0cb48OgU="
},
{
"pname": "System.Reflection",
"version": "4.3.0",
+18 -11
View File
@@ -14,32 +14,31 @@
buildDotnetModule rec {
pname = "naps2";
version = "7.5.3";
version = "8.2.1";
src = fetchFromGitHub {
owner = "cyanfish";
repo = "naps2";
tag = "v${version}";
hash = "sha256-vX+ZyCQsYqJjgYaufWJRnzX8retiFK5QHSP40bbBaCc=";
hash = "sha256-1OPFWmy9eDRnMJjYdzYubgfde7MNix8ZsSuN2ZHsvco=";
};
patches = [
./01-donate-button.patch
./02-button-dpi.patch
];
projectFile = "NAPS2.App.Gtk/NAPS2.App.Gtk.csproj";
nugetDeps = ./deps.json;
postPatch = ''
substituteInPlace NAPS2.Images.Gtk/NAPS2.Images.Gtk.csproj \
--replace-fail TargetFramework TargetFrameworks \
'';
dotnetFlags = [
"-p:TargetFrameworks=net8"
"-p:EnablePreviewFeatures=true"
"-p:TargetFrameworks=net9"
];
executables = [ "naps2" ];
dotnet-sdk = dotnetCorePackages.sdk_8_0;
dotnet-runtime = dotnetCorePackages.runtime_8_0;
dotnet-sdk = dotnetCorePackages.sdk_9_0;
dotnet-runtime = dotnetCorePackages.runtime_9_0;
nativeBuildInputs = [ wrapGAppsHook3 ];
@@ -60,6 +59,14 @@ buildDotnetModule rec {
install -D NAPS2.Lib/Icons/scanner-64-rev2.png $out/share/icons/hicolor/64x64/apps/com.naps2.Naps2.png
install -D NAPS2.Lib/Icons/scanner-72-rev1.png $out/share/icons/hicolor/72x72/apps/com.naps2.Naps2.png
install -D NAPS2.Lib/Icons/scanner-128.png $out/share/icons/hicolor/128x128/apps/com.naps2.Naps2.png
case "${stdenv.hostPlatform.system}" in
x86_64-linux)
chmod a+x $out/lib/naps2/_linux/tesseract
;;
aarch64-linux)
chmod a+x $out/lib/naps2/_linuxarm/tesseract
;;
esac
'';
meta = {