[vlc-devel] [PATCH] contrib: srt: update to 1.2.3

Justin Kim justin.kim at collabora.com
Fri Apr 20 04:11:26 CEST 2018


SRT has changed the license to MPL-2.0
with release 1.2.3 version.

Signed-off-by: Justin Kim <justin.kim at collabora.com>
---
 ...ubstitute-link-flags-for-package-nam.patch | 33 ++++++++++
 ...Clean-.pc-to-provide-the-dependecies.patch | 46 -------------
 .../0001-Fix-include-path-for-wintime.h.patch | 64 -------------------
 ...-channel.cpp-add-mswsock.h-for-Win32.patch | 28 --------
 ...ble-localtime_s-only-if-MSC_VER-1500.patch | 34 ----------
 ...pi.h-change-inet_ntop-to-getnameinfo.patch | 43 -------------
 ...akeLists.txt-let-cmake-find-pthread.patch} | 24 +++++--
 contrib/src/srt/SHA512SUMS                    |  3 +-
 contrib/src/srt/fix-pc.patch                  | 41 ------------
 contrib/src/srt/rules.mak                     | 13 ++--
 10 files changed, 56 insertions(+), 273 deletions(-)
 create mode 100644 contrib/src/srt/0001-CMakeLists.txt-substitute-link-flags-for-package-nam.patch
 delete mode 100644 contrib/src/srt/0001-Clean-.pc-to-provide-the-dependecies.patch
 delete mode 100644 contrib/src/srt/0001-Fix-include-path-for-wintime.h.patch
 delete mode 100644 contrib/src/srt/0001-channel.cpp-add-mswsock.h-for-Win32.patch
 delete mode 100644 contrib/src/srt/0001-srt_compat.h-Enable-localtime_s-only-if-MSC_VER-1500.patch
 delete mode 100644 contrib/src/srt/0001-srtcore-api.h-change-inet_ntop-to-getnameinfo.patch
 rename contrib/src/srt/{0001-CMakeLists.txt-let-cmake-find-pthread.patch => 0002-CMakeLists.txt-let-cmake-find-pthread.patch} (63%)
 delete mode 100644 contrib/src/srt/fix-pc.patch

