From 7ca3d40b0d800fa7f11946b0497336bf5491fb7f Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Wed, 19 Apr 2017 22:48:37 +0200 Subject: [PATCH] Split patches --- debian/patches/0002-Build-system-fixes.patch | 69 ------------------- .../patches/0002-Hide-internal-symbols.patch | 37 ++++++++++ ...h-libm-and-libdl-to-fix-underlinking.patch | 24 +++++++ ...-and-X-libraries-to-fix-underlinking.patch | 42 +++++++++++ debian/patches/series | 4 +- 5 files changed, 106 insertions(+), 70 deletions(-) delete mode 100644 debian/patches/0002-Build-system-fixes.patch create mode 100644 debian/patches/0002-Hide-internal-symbols.patch create mode 100644 debian/patches/0004-Link-with-libm-and-libdl-to-fix-underlinking.patch create mode 100644 debian/patches/0005-Link-with-xcb-and-X-libraries-to-fix-underlinking.patch diff --git a/debian/patches/0002-Build-system-fixes.patch b/debian/patches/0002-Build-system-fixes.patch deleted file mode 100644 index b2f53d2..0000000 --- a/debian/patches/0002-Build-system-fixes.patch +++ /dev/null @@ -1,69 +0,0 @@ -From: Sebastian Ramacher -Date: Wed, 19 Apr 2017 21:45:40 +0200 -Subject: Build system fixes - ---- - libobs/CMakeLists.txt | 27 ++++++++++++++++++++------- - libobs/util/c99defs.h | 2 +- - 2 files changed, 21 insertions(+), 8 deletions(-) - -diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt -index cd2b80e..de274dd 100644 ---- a/libobs/CMakeLists.txt -+++ b/libobs/CMakeLists.txt -@@ -168,6 +168,23 @@ elseif(UNIX) - ${libobs_PLATFORM_DEPS} - ${X11_XCB_LIBRARIES}) - -+ include_directories( -+ ${XCB_INCLUDE_DIRS} -+ ${X11_XCB_INCLUDE_DIRS} -+ ${X11_X11_INCLUDE_PATH}) -+ -+ add_definitions( -+ ${XCB_DEFINITIONS} -+ ${X11_XCB_DEFINITIONS}) -+ -+ set(libobs_PLATFORM_DEPS -+ ${libobs_PLATFORM_DEPS} -+ ${XCB_LIBRARIES} -+ ${X11_XCB_LIBRARIES} -+ ${X11_X11_LIB} -+ m -+ dl) -+ - if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") - # use the sysinfo compatibility library on bsd - find_package(Libsysinfo REQUIRED) -@@ -401,15 +418,11 @@ target_compile_definitions(libobs - PUBLIC - HAVE_OBSCONFIG_H) - --if(NOT MSVC) -- target_compile_options(libobs -- PUBLIC -- -mmmx -- -msse -- -msse2) -+if(UNIX) -+ set_source_files_properties(${libobs_SOURCES} PROPERTIES -+ COMPILE_FLAGS "-fvisibility=hidden") - endif() - -- - target_compile_options(libobs - PUBLIC - "${THREADS_DEFINITIONS}") -diff --git a/libobs/util/c99defs.h b/libobs/util/c99defs.h -index 43d52c8..4890858 100644 ---- a/libobs/util/c99defs.h -+++ b/libobs/util/c99defs.h -@@ -46,7 +46,7 @@ - - #define EXPORT __declspec(dllexport) - #else --#define EXPORT -+#define EXPORT __attribute__((visibility("default"))) - #endif - - #if _MSC_VER && _MSC_VER < 0x0708 diff --git a/debian/patches/0002-Hide-internal-symbols.patch b/debian/patches/0002-Hide-internal-symbols.patch new file mode 100644 index 0000000..ffd25d4 --- /dev/null +++ b/debian/patches/0002-Hide-internal-symbols.patch @@ -0,0 +1,37 @@ +From: Sebastian Ramacher +Date: Wed, 19 Apr 2017 21:45:40 +0200 +Subject: Hide internal symbols + +--- + libobs/CMakeLists.txt | 4 ++++ + libobs/util/c99defs.h | 2 +- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt +index cd2b80e..ef5b9bc 100644 +--- a/libobs/CMakeLists.txt ++++ b/libobs/CMakeLists.txt +@@ -409,6 +409,10 @@ if(NOT MSVC) + -msse2) + endif() + ++if(UNIX) ++ set_source_files_properties(${libobs_SOURCES} PROPERTIES ++ COMPILE_FLAGS "-fvisibility=hidden") ++endif() + + target_compile_options(libobs + PUBLIC +diff --git a/libobs/util/c99defs.h b/libobs/util/c99defs.h +index 43d52c8..4890858 100644 +--- a/libobs/util/c99defs.h ++++ b/libobs/util/c99defs.h +@@ -46,7 +46,7 @@ + + #define EXPORT __declspec(dllexport) + #else +-#define EXPORT ++#define EXPORT __attribute__((visibility("default"))) + #endif + + #if _MSC_VER && _MSC_VER < 0x0708 diff --git a/debian/patches/0004-Link-with-libm-and-libdl-to-fix-underlinking.patch b/debian/patches/0004-Link-with-libm-and-libdl-to-fix-underlinking.patch new file mode 100644 index 0000000..edc9b37 --- /dev/null +++ b/debian/patches/0004-Link-with-libm-and-libdl-to-fix-underlinking.patch @@ -0,0 +1,24 @@ +From: Sebastian Ramacher +Date: Wed, 19 Apr 2017 22:44:48 +0200 +Subject: Link with libm and libdl to fix underlinking + +--- + libobs/CMakeLists.txt | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt +index ef5b9bc..d1b62c5 100644 +--- a/libobs/CMakeLists.txt ++++ b/libobs/CMakeLists.txt +@@ -168,6 +168,11 @@ elseif(UNIX) + ${libobs_PLATFORM_DEPS} + ${X11_XCB_LIBRARIES}) + ++ set(libobs_PLATFORM_DEPS ++ ${libobs_PLATFORM_DEPS} ++ m ++ dl) ++ + if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") + # use the sysinfo compatibility library on bsd + find_package(Libsysinfo REQUIRED) diff --git a/debian/patches/0005-Link-with-xcb-and-X-libraries-to-fix-underlinking.patch b/debian/patches/0005-Link-with-xcb-and-X-libraries-to-fix-underlinking.patch new file mode 100644 index 0000000..e81211e --- /dev/null +++ b/debian/patches/0005-Link-with-xcb-and-X-libraries-to-fix-underlinking.patch @@ -0,0 +1,42 @@ +From: Sebastian Ramacher +Date: Wed, 19 Apr 2017 23:02:17 +0200 +Subject: Link with xcb and X libraries to fix underlinking + +--- + libobs/CMakeLists.txt | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt +index d1b62c5..d36afa1 100644 +--- a/libobs/CMakeLists.txt ++++ b/libobs/CMakeLists.txt +@@ -14,7 +14,8 @@ endif() + if(UNIX) + find_package(DBus QUIET) + if (NOT APPLE) +- find_package(X11_XCB REQUIRED) ++ find_package(XCB COMPONENTS XCB REQUIRED) ++ find_package(X11 REQUIRED) + endif() + else() + set(HAVE_DBUS "0") +@@ -161,12 +162,17 @@ elseif(UNIX) + endif() + + include_directories( +- ${X11_XCB_INCLUDE_DIRS}) ++ ${XCB_INCLUDE_DIRS} ++ ${X11_XCB_INCLUDE_DIRS} ++ ${X11_X11_INCLUDE_DIRS}) + add_definitions( ++ ${XCB_DEFINITIONS} + ${X11_XCB_DEFINITIONS}) + set(libobs_PLATFORM_DEPS + ${libobs_PLATFORM_DEPS} +- ${X11_XCB_LIBRARIES}) ++ ${XCB_LIBRARIES} ++ ${X11_XCB_LIBRARIES} ++ ${X11_X11_LIB}) + + set(libobs_PLATFORM_DEPS + ${libobs_PLATFORM_DEPS} diff --git a/debian/patches/series b/debian/patches/series index 7c22d81..bf8556e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,5 @@ 0001-Use-common-license.patch -0002-Build-system-fixes.patch +0002-Hide-internal-symbols.patch 0003-Use-path-in-usr-lib.patch +0004-Link-with-libm-and-libdl-to-fix-underlinking.patch +0005-Link-with-xcb-and-X-libraries-to-fix-underlinking.patch