Commit f3d73298 authored by Ghislain MARY's avatar Ghislain MARY

Merge branch 'build_soci'

parents ff73b4c6 0ea63d2e
......@@ -21,20 +21,17 @@
############################################################################
cmake_minimum_required(VERSION 3.0)
project(androidsupport LANGUAGES C)
project(androidsupport LANGUAGES CXX)
include(GNUInstallDirs)
set(SUPPORT_SOURCES
"${CMAKE_ANDROID_NDK}/sources/android/support/src/musl-multibyte/wctomb.c"
"${CMAKE_ANDROID_NDK}/sources/android/support/src/iswblank.cpp"
)
add_library(support STATIC ${SUPPORT_SOURCES})
target_include_directories(support PUBLIC "${CMAKE_ANDROID_NDK}/sources/android/support/include")
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(support PRIVATE "-std=c99")
endif()
install(TARGETS support
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
......@@ -42,11 +39,3 @@ install(TARGETS support
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
if(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
install(FILES
"${CMAKE_ANDROID_NDK}/sources/android/support/include/ctype.h"
"${CMAKE_ANDROID_NDK}/sources/android/support/include/langinfo.h"
"${CMAKE_ANDROID_NDK}/sources/android/support/include/nl_types.h"
"${CMAKE_ANDROID_NDK}/sources/android/support/include/xlocale.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
endif()
......@@ -44,7 +44,3 @@ lcb_cmake_options(
"-DENABLE_TESTS_COMPONENT=${ENABLE_UNIT_TESTS}"
)
if(EP_bctoolbox_BUILD_METHOD STREQUAL "rpm")
set(EP_bctoolbox_CONFIGURE_COMMAND_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/builders/bctoolbox/configure.sh.rpm.cmake)
set(EP_bctoolbox_BUILD_COMMAND_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/builders/bctoolbox/build.sh.rpm.cmake)
endif()
#!/bin/sh
export RPM_TOPDIR="@LINPHONE_BUILDER_WORK_DIR@/rpmbuild"
cd @ep_build@
# create rpmbuild workdir if needed
for dir in BUILDROOT RPMS SOURCES SPECS SRPMS; do
mkdir -p "$RPM_TOPDIR/$dir"
done
if [ ! -f @ep_config_h_file@ ]
then
cmake @ep_source@ -DCMAKE_INSTALL_PREFIX=@RPM_INSTALL_PREFIX@ -DCPACK_PACKAGE_NAME=bc-bctoolbox -DCPACK_GENERATOR=RPM \
`echo "@EP_bctoolbox_CMAKE_OPTIONS@" | sed 's/;/ /g'`
make package
cp -v *.rpm "$RPM_TOPDIR/RPMS/"
fi
......@@ -26,6 +26,7 @@ lcb_git_tag("master")
lcb_external_source_paths("belr")
lcb_groupable(YES)
lcb_package_source(YES)
lcb_spec_file("belr.spec")
lcb_dependencies("bctoolbox")
lcb_cmake_options("-DENABLE_TOOLS=${ENABLE_TOOLS}")
\ No newline at end of file
lcb_cmake_options("-DENABLE_TOOLS=${ENABLE_TOOLS}")
############################################################################
# decaf.cmake
# Copyright (C) 2017 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.
#
############################################################################
lcb_git_repository("git://git.linphone.org/decaf.git")
lcb_git_tag_latest("master")
lcb_git_tag("master")
lcb_external_source_paths("externals/decaf")
lcb_groupable(YES)
lcb_package_source(YES)
......@@ -20,39 +20,34 @@
#
############################################################################
set(EP_flexisip_GIT_REPOSITORY "git://git.linphone.org/flexisip" CACHE STRING "flexisip repository URL")
set(EP_flexisip_GIT_TAG_LATEST "master" CACHE STRING "flexisip tag to use when compiling latest version")
set(EP_flexisip_GIT_TAG "cc4e47496600e9b1d3d412ce6e887275c204334b" CACHE STRING "flexisip tag to use")
set(EP_flexisip_EXTERNAL_SOURCE_PATHS "<LINPHONE_BUILDER_TOP_DIR>")
set(EP_flexisip_GROUPABLE YES)
lcb_git_repository("git://git.linphone.org/flexisip")
lcb_git_tag_latest("master")
lcb_git_tag("cc4e47496600e9b1d3d412ce6e887275c204334b")
lcb_external_source_paths("<LINPHONE_BUILDER_TOP_DIR>")
lcb_groupable(YES)
set(EP_flexisip_CMAKE_OPTIONS )
set(EP_flexisip_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
"--host=${LINPHONE_BUILDER_HOST}"
)
set(EP_flexisip_CONFIG_H_FILE "flexisip.spec")
set(EP_flexisip_SPEC_FILE "flexisip.spec")
#set(EP_flexisip_CONFIG_H_FILE "flexisip.spec")
lcb_spec_file("flexisip.spec")
lcb_dependencies("sofiasip")
if (ENABLE_CONFERENCE)
if(ENABLE_CONFERENCE)
lcb_dependencies("linphone" "belr")
endif()
if (ENABLE_PRESENCE)
if(ENABLE_PRESENCE)
lcb_dependencies("bellesip")
endif()
if (ENABLE_REDIS)
lcb_dependencies("hiredis")
endif()
if(ENABLE_SOCI_BUILD)
if(ENABLE_SOCI)
lcb_dependencies("soci")
endif()
if (ENABLE_TRANSCODER)
if(ENABLE_TRANSCODER)
lcb_dependencies("ms2")
else()
lcb_dependencies("ortp")
endif()
if(ENABLE_REDIS)
lcb_dependencies("hiredis")
endif()
lcb_builder_cmake_options(flexisip
lcb_cmake_options(
"-DENABLE_TRANSCODER=${ENABLE_TRANSCODER}"
"-DENABLE_ODB=${ENABLE_ODB}"
"-DENABLE_ODBC=${ENABLE_ODBC}"
......@@ -61,7 +56,6 @@ lcb_builder_cmake_options(flexisip
"-DENABLE_PUSHNOTIFICATION=${ENABLE_PUSHNOTIFICATION}"
"-DENABLE_PRESENCE=${ENABLE_PRESENCE}"
"-DENABLE_CONFERENCE=${ENABLE_CONFERENCE}"
"-DXSDCXX_ROOT_PATH=${XSDCXX_ROOT_PATH}"
"-DENABLE_SNMP=${ENABLE_SNMP}"
"-DENABLE_DOC=${ENABLE_DOC}"
"-DENABLE_PROTOBUF=${ENABLE_PROTOBUF}"
......
......@@ -20,21 +20,14 @@
#
############################################################################
#set(hiredis_filename "v0.13.3.tar.gz")
#set(EP_hiredis_URL "https://github.com/redis/hiredis/archive/${hiredis_filename}")
#set(EP_hiredis_URL_HASH "SHA1=be6f1c50fc4d649dd2924f0afecc0a1705dbe0d3")
set(EP_hiredis_GIT_REPOSITORY "https://github.com/redis/hiredis.git" CACHE STRING "hiredis repository URL")
set(EP_hiredis_GIT_TAG "010756025e8cefd1bc66c6d4ed3b1648ef6f1f95" CACHE STRING "hiredis tag to use")
lcb_git_repository("https://github.com/redis/hiredis.git")
lcb_external_source_paths("externals/hiredis")
lcb_patch_command("COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/hiredis/CMakeLists.txt" "<SOURCE_DIR>")
lcb_patch_command("COMMAND" "${CMAKE_COMMAND}" "-E" "make_directory" "<SOURCE_DIR>/build/")
lcb_patch_command("COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/hiredis/build/CMakeLists.txt" "<SOURCE_DIR>/build/")
lcb_package_source(YES)
set(EP_hiredis_BUILD_METHOD "rpm")
lcb_use_autotools_for_rpm(YES)
lcb_dependencies(bctoolbox)
set(EP_hiredis_SPEC_FILE "hiredis.spec" )
set(EP_hiredis_CONFIG_H_FILE "${CMAKE_CURRENT_SOURCE_DIR}/builders/hiredis/${EP_hiredis_SPEC_FILE}" )
# the spec file goes into the build directory
set(EP_hiredis_PATCH_COMMAND "COMMAND" "${CMAKE_COMMAND}" "-E" "copy" ${EP_hiredis_CONFIG_H_FILE} "<BINARY_DIR>")
# Current versions of CMake cannot download over HTTPS.. we have a speficic step that uses wget to get the archive instead of
# using CMake's own downkoad facility.
set(EP_hiredis_CONFIGURE_COMMAND_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/builders/hiredis/configure.sh.cmake)
lcb_spec_file("hiredis.spec")
lcb_patch_command("COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/hiredis/build/hiredis.spec.cmake" "<SOURCE_DIR>/build/")
############################################################################
# CMakeLists.txt
# Copyright (C) 2017 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.
#
############################################################################
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
project(hiredis LANGUAGES C VERSION 0.13.3)
option(ENABLE_SHARED "Build shared library." YES)
option(ENABLE_STATIC "Build static library." YES)
include(GNUInstallDirs)
find_package(BcToolbox 0.0.3 REQUIRED)
set(HEADER_FILES
async.h
hiredis.h
read.h
sds.h
)
set(SOURCE_FILES
async.c
hiredis.c
net.c
read.c
sds.c
)
if(ENABLE_STATIC)
add_library(hiredis-static STATIC ${SOURCE_FILES})
set_target_properties(hiredis-static PROPERTIES OUTPUT_NAME hiredis)
install(TARGETS hiredis-static
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
)
endif()
if(ENABLE_SHARED)
add_library(hiredis SHARED ${SOURCE_FILES})
set_target_properties(hiredis PROPERTIES VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
install(TARGETS hiredis
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
)
endif()
install(FILES ${HEADER_FILES}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredis
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
install(DIRECTORY adapters DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredis)
add_subdirectory(build)
############################################################################
# CMakeLists.txt
# Copyright (C) 2017 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.
#
############################################################################
if (NOT CPACK_PACKAGE_NAME)
set(CPACK_PACKAGE_NAME "hiredis")
ENDIF()
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/../COPYING")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${PROJECT_VERSION})
set(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_SOURCE_IGNORE_FILES
"${CMAKE_BINARY_DIR}"
"^${PROJECT_SOURCE_DIR}/.git*"
)
bc_project_build_version(${PROJECT_VERSION} PROJECT_VERSION_BUILD)
if(PROJECT_VERSION_BUILD)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-${PROJECT_VERSION_BUILD}")
endif()
message("-- Package file name is ${CPACK_PACKAGE_FILE_NAME}" )
set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hiredis.spec.cmake ${CMAKE_CURRENT_SOURCE_DIR}/../hiredis.spec)
include(CPack)
%define pkg_name hiredis
%define finalpkg_name %{?_with_bc:bc-%{pkg_name}}%{!?_with_bc:%{pkg_name}}
%define pkg_name %{?_with_bc:bc-hiredis}%{!?_with_bc:hiredis}
%{?_with_bc: %define _prefix /opt/belledonne-communications}
# re-define some directories for older RPMBuild versions which don't. This messes up the doc/ dir
# taken from https://fedoraproject.org/wiki/Packaging:RPMMacros?rd=Packaging/RPMMacros
......@@ -9,14 +8,18 @@
%define _datadir %{_datarootdir}
%define _docdir %{_datadir}/doc
%define build_number @PROJECT_VERSION_BUILD@
%if %{build_number}
%define build_number_ext -%{build_number}
%endif
Name: %{finalpkg_name}
Version: 0.13.3
Release: 3%{?dist}
Name: %{pkg_name}
Version: @PROJECT_VERSION@
Release: %{build_number}%{?dist}
Summary: Minimalistic C client library for Redis
License: BSD
URL: https://github.com/redis/hiredis
Source0: v%{version}.tar.gz
Source0: %{name}-%{version}%{?build_number_ext}.tar.gz
%description
Hiredis is a minimalistic C client library for the Redis database.
......@@ -29,19 +32,26 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
This package contains libraries and header files for
developing applications that use %{name}.
%if 0%{?rhel} && 0%{?rhel} <= 7
%global cmake_name cmake3
%define ctest_name ctest3
%else
%global cmake_name cmake
%define ctest_name ctest
%endif
%prep
%setup -q -n hiredis-%{version}
%setup -q -n %{name}-%{version}%{?build_number_ext}
%build
make %{?_smp_mflags} OPTIMIZATION="%{optflags}"
%{expand:%%%cmake_name} . -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} -DCMAKE_PREFIX_PATH:PATH=%{_prefix}
make %{?_smp_mflags}
%install
make install PREFIX=%{buildroot}%{_prefix} INSTALL_LIBRARY_PATH=%{buildroot}%{_libdir}
mkdir -p %{buildroot}%{_bindir}
cp hiredis-test %{buildroot}%{_bindir}
make install DESTDIR=%{buildroot}
find %{buildroot} -name '*.a' -delete -print
%clean
rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
......@@ -49,13 +59,12 @@ find %{buildroot} -name '*.a' -delete -print
%files
%doc COPYING
%{_bindir}/hiredis-test
%{_libdir}/libhiredis.so.0.13
%{_libdir}/pkgconfig/hiredis.pc
%files devel
%doc README.md
%{_includedir}/%{pkg_name}/
%{_includedir}/hiredis/
%{_libdir}/libhiredis.a
%{_libdir}/libhiredis.so
%changelog
......
#!/bin/sh
export RPM_TOPDIR="@LINPHONE_BUILDER_WORK_DIR@/rpmbuild/SOURCES/"
export HIREDIS_TARBALL_URL="https://github.com/redis/hiredis/archive/v0.13.3.tar.gz"
mkdir -p "$RPM_TOPDIR"
echo "be6f1c50fc4d649dd2924f0afecc0a1705dbe0d3 v0.13.3.tar.gz" > "$RPM_TOPDIR/v0.13.3.tar.gz.sha1"
wget "$HIREDIS_TARBALL_URL" -P "$RPM_TOPDIR"
# check Sha1
cd "$RPM_TOPDIR" && sha1sum -c "$RPM_TOPDIR/v0.13.3.tar.gz.sha1"
############################################################################
# lime.cmake
# Copyright (C) 2017 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.
#
############################################################################
lcb_git_repository("gitosis@git.linphone.org:lime.git")
lcb_git_tag_latest("master")
lcb_git_tag("master")
lcb_external_source_paths("lime")
lcb_groupable(YES)
lcb_package_source(YES)
lcb_dependencies("decaf")
......@@ -26,8 +26,10 @@ lcb_git_tag("3.10.0")
lcb_external_source_paths("linphone")
lcb_groupable(YES)
lcb_package_source(YES)
lcb_spec_file("liblinphone.spec")
lcb_rpmbuild_name("liblinphone")
lcb_dependencies("bctoolbox" "bellesip" "ortp" "ms2" "belr")
lcb_dependencies("bctoolbox" "bellesip" "ortp" "ms2" "belr" "libxsd" "soci")
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES AND NOT APPLE)
# Do not build sqlite3, xml2 and zlib on Apple systems (Mac OS X and iOS), they are provided by the system
lcb_dependencies("sqlite3" "xml2")
......@@ -42,6 +44,9 @@ if(ENABLE_VCARD)
lcb_dependencies("belcard")
endif()
if(ENABLE_LIME_X3DH)
lcb_dependencies("lime")
endif()
lcb_cmake_options(
"-DENABLE_GTK_UI=${ENABLE_GTK_UI}"
"-DENABLE_VIDEO=${ENABLE_VIDEO}"
......
......@@ -22,12 +22,15 @@
lcb_git_repository("git://git.linphone.org/soci.git")
lcb_external_source_paths("externals/soci")
lcb_dependencies("sqlite3")
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES AND NOT APPLE)
# Do not build sqlite3 on Apple systems (Mac OS X and iOS), they are provided by the system
lcb_dependencies("sqlite3")
endif()
lcb_cmake_options(
"-DSOCI_TESTS=NO"
"-DSOCI_EMPTY=NO"
"-DWITH_DB2=NO"
"-DWITH_FIREBIRD=NO"
"-DWITH_MYSQL=YES"
......@@ -36,6 +39,7 @@ lcb_cmake_options(
"-DWITH_POSTGRESQL=NO"
"-DWITH_SQLITE3=YES"
)
lcb_package_source(YES)
lcb_spec_file("soci.spec")
lcb_linking_type("-DSOCI_SHARED=YES" "-DSOCI_STATIC=NO")
lcb_use_autotools_for_rpm(YES)
This diff is collapsed.
diff -urN EP_soci/CMakeLists.txt EP_soci.mod/CMakeLists.txt
--- EP_soci/CMakeLists.txt 2016-02-08 22:37:29.775133646 +0100
+++ EP_soci.mod/CMakeLists.txt 2016-02-08 22:39:44.963432447 +0100
@@ -73,10 +73,12 @@
# Installation
###############################################################################
-if(APPLE OR CMAKE_SIZEOF_VOID_P EQUAL 4)
- set(SOCI_LIBDIR "lib")
-else()
- set(SOCI_LIBDIR "lib64")
+if(NOT DEFINED SOCI_LIBDIR)
+ if(APPLE OR CMAKE_SIZEOF_VOID_P EQUAL 4)
+ set(SOCI_LIBDIR "lib")
+ else()
+ set(SOCI_LIBDIR "lib64")
+ endif()
endif()
set(BINDIR "bin" CACHE PATH "The directory to install binaries into.")
......@@ -20,25 +20,20 @@
#
############################################################################
set(EP_sofiasip_GIT_REPOSITORY "git://git.linphone.org/sofia-sip.git" CACHE STRING "sofiasip repository URL")
set(EP_sofiasip_GIT_TAG_LATEST "bc" CACHE STRING "sofiasip tag to use when compiling latest version")
set(EP_sofiasip_GIT_TAG "dcdc8efab5d164ec55c8706f978a827af04459e4" CACHE STRING "sofiasip tag to use")
set(EP_sofiasip_EXTERNAL_SOURCE_PATHS "externals/sofia-sip")
#set(EP_sofiasip_CMAKE_OPTIONS )
#set(EP_sofiasip_LINKING_TYPE "-DENABLE_STATIC=0")
lcb_git_repository("git://git.linphone.org/sofia-sip.git")
lcb_git_tag_latest("bc")
lcb_git_tag("dcdc8efab5d164ec55c8706f978a827af04459e4")
lcb_external_source_paths("externals/sofia-sip")
set(EP_sofiasip_DEPENDENCIES )
set(EP_sofiasip_LINKING_TYPE "--disable-static" "--enable-shared")
set(EP_sofiasip_BUILD_METHOD "autotools")
set(EP_sofiasip_USE_AUTOGEN True)
set(EP_sofiasio_BUILD_IN_SOURCE True)
set(EP_sofiasip_CONFIGURE_OPTIONS )
set(EP_sofiasip_CROSS_COMPILATION_OPTIONS
lcb_build_method("autotools")
lcb_use_autogen(YES)
lcb_build_in_source_tree(YES)
lcb_linking_type("--disable-static" "--enable-shared")
lcb_cross_compilation_options(
"--prefix=${CMAKE_INSTALL_PREFIX}"
"--host=${LINPHONE_BUILDER_HOST}"
)
# RPM
set(EP_sofiasip_SPEC_FILE "packages/sofia-sip-*.spec")
set(EP_sofiasip_RPMBUILD_NAME "sofia-sip")
lcb_spec_file("packages/sofia-sip-*.spec")
lcb_rpmbuild_name("sofia-sip")
lcb_use_autotools_for_rpm(YES)
......@@ -34,16 +34,10 @@ if [ @AUTOTOOLS_VERBOSE_MAKEFILE@ -eq 1 ]; then
VERBOSE="--verbose"
fi
# SPEC_PREFIX=""
# if [ @LINPHONE_BUILDER_SPEC_PREFIX@ != "" ]; then
# SPEC_PREFIX="--define \"_prefix @LINPHONE_BUILDER_SPEC_PREFIX@\""
# fi
cd @ep_source@
# TODO rpmbuild -ba @ep_build@/@LINPHONE_BUILDER_SPEC_FILE@ --define "_topdir $RPM_TOPDIR" $SPEC_PREFIX --with bc $VERBOSE @ep_redirect_to_file@
rpmbuild -ba @ep_build@/@LINPHONE_BUILDER_SPEC_FILE@ \
--define "_topdir $RPM_TOPDIR" --define '_PKG_CONFIG_PATH $PKG_CONFIG_PATH'\
--define "_builddir @ep_source@" \
@LINPHONE_BUILDER_RPMBUILD_GLOBAL_OPTION@ \
@LINPHONE_BUILDER_RPMBUILD_GLOBAL_OPTIONS@ \
@LINPHONE_BUILDER_RPMBUILD_OPTIONS@ \
$VERBOSE @ep_redirect_to_file@
......@@ -733,7 +733,7 @@ macro(linphone_builder_add_external_project PROJNAME)
# some specific RPMBUILD options to pass for this particular project
if(EP_${PROJNAME}_RPMBUILD_OPTIONS)
set(LINPHONE_BUILDER_RPMBUILD_OPTIONS "${EP_${PROJNAME}_RPMBUILD_OPTIONS}")
string(REPLACE ";" " " LINPHONE_BUILDER_RPMBUILD_OPTIONS "${EP_${PROJNAME}_RPMBUILD_OPTIONS}")
else()
set(LINPHONE_BUILDER_RPMBUILD_OPTIONS "")
endif()
......@@ -1380,6 +1380,17 @@ macro(lcb_use_c_compiler_for_assembler BOOL_VALUE)
lcb_builder_use_c_compiler_for_assembler("${LINPHONE_BUILDER_CURRENT_BUILDER}" ${BOOL_VALUE})
endmacro()
macro(lcb_builder_rpmbuild_options BUILDER)
set(_args "${ARGN}")
foreach(_arg IN LISTS _args)
list(APPEND EP_${BUILDER}_RPMBUILD_OPTIONS "${_arg}")
endforeach()
endmacro()
macro(lcb_rpmbuild_options)
lcb_builder_rmpbuild_options("${LINPHONE_BUILDER_CURRENT_BUILDER}" ${ARGN})
endmacro()
macro(lcb_blacklist_dependencies)
set(_args "${ARGN}")
foreach(_dependency IN LISTS _args)
......
......@@ -13,7 +13,7 @@ export RPM_TOPDIR="@LINPHONE_BUILDER_WORK_DIR@/rpmbuild"
rpmbuild -ta --clean --rmsource --define "_topdir $RPM_TOPDIR" \
--define='_localstatedir /var/opt/belledonne-communications' \
@LINPHONE_BUILDER_RPMBUILD_GLOBAL_OPTION@ \
@LINPHONE_BUILDER_RPMBUILD_GLOBAL_OPTIONS@ \
@LINPHONE_BUILDER_RPMBUILD_OPTIONS@ \
--rmspec @ep_build@/*.tar.gz \
$VERBOSE @ep_redirect_to_file@
......
......@@ -48,6 +48,7 @@ set(DEFAULT_VALUE_ENABLE_WEBRTC_AECM ON)
set(DEFAULT_VALUE_ENABLE_WEBRTC_AEC ON)
set(DEFAULT_VALUE_ENABLE_ZRTP ON)
set(DEFAULT_VALUE_ENABLE_LIME ON)
set(DEFAULT_VALUE_ENABLE_LIME_X3DH OFF)
set(DEFAULT_VALUE_ENABLE_TOOLS OFF)
set(DEFAULT_VALUE_ENABLE_JAVA_WRAPPER ON)
set(ENABLE_NLS NO CACHE BOOL "" FORCE)
......@@ -143,6 +144,9 @@ lcb_builder_linking_type(ortp "-DENABLE_STATIC=NO" "-DENABLE_SHARED=YES")
# polarssl
lcb_builder_linking_type(polarssl "-DUSE_SHARED_POLARSSL_LIBRARY=NO")
# soci
lcb_builder_linking_type(soci "-DSOCI_STATIC=YES" "-DSOCI_SHARED=NO")
# speex
lcb_builder_cmake_options(speex "-DENABLE_FLOAT_API=NO")
lcb_builder_cmake_options(speex "-DENABLE_FIXED_POINT=YES")
......@@ -159,7 +163,7 @@ lcb_builder_install_target(x264 "install-lib-static")
# Copy c++ library to install prefix
file(COPY "${CMAKE_ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${CMAKE_CXX_ANDROID_TOOLCHAIN_VERSION}/libs/${CMAKE_ANDROID_ARCH_ABI}/libgnustl_shared.so"
file(COPY "${CMAKE_ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libs/${CMAKE_ANDROID_ARCH_ABI}/libc++_shared.so"
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib"
)
......
......@@ -31,6 +31,7 @@ set(DEFAULT_VALUE_ENABLE_GSM ON)
set(DEFAULT_VALUE_ENABLE_GTK_UI OFF)
set(DEFAULT_VALUE_ENABLE_JPEG ON)
set(DEFAULT_VALUE_ENABLE_LIME ON)
set(DEFAULT_VALUE_ENABLE_LIME_X3DH OFF)
set(DEFAULT_VALUE_ENABLE_MBEDTLS ON)
set(DEFAULT_VALUE_ENABLE_MKV ON)
set(DEFAULT_VALUE_ENABLE_NLS OFF)
......
......@@ -25,18 +25,7 @@ include(${CMAKE_SOURCE_DIR}/cmake/FindLinuxPlatform.cmake)
# Check if we have everything to compile correctly
FUNCTION(CHECK_PROGRAM progname)
find_program(${progname}_PROGRAM
NAMES ${progname}
)
if(NOT ${progname}_PROGRAM)
message(FATAL_ERROR "Could not find the ${progname} program, which is needed for RPMBuild")
else()
message(STATUS "Found ${progname} : ${${progname}_PROGRAM}.")
endif()
ENDFUNCTION()
FUNCTION(CHECK_LIBRARY libname)
function(CHECK_LIBRARY libname)
find_library(${libname}_LIBRARY
NAMES ${libname}
PATHS /usr/lib/mysql/
......@@ -46,26 +35,16 @@ FUNCTION(CHECK_LIBRARY libname)
else()
message(STATUS "Found ${libname} : ${${libname}_LIBRARY}.")
endif()
ENDFUNCTION()
# Doxygen can be found through CMake
find_package(Doxygen REQUIRED)
# the rest will be checked manually
FOREACH(PROGNAME rpmbuild bison)
CHECK_PROGRAM(${PROGNAME})
ENDFOREACH()
endfunction()
set(FLEXISIP_LIBDEPS ssl mysqlclient_r mysqlclient)
if(PLATFORM STREQUAL "Debian")
set(DEFAULT_VALUE_ENABLE_SOCI_BUILD ON)
endif()
FOREACH(LIBNAME ${FLEXISIP_LIBDEPS})
CHECK_LIBRARY(${LIBNAME})
ENDFOREACH()
foreach(LIBNAME ${FLEXISIP_LIBDEPS})
check_library(${LIBNAME})
endforeach()
# Force use of system dependencies to build RPM packages
set(LINPHONE_BUILDER_USE_SYSTEM_DEPENDENCIES YES CACHE BOOL "" FORCE)
# Define default values for the flexisip builder options
set(DEFAULT_VALUE_DISABLE_BC_ANTLR ON)
......@@ -74,12 +53,12 @@ set(DEFAULT_VALUE_ENABLE_PUSHNOTIFICATION ON)
set(DEFAULT_VALUE_ENABLE_REDIS ON)
set(DEFAULT_VALUE_ENABLE_SOCI ON)
set(DEFAULT_VALUE_ENABLE_UNIT_TESTS OFF)
set(DEFAULT_VALUE_CMAKE_LINKING_TYPE "-DENABLE_STATIC=NO")
set(DEFAULT_VALUE_ENABLE_BC_HIREDIS ON)
set(DEFAULT_VALUE_CMAKE_LINKING_TYPE "-DENABLE_STATIC=NO")
# Global configuration
set(LINPHONE_BUILDER_HOST "")
set(RPM_INSTALL_PREFIX "/opt/belledonne-communications")
# Adjust PKG_CONFIG_PATH to include install directory
......@@ -93,106 +72,112 @@ endif()
# we can override the bctoolbox build method before including builders because it doesn't define it.
set(EP_bctoolbox_BUILD_METHOD "rpm")
lcb_builder_build_method(bctoolbox "rpm")
lcb_builder_cmake_options(bctoolbox "-DENABLE_TESTS=NO")
lcb_builder_cmake_options(bctoolbox "-DENABLE_TESTS_COMPONENT=NO")
lcb_builder_rpmbuild_options(bctoolbox
"--with bc"
"--without tests_component"
)
lcb_builder_cmake_options(ms2 "-DENABLE_SRTP=NO") #mainly to avoid issue with old libsrtp (sha1_update conflict with polarssl)