diff --git a/contrib/src/srt/0001-CMakeLists.txt-substitute-link-flags-for-package-nam.patch b/contrib/src/srt/0001-CMakeLists.txt-substitute-link-flags-for-package-nam.patch
new file mode 100644
index 0000000000..0d3cf7038a
--- /dev/null
+++ b/contrib/src/srt/0001-CMakeLists.txt-substitute-link-flags-for-package-nam.patch
@@ -0,0 +1,33 @@
+From 671f9bc81168438d7cbc86f5946f2dbb720fa60e Mon Sep 17 00:00:00 2001
+From: Justin Kim <justin.kim at collabora.com>
+Date: Thu, 19 Apr 2018 20:12:21 +0900
+Subject: [PATCH 1/2] CMakeLists.txt: substitute link flags for package names
+
+Signed-off-by: Justin Kim <justin.kim at collabora.com>
+---
+ CMakeLists.txt | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 85eb9c5..77fbfb0 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -90,6 +90,7 @@ if ( USE_GNUTLS )
+ 	endif()
+  
+ 	pkg_check_modules (SSL REQUIRED ${SSL_REQUIRED_MODULES})
++	set (SRT_LIBS_PRIVATE ${SSL_LDFLAGS})
+ 
+ 	add_definitions(
+ 		-DUSE_GNUTLS=1
+@@ -103,6 +104,7 @@ else()
+ 	find_package(OpenSSL REQUIRED)
+ 	set (SSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
+ 	set (SSL_LIBRARIES ${OPENSSL_LIBRARIES})
++	set (SRT_LIBS_PRIVATE ${SSL_LIBRARIES})
+ 
+ 	add_definitions(
+ 		-DHAICRYPT_USE_OPENSSL_EVP=1
+-- 
+2.17.0
+
diff --git a/contrib/src/srt/0001-Clean-.pc-to-provide-the-dependecies.patch b/contrib/src/srt/0001-Clean-.pc-to-provide-the-dependecies.patch
deleted file mode 100644
index 3e57dec08f..0000000000
--- a/contrib/src/srt/0001-Clean-.pc-to-provide-the-dependecies.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 02a6fcd2668a0f19ebeb77b02a0f5e9befda317c Mon Sep 17 00:00:00 2001
-From: Justin Kim <justin.kim at collabora.com>
-Date: Fri, 8 Dec 2017 18:32:55 +0900
-Subject: [PATCH] Clean .pc to provide the dependecies
-
-SRT will provide the dependencies by `Requires:` field.
-
-Signed-off-by: Justin Kim <justin.kim at collabora.com>
----
- CMakeLists.txt       | 5 ++---
- scripts/haisrt.pc.in | 2 +-
- 2 files changed, 3 insertions(+), 4 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 1db73d4..3bf4fe9 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -106,6 +106,7 @@ if ( USE_GNUTLS )
- 		${SSL_LIBRARY_DIRS}
- 	)
- else()
-+	set (SSL_REQUIRED_MODULES "openssl libcrypto zlib")
- 	find_package(OpenSSL REQUIRED)
- 	set (SSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
- 	set (SSL_LIBRARIES ${OPENSSL_LIBRARIES})
-@@ -115,7 +116,6 @@ else()
- 		-DHAICRYPT_USE_OPENSSL_AES
- 	)
- endif()
--
- message (STATUS "SSL libraries: ${SSL_LIBRARIES}")
- 
- # Detect if the compiler is GNU compatable for flags
-diff --git a/scripts/haisrt.pc.in b/scripts/haisrt.pc.in
-index 3b1c49f..beb103b 100644
---- a/scripts/haisrt.pc.in
-+++ b/scripts/haisrt.pc.in
-@@ -9,4 +9,4 @@ Version: @SRT_VERSION@
- Libs: -L${libdir} -l at TARGET_srt@ @IFNEEDED_LINK_HAICRYPT@ @IFNEEDED_SRTBASE@ @IFNEEDED_SRT_LDFLAGS@
- Libs.private: @SRT_LIBS_PRIVATE@
- Cflags: -I${includedir}
--
-+Requires.private: @SSL_REQUIRED_MODULES@
--- 
-2.7.4
-
diff --git a/contrib/src/srt/0001-Fix-include-path-for-wintime.h.patch b/contrib/src/srt/0001-Fix-include-path-for-wintime.h.patch
deleted file mode 100644
index 6a46847c15..0000000000
--- a/contrib/src/srt/0001-Fix-include-path-for-wintime.h.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From f9497cbb465453d5c8f895f7b70c19f7b0d0d23c Mon Sep 17 00:00:00 2001
-From: Justin Kim <justin.kim at collabora.com>
-Date: Tue, 2 Jan 2018 20:17:46 +0900
-Subject: [PATCH] Fix #include path for wintime.h
-
-`wintime.h` is installed `${includedir}/srt/win`
-so `platform_sys.h` shouldn't use an absolute path
-for this header.
-
-Signed-off-by: Justin Kim <justin.kim at collabora.com>
----
- common/win/wintime.h   | 3 +--
- scripts/haisrt.pc.in   | 2 +-
- srtcore/platform_sys.h | 2 +-
- 3 files changed, 3 insertions(+), 4 deletions(-)
-
-diff --git a/common/win/wintime.h b/common/win/wintime.h
-index af810b6..cc37b52 100644
---- a/common/win/wintime.h
-+++ b/common/win/wintime.h
-@@ -4,7 +4,6 @@
- #include <winsock2.h>
- #include <windows.h>
- #include <time.h>
--#include "haicrypt.h"
- 
- #ifdef __cplusplus
- extern "C" {
-@@ -34,7 +33,7 @@ struct timezone
- 
- void timeradd(struct timeval *a, struct timeval *b, struct timeval *result);
- 
--HAICRYPT_API int gettimeofday(struct timeval* tp, struct timezone* tz);
-+int gettimeofday(struct timeval* tp, struct timezone* tz);
- 
- #ifdef __cplusplus
- }
-diff --git a/scripts/haisrt.pc.in b/scripts/haisrt.pc.in
-index beb103b..9009f9b 100644
---- a/scripts/haisrt.pc.in
-+++ b/scripts/haisrt.pc.in
-@@ -8,5 +8,5 @@ Description: SRT library set
- Version: @SRT_VERSION@
- Libs: -L${libdir} -l at TARGET_srt@ @IFNEEDED_LINK_HAICRYPT@ @IFNEEDED_SRTBASE@ @IFNEEDED_SRT_LDFLAGS@
- Libs.private: @SRT_LIBS_PRIVATE@
--Cflags: -I${includedir}
-+Cflags: -I${includedir} -I${includedir}/srt
- Requires.private: @SSL_REQUIRED_MODULES@
-diff --git a/srtcore/platform_sys.h b/srtcore/platform_sys.h
-index 5ffa374..f2cb09b 100644
---- a/srtcore/platform_sys.h
-+++ b/srtcore/platform_sys.h
-@@ -8,7 +8,7 @@
-    #include <windows.h>
-    #include <inttypes.h>
-    #include <stdint.h>
--   #include <win/wintime.h>
-+   #include "win/wintime.h"
-    #if defined(_MSC_VER)
-       #pragma warning(disable:4251)
-    #endif
--- 
-2.11.0
-
diff --git a/contrib/src/srt/0001-channel.cpp-add-mswsock.h-for-Win32.patch b/contrib/src/srt/0001-channel.cpp-add-mswsock.h-for-Win32.patch
deleted file mode 100644
index 507311fbbb..0000000000
--- a/contrib/src/srt/0001-channel.cpp-add-mswsock.h-for-Win32.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From a3f76dccdef8b2968a1c9d6961585ae9162e9eb3 Mon Sep 17 00:00:00 2001
-From: Justin Kim <justin.kim at collabora.com>
-Date: Thu, 23 Nov 2017 20:03:57 +0900
-Subject: [PATCH] channel.cpp: add mswsock.h for Win32
-
-For cross-compiling, 'mswsock.h' is required to use
-MSG_TRUNC flag.
-
-Signed-off-by: Justin Kim <justin.kim at collabora.com>
----
- srtcore/channel.cpp | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/srtcore/channel.cpp b/srtcore/channel.cpp
-index a15179b..07b0b96 100644
---- a/srtcore/channel.cpp
-+++ b/srtcore/channel.cpp
-@@ -75,6 +75,7 @@ modified by
- #else
-    #include <winsock2.h>
-    #include <ws2tcpip.h>
-+   #include <mswsock.h>
- #endif
- 
- #include <iostream>
--- 
-2.7.4
-
diff --git a/contrib/src/srt/0001-srt_compat.h-Enable-localtime_s-only-if-MSC_VER-1500.patch b/contrib/src/srt/0001-srt_compat.h-Enable-localtime_s-only-if-MSC_VER-1500.patch
deleted file mode 100644
index 2bf50ffdcb..0000000000
--- a/contrib/src/srt/0001-srt_compat.h-Enable-localtime_s-only-if-MSC_VER-1500.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 32917c2f3c942b7ac25bc461f5984441bcb1fd21 Mon Sep 17 00:00:00 2001
-From: Justin Kim <justin.kim at collabora.com>
-Date: Tue, 2 Jan 2018 16:20:44 +0900
-Subject: [PATCH] srt_compat.h: Enable localtime_s only if MSC_VER >= 1500
-
-Signed-off-by: Justin Kim <justin.kim at collabora.com>
----
- common/srt_compat.h | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/common/srt_compat.h b/common/srt_compat.h
-index d73e193..bddf5f8 100644
---- a/common/srt_compat.h
-+++ b/common/srt_compat.h
-@@ -177,10 +177,16 @@ inline struct tm LocalTime(time_t tt)
- {
- 	struct tm tm;
- #ifdef WIN32
-+#if defined(_MSC_VER) && (_MSC_VER>=1500)
- 	errno_t rr = localtime_s(&tm, &tt);
- 	if (rr)
- 		return tm;
-+
- #else
-+	tm = *localtime(&tt);
-+#endif // _MSC_VER
-+
-+#else // WIN32
- 	tm = *localtime_r(&tt, &tm);
- #endif
- 
--- 
-2.7.4
-
diff --git a/contrib/src/srt/0001-srtcore-api.h-change-inet_ntop-to-getnameinfo.patch b/contrib/src/srt/0001-srtcore-api.h-change-inet_ntop-to-getnameinfo.patch
deleted file mode 100644
index 7c66726724..0000000000
--- a/contrib/src/srt/0001-srtcore-api.h-change-inet_ntop-to-getnameinfo.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 9f9ac2b05be359e68b849d9e2948b0a0ac82b35d Mon Sep 17 00:00:00 2001
-From: Justin Kim <justin.kim at collabora.com>
-Date: Fri, 24 Nov 2017 11:09:36 +0900
-Subject: [PATCH] srtcore/api.h: change inet_ntop to getnameinfo
-
-Missing a header `arpa/inet.h` causes compilation warings.
-However, rather than the header for `inet_ntop` function, it would
-be better to use a protocol-independent address to name translator.
-
-Signed-off-by: Justin Kim <justin.kim at collabora.com>
----
- srtcore/api.h          | 2 +-
- srtcore/platform_sys.h | 1 +
- 2 files changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/srtcore/api.h b/srtcore/api.h
-index cd62531..7045da4 100644
---- a/srtcore/api.h
-+++ b/srtcore/api.h
-@@ -282,7 +282,7 @@ inline std::string SockaddrToString(const sockaddr* sadr)
- 
- 	std::ostringstream output;
- 	char hostbuf[1024];
--	if (inet_ntop(sadr->sa_family, addr, hostbuf, 1024))
-+	if (!getnameinfo(sadr, sizeof(*sadr), hostbuf, 1024, NULL, 0, NI_NAMEREQD))
- 	{
- 		output << hostbuf;
- 	}
-diff --git a/srtcore/platform_sys.h b/srtcore/platform_sys.h
-index 5a1d65c..5ffa374 100644
---- a/srtcore/platform_sys.h
-+++ b/srtcore/platform_sys.h
-@@ -16,6 +16,7 @@
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <sys/time.h>
-+#include <netdb.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
- #include <unistd.h>
--- 
-2.11.0
-
diff --git a/contrib/src/srt/0001-CMakeLists.txt-let-cmake-find-pthread.patch b/contrib/src/srt/0002-CMakeLists.txt-let-cmake-find-pthread.patch
similarity index 63%
rename from contrib/src/srt/0001-CMakeLists.txt-let-cmake-find-pthread.patch
rename to contrib/src/srt/0002-CMakeLists.txt-let-cmake-find-pthread.patch
index fc674c5372..b90a4e5cf3 100644
--- a/contrib/src/srt/0001-CMakeLists.txt-let-cmake-find-pthread.patch
+++ b/contrib/src/srt/0002-CMakeLists.txt-let-cmake-find-pthread.patch
@@ -1,19 +1,21 @@
-From 3427a475be0163312986eb64d777b9f76feff554 Mon Sep 17 00:00:00 2001
+From 6446d6c9294b63b3b1d363a4e92213a3bb5d4101 Mon Sep 17 00:00:00 2001
 From: Justin Kim <justin.kim at collabora.com>
 Date: Fri, 23 Mar 2018 13:05:29 +0900
-Subject: [PATCH] CMakeLists.txt: let cmake find pthread
+Subject: [PATCH 2/2] CMakeLists.txt: let cmake find pthread
 
 ---
- CMakeLists.txt | 17 ++++++-----------
- 1 file changed, 6 insertions(+), 11 deletions(-)
+ CMakeLists.txt | 24 ++++++------------------
+ 1 file changed, 6 insertions(+), 18 deletions(-)
 
 diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 8e02b58..dd2511a 100644
+index 77fbfb0..52d6bcd 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -212,18 +212,13 @@ endif()
+@@ -213,28 +213,16 @@ if (${ENABLE_PROFILE} AND HAVE_COMPILER_GNU_COMPAT)
+ endif()
  
  
+-if (NOT MINGW)
  # find pthread
 -find_path(PTHREAD_INCLUDE_DIR pthread.h HINTS C:/pthread-win32/include)
 -if (PTHREAD_INCLUDE_DIR)
@@ -35,7 +37,15 @@ index 8e02b58..dd2511a 100644
 +	set (SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE} ${CMAKE_THREAD_LIBS_INIT})
  endif()
  
+-elseif(THREADS_FOUND)
+-	set(PTHREAD_LIBRARY ${CMAKE_THREAD_LIBS_INIT})
+-else()
+-	find_library(PTHREAD_LIBRARY NAMES pthread pthreadGC2 pthreadGC)
+-endif() # if (NOT MINGW)
+-
  # This is required in some projects that add some other sources
+ # to the SRT library to be compiled together (aka "virtual library").
+ if (DEFINED SRT_EXTRA_LIB_INC)
 -- 
-2.7.4
+2.17.0
 
diff --git a/contrib/src/srt/SHA512SUMS b/contrib/src/srt/SHA512SUMS
index 6e7338cdd7..a1abaf6598 100644
--- a/contrib/src/srt/SHA512SUMS
+++ b/contrib/src/srt/SHA512SUMS
@@ -1 +1,2 @@
-cb897c97d5fd93b333c8de0805c78c940650a2daf8d821e09e3fb01c7e4b56bd7513cf28545f7ac422fba9fa8420b745f397359a4b9e81cff496c776820ea90a  srt-1.2.2.tar.gz
+30bc7750e1a47d637c57fef9dcf0d1be02ac51831f041f75ea3bd2437f1e1bfd06848fbbdcfb5476267b9165b1a035e5bedfa9ea2f3c88ea536ee93c23e3cd46  srt-1.2.3.tar.gz
+
diff --git a/contrib/src/srt/fix-pc.patch b/contrib/src/srt/fix-pc.patch
deleted file mode 100644
index 8f666fa6f6..0000000000
--- a/contrib/src/srt/fix-pc.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 2f96045d17b2fc912d8bece54adf1cbe774166dd Mon Sep 17 00:00:00 2001
-From: Justin Kim <justin.kim at collabora.com>
-Date: Fri, 8 Dec 2017 20:43:54 +0900
-Subject: [PATCH] CMakeLists.txt: substitute link flags for package names
-
-Signed-off-by: Justin Kim <justin.kim at collabora.com>
----
- CMakeLists.txt | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 8e02b58..d9a8a1b 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -90,6 +90,7 @@ set_if(LINUX ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
- # find OpenSSL
- if ( USE_GNUTLS )
- 	pkg_check_modules (SSL REQUIRED gnutls nettle)
-+	set (SRT_LIBS_PRIVATE ${SSL_LDFLAGS})
- 
- 	add_definitions(
- 		-DUSE_GNUTLS=1
-@@ -102,6 +103,7 @@ else()
- 	find_package(OpenSSL REQUIRED)
- 	set (SSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
- 	set (SSL_LIBRARIES ${OPENSSL_LIBRARIES})
-+	set (SRT_LIBS_PRIVATE ${SSL_LIBRARIES})
- 
- 	add_definitions(
- 		-DHAICRYPT_USE_OPENSSL_EVP=1
-@@ -358,7 +360,6 @@ target_include_directories(${TARGET_haicrypt}
- 
- set_target_properties (${TARGET_haicrypt} PROPERTIES VERSION ${SRT_VERSION} SOVERSION ${SRT_VERSION_MAJOR})
- target_link_libraries(${TARGET_haicrypt} PRIVATE ${SSL_LIBRARIES})
--set (SRT_LIBS_PRIVATE ${SSL_LIBRARIES})
- if (WIN32)
- 	target_link_libraries(${TARGET_haicrypt} PRIVATE ws2_32.lib)
- 	set (SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE} ws2_32.lib)
--- 
-2.15.1
-
diff --git a/contrib/src/srt/rules.mak b/contrib/src/srt/rules.mak
index 2c5c556836..68233c8f01 100644
--- a/contrib/src/srt/rules.mak
+++ b/contrib/src/srt/rules.mak
@@ -1,6 +1,6 @@
 # srt
 
-SRT_VERSION := 1.2.2
+SRT_VERSION := 1.2.3
 SRT_URL := $(GITHUB)/Haivision/srt/archive/v$(SRT_VERSION).tar.gz
 
 ifdef BUILD_NETWORK
@@ -26,14 +26,9 @@ $(TARBALLS)/srt-$(SRT_VERSION).tar.gz:
 
 srt: srt-$(SRT_VERSION).tar.gz .sum-srt
 	$(UNPACK)
-	$(APPLY) $(SRC)/srt/fix-pc.patch
-	$(APPLY) $(SRC)/srt/add-implicit-link-libraries.patch
-	$(APPLY) $(SRC)/srt/0001-srtcore-api.h-change-inet_ntop-to-getnameinfo.patch
-	$(APPLY) $(SRC)/srt/0001-Clean-.pc-to-provide-the-dependecies.patch
-	$(APPLY) $(SRC)/srt/0001-srt_compat.h-Enable-localtime_s-only-if-MSC_VER-1500.patch
-	$(APPLY) $(SRC)/srt/0001-channel.cpp-add-mswsock.h-for-Win32.patch
-	$(APPLY) $(SRC)/srt/0001-Fix-include-path-for-wintime.h.patch
-	$(APPLY) $(SRC)/srt/0001-CMakeLists.txt-let-cmake-find-pthread.patch
+	$(APPLY) $(SRC)/srt/add-implicit-link-libraries.patch 
+	$(APPLY) $(SRC)/srt/0001-CMakeLists.txt-substitute-link-flags-for-package-nam.patch
+	$(APPLY) $(SRC)/srt/0002-CMakeLists.txt-let-cmake-find-pthread.patch
 	$(call pkg_static,"scripts/haisrt.pc.in")
 	mv srt-$(SRT_VERSION) $@ && touch $@
 
-- 
2.17.0



More information about the vlc-devel mailing list