commit 5f10964f99a24eeb4d22c15d7efc4c02ae480600
Author: Leigh Scott <leigh123linux(a)gmail.com>
Date: Thu Apr 22 17:29:50 2021 +0100
Use archlinux patches
cmake-Install-a-pkgconfig-file.patch | 65 ++++++++
cmake-Install-into-standard-directories.patch | 32 ++++
cmake-Use-external-jansson-if-possible.patch | 45 ++++++
headers-fix.patch | 111 -------------
libdir-fix.patch | 19 ---
libftl.spec | 28 ++--
refactor-remove-ftl_app-completely.patch | 217 ++++++++++++++++++++++++++
7 files changed, 370 insertions(+), 147 deletions(-)
---
diff --git a/cmake-Install-a-pkgconfig-file.patch b/cmake-Install-a-pkgconfig-file.patch
new file mode 100644
index 0000000..bcd1415
--- /dev/null
+++ b/cmake-Install-a-pkgconfig-file.patch
@@ -0,0 +1,65 @@
+From 2a951451afe9af57b7b1e48ce330e1b7035cf45a Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <jsteffens(a)make.tv>
+Date: Fri, 29 Mar 2019 12:06:47 +0100
+Subject: [PATCH 3/6] cmake: Install a pkgconfig file
+
+---
+ CMakeLists.txt | 9 ++++++++-
+ libftl.pc.in | 11 +++++++++++
+ 2 files changed, 19 insertions(+), 1 deletion(-)
+ create mode 100644 libftl.pc.in
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 66eb27a5059fd7f7..f6cb6c28eba784e5 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -2,6 +2,8 @@ cmake_minimum_required (VERSION 2.8.0)
+ enable_language(C)
+ project(libftl)
+
++SET(FTL_VERSION "0.5.0")
++
+ option(DISABLE_AUTO_INGEST "Set to TRUE to disable auto ingest feature which
removes curl and jansson dependancies" FALSE)
+ MESSAGE(STATUS "FTL DISABLE_AUTO_INGEST: " ${DISABLE_AUTO_INGEST})
+
+@@ -100,7 +102,7 @@ add_library(ftl ${FTL_LIB_TYPE} libftl/hmac/hmac.c
+ ${FTLSDK_PLATFORM_FILES})
+ include_directories(libftl libftl/gettimeofday)
+
+-set_target_properties(ftl PROPERTIES VERSION "0.5.0")
++set_target_properties(ftl PROPERTIES VERSION ${FTL_VERSION})
+ set_target_properties(ftl PROPERTIES SOVERSION 0)
+
+ target_link_libraries(ftl ${CURL_LIBRARIES} ${JANSSON_LIBRARIES})
+@@ -134,6 +136,11 @@ if (NOT DISABLE_FTL_APP)
+ target_include_directories(ftl_app PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/ftl_app)
+ endif()
+
++configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libftl.pc.in
++ ${CMAKE_CURRENT_BINARY_DIR}/libftl.pc @ONLY)
++
+ # Install rules
+ install(TARGETS ftl DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ install(FILES libftl/ftl.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libftl)
++install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libftl.pc
++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+diff --git a/libftl.pc.in b/libftl.pc.in
+new file mode 100644
+index 0000000000000000..106ffc8d4da4235e
+--- /dev/null
++++ b/libftl.pc.in
+@@ -0,0 +1,11 @@
++prefix=@CMAKE_INSTALL_PREFIX@
++exec_prefix=${prefix}
++libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
++includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/libftl
++
++Name: FTL
++Description: Library for Mixer's FTL Protocol
++Version: @FTL_VERSION@
++Requires.private: libcurl jansson
++Libs: -L${libdir} -lftl
++Cflags: -I${includedir}
+--
+2.31.1
+
diff --git a/cmake-Install-into-standard-directories.patch
b/cmake-Install-into-standard-directories.patch
new file mode 100644
index 0000000..7a1cec9
--- /dev/null
+++ b/cmake-Install-into-standard-directories.patch
@@ -0,0 +1,32 @@
+From f39e3c1d55103dd61b426c377f281f48d04ccd96 Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <jsteffens(a)make.tv>
+Date: Fri, 29 Mar 2019 12:06:31 +0100
+Subject: [PATCH 2/6] cmake: Install into standard directories
+
+---
+ CMakeLists.txt | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 930f16bc64008fd6..66eb27a5059fd7f7 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -11,6 +11,7 @@ MESSAGE(STATUS "FTL DISABLE_FTL_APP: " ${DISABLE_FTL_APP})
+ option(FTL_STATIC_COMPILE "Set to TRUE if you want ftl to be compiled as a static
lib. If TRUE, the program will want to statically link to the ftl cmake object."
FALSE)
+ MESSAGE(STATUS "FTL FTL_STATIC_COMPILE: " ${FTL_STATIC_COMPILE})
+
++include(GNUInstallDirs)
+ find_package(Threads REQUIRED)
+ find_package(PkgConfig)
+
+@@ -134,4 +135,5 @@ if (NOT DISABLE_FTL_APP)
+ endif()
+
+ # Install rules
+-install(TARGETS ftl DESTINATION lib)
+\ No newline at end of file
++install(TARGETS ftl DESTINATION ${CMAKE_INSTALL_LIBDIR})
++install(FILES libftl/ftl.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libftl)
+--
+2.31.1
+
diff --git a/cmake-Use-external-jansson-if-possible.patch
b/cmake-Use-external-jansson-if-possible.patch
new file mode 100644
index 0000000..42765eb
--- /dev/null
+++ b/cmake-Use-external-jansson-if-possible.patch
@@ -0,0 +1,45 @@
+From d8b016be5c23a6679cd36f21b818dcbedc44bc2c Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <jsteffens(a)make.tv>
+Date: Fri, 29 Mar 2019 12:05:35 +0100
+Subject: [PATCH 1/6] cmake: Use external jansson if possible
+
+---
+ CMakeLists.txt | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index ef616e99ebbbdd08..930f16bc64008fd6 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -12,6 +12,7 @@ option(FTL_STATIC_COMPILE "Set to TRUE if you want ftl to be
compiled as a stati
+ MESSAGE(STATUS "FTL FTL_STATIC_COMPILE: " ${FTL_STATIC_COMPILE})
+
+ find_package(Threads REQUIRED)
++find_package(PkgConfig)
+
+ set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
+ set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
+@@ -39,15 +40,18 @@ if (NOT CURL_FOUND AND NOT DISABLE_AUTO_INGEST)
+ endif()
+
+ # We will only try to include lib jansson if auto ingest is enabled.
+-SET(JANSSON_LIBRARIES "")
+-if (NOT DISABLE_AUTO_INGEST)
++if (PKG_CONFIG_FOUND AND NOT DISABLE_AUTO_INGEST)
++ pkg_check_modules(JANSSON jansson)
++endif()
++if (NOT JANSSON_FOUND AND NOT DISABLE_AUTO_INGEST)
+ SET(JANSSON_BUILD_DOCS OFF CACHE BOOL "Jansson docs off")
+ SET(JANSSON_WITHOUT_TESTS ON CACHE BOOL "Jansson build without tests")
+ SET(JANSSON_EXAMPLES OFF CACHE BOOL "Jansson disable examples")
+ SET(USE_WINDOWS_CRYPTOAPI off)
+ add_subdirectory(libjansson)
+- include_directories(${CMAKE_CURRENT_BINARY_DIR}/libjansson/include)
++ SET(JANSSON_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/libjansson/include)
+ SET(JANSSON_LIBRARIES jansson)
++ include_directories(${JANSSON_INCLUDE_DIRS})
+ endif()
+
+ if (WIN32)
+--
+2.31.1
diff --git a/libftl.spec b/libftl.spec
index fd8e089..d6b02c1 100644
--- a/libftl.spec
+++ b/libftl.spec
@@ -2,18 +2,22 @@
Name: libftl
Version: 0.9.14
-Release: 7%{?dist}
+Release: 8%{?dist}
Summary: FTL audio/video streaming library
License: MIT
URL:
https://github.com/mixer/ftl-sdk
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
-Patch0: libdir-fix.patch
-Patch1: headers-fix.patch
+Patch0: cmake-Use-external-jansson-if-possible.patch
+Patch1: cmake-Install-into-standard-directories.patch
+Patch2: cmake-Install-a-pkgconfig-file.patch
+Patch3: refactor-remove-ftl_app-completely.patch
BuildRequires: cmake3
BuildRequires: gcc
BuildRequires: gcc-c++
+BuildRequires: jansson-devel
+BuildRequires: libcurl-devel
%description
FTL-SDK is a cross platform SDK written in C to enable sending audio/video to
@@ -40,19 +44,6 @@ Development files for libftl.
%install
%cmake3_install
-mkdir -p %{buildroot}%{_libdir}/pkgconfig/
-cat << EOF > %{buildroot}%{_libdir}/pkgconfig/libftl.pc
-prefix=%{_prefix}
-libdir=%{_libdir}
-includedir=%{_includedir}/ftl
-
-Name:
-Description: FTL audio/video streaming library.
-Version: %{version}
-Libs: -L\${libdir} -lftl
-Cflags: -I\${includedir}
-EOF
-
%files
%license LICENSE
%doc README.md
@@ -62,9 +53,12 @@ EOF
%files devel
%{_libdir}/pkgconfig/libftl.pc
%{_libdir}/%{name}.so
-%{_includedir}/ftl/
+%{_includedir}/libftl/
%changelog
+* Thu Apr 22 2021 Leigh Scott <leigh123linux(a)gmail.com> - 0.9.14-8
+- Use archlinux patches
+
* Sat Apr 03 2021 Leigh Scott <leigh123linux(a)gmail.com> - 0.9.14-7
- Add pkgconfig file
diff --git a/refactor-remove-ftl_app-completely.patch
b/refactor-remove-ftl_app-completely.patch
new file mode 100644
index 0000000..cfd680a
--- /dev/null
+++ b/refactor-remove-ftl_app-completely.patch
@@ -0,0 +1,217 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,105 +1,98 @@
+-cmake_minimum_required (VERSION 2.8.0)
++cmake_minimum_required(VERSION 3.0)
+ enable_language(C)
+ project(libftl)
+
+-SET(FTL_VERSION "0.5.0")
++set(FTL_VERSION "0.5.0")
+
+ option(DISABLE_AUTO_INGEST "Set to TRUE to disable auto ingest feature which
removes curl and jansson dependancies" FALSE)
+-MESSAGE(STATUS "FTL DISABLE_AUTO_INGEST: " ${DISABLE_AUTO_INGEST})
+-
+-option(DISABLE_FTL_APP "Set to TRUE to disable including the ftl app in the cmake
output." FALSE)
+-MESSAGE(STATUS "FTL DISABLE_FTL_APP: " ${DISABLE_FTL_APP})
++message(STATUS "FTL DISABLE_AUTO_INGEST: " ${DISABLE_AUTO_INGEST})
+
+ option(FTL_STATIC_COMPILE "Set to TRUE if you want ftl to be compiled as a static
lib. If TRUE, the program will want to statically link to the ftl cmake object."
FALSE)
+-MESSAGE(STATUS "FTL FTL_STATIC_COMPILE: " ${FTL_STATIC_COMPILE})
++message(STATUS "FTL FTL_STATIC_COMPILE: " ${FTL_STATIC_COMPILE})
+
+ include(GNUInstallDirs)
+ find_package(Threads REQUIRED)
+ find_package(PkgConfig)
+
+-set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
+-set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
++set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
++set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
+
+ if (DISABLE_AUTO_INGEST)
+- add_definitions(-DDISABLE_AUTO_INGEST)
+-endif()
++ add_definitions(-DDISABLE_AUTO_INGEST)
++endif ()
+
+ # We will only try to include curl if we have auto ingest enabled.
+ if (NOT DISABLE_AUTO_INGEST)
+- FIND_PACKAGE(CURL)
+-endif()
++ find_package(CURL)
++endif ()
+ if (NOT CURL_FOUND AND NOT DISABLE_AUTO_INGEST)
+- SET(CURL_DISABLE_NTLM ON CACHE BOOL "Disabling NTLM")
+- SET(CURL_DISABLE_TELNET ON CACHE BOOL "Disabling Telnet")
+- SET(CURL_DISABLE_LDAP ON CACHE BOOL "Disabling Ldap")
+- SET(CURL_DISABLE_LDAPS ON CACHE BOOL "Disabling secure ldap")
+- SET(BUILD_CURL_EXE OFF CACHE BOOL "Building libcurl")
+- SET(HTTP_ONLY ON CACHE BOOL "using compiling HTTP")
+- SET(BUILD_TESTING OFF CACHE BOOL "Not building Tests")
+- add_subdirectory(libcurl)
+- SET(CURL_INCLUDE_DIRS libcurl/include
${CMAKE_CURRENT_BINARY_DIR}/libcurl/include/curl)
+- SET(CURL_LIBRARIES libcurl)
+- include_directories(${CURL_INCLUDE_DIRS})
+-endif()
++ set(CURL_DISABLE_NTLM ON CACHE BOOL "Disabling NTLM")
++ set(CURL_DISABLE_TELNET ON CACHE BOOL "Disabling Telnet")
++ set(CURL_DISABLE_LDAP ON CACHE BOOL "Disabling Ldap")
++ set(CURL_DISABLE_LDAPS ON CACHE BOOL "Disabling secure ldap")
++ set(BUILD_CURL_EXE OFF CACHE BOOL "Building libcurl")
++ set(HTTP_ONLY ON CACHE BOOL "using compiling HTTP")
++ set(BUILD_TESTING OFF CACHE BOOL "Not building Tests")
++ add_subdirectory(libcurl)
++ set(CURL_INCLUDE_DIRS libcurl/include
${CMAKE_CURRENT_BINARY_DIR}/libcurl/include/curl)
++ set(CURL_LIBRARIES libcurl)
++ include_directories(${CURL_INCLUDE_DIRS})
++endif ()
+
+ # We will only try to include lib jansson if auto ingest is enabled.
+ if (PKG_CONFIG_FOUND AND NOT DISABLE_AUTO_INGEST)
+- pkg_check_modules(JANSSON jansson)
+-endif()
++ pkg_check_modules(JANSSON jansson)
++endif ()
+ if (NOT JANSSON_FOUND AND NOT DISABLE_AUTO_INGEST)
+- SET(JANSSON_BUILD_DOCS OFF CACHE BOOL "Jansson docs off")
+- SET(JANSSON_WITHOUT_TESTS ON CACHE BOOL "Jansson build without tests")
+- SET(JANSSON_EXAMPLES OFF CACHE BOOL "Jansson disable examples")
+- SET(USE_WINDOWS_CRYPTOAPI off)
+- add_subdirectory(libjansson)
+- SET(JANSSON_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/libjansson/include)
+- SET(JANSSON_LIBRARIES jansson)
+- include_directories(${JANSSON_INCLUDE_DIRS})
+-endif()
++ set(JANSSON_BUILD_DOCS OFF CACHE BOOL "Jansson docs off")
++ set(JANSSON_WITHOUT_TESTS ON CACHE BOOL "Jansson build without tests")
++ set(JANSSON_EXAMPLES OFF CACHE BOOL "Jansson disable examples")
++ set(USE_WINDOWS_CRYPTOAPI off)
++ add_subdirectory(libjansson)
++ set(JANSSON_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/libjansson/include)
++ set(JANSSON_LIBRARIES jansson)
++ include_directories(${JANSSON_INCLUDE_DIRS})
++endif ()
+
+ if (WIN32)
+- set(FTL_PLATFORM_FILES ftl_app/win32/xgetopt.c
+- ftl_app/win32/xgetopt.h
+- ftl_app/win32/ctrlc_handler.c)
+- #set(FTL_PLATFORM_LIBS kernel32 user32 gdi32 advapi32 )
+- #set(FTL_PLATFORM_LIBS ws2_32 )
+- set(FTLSDK_PLATFORM_FILES libftl/win32/socket.c
+- libftl/win32/socket.h
+- libftl/win32/threads.c
+- libftl/win32/threads.h)
+- include_directories(libftl/win32)
+-else()
+- set(FTL_PLATFORM_FILES ftl_app/posix/ctrlc_handler.c)
+- set(FTLSDK_PLATFORM_FILES libftl/posix/socket.c
+- libftl/posix/socket.h
+- libftl/posix/threads.c
+- libftl/posix/threads.h)
+- include_directories(libftl/posix)
+-endif()
++ #set(FTL_PLATFORM_LIBS kernel32 user32 gdi32 advapi32 )
++ #set(FTL_PLATFORM_LIBS ws2_32 )
++ set(FTLSDK_PLATFORM_FILES libftl/win32/socket.c
++ libftl/win32/socket.h
++ libftl/win32/threads.c
++ libftl/win32/threads.h)
++ include_directories(libftl/win32)
++else ()
++ set(FTLSDK_PLATFORM_FILES libftl/posix/socket.c
++ libftl/posix/socket.h
++ libftl/posix/threads.c
++ libftl/posix/threads.h)
++ include_directories(libftl/posix)
++endif ()
+
+ # Figure out what kind of lib we should be producing.
+-if(FTL_STATIC_COMPILE)
+- set(FTL_LIB_TYPE STATIC)
+- add_definitions(-DFTL_STATIC_COMPILE=1)
+-else(FTL_STATIC_COMPILE)
+- set(FTL_LIB_TYPE SHARED)
+-endif(FTL_STATIC_COMPILE)
++if (FTL_STATIC_COMPILE)
++ set(FTL_LIB_TYPE STATIC)
++ add_definitions(-DFTL_STATIC_COMPILE=1)
++else ()
++ set(FTL_LIB_TYPE SHARED)
++endif ()
+
+ add_library(ftl ${FTL_LIB_TYPE} libftl/hmac/hmac.c
+- libftl/hmac/hmac.h
+- libftl/hmac/sha2.c
+- libftl/hmac/sha2.h
+- libftl/gettimeofday/gettimeofday.c
+- libftl/gettimeofday/gettimeofday.h
+- libftl/ftl-sdk.c
+- libftl/handshake.c
+- libftl/ingest.c
+- libftl/ftl_helpers.c
+- libftl/media.c
+- libftl/logging.c
+- libftl/ftl.h
+- libftl/ftl_private.h
+- ${FTLSDK_PLATFORM_FILES})
++ libftl/hmac/hmac.h
++ libftl/hmac/sha2.c
++ libftl/hmac/sha2.h
++ libftl/gettimeofday/gettimeofday.c
++ libftl/gettimeofday/gettimeofday.h
++ libftl/ftl-sdk.c
++ libftl/handshake.c
++ libftl/ingest.c
++ libftl/ftl_helpers.c
++ libftl/media.c
++ libftl/logging.c
++ libftl/ftl.h
++ libftl/ftl_private.h
++ ${FTLSDK_PLATFORM_FILES})
+ include_directories(libftl libftl/gettimeofday)
+
+ set_target_properties(ftl PROPERTIES VERSION ${FTL_VERSION})
+@@ -107,37 +100,12 @@ set_target_properties(ftl PROPERTIES SOVERSION 0)
+
+ target_link_libraries(ftl ${CURL_LIBRARIES} ${JANSSON_LIBRARIES})
+
+-if(WIN32)
+- target_link_libraries(ftl ws2_32)
+-endif()
+-
+-if (NOT DISABLE_FTL_APP)
+- add_executable(ftl_app
+- ftl_app/main.c
+- ftl_app/main.h
+- ftl_app/file_parser.c
+- ftl_app/file_parser.h
+- ftl_app/gettimeofday.c
+- ftl_app/gettimeofday.h
+- ftl_app/bitstream.c
+- ftl_app/bitstream.h
+- ftl_app/cavlc.c
+- ftl_app/cavlc.h
+- ftl_app/decode.c
+- ftl_app/decode.h
+- ftl_app/nalu.c
+- ftl_app/nalu.h
+- ftl_app/utils.c
+- ftl_app/utils.h
+- ftl_app/dec_obj.h
+- ${FTL_PLATFORM_FILES})
+-
+- target_link_libraries(ftl_app ftl ${CURL_LIBRARIES} ${JANSSON_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} ${FTL_PLATFORM_LIBS})
+- target_include_directories(ftl_app PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/ftl_app)
+-endif()
++if (WIN32)
++ target_link_libraries(ftl ws2_32)
++endif ()
+
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libftl.pc.in
+- ${CMAKE_CURRENT_BINARY_DIR}/libftl.pc @ONLY)
++ ${CMAKE_CURRENT_BINARY_DIR}/libftl.pc @ONLY)
+
+ # Install rules
+ install(TARGETS ftl DESTINATION ${CMAKE_INSTALL_LIBDIR})