[vlc-devel] [PATCH 2/3] contrib: openjpeg: import pthreads library where necessary

Sean McGovern gseanmcg at gmail.com
Wed Dec 6 04:56:44 CET 2017


---
 contrib/src/openjpeg/openjp2_pthread.patch | 39 ++++++++++++++++++++++++++++++
 contrib/src/openjpeg/rules.mak             |  1 +
 2 files changed, 40 insertions(+)
 create mode 100644 contrib/src/openjpeg/openjp2_pthread.patch

diff --git a/contrib/src/openjpeg/openjp2_pthread.patch b/contrib/src/openjpeg/openjp2_pthread.patch
new file mode 100644
index 0000000..2065f58
--- /dev/null
+++ b/contrib/src/openjpeg/openjp2_pthread.patch
@@ -0,0 +1,39 @@
+--- openjpeg/src/lib/openjp2/libopenjp2.pc.cmake.in.ORIG	2017-10-04 18:23:14.000000000 -0400
++++ openjpeg/src/lib/openjp2/libopenjp2.pc.cmake.in	2017-12-05 19:05:07.578239280 -0500
+@@ -10,5 +10,5 @@
+ URL: http://www.openjpeg.org/
+ Version: @OPENJPEG_VERSION@
+ Libs: -L${libdir} -lopenjp2
+-Libs.private: -lm
++Libs.private: -lm @PTHREAD_LIBS@
+ Cflags: -I${includedir}
+--- openjpeg/src/lib/openjp2/CMakeLists.txt.ORIG	2017-12-05 19:24:42.152312033 -0500
++++ openjpeg/src/lib/openjp2/CMakeLists.txt	2017-12-05 19:25:35.097306981 -0500
+@@ -188,6 +188,7 @@
+ endif(OPJ_USE_THREAD AND Threads_FOUND AND CMAKE_USE_WIN32_THREADS_INIT )
+ 
+ if(OPJ_USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT )
++   set(PTHREAD_LIBS ${CMAKE_THREAD_LIBS_INIT})
+    add_definitions( -DMUTEX_pthread)
+ endif(OPJ_USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT )
+ 
+@@ -216,3 +216,8 @@
+         target_link_libraries(test_sparse_array ${CMAKE_THREAD_LIBS_INIT})
+     endif(OPJ_USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT)
+ endif(BUILD_UNIT_TESTS)
++
++if(UNIX)
++    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libopenjp2.pc.cmake.in
++                   ${PROJECT_BINARY_DIR}/libopenjp2.pc @ONLY)
++endif(UNIX)
+--- openjpeg/CMakeLists.txt.ORIG	2017-10-04 18:23:14.000000000 -0400
++++ openjpeg/CMakeLists.txt	2017-12-05 19:43:35.573788173 -0500
+@@ -359,8 +359,6 @@
+ endif()
+ if(BUILD_PKGCONFIG_FILES)
+   # install in lib and not share (see multi-arch note above)
+-  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjp2/libopenjp2.pc.cmake.in
+-    ${CMAKE_CURRENT_BINARY_DIR}/libopenjp2.pc @ONLY)
+   install( FILES  ${CMAKE_CURRENT_BINARY_DIR}/libopenjp2.pc DESTINATION
+     ${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig )
+ #
diff --git a/contrib/src/openjpeg/rules.mak b/contrib/src/openjpeg/rules.mak
index d7968c2..3cb52b0 100644
--- a/contrib/src/openjpeg/rules.mak
+++ b/contrib/src/openjpeg/rules.mak
@@ -16,6 +16,7 @@ ifdef HAVE_VISUALSTUDIO
 endif
 #	$(APPLY) $(SRC)/openjpeg/restrict.patch
 	$(APPLY) $(SRC)/openjpeg/install.patch
+	$(APPLY) $(SRC)/openjpeg/openjp2_pthread.patch
 	$(call pkg_static,"./src/lib/openjp2/libopenjp2.pc.cmake.in")
 	$(MOVE)
 
-- 
2.7.4



More information about the vlc-devel mailing list