net-p2p/classified-ads: Fix build w/ >=net-libs/miniupnpc-2.2.8

This was broken for a full year ...

Closes: https://bugs.gentoo.org/934332
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
This commit is contained in:
Andreas Sturmlechner
2025-07-28 23:54:12 +02:00
parent ae37e84ffb
commit c4934b4851
2 changed files with 50 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
# Copyright 1999-2024 Gentoo Authors
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -45,6 +45,8 @@ DEPEND="${RDEPEND}
BDEPEND="sys-devel/gettext
doc? ( app-text/doxygen )"
PATCHES=( "${FILESDIR}/${P}-miniupnpc-2.2.8.patch" ) # bug 934332, git master
src_prepare() {
# preprocessed graphics are unpacked into wrong directory
# so lets move them into correct location:

View File

@@ -0,0 +1,47 @@
https://github.com/operatornormal/classified-ads/commit/bfc61b0d41933f832451c288e3a36f87338afdc4
From bfc61b0d41933f832451c288e3a36f87338afdc4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Antti=20J=C3=A4rvinen?= <antti.jarvinen@katiska.org>
Date: Wed, 8 Jan 2025 21:23:22 +0200
Subject: [PATCH] Support for miniupnpc 2.2.8 see
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1076686 thanks for Yangfl
---
net/networklistener.cpp | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/net/networklistener.cpp b/net/networklistener.cpp
index 24eaa4c..42de839 100644
--- a/net/networklistener.cpp
+++ b/net/networklistener.cpp
@@ -1,7 +1,7 @@
/* -*-C++-*- -*-coding: utf-8-unix;-*-
- Classified Ads is Copyright (c) Antti Järvinen 2013.
+ Classified Ads is Copyright (c) Antti Järvinen 2013-2025.
- This file is part of Classified Ads.
+ This file is part of Classified Ads.
Classified Ads is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -9,7 +9,7 @@
version 2.1 of the License, or (at your option) any later version.
Classified Ads is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
@@ -291,7 +291,11 @@ void NetworkListener::figureOutLocalAddresses() {
char lan_address[64];
struct UPNPUrls upnp_urls;
struct IGDdatas upnp_data;
+#if (MINIUPNPC_API_VERSION >= 18)
+ int status = UPNP_GetValidIGD(upnp_dev, &upnp_urls, &upnp_data, lan_address, sizeof(lan_address), NULL, 0);
+#else
int status = UPNP_GetValidIGD(upnp_dev, &upnp_urls, &upnp_data, lan_address, sizeof(lan_address));
+#endif
// look up possible "status" values, the number "1" indicates a valid IGD was found
QLOG_STR("UPNP_GetValidIGD = " + QString::number(status)) ;
if ( status > 0 ) {