git: 0a6cda3b68cb - 2022Q4 - net/opennx: Fix build on armv7

From: Nuno Teixeira <eduardo_at_FreeBSD.org>
Date: Tue, 08 Nov 2022 02:17:15 UTC
The branch 2022Q4 has been updated by eduardo:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0a6cda3b68cba83831c6e5f9fb434e8f892e7d2a

commit 0a6cda3b68cba83831c6e5f9fb434e8f892e7d2a
Author:     Robert Clausecker <fuz@fuz.su>
AuthorDate: 2022-11-08 01:35:21 +0000
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2022-11-08 01:41:07 +0000

    net/opennx: Fix build on armv7
    
    time_t is a long long on armv7, but OpenNX tries to store time stamps
    into configuration storage that only eats long variables.  Cast to long
    and cross fingers that nobody is going to use this port past 2036.
    
    PR:             267618
    Approved by:    portmgr (blanket: build fix)
    MFH:            2022Q4
    
    (cherry picked from commit dceaf660a726b36ac871827a7bbb70b89930f049)
---
 net/opennx/Makefile                  |  2 +-
 net/opennx/files/patch-opennxApp.cpp | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/net/opennx/Makefile b/net/opennx/Makefile
index 74975922a905..3ef59e488b5c 100644
--- a/net/opennx/Makefile
+++ b/net/opennx/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	opennx
 PORTVERSION=	0.16.0.729
-PORTREVISION=	10
+PORTREVISION=	11
 CATEGORIES=	net
 MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/CI-source
 
diff --git a/net/opennx/files/patch-opennxApp.cpp b/net/opennx/files/patch-opennxApp.cpp
new file mode 100644
index 000000000000..a4a805af02e6
--- /dev/null
+++ b/net/opennx/files/patch-opennxApp.cpp
@@ -0,0 +1,22 @@
+--- opennxApp.cpp.orig	2022-11-07 09:51:49 UTC
++++ opennxApp.cpp
+@@ -759,7 +759,7 @@ void opennxApp::checkNxSmartCardSupport()
+ #endif
+     if (!fn.FileExists())
+         return;
+-    time_t last_mtime;
++    long last_mtime;
+     long last_size;
+     time_t mtime = fn.GetModificationTime().GetTicks();
+     long size = fn.GetSize().ToULong();
+@@ -767,8 +767,8 @@ void opennxApp::checkNxSmartCardSupport()
+     wxConfigBase::Get()->Read(wxT("Config/NxSshSize"), &last_size, 0);
+     wxConfigBase::Get()->Read(wxT("Config/NxSshSmartCardSupport"), &m_bNxSmartCardSupport, false);
+ 
+-    if ((mtime != last_mtime) || (size != last_size)) {
+-        wxConfigBase::Get()->Write(wxT("Config/NxSshStamp"), mtime);
++    if ((mtime != (time_t)last_mtime) || (size != last_size)) {
++        wxConfigBase::Get()->Write(wxT("Config/NxSshStamp"), (long)mtime);
+         wxConfigBase::Get()->Write(wxT("Config/NxSshSize"), size);
+         wxString nxsshcmd = fn.GetShortPath();
+         nxsshcmd << wxT(" -I 0 -V");