]> git.pld-linux.org Git - packages/bcg729.git/commitdiff
- aded git patch (updated to current master, adjusting cmake config files for mediast... master auto/th/bcg729-1.1.1-2
authorJakub Bogusz <qboosh@pld-linux.org>
Sun, 10 Mar 2024 06:36:58 +0000 (07:36 +0100)
committerJakub Bogusz <qboosh@pld-linux.org>
Sun, 10 Mar 2024 06:36:58 +0000 (07:36 +0100)
bcg729-git.patch [new file with mode: 0644]
bcg729.spec

diff --git a/bcg729-git.patch b/bcg729-git.patch
new file mode 100644 (file)
index 0000000..a8cafe4
--- /dev/null
@@ -0,0 +1,385 @@
+diff --git a/BCG729Config.cmake.in b/BCG729Config.cmake.in
+new file mode 100644
+index 0000000..1644e44
+--- /dev/null
++++ b/BCG729Config.cmake.in
+@@ -0,0 +1,47 @@
++############################################################################
++# BCG729Config.cmake
++# Copyright (C) 2015-2023  Belledonne Communications, Grenoble France
++#
++############################################################################
++#
++# This program is free software; you can redistribute it and/or
++# modify it under the terms of the GNU General Public License
++# as published by the Free Software Foundation; either version 2
++# of the License, or (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
++#
++############################################################################
++#
++# Config file for the bcg729 package.
++#
++# Targets
++# ^^^^^^^
++#
++# The following targets are defined:
++#  bcg729 - The bcg729 library target
++#
++#
++# Result variables
++# ^^^^^^^^^^^^^^^^
++#
++# This config file will set the following variables in your project:
++#
++#  BCG729_FOUND - The bcg729 library has been found
++#  BCG729_TARGET - The name of the CMake target for the bcg729 library
++
++
++@PACKAGE_INIT@
++
++include("${CMAKE_CURRENT_LIST_DIR}/BCG729Targets.cmake")
++
++set(BCG729_TARGET bcg729)
++
++check_required_components(BZRTP)
+diff --git a/Bcg729Config.cmake.in b/Bcg729Config.cmake.in
+deleted file mode 100644
+index 54d959b..0000000
+--- a/Bcg729Config.cmake.in
++++ /dev/null
+@@ -1,62 +0,0 @@
+-############################################################################
+-# Bcg729Config.cmake
+-# Copyright (C) 2015  Belledonne Communications, Grenoble France
+-#
+-############################################################################
+-#
+-# This program is free software; you can redistribute it and/or
+-# modify it under the terms of the GNU General Public License
+-# as published by the Free Software Foundation; either version 2
+-# of the License, or (at your option) any later version.
+-#
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-# GNU General Public License for more details.
+-#
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+-#
+-############################################################################
+-#
+-# Config file for the bcg729 package.
+-# It defines the following variables:
+-#
+-#  BCG729_FOUND - system has bcg729
+-#  BCG729_INCLUDE_DIRS - the bcg729 include directory
+-#  BCG729_LIBRARIES - The libraries needed to use bcg729
+-#  BCG729_CPPFLAGS - The compilation flags needed to use bcg729
+-
+-@PACKAGE_INIT@
+-
+-include("${CMAKE_CURRENT_LIST_DIR}/Bcg729Targets.cmake")
+-
+-if(@ENABLE_SHARED@)
+-      set(BCG729_TARGETNAME bcg729)
+-      set(BCG729_LIBRARIES ${BCG729_TARGETNAME})
+-else()
+-      set(BCG729_TARGETNAME bcg729-static)
+-      if(TARGET ${BCG729_TARGETNAME})
+-              if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
+-                      set(BCG729_LIBRARIES ${BCG729_TARGETNAME})
+-              else()
+-                      get_target_property(BCG729_LIBRARIES ${BCG729_TARGETNAME} LOCATION)
+-              endif()
+-              get_target_property(BCG729_LINK_LIBRARIES ${BCG729_TARGETNAME} INTERFACE_LINK_LIBRARIES)
+-              if(BCG729_LINK_LIBRARIES)
+-                      list(APPEND BCG729_LIBRARIES ${BCG729_LINK_LIBRARIES})
+-              endif()
+-      endif()
+-endif()
+-get_target_property(BCG729_INCLUDE_DIRS ${BCG729_TARGETNAME} INTERFACE_INCLUDE_DIRECTORIES)
+-if (NOT BCG729_INCLUDE_DIRS)
+-      set (BCG729_INCLUDE_DIRS)
+-endif()
+-
+-list(INSERT BCG729_INCLUDE_DIRS 0 "@CMAKE_INSTALL_FULL_INCLUDEDIR@")
+-
+-list(REMOVE_DUPLICATES BCG729_INCLUDE_DIRS)
+-
+-set(BCG729_CPPFLAGS @BCG729_CPPFLAGS@)
+-set(BCG729_FOUND 1)
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 69dbaef..6c40d55 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ ############################################################################
+ # CMakeLists.txt
+-# Copyright (C) 2014  Belledonne Communications, Grenoble France
++# Copyright (C) 2014-2023  Belledonne Communications, Grenoble France
+ #
+ ############################################################################
+ #
+@@ -20,8 +20,9 @@
+ #
+ ############################################################################
+-cmake_minimum_required(VERSION 3.1)
+-project(bcg729 VERSION 1.1.1 LANGUAGES C)
++cmake_minimum_required(VERSION 3.22)
++
++project(BCG729 VERSION 1.1.1 LANGUAGES C)
+ set(PACKAGE "${PROJECT_NAME}")
+@@ -34,27 +35,15 @@ set(PACKAGE_URL "")
+ set(VERSION "${PACKAGE_VERSION}")
+-option(ENABLE_SHARED "Build shared library." YES)
+-option(ENABLE_STATIC "Build static library." YES)
+ option(ENABLE_STRICT "Build with strict compile options." YES)
+-option(ENABLE_TESTS "Enable compilation of the tests." NO)
++option(ENABLE_UNIT_TESTS "Enable compilation of the tests." NO)
+ include(GNUInstallDirs)
+-include_directories(
+-      include
+-      src
+-      ${CMAKE_CURRENT_BINARY_DIR}
+-      ${CMAKE_CURRENT_BINARY_DIR}/src
+-)
+-set(MSVC_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/MSVC")
+-if(MSVC)
+-      include_directories(${MSVC_INCLUDE_DIR})
+-endif()
+ set(BCG729_CPPFLAGS )
+-if(ENABLE_STATIC)
++if(NOT BUILD_SHARED_LIBS)
+       set(BCG729_STATIC 1)
+       list(APPEND BCG729_CPPFLAGS "-DBCG729_STATIC")
+ endif()
+@@ -69,7 +58,7 @@ else()
+                       add_definitions(" -Werror -Wextra -Wno-unused-parameter -Wno-missing-field-initializers ")
+               endif()
+       endif()
+-      if(NOT ENABLE_TESTS) # test access inner functions so maintain visibility if we want to run tests
++      if(NOT ENABLE_UNIT_TESTS) # test access inner functions so maintain visibility if we want to run tests
+               add_definitions("-fvisibility=hidden")
+       endif()
+       if(CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+@@ -77,53 +66,53 @@ else()
+       endif()
+ endif()
+-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
++configure_file(${PROJECT_SOURCE_DIR}/config.h.cmake ${PROJECT_BINARY_DIR}/config.h)
+ add_subdirectory(include)
+ add_subdirectory(src)
+-if(ENABLE_TESTS)
++if(ENABLE_UNIT_TESTS AND NOT WIN32)
++      # Deactivated on Windows because of symbol export issues (TODO: fix that)
+       add_subdirectory(test)
+ endif()
+ include(CMakePackageConfigHelpers)
+-set(CONFIG_PACKAGE_LOCATION "${CMAKE_INSTALL_DATADIR}/Bcg729/cmake")
+-write_basic_package_version_file(
+-      "${CMAKE_CURRENT_BINARY_DIR}/Bcg729ConfigVersion.cmake"
+-      VERSION ${PACKAGE_VERSION}
++set(CMAKE_MODULES_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake")
++configure_package_config_file("${PROJECT_NAME}Config.cmake.in" "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
++      INSTALL_DESTINATION "${CMAKE_MODULES_INSTALL_DIR}"
++      NO_SET_AND_CHECK_MACRO
++)
++write_basic_package_version_file("${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
++      VERSION ${PROJECT_VERSION}
+       COMPATIBILITY AnyNewerVersion
+ )
+-export(EXPORT Bcg729Targets
+-      FILE "${CMAKE_CURRENT_BINARY_DIR}/Bcg729Targets.cmake"
++install(FILES
++      "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
++      "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
++      DESTINATION ${CMAKE_MODULES_INSTALL_DIR}
+ )
+-configure_package_config_file(Bcg729Config.cmake.in
+-      "${CMAKE_CURRENT_BINARY_DIR}/Bcg729Config.cmake"
+-      INSTALL_DESTINATION ${CONFIG_PACKAGE_LOCATION}
+-      NO_SET_AND_CHECK_MACRO
++
++export(EXPORT ${PROJECT_NAME}Targets
++      FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake"
++)
++install(EXPORT ${PROJECT_NAME}Targets
++      FILE "${PROJECT_NAME}Targets.cmake"
++      DESTINATION ${CMAKE_MODULES_INSTALL_DIR}
+ )
++
+ set(prefix "${CMAKE_INSTALL_PREFIX}")
+ set(exec_prefix "\${prefix}")
+ set(includedir  "\${prefix}/include")
+ set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
+ configure_file(libbcg729.pc.in
+-      "${CMAKE_CURRENT_BINARY_DIR}/libbcg729.pc"
++      "${PROJECT_BINARY_DIR}/libbcg729.pc"
+       @ONLY
+ )
+ install(FILES
+-      "${CMAKE_CURRENT_BINARY_DIR}/libbcg729.pc"
++      "${PROJECT_BINARY_DIR}/libbcg729.pc"
+       DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
+ )
+-install(EXPORT Bcg729Targets
+-      FILE Bcg729Targets.cmake
+-      DESTINATION ${CONFIG_PACKAGE_LOCATION}
+-)
+-install(FILES
+-      "${CMAKE_CURRENT_BINARY_DIR}/Bcg729Config.cmake"
+-      "${CMAKE_CURRENT_BINARY_DIR}/Bcg729ConfigVersion.cmake"
+-      DESTINATION ${CONFIG_PACKAGE_LOCATION}
+-)
+ add_subdirectory(build)
+-
+diff --git a/README.md b/README.md
+index b9c6547..afe418a 100644
+--- a/README.md
++++ b/README.md
+@@ -53,9 +53,7 @@ Building by Autotools way is deprecated. Use [CMake][cmake-website] to configure
+ * `CMAKE_INSTALL_PREFIX=<string>` : install prefix
+ * `CMAKE_PREFIX_PATH=<string>`    : column-separated list of prefixes where to look for dependencies
+-* `ENABLE_SHARED=NO`              : do not build the shared library
+-* `ENABLE_STATIC=NO`              : do not build the static library
+-* `ENABLE_TESTS=NO`               : do not build non-regression tests
++* `ENABLE_UNIT_TESTS=NO`               : do not build non-regression tests
+ ### Note for packagers
+diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt
+index 9cda4d2..3146bdc 100644
+--- a/build/CMakeLists.txt
++++ b/build/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ ############################################################################
+ # CMakeLists.txt
+-# Copyright (C) 2017-2018  Belledonne Communications, Grenoble France
++# Copyright (C) 2017-2023  Belledonne Communications, Grenoble France
+ #
+ ############################################################################
+ #
+@@ -21,7 +21,8 @@
+ ############################################################################
+ if(NOT CPACK_PACKAGE_NAME)
+-      set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
++      string(TOLOWER "${PROJECT_NAME}" LOWERCASE_PROJECT_NAME)
++      set(CPACK_PACKAGE_NAME "${LOWERCASE_PROJECT_NAME}")
+ ENDIF()
+ set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/../LICENSE.txt")
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 75522d1..60ca4f8 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ ############################################################################
+ # CMakeLists.txt
+-# Copyright (C) 2014  Belledonne Communications, Grenoble France
++# Copyright (C) 2014-2023  Belledonne Communications, Grenoble France
+ #
+ ############################################################################
+ #
+@@ -49,32 +49,33 @@ set(BCG729_SOURCE_FILES
+       vad.c
+ )
+-if(ENABLE_STATIC)
+-      add_library(bcg729-static STATIC ${BCG729_SOURCE_FILES})
+-      target_compile_definitions(bcg729-static PRIVATE "-DBCG729_EXPORTS")
+-      set_target_properties(bcg729-static PROPERTIES OUTPUT_NAME bcg729)
+-      install(TARGETS bcg729-static EXPORT Bcg729Targets
+-              ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+-              PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+-      )
+-endif()
+-if(ENABLE_SHARED)
+-      add_library(bcg729 SHARED ${BCG729_SOURCE_FILES})
+-      target_compile_definitions(bcg729 PRIVATE "-DBCG729_EXPORTS")
+-      set_target_properties(bcg729 PROPERTIES VERSION 0)
+-      if(MSVC)
+-              if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
+-                      install(FILES $<TARGET_PDB_FILE:bcg729>
+-                              DESTINATION ${CMAKE_INSTALL_BINDIR}
+-                              PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+-                      )
+-              endif()
+-              set_target_properties(bcg729 PROPERTIES PREFIX "lib")
++add_library(bcg729 ${BCG729_SOURCE_FILES})
++target_compile_definitions(bcg729 PRIVATE "BCG729_EXPORTS")
++set_target_properties(bcg729 PROPERTIES VERSION 0)
++target_include_directories(bcg729
++      PUBLIC
++              $<INSTALL_INTERFACE:include>
++              $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
++      PRIVATE
++              ${PROJECT_SOURCE_DIR}/include
++              ${PROJECT_SOURCE_DIR}/src
++              ${PROJECT_BINARY_DIR}
++)
++
++if(MSVC AND BUILD_SHARED_LIBS)
++      if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
++              install(FILES $<TARGET_PDB_FILE:bcg729>
++                      DESTINATION ${CMAKE_INSTALL_BINDIR}
++                      PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
++              )
+       endif()
+-      install(TARGETS bcg729 EXPORT Bcg729Targets
+-              RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+-              LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+-              ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+-              PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+-      )
++      set_target_properties(bcg729 PROPERTIES PREFIX "lib")
+ endif()
++
++
++install(TARGETS bcg729 EXPORT ${PROJECT_NAME}Targets
++      RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
++      LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++      ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
++      PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
++)
+diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
+index 6940798..99bbfc9 100644
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -24,6 +24,8 @@ set(BCG729_LIBRARY bcg729)
+ set(UTIL_SRC src/testUtils.c  src/testUtils.h)
++include_directories(${PROJECT_SOURCE_DIR}/src ${PROJECT_BINARY_DIR})
++
+ add_executable(adaptativeCodebookSearchTest src/adaptativeCodebookSearchTest.c ${UTIL_SRC})
+ target_link_libraries(adaptativeCodebookSearchTest ${BCG729_LIBRARY})
index 2285f9beede7f2d11e20ee54c712151168f545a6..aca000939808b6576b6037c0ada224ed05831444 100644 (file)
@@ -6,14 +6,15 @@ Summary:      ITU G729 Annex A speech codec library
 Summary(pl.UTF-8):     Biblioteka kodeka mowy ITU G729 Annex A
 Name:          bcg729
 Version:       1.1.1
-Release:       1
+Release:       2
 License:       GPL v3+
 Group:         Libraries
 #Source0Download: https://gitlab.linphone.org/BC/public/bcg729/tags
 Source0:       https://gitlab.linphone.org/BC/public/bcg729/-/archive/%{version}/%{name}-%{version}.tar.bz2
 # Source0-md5: 23b0c28422df3251adbc81e596ef9861
-URL:           http://www.linphone.org/technical-corner/bcg729
-BuildRequires: cmake >= 3.1
+Patch0:                %{name}-git.patch
+URL:           https://www.linphone.org/technical-corner/bcg729
+BuildRequires: cmake >= 3.22
 BuildRequires: pkgconfig
 BuildRequires: rpmbuild(macros) >= 1.745
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -64,24 +65,32 @@ Statyczna biblioteka bcg729.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
-install -d build
-cd build
-%cmake .. \
+%if %{with static_libs}
+%cmake -B builddir-static \
        -DCMAKE_INSTALL_LIBDIR=%{_lib} \
-       %{!?with_static_libs:-DENABLE_STATIC=OFF}
+       -DBUILD_SHARED_LIBS=OFF
+
+%{__make} -C builddir-static
+%endif
+
+%cmake -B builddir \
+       -DCMAKE_INSTALL_LIBDIR=%{_lib}
 
-%{__make}
+%{__make} -C builddir
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-%{__make} -C build install \
+%if %{with static_libs}
+%{__make} -C builddir-static install \
        DESTDIR=$RPM_BUILD_ROOT
+%endif
 
-# disable completeness check incompatible with split packaging
-%{__sed} -i -e '/^foreach(target .*IMPORT_CHECK_TARGETS/,/^endforeach/d; /^unset(_IMPORT_CHECK_TARGETS)/d' $RPM_BUILD_ROOT%{_datadir}/Bcg729/cmake/Bcg729Targets.cmake
+%{__make} -C builddir install \
+       DESTDIR=$RPM_BUILD_ROOT
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -99,8 +108,8 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_libdir}/libbcg729.so
 %{_includedir}/bcg729
 %{_pkgconfigdir}/libbcg729.pc
-%dir %{_datadir}/Bcg729
-%{_datadir}/Bcg729/cmake
+%dir %{_datadir}/BCG729
+%{_datadir}/BCG729/cmake
 
 %if %{with static_libs}
 %files static
This page took 0.118011 seconds and 4 git commands to generate.