git: dd79365119e0 - main - graphics/qgis: Use gettid patch from qgis project

From: Rainer Hurling <rhurlin_at_FreeBSD.org>
Date: Mon, 24 Mar 2025 20:30:52 UTC
The branch main has been updated by rhurlin:

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

commit dd79365119e0d84102e50a08887fb46655b1869e
Author:     Rainer Hurling <rhurlin@FreeBSD.org>
AuthorDate: 2025-03-24 20:12:03 +0000
Commit:     Rainer Hurling <rhurlin@FreeBSD.org>
CommitDate: 2025-03-24 20:30:35 +0000

    graphics/qgis: Use gettid patch from qgis project
    
    A few hours after the commit of v3.42.0 of the QGIS port, a suitable
    patch [1] was published in the main branch of the QGIS project, which
    represents a more general solution for the replacement of the
    linux-centric gettid().
    
    [1] https://github.com/qgis/QGIS/commit/00c4fa69116bda5a40af1dfc2ed194f9aec08d52
---
 graphics/qgis/Makefile                             |  1 +
 .../patch-src_server_qgsfcgiserverresponse.cpp     | 23 +++++++++-------------
 2 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/graphics/qgis/Makefile b/graphics/qgis/Makefile
index 191ac5a4d28e..1b1c136ce4cf 100644
--- a/graphics/qgis/Makefile
+++ b/graphics/qgis/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	qgis
 DISTVERSION=	3.42.1
+PORTREVISION=	1
 CATEGORIES=	graphics geography
 MASTER_SITES=	https://qgis.org/downloads/
 
diff --git a/graphics/qgis/files/patch-src_server_qgsfcgiserverresponse.cpp b/graphics/qgis/files/patch-src_server_qgsfcgiserverresponse.cpp
index f937936314dc..b3b51509b523 100644
--- a/graphics/qgis/files/patch-src_server_qgsfcgiserverresponse.cpp
+++ b/graphics/qgis/files/patch-src_server_qgsfcgiserverresponse.cpp
@@ -1,24 +1,19 @@
 --- src/server/qgsfcgiserverresponse.cpp.orig	2025-03-21 12:35:59 UTC
 +++ src/server/qgsfcgiserverresponse.cpp
-@@ -31,6 +31,7 @@
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <chrono>
-+#include <pthread_np.h>
+@@ -23,6 +23,7 @@
+ #include "qgsmessagelog.h"
+ #include <fcgi_stdio.h>
+ #include <QDebug>
++#include <QThread>
  
- //
- // QgsFCGXStreamData copied from libfcgi FCGX_Stream_Data
-@@ -114,7 +115,12 @@ void QgsSocketMonitoringThread::run()
+ #include "qgslogger.h"
+ 
+@@ -114,7 +115,7 @@ void QgsSocketMonitoringThread::run()
    }
  
  #if defined( Q_OS_UNIX ) && !defined( Q_OS_ANDROID )
 -  const pid_t threadId = gettid();
-+  // https://github.com/qgis/QGIS/commit/6ecc1c31c95894199b88b56f8023e74807743957
-+  #if !defined (__FreeBSD__)
-+    const pid_t threadId = gettid();
-+  #else
-+    const pid_t threadId = pthread_getthreadid_np();
-+  #endif
++  quint64 threadId = reinterpret_cast<quint64>( QThread::currentThreadId() );
  
    mShouldStop.store( false );
    char c;