Merge pull request #326402 from emilazy/miniupnpc-2.2.8-again

miniupnpc: 2.2.7 -> 2.2.8, again
This commit is contained in:
Doron Behar
2024-07-12 09:22:33 +03:00
committed by GitHub
39 changed files with 773 additions and 281 deletions
@@ -2,6 +2,7 @@
, stdenv
, mkDerivation
, fetchFromGitHub
, fetchpatch2
, pkg-config
, cmake
, openssl
@@ -34,6 +35,14 @@ mkDerivation rec {
hash = "sha256-+9uBmmdQ/shWYnJ7tM+Y8OgqYcQHHI2qeMw2tl1lE+w=";
};
patches = [
# upnp: add compatibility for miniupnpc 2.2.8
(fetchpatch2 {
url = "https://github.com/Bitcoin-ABC/bitcoin-abc/commit/5678070f182124a1a8c7c60873d1877094be76ab.patch?full_index=1";
hash = "sha256-QC7TlWepVxQuIZVTbGtQy+HmmXP8PWNhJWdVYudJvmI=";
})
];
nativeBuildInputs = [ pkg-config cmake ];
buildInputs = [
openssl
@@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchurl
, fetchpatch2
, autoreconfHook
, pkg-config
, util-linux
@@ -32,6 +33,14 @@ stdenv.mkDerivation rec {
hash = "sha256-PqpePDna2gpCzF2K43N4h6cV5Y9w/e5ZcUvaNEaFaIk=";
};
patches = [
# upnp: add compatibility for miniupnpc 2.2.8
(fetchpatch2 {
url = "https://github.com/bitcoinknots/bitcoin/commit/643014424359a4783cf9c73bee3346ac2f04e713.patch?full_index=1";
hash = "sha256-FdLoNH3+ZZTbqrwRvhbAeJuGz4SgnIvoWUBzRxjfzs8=";
})
];
nativeBuildInputs =
[ autoreconfHook pkg-config ]
++ lib.optionals stdenv.isLinux [ util-linux ]
@@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchurl
, fetchpatch2
, autoreconfHook
, pkg-config
, installShellFiles
@@ -43,6 +44,14 @@ stdenv.mkDerivation rec {
sha256 = "0c1051fd921b8fae912f5c2dfd86b085ab45baa05cd7be4585b10b4d1818f3da";
};
patches = [
# upnp: fix build with miniupnpc 2.2.8
(fetchpatch2 {
url = "https://github.com/bitcoin/bitcoin/commit/8acdf66540834b9f9cf28f16d389e8b6a48516d5.patch?full_index=1";
hash = "sha256-oDvHUvwAEp0LJCf6QBESn38Bu359TcPpLhvuLX3sm6M=";
})
];
nativeBuildInputs =
[ autoreconfHook pkg-config installShellFiles ]
++ lib.optionals stdenv.isLinux [ util-linux ]
@@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch2
, autoreconfHook
, pkg-config
, util-linux
@@ -33,6 +34,14 @@ stdenv.mkDerivation rec {
sha256 = "sha256-qHtSgfZGZ4Beu5fsJAOZm8ejj7wfHBbOS6WAjOrCuw4=";
};
patches = [
# upnp: fix build with miniupnpc 2.2.8
(fetchpatch2 {
url = "https://github.com/bitcoin/bitcoin/commit/8acdf66540834b9f9cf28f16d389e8b6a48516d5.patch?full_index=1";
hash = "sha256-oDvHUvwAEp0LJCf6QBESn38Bu359TcPpLhvuLX3sm6M=";
})
];
nativeBuildInputs =
[ autoreconfHook pkg-config ]
++ lib.optionals stdenv.isLinux [ util-linux ]
@@ -20,13 +20,13 @@
stdenv.mkDerivation rec {
pname = "gridcoin-research";
version = "5.4.8.0";
version = "5.4.8.0-hotfix-1";
src = fetchFromGitHub {
owner = "gridcoin-community";
repo = "Gridcoin-Research";
rev = "${version}";
sha256 = "sha256-HZirzXkqM2aep+wq8k2UCFWHPtN0sBZXjamgt7RYPBo=";
hash = "sha256-e58GJNiZq4LP/HTeveTQD6APeTvUbhUTwMwhU+PiVc0=";
};
nativeBuildInputs = [
@@ -2,6 +2,7 @@
, stdenv
, fetchurl
, fetchFromGitHub
, fetchpatch2
, autoreconfHook
, pkg-config
, installShellFiles
@@ -41,6 +42,14 @@ stdenv.mkDerivation rec {
sha256 = "0f6vi2k5xvjrhiazfjcd4aj246dfcg51xsnqb9wdjl41cg0ckwmf";
};
patches = [
# upnp: add compatibility for miniupnpc 2.2.8
(fetchpatch2 {
url = "https://github.com/Groestlcoin/groestlcoin/commit/8acdf66540834b9f9cf28f16d389e8b6a48516d5.patch?full_index=1";
hash = "sha256-oDvHUvwAEp0LJCf6QBESn38Bu359TcPpLhvuLX3sm6M=";
})
];
nativeBuildInputs = [ autoreconfHook pkg-config installShellFiles ]
++ lib.optionals stdenv.isLinux [ util-linux ]
++ lib.optionals stdenv.isDarwin [ hexdump ]
@@ -1,9 +1,10 @@
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config
{ lib, stdenv, fetchFromGitHub, cmake, ninja, pkg-config
, boost, miniupnpc, openssl, unbound
, zeromq, pcsclite, readline, libsodium, hidapi
, randomx, rapidjson, easyloggingpp
, CoreData, IOKit, PCSC
, trezorSupport ? true, libusb1, protobuf, python3
, monero-cli
}:
stdenv.mkDerivation rec {
@@ -18,9 +19,7 @@ stdenv.mkDerivation rec {
fetchSubmodules = true;
};
patches = [
./use-system-libraries.patch
];
inherit (monero-cli) patches;
postPatch = ''
# remove vendored libraries
@@ -29,7 +28,7 @@ stdenv.mkDerivation rec {
cp -r . $source
'';
nativeBuildInputs = [ cmake pkg-config ];
nativeBuildInputs = [ cmake ninja pkg-config ];
buildInputs = [
boost miniupnpc openssl unbound
@@ -1,94 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fb71d2d..3a710a4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -364,10 +364,10 @@ if(NOT MANUAL_SUBMODULES)
endfunction ()
message(STATUS "Checking submodules")
- check_submodule(external/miniupnp)
- check_submodule(external/rapidjson)
+ # check_submodule(external/miniupnp)
+ # check_submodule(external/rapidjson)
check_submodule(external/trezor-common)
- check_submodule(external/randomx)
+ # check_submodule(external/randomx)
check_submodule(external/supercop)
endif()
endif()
@@ -300,7 +300,8 @@ endif()
# elseif(CMAKE_SYSTEM_NAME MATCHES ".*BSDI.*")
# set(BSDI TRUE)
-include_directories(external/rapidjson/include external/easylogging++ src contrib/epee/include external)
+include_directories(external/easylogging++ src contrib/epee/include external)
+#include_directories(external/rapidjson/include external/easylogging++ src contrib/epee/include external)
if(APPLE)
include_directories(SYSTEM /usr/include/malloc)
diff --git a/cmake/FindMiniupnpc.cmake b/cmake/FindMiniupnpc.cmake
index ad2004a..7f4bb68 100644
--- a/cmake/FindMiniupnpc.cmake
+++ b/cmake/FindMiniupnpc.cmake
@@ -37,7 +37,7 @@ set(MINIUPNP_STATIC_LIBRARIES ${MINIUPNP_STATIC_LIBRARY})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
- MiniUPnPc DEFAULT_MSG
+ Miniupnpc DEFAULT_MSG
MINIUPNP_INCLUDE_DIR
MINIUPNP_LIBRARY
)
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
index 71b165f..10189ce 100644
--- a/external/CMakeLists.txt
+++ b/external/CMakeLists.txt
@@ -37,21 +37,9 @@
find_package(Miniupnpc REQUIRED)
-message(STATUS "Using in-tree miniupnpc")
-set(UPNPC_NO_INSTALL TRUE CACHE BOOL "Disable miniupnp installation" FORCE)
-add_subdirectory(miniupnp/miniupnpc)
-set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external")
-set_property(TARGET libminiupnpc-static PROPERTY POSITION_INDEPENDENT_CODE ON)
-if(MSVC)
- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267")
-elseif(NOT MSVC)
- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value")
-endif()
-if(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -D_NETBSD_SOURCE")
-endif()
-
-set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE)
+set(UPNP_STATIC false PARENT_SCOPE)
+set(UPNP_INCLUDE ${MINIUPNP_INCLUDE_DIR} PARENT_SCOPE)
+set(UPNP_LIBRARIES ${MINIUPNP_LIBRARY} PARENT_SCOPE)
find_package(Unbound)
@@ -69,5 +69,4 @@ endif()
add_subdirectory(db_drivers)
add_subdirectory(easylogging++)
add_subdirectory(qrcodegen)
-add_subdirectory(randomx EXCLUDE_FROM_ALL)
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
index c626e22..be570ed 100644
--- a/src/p2p/net_node.inl
+++ b/src/p2p/net_node.inl
@@ -60,9 +60,9 @@
#include "cryptonote_core/cryptonote_core.h"
#include "net/parse.h"
-#include <miniupnp/miniupnpc/miniupnpc.h>
-#include <miniupnp/miniupnpc/upnpcommands.h>
-#include <miniupnp/miniupnpc/upnperrors.h>
+#include <miniupnpc/miniupnpc.h>
+#include <miniupnpc/upnpcommands.h>
+#include <miniupnpc/upnperrors.h>
#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net.p2p"
@@ -1,4 +1,4 @@
{ lib, stdenv, mkDerivation, fetchFromGitHub, fetchpatch
{ lib, stdenv, mkDerivation, fetchFromGitHub, fetchpatch, fetchpatch2
, pkg-config, autoreconfHook
, openssl, db48, boost, zlib, miniupnpc
, glib, protobuf, util-linux, qrencode
@@ -34,6 +34,13 @@ mkDerivation rec {
url = "https://github.com/litecoin-project/litecoin/commit/6d1adb19aa79a8e8e140582759515bbd76816aa0.patch";
hash = "sha256-1y4Iz2plMw5HMAjl9x50QQpYrYaUd2WKrrAcUnQmlBY=";
})
# net: add compatibility for miniupnpc 2.2.8
# https://github.com/litecoin-project/litecoin/pull/971
(fetchpatch2 {
url = "https://github.com/litecoin-project/litecoin/commit/5dddffa3e1bbcc7a3e6963b4860ba2d675ca847b.patch?full_index=1";
hash = "sha256-F5GcL1RM91l04WrS3qYlV5zEcwyXrcRdmLLCqu1Hop0=";
})
];
nativeBuildInputs = [ pkg-config autoreconfHook ];
@@ -1,39 +0,0 @@
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, unbound, openssl, boost
, lmdb, miniupnpc, readline, git, libsodium, rapidjson, cppzmq }:
stdenv.mkDerivation rec {
pname = "masari";
version = "unstable-2022-10-09";
src = fetchFromGitHub {
owner = "masari-project";
repo = "masari";
rev = "ff71f52220858b84a4403dab9a14339bcad57826";
sha256 = "sha256-GunNFqZNgpLfyAA9BiBC98axgTQuK76z3BUl5T0iJqs=";
};
postPatch = ''
# remove vendored libraries
rm -r external/{miniupnpc,rapidjson}
# include missing headers
sed -i "1i #include <map>" src/device/device_default.hpp
sed -i "1i #include <boost/mpl/contains.hpp>" contrib/epee/include/storages/portable_storage.h
'';
nativeBuildInputs = [ cmake pkg-config git ];
buildInputs = [
boost miniupnpc openssl unbound
readline libsodium
rapidjson cppzmq
];
meta = with lib; {
description = "scalability-focused, untraceable, secure, and fungible cryptocurrency using the RingCT protocol";
homepage = "https://www.getmasari.org/";
license = licenses.bsd3;
maintainers = with maintainers; [ matthewcroughan ];
platforms = platforms.linux;
};
}
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config
{ lib, stdenv, fetchFromGitHub, fetchpatch2, cmake, ninja, pkg-config
, boost, miniupnpc, openssl, unbound
, zeromq, pcsclite, readline, libsodium, hidapi
, randomx, rapidjson
@@ -35,6 +35,28 @@ stdenv.mkDerivation rec {
};
patches = [
# cmake: remove unused/extera cmake/FindMiniupnpc.cmake and only rely on external/miniupnpc
# https://github.com/monero-project/monero/pull/9366
(fetchpatch2 {
url = "https://github.com/monero-project/monero/commit/5074a543a49f7e23fb39b6462fd4c4c9741c3693.patch?full_index=1";
hash = "sha256-dS2hhEU6m2of0ULlsf+/tZMHUmq3vGGXJPGHvtnpQnY=";
})
# cmake: add different parameters to add_monero_library.
# https://github.com/monero-project/monero/pull/9367
(fetchpatch2 {
url = "https://github.com/monero-project/monero/commit/b91ead90254ac6d6daf908f689c38e372a44c615.patch?full_index=1";
hash = "sha256-DL2YqkvEONbeEDqLOAo2eSF5JF5gOzKcLKeNlUXBY1w=";
})
# external: update miniupnpc to 2.2.8
# https://github.com/monero-project/monero/pull/9367
(fetchpatch2 {
url = "https://github.com/monero-project/monero/commit/d81da086ec5088a04b3f7b34831e72910300e2f7.patch?full_index=1";
hash = "sha256-ZJGiDMk5DMmEXwzoUYPC+DIoebluFh54kMQtQU78ckI=";
excludes = [ "external/miniupnp" ];
})
./use-system-libraries.patch
];
@@ -47,7 +69,7 @@ stdenv.mkDerivation rec {
cp -r . $source
'';
nativeBuildInputs = [ cmake pkg-config ];
nativeBuildInputs = [ cmake ninja pkg-config ];
buildInputs = [
boost miniupnpc openssl unbound
@@ -1,14 +1,14 @@
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
index 5b7f69a56..5536debe8 100644
index f8b834ac17...520e148428 100644
--- a/external/CMakeLists.txt
+++ b/external/CMakeLists.txt
@@ -36,22 +36,9 @@
# others.
@@ -39,23 +39,12 @@
add_compile_options(-D_GNU_SOURCE)
endif()
find_package(Miniupnpc REQUIRED)
-
-message(STATUS "Using in-tree miniupnpc")
-set(UPNPC_NO_INSTALL TRUE CACHE BOOL "Disable miniupnp installation" FORCE)
-set(UPNPC_BUILD_TESTS FALSE CACHE BOOL "Disable miniupnp internal tests." FORCE)
-add_subdirectory(miniupnp/miniupnpc)
-set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external")
-set_property(TARGET libminiupnpc-static PROPERTY POSITION_INDEPENDENT_CODE ON)
@@ -20,33 +20,19 @@ index 5b7f69a56..5536debe8 100644
-if(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -D_NETBSD_SOURCE")
-endif()
-
-set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE)
+set(UPNP_STATIC false PARENT_SCOPE)
+set(UPNP_INCLUDE ${MINIUPNP_INCLUDE_DIR} PARENT_SCOPE)
+set(UPNP_LIBRARIES ${MINIUPNP_LIBRARY} PARENT_SCOPE)
+include(FindPkgConfig)
+pkg_check_modules(MINIUPNPC REQUIRED IMPORTED_TARGET GLOBAL miniupnpc)
+get_target_property(MINIUPNPC_INCLUDE_DIR PkgConfig::MINIUPNPC INTERFACE_INCLUDE_DIRECTORIES)
+set_target_properties(PkgConfig::MINIUPNPC PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${MINIUPNPC_INCLUDE_DIR}/miniupnpc")
+set(UPNP_LIBRARIES PkgConfig::MINIUPNPC PARENT_SCOPE)
-set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE)
-
find_package(Unbound)
@@ -69,4 +56,3 @@ endif()
if(NOT UNBOUND_INCLUDE_DIR)
@@ -72,4 +61,3 @@
add_subdirectory(db_drivers)
add_subdirectory(easylogging++)
add_subdirectory(qrcodegen)
-add_subdirectory(randomx EXCLUDE_FROM_ALL)
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
index d4b39869c..13071d898 100644
--- a/src/p2p/net_node.inl
+++ b/src/p2p/net_node.inl
@@ -61,9 +61,9 @@
#include "cryptonote_core/cryptonote_core.h"
#include "net/parse.h"
-#include <miniupnp/miniupnpc/miniupnpc.h>
-#include <miniupnp/miniupnpc/upnpcommands.h>
-#include <miniupnp/miniupnpc/upnperrors.h>
+#include <miniupnpc/miniupnpc.h>
+#include <miniupnpc/upnpcommands.h>
+#include <miniupnpc/upnperrors.h>
#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net.p2p"
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, openssl, boost, libevent, autoreconfHook, db4, miniupnpc, eject, pkg-config, hexdump }:
{ lib, stdenv, fetchFromGitHub, fetchpatch2, openssl, boost, libevent, autoreconfHook, db4, miniupnpc, eject, pkg-config, hexdump }:
stdenv.mkDerivation rec {
pname = "namecoind";
@@ -11,6 +11,14 @@ stdenv.mkDerivation rec {
sha256 = "sha256-2KMK5Vb8osuaKbzI1aaPSYg+te+v9CEcGUkrVI6Fk54=";
};
patches = [
# upnp: add compatibility for miniupnpc 2.2.8
(fetchpatch2 {
url = "https://github.com/namecoin/namecoin-core/commit/8acdf66540834b9f9cf28f16d389e8b6a48516d5.patch?full_index=1";
hash = "sha256-oDvHUvwAEp0LJCf6QBESn38Bu359TcPpLhvuLX3sm6M=";
})
];
nativeBuildInputs = [
autoreconfHook
pkg-config
@@ -4,6 +4,7 @@
, boost
, db48
, fetchFromGitHub
, fetchpatch2
, libevent
, miniupnpc
, openssl
@@ -25,6 +26,14 @@ stdenv.mkDerivation rec {
hash = "sha256-RxkLt+7u+r5jNwEWiArTUpZ8ykYwWtvIDFXTSKhGN/w=";
};
patches = [
# upnp: fix build with miniupnpc 2.2.8
(fetchpatch2 {
url = "https://github.com/bitcoin/bitcoin/commit/8acdf66540834b9f9cf28f16d389e8b6a48516d5.patch?full_index=1";
hash = "sha256-oDvHUvwAEp0LJCf6QBESn38Bu359TcPpLhvuLX3sm6M=";
})
];
nativeBuildInputs = [ pkg-config autoreconfHook ];
buildInputs = [ openssl db48 boost zlib miniupnpc libevent zeromq unixtools.hexdump python3 ];
@@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch2
, cmake
, pkg-config
, makeWrapper
@@ -27,6 +28,14 @@ stdenv.mkDerivation rec {
fetchSubmodules = true;
};
patches = [
# miniupnp: add support for api version 18
(fetchpatch2 {
url = "https://github.com/flyinghead/flycast/commit/71982eda7a038e24942921e558845103b6c12326.patch?full_index=1";
hash = "sha256-5fFCgX7MfCqW7zxXJuHt9js+VTZZKEQHRYuWh7MTKzI=";
})
];
nativeBuildInputs = [
cmake
pkg-config
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, bzip2, libX11
{ lib, stdenv, fetchFromGitHub, fetchpatch2, cmake, pkg-config, bzip2, libX11
, mkDerivation, qtbase, qttools, qtmultimedia, qtscript
, libiconv, pcre-cpp, libidn, lua5, miniupnpc, aspell, gettext, perl }:
@@ -13,6 +13,13 @@ mkDerivation rec {
sha256 = "sha256-JmAopXFS6MkxW0wDQ1bC/ibRmWgOpzU0971hcqAehLU=";
};
patches = [
(fetchpatch2 {
url = "https://github.com/eiskaltdcpp/eiskaltdcpp/commit/5ab5e1137a46864b6ecd1ca302756da8b833f754.patch?full_index=1";
hash = "sha256-GIdcIHKXNSbHxbiMGRPgfq2w/zNSfR/FhyyXayFWfg8=";
})
];
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ qtbase qttools qtmultimedia qtscript bzip2 libX11 pcre-cpp libidn lua5 miniupnpc aspell gettext
(perl.withPackages (p: with p; [
@@ -1,12 +0,0 @@
diff --git a/libretroshare/src/util/rsdir.cc b/libretroshare/src/util/rsdir.cc
index 8556b8198..d63699216 100644
--- a/libretroshare/src/util/rsdir.cc
+++ b/libretroshare/src/util/rsdir.cc
@@ -47,6 +47,7 @@
#include <fstream>
#include <stdexcept>
+#include <filesystem>
#if defined(WIN32) || defined(__CYGWIN__)
#include "util/rsstring.h"
@@ -1,5 +1,4 @@
{ lib, mkDerivation, fetchFromGitHub
, fetchpatch
{ lib, stdenv, mkDerivation, fetchFromGitHub, fetchpatch2
, qmake, cmake, pkg-config, miniupnpc, bzip2
, speex, libmicrohttpd, libxml2, libxslt, sqlcipher, rapidjson, libXScrnSaver
, qtbase, qtx11extras, qtmultimedia, libgnome-keyring
@@ -7,13 +6,13 @@
mkDerivation rec {
pname = "retroshare";
version = "0.6.6";
version = "0.6.7.2";
src = fetchFromGitHub {
owner = "RetroShare";
repo = "RetroShare";
rev = "v${version}";
sha256 = "1hsymbhsfgycj39mdkrdp2hgq8irmvxa4a6jx2gg339m1fgf2xmh";
hash = "sha256-1A1YvOWIiWlP1JPUTg5Z/lxVGCBv4tCPf5sZdPogitU=";
fetchSubmodules = true;
};
@@ -21,13 +20,13 @@ mkDerivation rec {
# The build normally tries to get git sub-modules during build
# but we already have them checked out
./no-submodules.patch
./cpp-filesystem.patch
# Fix gcc-13 build failure
(fetchpatch {
name = "gcc-13.patch";
url = "https://github.com/RetroShare/RetroShare/commit/e1934fd9b03cd52c556eb06d94fb5d68b649592e.patch";
hash = "sha256-oqxQAsD4fmkWAH2kSVmmed/q0LzTW/iqUU1SgYNdFyk=";
# Support the miniupnpc-2.2.8 API change
(fetchpatch2 {
url = "https://github.com/RetroShare/libretroshare/commit/f1b89c4f87d77714571b4135c301bf0429096a20.patch?full_index=1";
hash = "sha256-UiZMsUFaOZTLj/dx1rLr5bTR1CQ6nt2+IygQdvwJqwc=";
stripLen = 1;
extraPrefix = "libretroshare/";
})
];
@@ -48,6 +47,15 @@ mkDerivation rec {
"RS_EXTRA_VERSION="
];
postPatch = ''
# Build libsam3 as C, not C++. No, I have no idea why it tries to
# do that, either.
substituteInPlace libretroshare/src/libretroshare.pro \
--replace-fail \
"LIBSAM3_MAKE_PARAMS =" \
"LIBSAM3_MAKE_PARAMS = CC=$CC AR=$AR"
'';
postInstall = ''
# BT DHT bootstrap
cp libbitdht/src/bitdht/bdboot.txt $out/share/retroshare
@@ -1,8 +1,9 @@
Submodule libretroshare contains modified content
diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro
index 84d18944e..71aeb67d2 100644
index 923f878c..ef00f3d7 100644
--- a/libretroshare/src/libretroshare.pro
+++ b/libretroshare/src/libretroshare.pro
@@ -870,20 +870,14 @@ rs_jsonapi {
@@ -930,20 +930,14 @@ rs_jsonapi {
genrestbedlib.variable_out = PRE_TARGETDEPS
win32-g++:isEmpty(QMAKE_SH) {
genrestbedlib.commands = \
@@ -28,7 +29,7 @@ index 84d18944e..71aeb67d2 100644
mkdir -p $${RESTBED_BUILD_PATH} &&
}
genrestbedlib.commands += \
@@ -991,14 +985,9 @@ rs_broadcast_discovery {
@@ -1063,14 +1057,9 @@ rs_broadcast_discovery {
udpdiscoverycpplib.variable_out = PRE_TARGETDEPS
win32-g++:isEmpty(QMAKE_SH) {
udpdiscoverycpplib.commands = \
@@ -44,8 +45,26 @@ index 84d18944e..71aeb67d2 100644
}
udpdiscoverycpplib.commands += \
cd $$shell_path($${UDP_DISCOVERY_BUILD_PATH}) && \
@@ -1106,15 +1095,13 @@ rs_sam3_libsam3 {
win32-g++:isEmpty(QMAKE_SH) {
LIBSAM3_MAKE_PARAMS = CC=gcc
libsam3.commands = \
- cd /D $$shell_path($${RS_SRC_PATH}) && git submodule update --init supportlibs/libsam3 || cd . $$escape_expand(\\n\\t) \
+ cd /D $$shell_path($${RS_SRC_PATH}) && cd . $$escape_expand(\\n\\t) \
$(CHK_DIR_EXISTS) $$shell_path($$LIBSAM3_BUILD_PATH) $(MKDIR) $$shell_path($${LIBSAM3_BUILD_PATH}) $$escape_expand(\\n\\t) \
$(COPY_DIR) $$shell_path($${LIBSAM3_SRC_PATH}) $$shell_path($${LIBSAM3_BUILD_PATH}) || cd . $$escape_expand(\\n\\t)
} else {
LIBSAM3_MAKE_PARAMS =
libsam3.commands = \
- cd $${RS_SRC_PATH} && ( \
- git submodule update --init supportlibs/libsam3 || \
- true ) && \
+ cd $${RS_SRC_PATH} && \
mkdir -p $${LIBSAM3_BUILD_PATH} && \
(cp -r $${LIBSAM3_SRC_PATH}/* $${LIBSAM3_BUILD_PATH} || true) &&
}
diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro
index 654efd170..06cba9ba3 100644
index d73117b84..b2fc6799a 100644
--- a/retroshare-gui/src/retroshare-gui.pro
+++ b/retroshare-gui/src/retroshare-gui.pro
@@ -66,10 +66,7 @@ rs_gui_cmark {
@@ -1,6 +1,7 @@
{ stdenv
, lib
, fetchFromGitHub
, fetchpatch2
, cmake
, pkg-config
, python3
@@ -69,6 +70,20 @@ stdenv.mkDerivation (finalAttrs: {
fetchSubmodules = true;
};
patches = [
(fetchpatch2 {
url = "https://github.com/transmission/transmission/commit/febfe49ca3ecab1a7142ecb34012c1f0b2bcdee8.patch?full_index=1";
hash = "sha256-Ge0+AXf/ilfMieGBAdvvImY7JOb0gGIdeKprC37AROs=";
excludes = [
# The submodule that we don't use (we use our miniupnp)
"third-party/miniupnp"
# Hunk fails for this one, but we don't care because we don't rely upon
# xcode definitions even for the Darwin build.
"Transmission.xcodeproj/project.pbxproj"
];
})
];
outputs = [ "out" "apparmor" ];
cmakeFlags = [
@@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch2
, intltool
, pkg-config
, wrapGAppsHook3
@@ -19,6 +20,15 @@ stdenv.mkDerivation {
hash = "sha256-RWnNjpgXRYncz9ID8zirENffy1UsfHD1H6Mmd8DKN4k=";
};
patches = [
# Fix build with miniupnpc 2.2.8
# https://github.com/Holarse-Linuxgaming/yaup/pull/6
(fetchpatch2 {
url = "https://github.com/Holarse-Linuxgaming/yaup/commit/c92134e305932785a60bd72131388f507b4d1853.patch?full_index=1";
hash = "sha256-Exqkfp9VYIf9JpAc10cO8NuEAWvI5Houi7CLXV5zBDY=";
})
];
nativeBuildInputs = [
intltool
pkg-config
+10
View File
@@ -2,6 +2,7 @@
lib,
stdenv,
fetchurl,
fetchpatch2,
alsa-lib,
boost,
curl,
@@ -48,6 +49,15 @@ stdenv.mkDerivation (finalAttrs: {
sha256 = "sha256-IUvMfG4jtN/QXq4DQIDuI0+Bl3MSSwDGKOyjfcRWgvE=";
};
patches = [
# Fix build with miniupnpc 2.2.8
# https://github.com/Aleph-One-Marathon/alephone/pull/503
(fetchpatch2 {
url = "https://github.com/Aleph-One-Marathon/alephone/commit/e25c4bc1ac02619e811b8f19bf4c2f617550e124.patch?full_index=1";
hash = "sha256-BFLLSTjNl/+/kVb+t6EyW1jhAlKN/G+Q99TICV9VHOY=";
})
];
nativeBuildInputs = [
pkg-config
icoutils
+55
View File
@@ -0,0 +1,55 @@
{
lib,
stdenv,
fetchFromGitHub,
meson,
ninja,
pkg-config,
libevent,
file,
qrencode,
openssl,
miniupnpc,
nix-update-script,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "pshs";
version = "0.4.3";
src = fetchFromGitHub {
owner = "projg2";
repo = "pshs";
rev = "v${finalAttrs.version}";
hash = "sha256-sfhhxeQa0rmBerfAemuHou0N001Zq5Hh7s7utxLQHOI=";
};
nativeBuildInputs = [
meson
ninja
pkg-config
];
buildInputs = [
libevent
file
qrencode
openssl
miniupnpc
];
strictDeps = true;
__structuredAttrs = true;
passthru.updateScript = nix-update-script { };
meta = {
description = "Pretty small HTTP server - a command-line tool to share files";
mainProgram = "pshs";
homepage = "https://github.com/mgorny/pshs";
sourceProvenance = [ lib.sourceTypes.fromSource ];
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.unix;
};
})
+88
View File
@@ -0,0 +1,88 @@
{
lib,
stdenv,
fetchFromGitLab,
fetchpatch2,
autoreconfHook,
ncurses,
SDL,
gpm,
miniupnpc,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "qodem";
version = "1.0.1-unstable-2022-02-12";
src = fetchFromGitLab {
owner = "AutumnMeowMeow";
repo = "qodem";
rev = "69cc7458ef23243f790348a4cc503a8173008e55";
hash = "sha256-Ocb2inuxeDOfqge+h7pHL9I9Kn72Mgi8Eq179/58alk=";
};
patches = [
# Fix ICH with count>1
# https://gitlab.com/AutumnMeowMeow/qodem/-/issues/77
(fetchpatch2 {
url = "https://gitlab.com/-/project/6684464/uploads/c2ceaef82d483c13ff9ec64424f3c40a/0001-Fix-ICH-with-count-1.patch";
hash = "sha256-lCqj4p8onUS4pehQMXS6lbC7JH5dP6sOjDALpasgd2M=";
})
# Don't clear line rendition on partial ED
# https://gitlab.com/AutumnMeowMeow/qodem/-/issues/78
(fetchpatch2 {
url = "https://gitlab.com/-/project/6684464/uploads/462c0b1cf05c3fc2857ce982e62fefcc/0001-Don-t-clear-line-rendition-on-partial-ED.patch";
hash = "sha256-lSuxP0tUfGa3BjK3ehpdMi16XaGZrdVvAcM2vnjAme8=";
})
# DECCOLM should clear line rendition attributes
# https://gitlab.com/AutumnMeowMeow/qodem/-/issues/78
(fetchpatch2 {
url = "https://gitlab.com/-/project/6684464/uploads/812bdfdfaee44eed346fcff85f53efbe/0002-DECCOLM-should-clear-line-rendition-attributes.patch";
hash = "sha256-XO+h5fpBTLLYC3t4FRCy1uFiMkmSXbre4T2NB/FC3uQ=";
})
# Fix build with miniupnpc 2.2.8
./qodem-fix-miniupnpc-2.2.8.patch
];
nativeBuildInputs = [
autoreconfHook
];
buildInputs = [
ncurses
SDL
miniupnpc
] ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform gpm) [
gpm
];
configureFlags = lib.optionals (!(lib.meta.availableOn stdenv.hostPlatform gpm)) [
"--disable-gpm"
];
strictDeps = true;
enableParallelBuilding = true;
__structuredAttrs = true;
meta = {
homepage = "https://qodem.sourceforge.net/";
description = "Re-implementation of the DOS-era Qmodem serial communications package";
longDescription = ''
Qodem is a from-scratch clone implementation of the Qmodem
communications program made popular in the days when Bulletin Board
Systems ruled the night. Qodem emulates the dialing directory and the
terminal screen features of Qmodem over both modem and Internet
connections.
'';
changelog = "${finalAttrs.src.meta.homepage}-/blob/${finalAttrs.src.rev}/ChangeLog";
maintainers = with lib.maintainers; [ embr ];
sourceProvenance = [ lib.sourceTypes.fromSource ];
license = lib.licenses.publicDomain;
platforms = lib.platforms.unix;
};
})
@@ -0,0 +1,55 @@
diff --git a/source/netclient.c b/source/netclient.c
index 6b6f99ec9b...88d4b91077 100644
--- a/source/netclient.c
+++ b/source/netclient.c
@@ -496,7 +496,7 @@
*/
device_list = upnpDiscover(2000, NULL, NULL, 0, 0, 2, NULL);
# else
-# if (MINIUPNPC_API_VERSION == 17)
+# if (MINIUPNPC_API_VERSION >= 17)
/*
* Version 17
*
@@ -516,8 +516,13 @@
if (device_list != NULL) {
+#if (MINIUPNPC_API_VERSION <= 17) || !defined(MINIUPNPC_API_VERSION)
rc = UPNP_GetValidIGD(device_list, &upnp_urls, &upnp_igd_datas,
local_host, sizeof(local_host));
+#else
+ rc = UPNP_GetValidIGD(device_list, &upnp_urls, &upnp_igd_datas,
+ local_host, sizeof(local_host), NULL, 0);
+#endif
switch (rc) {
@@ -525,13 +530,27 @@
DLOG(("Found valid IGD : %s\n", upnp_urls.controlURL));
break;
+#if (MINIUPNPC_API_VERSION >= 18)
case 2:
+ DLOG(("Found a (reserved?) IGD : %s\n", upnp_urls.controlURL));
+ DLOG(("Trying to continue anyway\n"));
+ break;
+#endif
+#if (MINIUPNPC_API_VERSION <= 17) || !defined(MINIUPNPC_API_VERSION)
+ case 2:
+#else
+ case 3:
+#endif
DLOG(("Found a (not connected?) IGD : %s\n", upnp_urls.controlURL));
DLOG(("Trying to continue anyway\n"));
break;
+#if (MINIUPNPC_API_VERSION <= 17) || !defined(MINIUPNPC_API_VERSION)
case 3:
+#else
+ case 4:
+#endif
DLOG(("UPnP device found. Is it an IGD ? : %s\n",
upnp_urls.controlURL));
DLOG(("Trying to continue anyway\n"));
@@ -47,6 +47,8 @@ stdenv.mkDerivation (finalAttrs: {
patches = [
# fix build with openssl 3.0
./transmission-3.00-openssl-3.patch
# fix build with miniupnpc 2.2.8
./transmission-3.00-miniupnpc-2.2.8.patch
];
outputs = [ "out" "apparmor" ];
@@ -0,0 +1,18 @@
diff --git a/libtransmission/upnp.c b/libtransmission/upnp.c
index c9e248a379...c7b2580bcb 100644
--- a/libtransmission/upnp.c
+++ b/libtransmission/upnp.c
@@ -194,8 +194,13 @@
errno = 0;
+#if (MINIUPNPC_API_VERSION >= 18)
if (UPNP_GetValidIGD(devlist, &handle->urls, &handle->data, handle->lanaddr,
+ sizeof(handle->lanaddr), NULL, 0) == UPNP_IGD_VALID_CONNECTED)
+#else
+ if (UPNP_GetValidIGD(devlist, &handle->urls, &handle->data, handle->lanaddr,
sizeof(handle->lanaddr)) == UPNP_IGD_VALID_CONNECTED)
+#endif
{
tr_logAddNamedInfo(getKey(), _("Found Internet Gateway Device \"%s\""), handle->urls.controlURL);
tr_logAddNamedInfo(getKey(), _("Local Address is \"%s\""), handle->lanaddr);
+7 -1
View File
@@ -1,4 +1,4 @@
{ stdenv, lib, fetchpatch, perl, fetchurl, python3, fmt, libidn
{ stdenv, lib, fetchpatch, fetchpatch2, perl, fetchurl, python3, fmt, libidn
, pkg-config, spidermonkey_78, boost, icu, libxml2, libpng, libsodium
, libjpeg, zlib, curl, libogg, libvorbis, enet, miniupnpc
, openal, libGLU, libGL, xorgproto, libX11, libXcursor, nspr, SDL2
@@ -72,6 +72,12 @@ stdenv.mkDerivation rec {
url = "https://github.com/0ad/0ad/commit/093e1eb23519ab4a4633a999a555a58e4fd5343e.patch";
hash = "sha256-NuWO64narU1JID/F3cj7lJKjo96XR7gSW0w8I3/hhuw=";
})
# Fix build with miniupnpc 2.2.8
# https://github.com/0ad/0ad/pull/45
(fetchpatch2 {
url = "https://github.com/0ad/0ad/commit/1575580bbc5278576693f3fbbb32de0b306aa27e.patch?full_index=1";
hash = "sha256-iXiUYTJCWwJpb2U3P58jTV4OpyW6quofu8Jq6xNEq48=";
})
];
configurePhase = ''
+10
View File
@@ -1,5 +1,6 @@
{ lib
, fetchFromGitHub
, fetchpatch2
, stdenv
, cmake
, pkg-config
@@ -45,6 +46,15 @@ stdenv.mkDerivation rec {
fetchSubmodules = true;
};
patches = [
# Fix build with miniupnpc 2.2.8
# https://github.com/streetpea/chiaki4deck/pull/355
(fetchpatch2 {
url = "https://github.com/streetpea/chiaki4deck/commit/e5806ae39cc6e8632d0f8cccefb5b7ddd458951a.patch?full_index=1";
hash = "sha256-0oGhymCZkhckJkvP64WNc4aaEzXlXYI84S7Blq7WgVw=";
})
];
nativeBuildInputs = [
cmake
pkg-config
@@ -0,0 +1,176 @@
diff --git a/include/autoconf.h.in b/include/autoconf.h.in
index bab2fcfa6c...22bc9202ca 100644
--- a/include/autoconf.h.in
+++ b/include/autoconf.h.in
@@ -797,6 +797,9 @@
/* UPNP support library 1.7 */
#undef HAVE_LIBMINIUPNP17
+/* UPNP support library 2.2.8 */
+#undef HAVE_LIBMINIUPNP228
+
/* Define to 1 if you have the `prldap60' library (-lprldap60). */
#undef HAVE_LIBPRLDAP60
diff --git a/include/common.h b/include/common.h
index 137f5ec51f...2c24759b52 100755
--- a/include/common.h
+++ b/include/common.h
@@ -1404,8 +1404,14 @@
/* return codes from UPNP_GetValidIGD(). */
#define UPNP_NO_IGD (0)
#define UPNP_CONNECTED_IGD (1)
+#if HAVE_LIBMINIUPNP228
+#define UPNP_RESERVED_IGD (2)
+#define UPNP_DISCONNECTED_IGD (3)
+#define UPNP_UNKNOWN_DEVICE (4)
+#else /* !HAVE_LIBMINIUPNP_228 */
#define UPNP_DISCONNECTED_IGD (2)
#define UPNP_UNKNOWN_DEVICE (3)
+#endif /* !HAVE_LIBMINIUPNP_228 */
#define UPNP_SUCCESS (1)
#define UPNP_FAILURE (2)
diff --git a/lib/upnp.c b/lib/upnp.c
index d9535ca03c...dc99d53c06 100644
--- a/lib/upnp.c
+++ b/lib/upnp.c
@@ -154,7 +154,7 @@
addrstring,
NULL,
0
-#if HAVE_LIBMINIUPNP17
+#if HAVE_LIBMINIUPNP17 || HAVE_LIBMINIUPNP228
,0,
#if MINIUPNPC_API_VERSION >= 14
@@ -162,7 +162,7 @@
#endif /* MINIUPNPC_API_VERSION >= 14 */
&rc
-#endif /* HAVE_LIBMINIUPNP17 */
+#endif /* HAVE_LIBMINIUPNP17 || HAVE_LIBMINIUPNP228 */
);
#if SOCKS_CLIENT && SOCKSLIBRARY_DYNAMIC
@@ -208,7 +208,12 @@
socks_autoadd_directroute(&commands, &protocols, &saddr, &smask);
}
+#if HAVE_LIBMINIUPNP228
+ devtype = UPNP_GetValidIGD(dev, &url, &data, myaddr, sizeof(myaddr),
+ NULL, 0);
+#else /* !HAVE_LIBMINIUPNP228 */
devtype = UPNP_GetValidIGD(dev, &url, &data, myaddr, sizeof(myaddr));
+#endif /* !HAVE_LIBMINIUPNP228 */
switch (devtype) {
case UPNP_NO_IGD:
snprintf(emsg, emsglen, "no UPNP IGD discovered on local network");
@@ -226,9 +231,10 @@
rc = 0;
break;
- case UPNP_DISCONNECTED_IGD:
+#if HAVE_LIBMINIUPNP228
+ case UPNP_RESERVED_IGD:
snprintf(emsg, emsglen,
- "UPNP IGD discovered at url %s, but it is not connected",
+ "UPNP IGD discovered at url %s, but its IP is reserved",
str2vis(url.controlURL,
strlen(url.controlURL),
vbuf,
@@ -236,6 +242,18 @@
swarnx("%s: %s", function, emsg);
rc = -1;
+#endif /* HAVE_LIBMINIUPNP228 */
+
+ case UPNP_DISCONNECTED_IGD:
+ snprintf(emsg, emsglen,
+ "UPNP IGD discovered at url %s, but it is not connected",
+ str2vis(url.controlURL,
+ strlen(url.controlURL),
+ vbuf,
+ sizeof(vbuf)));
+
+ swarnx("%s: %s", function, emsg);
+ rc = -1;
break;
case UPNP_UNKNOWN_DEVICE:
@@ -273,12 +291,12 @@
#if HAVE_LIBMINIUPNP13
STRCPY_ASSERTLEN(gw->state.data.upnp.servicetype, data.servicetype);
-#elif HAVE_LIBMINIUPNP14 || HAVE_LIBMINIUPNP17
+#elif HAVE_LIBMINIUPNP14 || HAVE_LIBMINIUPNP17 || HAVE_LIBMINIUPNP228
STRCPY_ASSERTLEN(gw->state.data.upnp.servicetype, data.CIF.servicetype);
#else
# error "unexpected miniupnp version"
-#endif /* HAVE_LIBMINIUPNP17 */
+#endif /* HAVE_LIBMINIUPNP14 || HAVE_LIBMINIUPNP17 || HAVE_LIBMINIUPNP228 */
slog(LOG_NEGOTIATE, "%s: inited ok. controlurl: %s, servicetype: %s",
function,
@@ -756,9 +774,9 @@
buf,
protocol,
NULL
-#if HAVE_LIBMINIUPNP17
+#if HAVE_LIBMINIUPNP17 || HAVE_LIBMINIUPNP228
,0
-#endif /* HAVE_LIBMINIUPNP17 */
+#endif /* HAVE_LIBMINIUPNP17 || HAVE_LIBMINIUPNP228 */
)) != UPNPCOMMAND_SUCCESS) {
snprintf(emsg, emsglen,
"UPNP_AddPortMapping() failed: %s", strupnperror(rc));
diff --git a/miniupnpc.m4 b/miniupnpc.m4
index 85086d4917...ebb8875763 100644
--- a/miniupnpc.m4
+++ b/miniupnpc.m4
@@ -20,7 +20,7 @@
LIBS=$oLIBS
fi
if test x"${have_libminiupnp}" = xt; then
- AC_MSG_CHECKING([for miniupnpc version >= 1.7])
+ AC_MSG_CHECKING([for miniupnpc version >= 2.2.8])
AC_TRY_COMPILE([
#include <stdio.h>
#include <miniupnpc/miniupnpc.h>
@@ -30,12 +30,34 @@
#ifndef MINIUPNPC_API_VERSION
#error "no api version define"
#else
- # if MINIUPNPC_API_VERSION < 8
+ # if MINIUPNPC_API_VERSION < 18
#error "api version too low"
# endif
#endif],
[AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_LIBMINIUPNP, 1, [UPNP support library])
+ AC_DEFINE(HAVE_LIBMINIUPNP228, 1, [UPNP support library 2.2.8])
+ unset no_upnp
+ SOCKDDEPS="${SOCKDDEPS}${SOCKDDEPS:+ }$UPNPLIB"
+ DLIBDEPS="${DLIBDEPS}${DLIBDEPS:+ }$UPNPLIB"],
+ [AC_MSG_RESULT(no)])
+
+ AC_MSG_CHECKING([for miniupnpc version >= 1.7])
+ AC_TRY_COMPILE([
+ #include <stdio.h>
+ #include <miniupnpc/miniupnpc.h>
+ #include <miniupnpc/upnpcommands.h>
+ #include <miniupnpc/upnperrors.h>], [
+
+ #ifndef MINIUPNPC_API_VERSION
+ #error "no api version define"
+ #else
+ # if MINIUPNPC_API_VERSION < 8 || MINIUPNPC_API_VERSION > 17
+ #error "api version too low or high"
+ # endif
+ #endif],
+ [AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_LIBMINIUPNP, 1, [UPNP support library])
AC_DEFINE(HAVE_LIBMINIUPNP17, 1, [UPNP support library 1.7])
unset no_upnp
SOCKDDEPS="${SOCKDDEPS}${SOCKDDEPS:+ }$UPNPLIB"
+2
View File
@@ -26,6 +26,8 @@ stdenv.mkDerivation rec {
# Fixes several issues with `osint.m4` that causes incorrect check failures when using newer
# versions of clang: missing `stdint.h` for `uint8_t` and unused `sa_len_ptr`.
./clang-osint-m4.patch
# Fixes build with miniupnpc 2.2.8.
./dante-1.4.3-miniupnpc-2.2.8.patch
] ++ lib.optionals remove_getaddrinfo_checks [
(fetchpatch {
name = "0002-osdep-m4-Remove-getaddrinfo-too-low-checks.patch";
-27
View File
@@ -1,27 +0,0 @@
{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, libevent, file, qrencode, miniupnpc }:
stdenv.mkDerivation rec {
pname = "pshs";
version = "0.3.4";
src = fetchFromGitHub {
owner = "mgorny";
repo = "pshs";
rev = "v${version}";
sha256 = "1j8j4r0vsmp6226q6jdgf9bzhx3qk7vdliwaw7f8kcsrkndkg6p4";
};
nativeBuildInputs = [ autoreconfHook pkg-config ];
buildInputs = [ libevent file qrencode miniupnpc ];
# SSL requires libevent at 2.1 with ssl support
configureFlags = [ "--disable-ssl" ];
meta = {
description = "Pretty small HTTP server - a command-line tool to share files";
mainProgram = "pshs";
homepage = "https://github.com/mgorny/pshs";
license = lib.licenses.bsd3;
platforms = lib.platforms.linux;
};
}
@@ -0,0 +1,120 @@
From f4f1800f5e67ab59312ccf710695acf06fb4ae26 Mon Sep 17 00:00:00 2001
From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
Date: Mon, 1 Jul 2024 10:07:06 -0400
Subject: [PATCH] fix(upnp): support newer miniupnpc library (#2782)
Co-authored-by: Vithorio Polten <reach@vithor.io>
---
src/upnp.cpp | 30 +++++++++++++++---------------
src/upnp.h | 31 ++++++++++++++++++++++++++++++-
2 files changed, 45 insertions(+), 16 deletions(-)
diff --git a/src/upnp.cpp b/src/upnp.cpp
index f65bcb87..fcbaaeb5 100644
--- a/src/upnp.cpp
+++ b/src/upnp.cpp
@@ -19,19 +19,6 @@
using namespace std::literals;
namespace upnp {
- constexpr auto INET6_ADDRESS_STRLEN = 46;
-
- constexpr auto PORT_MAPPING_LIFETIME = 3600s;
- constexpr auto REFRESH_INTERVAL = 120s;
-
- constexpr auto IPv4 = 0;
- constexpr auto IPv6 = 1;
-
- using device_t = util::safe_ptr<UPNPDev, freeUPNPDevlist>;
-
- KITTY_USING_MOVE_T(urls_t, UPNPUrls, , {
- FreeUPNPUrls(&el);
- });
struct mapping_t {
struct {
@@ -59,6 +46,19 @@ namespace upnp {
return "Unknown status"sv;
}
+ /**
+ * This function is a wrapper around UPNP_GetValidIGD() that returns the status code. There is a pre-processor
+ * check to determine which version of the function to call based on the version of the MiniUPnPc library.
+ */
+ int
+ UPNP_GetValidIGDStatus(device_t &device, urls_t *urls, IGDdatas *data, std::array<char, INET6_ADDRESS_STRLEN> &lan_addr) {
+#if (MINIUPNPC_API_VERSION >= 18)
+ return UPNP_GetValidIGD(device.get(), &urls->el, data, lan_addr.data(), lan_addr.size(), nullptr, 0);
+#else
+ return UPNP_GetValidIGD(device.get(), &urls->el, data, lan_addr.data(), lan_addr.size());
+#endif
+ }
+
class deinit_t: public platf::deinit_t {
public:
deinit_t() {
@@ -109,7 +109,7 @@ namespace upnp {
IGDdatas data;
urls_t urls;
std::array<char, INET6_ADDRESS_STRLEN> lan_addr;
- auto status = UPNP_GetValidIGD(device.get(), &urls.el, &data, lan_addr.data(), lan_addr.size());
+ auto status = upnp::UPNP_GetValidIGDStatus(device, &urls, &data, lan_addr);
if (status != 1 && status != 2) {
BOOST_LOG(debug) << "No valid IPv6 IGD: "sv << status_string(status);
return false;
@@ -331,7 +331,7 @@ namespace upnp {
std::array<char, INET6_ADDRESS_STRLEN> lan_addr;
urls_t urls;
- auto status = UPNP_GetValidIGD(device.get(), &urls.el, &data, lan_addr.data(), lan_addr.size());
+ auto status = upnp::UPNP_GetValidIGDStatus(device, &urls, &data, lan_addr);
if (status != 1 && status != 2) {
BOOST_LOG(error) << status_string(status);
mapped = false;
diff --git a/src/upnp.h b/src/upnp.h
index 73fc4f79..4b2e3296 100644
--- a/src/upnp.h
+++ b/src/upnp.h
@@ -4,9 +4,38 @@
*/
#pragma once
+#include <miniupnpc/miniupnpc.h>
+
#include "platform/common.h"
namespace upnp {
+ constexpr auto INET6_ADDRESS_STRLEN = 46;
+ constexpr auto IPv4 = 0;
+ constexpr auto IPv6 = 1;
+ constexpr auto PORT_MAPPING_LIFETIME = 3600s;
+ constexpr auto REFRESH_INTERVAL = 120s;
+
+ using device_t = util::safe_ptr<UPNPDev, freeUPNPDevlist>;
+
+ KITTY_USING_MOVE_T(urls_t, UPNPUrls, , {
+ FreeUPNPUrls(&el);
+ });
+
+ /**
+ * @brief Get the valid IGD status.
+ * @param device The device.
+ * @param urls The URLs.
+ * @param data The IGD data.
+ * @param lan_addr The LAN address.
+ * @return The UPnP Status.
+ * @retval 0 No IGD found.
+ * @retval 1 A valid connected IGD has been found.
+ * @retval 2 A valid IGD has been found but it reported as not connected.
+ * @retval 3 An UPnP device has been found but was not recognized as an IGD.
+ */
+ int
+ UPNP_GetValidIGDStatus(device_t &device, urls_t *urls, IGDdatas *data, std::array<char, INET6_ADDRESS_STRLEN> &lan_addr);
+
[[nodiscard]] std::unique_ptr<platf::deinit_t>
start();
-}
+} // namespace upnp
--
2.45.2
+6
View File
@@ -62,6 +62,12 @@ stdenv'.mkDerivation rec {
fetchSubmodules = true;
};
patches = [
# fix(upnp): support newer miniupnpc library (#2782)
# Manually cherry-picked on to 0.23.1.
./0001-fix-upnp-support-newer-miniupnpc-library-2782.patch
];
# build webui
ui = buildNpmPackage {
inherit src version;
+9
View File
@@ -1,4 +1,5 @@
{ lib, stdenv, fetchFromGitHub
, fetchpatch2
, installShellFiles
, boost, zlib, openssl
, upnpSupport ? true, miniupnpc
@@ -17,6 +18,14 @@ stdenv.mkDerivation rec {
sha256 = "sha256-0n3cPF3KBuzNOagrn88HeTvFAu1sYTkijpiGr77X5GI=";
};
patches = [
# Support miniupnp-2.2.8 (fixes #2071)
(fetchpatch2 {
url = "https://github.com/PurpleI2P/i2pd/commit/697d8314415b0dc0634fd1673abc589a080e0a31.patch?full_index=1";
hash = "sha256-B9Ngw1yPrnF5pGLe1a5x0TlyInvQGcq1zQUKO/ELFzA=";
})
];
buildInputs = [ boost zlib openssl ]
++ lib.optional upnpSupport miniupnpc;
+16 -18
View File
@@ -1,38 +1,36 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
{
lib,
stdenv,
fetchFromGitHub,
cmake,
}:
stdenv.mkDerivation rec {
pname = "miniupnpc";
version = "2.2.7";
version = "2.2.8";
src = fetchFromGitHub {
owner = "miniupnp";
repo = "miniupnp";
rev = "miniupnpc_${lib.replaceStrings ["."] ["_"] version}";
hash = "sha256-cIijY1NcdF169tibfB13845UT9ZoJ/CZ+XLES9ctWTY=";
rev = "miniupnpc_${lib.replaceStrings [ "." ] [ "_" ] version}";
hash = "sha256-kPH5nr+rIcF3mxl+L0kN5dn+9xvQccVa8EduwhuYboY=";
};
sourceRoot = "${src.name}/miniupnpc";
nativeBuildInputs = [ cmake ];
cmakeFlags = [
(lib.cmakeBool "UPNPC_BUILD_SHARED" (!stdenv.hostPlatform.isStatic))
(lib.cmakeBool "UPNPC_BUILD_STATIC" stdenv.hostPlatform.isStatic)
];
doCheck = !stdenv.isFreeBSD;
makeFlags = [ "PREFIX=$(out)" ];
postInstall = ''
chmod +x $out/lib/libminiupnpc${stdenv.hostPlatform.extensions.sharedLibrary}
# for some reason cmake does not install binaries and manpages
# https://github.com/miniupnp/miniupnp/issues/637
mkdir -p $out/bin
cp -a upnpc-static $out/bin/upnpc
cp -a ../external-ip.sh $out/bin/external-ip
mkdir -p $out/share/man
cp -a ../man3 $out/share/man
mv $out/bin/upnpc-* $out/bin/upnpc
mv $out/bin/upnp-listdevices-* $out/bin/upnp-listdevices
mv $out/bin/external-ip.sh $out/bin/external-ip
'';
meta = with lib; {
-30
View File
@@ -1,30 +0,0 @@
{ lib, stdenv, fetchFromGitHub, autoconf, automake, ncurses, SDL, gpm, miniupnpc }:
stdenv.mkDerivation rec {
pname = "qodem";
version = "1.0.1";
src = fetchFromGitHub {
owner = "klamonte";
repo = "qodem";
rev = "v${version}";
sha256 = "NAdcTVmNrDa3rbsbxJxFoI7sz5NK5Uw+TbP+a1CdB+Q=";
};
nativeBuildInputs = [ autoconf automake ];
buildInputs = [ ncurses SDL gpm miniupnpc ];
meta = with lib; {
homepage = "https://qodem.sourceforge.net/";
description = "Re-implementation of the DOS-era Qmodem serial communications package";
longDescription = ''
Qodem is a from-scratch clone implementation of the Qmodem
communications program made popular in the days when Bulletin Board
Systems ruled the night. Qodem emulates the dialing directory and the
terminal screen features of Qmodem over both modem and Internet
connections.
'';
maintainers = with maintainers; [ embr ];
license = licenses.publicDomain;
};
}
+1
View File
@@ -867,6 +867,7 @@ mapAliases ({
marwaita-manjaro = lib.warn "marwaita-manjaro has been renamed to marwaita-teal" marwaita-teal; # Added 2024-07-08
marwaita-peppermint = lib.warn "marwaita-peppermint has been renamed to marwaita-red" marwaita-red; # Added 2024-07-01
marwaita-ubuntu = lib.warn "marwaita-ubuntu has been renamed to marwaita-orange" marwaita-orange; # Added 2024-07-08
masari = throw "masari has been removed as it was abandoned upstream"; # Added 2024-07-11
matrique = spectral; # Added 2020-01-27
matrixcli = throw "'matrixcli' has been removed due to being unmaintained and broken functionality. Recommend 'matrix-commander' as an alternative"; # Added 2024-03-09
matrix-recorder = throw "matrix-recorder has been removed due to being unmaintained"; # Added 2023-05-21
-6
View File
@@ -12085,8 +12085,6 @@ with pkgs;
qmarkdowntextedit = libsForQt5.callPackage ../development/libraries/qmarkdowntextedit { };
qodem = callPackage ../tools/networking/qodem { };
qosmic = libsForQt5.callPackage ../applications/graphics/qosmic { };
qovery-cli = callPackage ../tools/admin/qovery-cli { };
@@ -25824,8 +25822,6 @@ with pkgs;
postgrey = callPackage ../servers/mail/postgrey { };
pshs = callPackage ../servers/http/pshs { };
quark = callPackage ../servers/http/quark { };
smtprelay = callPackage ../servers/mail/smtprelay { };
@@ -35696,8 +35692,6 @@ with pkgs;
monero-gui = libsForQt5.callPackage ../applications/blockchains/monero-gui { };
masari = callPackage ../applications/blockchains/masari { };
napari = with python3Packages; toPythonApplication napari;
nano-wallet = libsForQt5.callPackage ../applications/blockchains/nano-wallet { };