Commit 81f5f029 authored by Ghislain MARY's avatar Ghislain MARY

Rework hiredis builder.

parent 2fdbbd7a
......@@ -20,36 +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_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}"
......
......@@ -20,21 +20,10 @@
#
############################################################################
#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>")
set(EP_hiredis_BUILD_METHOD "rpm")
lcb_spec_file("hiredis.spec")
lcb_use_autotools_for_rpm(YES)
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_patch_command("COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/hiredis/hiredis.spec" "<SOURCE_DIR>")
############################################################################
# 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)
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 bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
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})
install(TARGETS hiredis
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
endif()
install(FILES ${HEADER_FILES}
DESTINATION include/hiredis
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
install(DIRECTORY adapters DESTINATION include/hiredis)
\ No newline at end of file
#!/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"
......@@ -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)
......@@ -117,6 +117,7 @@ lcb_builder_rpmbuild_options(flexisip
"--with push"
)
lcb_builder_build_method(hiredis "rpm")
lcb_builder_rpmbuild_options(hiredis "--with bc")
if(NOT ENABLE_TRANSCODER)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment