From 80826d8b7b7b8610d4c0769bd6dea8b5af64f883 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 25 Nov 2018 18:37:12 -0800 Subject: [PATCH] crtmpserver: Fix compilation without deprecated OpenSSL APIs Switched to codeload to simplify the Makefile. Removed the website as it is no longer valid. Renamed .diff file to .patch Added uclibc++ support. Fixed 060-add-missing-includes.patch , which was totally wrong to begin with. C headers are generally not used with C++ programs. Minor cleanups. Signed-off-by: Rosen Penev --- multimedia/crtmpserver/Makefile | 21 ++++----- .../patches/060-add-missing-includes.patch | 22 ++------- ...mpat.diff => 090-openssl-1.1-compat.patch} | 0 .../patches/100-openssl-deprecated.patch | 46 +++++++++++++++++++ 4 files changed, 59 insertions(+), 30 deletions(-) rename multimedia/crtmpserver/patches/{090-openssl-1.1-compat.diff => 090-openssl-1.1-compat.patch} (100%) create mode 100644 multimedia/crtmpserver/patches/100-openssl-deprecated.patch diff --git a/multimedia/crtmpserver/Makefile b/multimedia/crtmpserver/Makefile index 571555d61..25a22410f 100644 --- a/multimedia/crtmpserver/Makefile +++ b/multimedia/crtmpserver/Makefile @@ -10,27 +10,26 @@ include $(TOPDIR)/rules.mk PKG_NAME:=crtmpserver PKG_REV:=b6fdcdb953d1e99c48a0c37a8c80f2cad2db443b PKG_VERSION:=2012-07-18+git-$(PKG_REV) -PKG_RELEASE:=3 -PKG_BUILD_PARALLEL:=2 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/j0sh/crtmpserver/tar.gz/$(PKG_REV)? +PKG_HASH:=e210eeb99d39334e7beb0a1be27dcf23d1f851383f87cf63d7fb98209ef96cee +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_REV) + PKG_MAINTAINER:=Thomas Heil PKG_LICENSE:=GPL-3.0 +PKG_BUILD_PARALLEL:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_MIRROR_HASH:=8d887996b6b8cb465ec59f3f713fca46161cbb804cacd2b5405f836083fb58ba -PKG_SOURCE_URL:=https://github.com/j0sh/crtmpserver.git -PKG_SOURCE_SUBDIR:=crtmpserver-$(PKG_VERSION) -PKG_SOURCE_VERSION:=$(PKG_REV) -PKG_SOURCE_PROTO:=git - +include $(INCLUDE_DIR)/uclibc++.mk include $(INCLUDE_DIR)/package.mk define Package/crtmpserver SECTION:=multimedia CATEGORY:=Multimedia - DEPENDS:=+libopenssl +libstdcpp +liblua + DEPENDS:=$(CXX_DEPENDS) +libopenssl +liblua TITLE:=C++ RTMP Server - URL:=http://www.rtmpd.com/ endef define Package/crtmpserver/description diff --git a/multimedia/crtmpserver/patches/060-add-missing-includes.patch b/multimedia/crtmpserver/patches/060-add-missing-includes.patch index 7b9da39a2..c5241c27c 100644 --- a/multimedia/crtmpserver/patches/060-add-missing-includes.patch +++ b/multimedia/crtmpserver/patches/060-add-missing-includes.patch @@ -1,26 +1,10 @@ ---- a/sources/common/include/common.h -+++ b/sources/common/include/common.h -@@ -20,6 +20,10 @@ - #ifndef _COMMON_H - #define _COMMON_H - -+#include -+#include -+#include -+ - #include "defines.h" - #include "platform/platform.h" - #include "utils/utils.h" --- a/sources/common/src/utils/logging/fileloglocation.cpp +++ b/sources/common/src/utils/logging/fileloglocation.cpp -@@ -18,6 +18,10 @@ +@@ -17,6 +17,7 @@ + * along with crtmpserver. If not, see . */ ++#include -+#include -+#include -+#include -+ #include "utils/logging/fileloglocation.h" #include "utils/lua/luautils.h" - #include "utils/misc/file.h" diff --git a/multimedia/crtmpserver/patches/090-openssl-1.1-compat.diff b/multimedia/crtmpserver/patches/090-openssl-1.1-compat.patch similarity index 100% rename from multimedia/crtmpserver/patches/090-openssl-1.1-compat.diff rename to multimedia/crtmpserver/patches/090-openssl-1.1-compat.patch diff --git a/multimedia/crtmpserver/patches/100-openssl-deprecated.patch b/multimedia/crtmpserver/patches/100-openssl-deprecated.patch new file mode 100644 index 000000000..60b362b41 --- /dev/null +++ b/multimedia/crtmpserver/patches/100-openssl-deprecated.patch @@ -0,0 +1,46 @@ +--- a/sources/common/src/utils/misc/crypto.cpp ++++ b/sources/common/src/utils/misc/crypto.cpp +@@ -350,6 +350,7 @@ string unhex(string source) { + return result; + } + ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + void CleanupSSL() { + ERR_remove_state(0); + ENGINE_cleanup(); +@@ -358,3 +359,4 @@ void CleanupSSL() { + EVP_cleanup(); + CRYPTO_cleanup_all_ex_data(); + } ++#endif +--- a/sources/crtmpserver/src/crtmpserver.cpp ++++ b/sources/crtmpserver/src/crtmpserver.cpp +@@ -298,8 +298,10 @@ void Cleanup() { + delete gRs.pConfigFile; + gRs.pConfigFile = NULL; + ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + WARN("Doing final OpenSSL cleanup"); + CleanupSSL(); ++#endif + + WARN("Shutting down the logger leaving you in the dark. Bye bye... :("); + Logger::Free(true); +--- a/sources/thelib/src/protocols/ssl/basesslprotocol.cpp ++++ b/sources/thelib/src/protocols/ssl/basesslprotocol.cpp +@@ -43,6 +43,7 @@ BaseSSLProtocol::~BaseSSLProtocol() { + bool BaseSSLProtocol::Initialize(Variant ¶meters) { + //1. Initialize the SSL library + if (!_libraryInitialized) { ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + //3. This is the first time we use the library. So we have to + //initialize it first + SSL_library_init(); +@@ -55,6 +56,7 @@ bool BaseSSLProtocol::Initialize(Variant ¶meters) { + OpenSSL_add_all_algorithms(); + OpenSSL_add_all_ciphers(); + OpenSSL_add_all_digests(); ++#endif + + //initialize the random numbers generator + InitRandGenerator();