vlc | branch: master | Thomas Guillem <tho...@gllm.fr> | Tue Mar 13 11:08:08 
2018 +0100| [aeeceec8d5f362baee4db97a6f9be7fba054f334] | committer: Thomas 
Guillem

contrib: soxr: fix build on WIN32

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=aeeceec8d5f362baee4db97a6f9be7fba054f334
---

 contrib/src/soxr/0001-always-generate-.pc.patch    | 36 ++++++++++++++++
 .../src/soxr/0002-expose-Libs.private-in-.pc.patch | 48 ++++++++++++++++++++++
 contrib/src/soxr/rules.mak                         |  2 +
 3 files changed, 86 insertions(+)

diff --git a/contrib/src/soxr/0001-always-generate-.pc.patch 
b/contrib/src/soxr/0001-always-generate-.pc.patch
new file mode 100644
index 0000000000..c6e2d6f6f4
--- /dev/null
+++ b/contrib/src/soxr/0001-always-generate-.pc.patch
@@ -0,0 +1,36 @@
+From f3aa21ee2ebe3bb64f121dfd2ffed9a5d904a001 Mon Sep 17 00:00:00 2001
+From: Thomas Guillem <tho...@gllm.fr>
+Date: Tue, 13 Mar 2018 10:56:25 +0100
+Subject: [PATCH 1/2] always generate .pc
+
+This allows .pc files to be generated when cross-compiling for WIN32 (using
+mingw32).
+---
+ src/CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index bb01a0d..f2c1c87 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -86,7 +86,7 @@ set_target_properties (${PROJECT_NAME} PROPERTIES
+   PUBLIC_HEADER "${PROJECT_NAME}.h")
+ if (BUILD_FRAMEWORK)
+   set_target_properties (${PROJECT_NAME} PROPERTIES FRAMEWORK TRUE)
+-elseif (NOT WIN32)
++else ()
+   set (TARGET_PCS ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc)
+   configure_file (${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc.in 
${TARGET_PCS})
+   install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION 
${LIB_INSTALL_DIR}/pkgconfig)
+@@ -110,7 +110,7 @@ if (WITH_LSR_BINDINGS)
+     PUBLIC_HEADER "${LSR}.h")
+   if (BUILD_FRAMEWORK)
+     set_target_properties (${LSR} PROPERTIES FRAMEWORK TRUE)
+-  elseif (NOT WIN32)
++  else ()
+     set (TARGET_PCS "${TARGET_PCS} ${CMAKE_CURRENT_BINARY_DIR}/${LSR}.pc")
+     configure_file (${CMAKE_CURRENT_SOURCE_DIR}/${LSR}.pc.in 
${CMAKE_CURRENT_BINARY_DIR}/${LSR}.pc)
+     install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${LSR}.pc DESTINATION 
${LIB_INSTALL_DIR}/pkgconfig)
+-- 
+2.11.0
+
diff --git a/contrib/src/soxr/0002-expose-Libs.private-in-.pc.patch 
b/contrib/src/soxr/0002-expose-Libs.private-in-.pc.patch
new file mode 100644
index 0000000000..134e5eccbb
--- /dev/null
+++ b/contrib/src/soxr/0002-expose-Libs.private-in-.pc.patch
@@ -0,0 +1,48 @@
+From 09360cec54474d8739efd058d995646160594421 Mon Sep 17 00:00:00 2001
+From: Thomas Guillem <tho...@gllm.fr>
+Date: Tue, 13 Mar 2018 10:57:27 +0100
+Subject: [PATCH 2/2] expose Libs.private in .pc
+
+This fixes static build when avcodec and/or avutil is used.
+---
+ CMakeLists.txt     | 2 ++
+ src/soxr-lsr.pc.in | 1 +
+ src/soxr.pc.in     | 1 +
+ 3 files changed, 4 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index ee48f6c..5adb583 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -142,6 +142,8 @@ if (WITH_AVFFT OR (CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" 
AND SIMD32_FOUND AND WI
+   endif ()
+ endif ()
+ 
++string(REPLACE ";" " " LIBS_PRIVATE_PC "${LIBS}")
++
+ check_function_exists (lrint HAVE_LRINT)
+ check_include_files (fenv.h HAVE_FENV_H)
+ check_include_files (stdbool.h HAVE_STDBOOL_H)
+diff --git a/src/soxr-lsr.pc.in b/src/soxr-lsr.pc.in
+index 7b75757..5d51778 100644
+--- a/src/soxr-lsr.pc.in
++++ b/src/soxr-lsr.pc.in
+@@ -2,4 +2,5 @@ Name: ${LSR}
+ Description: ${DESCRIPTION_SUMMARY} (with libsamplerate-like bindings)
+ Version: ${PROJECT_VERSION}
+ Libs: -L${LIB_INSTALL_DIR} -l${LSR}
++Libs.private: ${LIBS_PRIVATE_PC}
+ Cflags: -I${INCLUDE_INSTALL_DIR}
+diff --git a/src/soxr.pc.in b/src/soxr.pc.in
+index 69d225b..30f0d2d 100644
+--- a/src/soxr.pc.in
++++ b/src/soxr.pc.in
+@@ -2,4 +2,5 @@ Name: ${PROJECT_NAME}
+ Description: ${DESCRIPTION_SUMMARY}
+ Version: ${PROJECT_VERSION}
+ Libs: -L${LIB_INSTALL_DIR} -l${PROJECT_NAME}
++Libs.private: ${LIBS_PRIVATE_PC}
+ Cflags: -I${INCLUDE_INSTALL_DIR}
+-- 
+2.11.0
+
diff --git a/contrib/src/soxr/rules.mak b/contrib/src/soxr/rules.mak
index c7584809f7..ed2893f138 100644
--- a/contrib/src/soxr/rules.mak
+++ b/contrib/src/soxr/rules.mak
@@ -15,6 +15,8 @@ $(TARBALLS)/soxr-$(SOXR_VERSION)-Source.tar.xz:
 
 soxr: soxr-$(SOXR_VERSION)-Source.tar.xz .sum-soxr
        $(UNPACK)
+       $(APPLY) $(SRC)/soxr/0001-always-generate-.pc.patch
+       $(APPLY) $(SRC)/soxr/0002-expose-Libs.private-in-.pc.patch
        $(MOVE)
 
 .soxr: soxr toolchain.cmake

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to