[packages/liblinphone] - added c++-static patch, restore static liblinphone++ and .pc files
qboosh
qboosh at pld-linux.org
Thu Jul 15 22:44:25 CEST 2021
commit 1943762bdf9f7d429e4c9ba805ee7c3856a1aeb4
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Thu Jul 15 22:47:43 2021 +0200
- added c++-static patch, restore static liblinphone++ and .pc files
liblinphone-c++-static.patch | 53 ++++++++++++++++++++++++++++++++++++++++++++
liblinphone.spec | 42 ++++++++++++++++++++++++++++++-----
2 files changed, 90 insertions(+), 5 deletions(-)
---
diff --git a/liblinphone.spec b/liblinphone.spec
index 9dcfab8..f765558 100644
--- a/liblinphone.spec
+++ b/liblinphone.spec
@@ -16,6 +16,7 @@ Group: Applications/Communications
#Source0Download: https://gitlab.linphone.org/BC/public/liblinphone/-/tags
Source0: https://gitlab.linphone.org/BC/public/liblinphone/-/archive/%{version}/%{name}-%{version}.tar.bz2
# Source0-md5: eb36559e436cd785aefec066e65ffc19
+Patch0: %{name}-c++-static.patch
URL: http://www.linphone.org/technical-corner/liblinphone
# base and tester components
BuildRequires: bctoolbox-devel >= 0.0.3
@@ -193,6 +194,7 @@ pochodzącego z GNOME.
%prep
%setup -q
+%patch0 -p1
%build
install -d builddir
@@ -229,6 +231,36 @@ install -d $RPM_BUILD_ROOT%{_mandir}/{man1,cs/man1}
cp -p share/C/{linphonec,linphonecsh}.1 $RPM_BUILD_ROOT%{_mandir}/man1
cp -p share/cs/linphonec.1 $RPM_BUILD_ROOT%{_mandir}/cs/man1
+# missing in 4.x
+install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
+cat >>$RPM_BUILD_ROOT%{_pkgconfigdir}/linphone.pc <<'EOF'
+prefix=%{_prefix}
+exec_prefix=%{_prefix}
+libdir=%{_libdir}
+includedir=%{_includedir}
+
+Name: liblinphone
+Requires: mediastreamer ortp bctoolbox
+Description: All in one linphone libs.
+Version: %{version}
+Libs: -L${libdir} -llinphone
+Cflags: -I${includedir}
+EOF
+
+cat >>$RPM_BUILD_ROOT%{_pkgconfigdir}/linphone++.pc <<'EOF'
+prefix=%{_prefix}
+exec_prefix=%{_prefix}
+libdir=%{_libdir}
+includedir=%{_includedir}
+
+Name: liblinphone++
+Requires.private: linphone bctoolbox belle-sip
+Description: C++ wrapper for linphone libraries.
+Version: %{version}
+Libs: -L${libdir} -llinphone++
+Cflags: -I${includedir}
+EOF
+
%clean
rm -rf $RPM_BUILD_ROOT
@@ -255,7 +287,7 @@ rm -rf $RPM_BUILD_ROOT
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/liblinphone.so
%{_includedir}/linphone
-#%{_pkgconfigdir}/linphone.pc
+%{_pkgconfigdir}/linphone.pc
%dir %{_datadir}/Linphone
%{_datadir}/Linphone/cmake
@@ -277,14 +309,14 @@ rm -rf $RPM_BUILD_ROOT
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/liblinphone++.so
%{_includedir}/linphone++
-#%{_pkgconfigdir}/linphone++.pc
+%{_pkgconfigdir}/linphone++.pc
%dir %{_datadir}/LinphoneCxx
%{_datadir}/LinphoneCxx/cmake
%if %{with static_libs}
-#%files c++-static
-#%defattr(644,root,root,755)
-#%{_libdir}/liblinphone++.a
+%files c++-static
+%defattr(644,root,root,755)
+%{_libdir}/liblinphone++.a
%endif
%files c++-apidocs
diff --git a/liblinphone-c++-static.patch b/liblinphone-c++-static.patch
new file mode 100644
index 0000000..0ab837a
--- /dev/null
+++ b/liblinphone-c++-static.patch
@@ -0,0 +1,53 @@
+--- liblinphone-4.5.24/wrappers/cpp/CMakeLists.txt.orig 2021-07-06 10:06:15.000000000 +0200
++++ liblinphone-4.5.24/wrappers/cpp/CMakeLists.txt 2021-07-15 21:33:45.817747269 +0200
+@@ -38,6 +38,7 @@
+ )
+ add_custom_target(linphone-cxx-wrapper ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/include/linphone++/linphone.hh" "${CMAKE_CURRENT_BINARY_DIR}/src/linphone++.cc")
+
++if(ENABLE_SHARED)
+ add_library(linphone++ SHARED
+ object.cc
+ tools.cc
+@@ -81,6 +82,42 @@
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ FRAMEWORK DESTINATION Frameworks
+ )
++endif()
++if(ENABLE_STATIC)
++add_library(linphone++-static STATIC
++ object.cc
++ tools.cc
++ ${CMAKE_CURRENT_BINARY_DIR}/src/linphone++.cc
++)
++add_dependencies(linphone++-static linphone-cxx-wrapper)
++
++if(APPLE)
++ set_target_properties(linphone++-static PROPERTIES OUTPUT_NAME linphone++)
++else()
++ set_target_properties(linphone++-static PROPERTIES OUTPUT_NAME liblinphone++)
++endif()
++set_target_properties(linphone++-static PROPERTIES PREFIX "")
++target_link_libraries(linphone++-static
++ PRIVATE ${BCTOOLBOX_CORE_LIBRARIES} ${BELLESIP_LIBRARIES} linphone
++)
++
++target_include_directories(linphone++-static
++ PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/include
++ PRIVATE ${PROJECT_BINARY_DIR}/include
++ PRIVATE ${PROJECT_SOURCE_DIR}/include
++ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
++ PRIVATE ${BCTOOLBOX_INCLUDE_DIRS}
++ PRIVATE ${BELLESIP_INCLUDE_DIRS}
++)
++
++install(TARGETS linphone++-static EXPORT LinphoneCxxTargets
++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ FRAMEWORK DESTINATION Frameworks
++)
++endif()
++
+ install(FILES object.hh
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/linphone++
+ )
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/liblinphone.git/commitdiff/1943762bdf9f7d429e4c9ba805ee7c3856a1aeb4
More information about the pld-cvs-commit
mailing list