contrib: srt: Apply a patch to fix link flags
authorJustin Kim <justin.kim@collabora.com>
Fri, 8 Dec 2017 11:51:52 +0000 (20:51 +0900)
committerKonstantin Pavlov <thresh@videolan.org>
Fri, 8 Dec 2017 14:23:48 +0000 (17:23 +0300)
SRT 1.2.2 has a bug in their `.pc` that `Libs.private`
field has package names.

Signed-off-by: Justin Kim <justin.kim@collabora.com>
Signed-off-by: Konstantin Pavlov <thresh@videolan.org>
contrib/src/srt/fix-pc.patch [new file with mode: 0644]
contrib/src/srt/rules.mak

diff --git a/contrib/src/srt/fix-pc.patch b/contrib/src/srt/fix-pc.patch
new file mode 100644 (file)
index 0000000..8f666fa
--- /dev/null
@@ -0,0 +1,41 @@
+From 2f96045d17b2fc912d8bece54adf1cbe774166dd Mon Sep 17 00:00:00 2001
+From: Justin Kim <justin.kim@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@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
+
index 78d7c9a..b263bff 100644 (file)
@@ -23,6 +23,7 @@ $(TARBALLS)/srt-$(SRT_VERSION).tar.gz:
 
 srt: srt-$(SRT_VERSION).tar.gz .sum-srt
        $(UNPACK)
+       $(APPLY) $(SRC)/srt/fix-pc.patch
        $(call pkg_static,"scripts/haisrt.pc.in")
        mv srt-$(SRT_VERSION) $@ && touch $@