Commit 7b1378c9 authored by Ghislain MARY's avatar Ghislain MARY

Handle packaging of linphone desktop for raspberry.

parent 7c50bf51
......@@ -64,3 +64,6 @@ set(EP_vpx_CROSS_COMPILATION_OPTIONS
"--target=armv6-linux-gcc"
)
# Add config step for packaging
set(LINPHONE_BUILDER_ADDITIONAL_CONFIG_STEPS "${CMAKE_CURRENT_LIST_DIR}/desktop-raspberry/additional_steps.cmake")
############################################################################
# additional_steps.cmake
# Copyright (C) 2016 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
# Packaging
if(ENABLE_PACKAGING)
get_cmake_property(_varnames VARIABLES)
set(ENABLE_VARIABLES )
foreach(_varname ${_varnames})
if(_varname MATCHES "^ENABLE_.*")
list(APPEND ENABLE_VARIABLES -D${_varname}=${${_varname}})
endif()
endforeach()
linphone_builder_apply_flags()
linphone_builder_set_ep_directories(package)
linphone_builder_expand_external_project_vars()
ExternalProject_Add(TARGET_linphone_package
DEPENDS TARGET_linphone_builder
TMP_DIR ${ep_tmp}
BINARY_DIR ${ep_build}
SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/package"
DOWNLOAD_COMMAND ""
CMAKE_GENERATOR ${CMAKE_GENERATOR}
CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} -DLINPHONE_OUTPUT_DIR=${CMAKE_INSTALL_PREFIX} -DLINPHONE_SOURCE_DIR=${EP_linphone_SOURCE_DIR} ${ENABLE_VARIABLES}
)
endif()
############################################################################
# CMakeLists.txt
# Copyright (C) 2016 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
cmake_minimum_required(VERSION 3.0)
project(LINPHONE_PACKAGE) # Dummy project
#find_package(Linphone REQUIRED)
find_package(Git)
if(GIT_EXECUTABLE)
execute_process(
COMMAND ${GIT_EXECUTABLE} describe --always
OUTPUT_VARIABLE LINPHONE_GIT_REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${LINPHONE_SOURCE_DIR}
)
else()
set(LINPHONE_GIT_REVISION "0.0.0")
endif()
string(REGEX REPLACE "([0-9.]+)-?.*" "\\1" LINPHONE_VERSION "${LINPHONE_GIT_REVISION}")
string(REPLACE "." ";" SPLITTED_LINPHONE_VERSION ${LINPHONE_VERSION})
list(GET SPLITTED_LINPHONE_VERSION 0 LINPHONE_MAJOR_VERSION)
list(GET SPLITTED_LINPHONE_VERSION 1 LINPHONE_MINOR_VERSION)
list(GET SPLITTED_LINPHONE_VERSION 2 LINPHONE_MICRO_VERSION)
set(PACKAGE_VERSION "${LINPHONE_VERSION}")
# Prepare the tarball
set(LINPHONE_SDK_TMP "${CMAKE_CURRENT_BINARY_DIR}/linphone-raspberry")
file(REMOVE_RECURSE "${LINPHONE_SDK_TMP}")
file(COPY "${LINPHONE_OUTPUT_DIR}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
file(RENAME "${CMAKE_CURRENT_BINARY_DIR}/desktop-raspberry" "${LINPHONE_SDK_TMP}")
file(REMOVE_RECURSE "${LINPHONE_SDK_TMP}/etc")
file(REMOVE_RECURSE "${LINPHONE_SDK_TMP}/sbin")
file(REMOVE_RECURSE "${LINPHONE_SDK_TMP}/share/doc")
file(REMOVE_RECURSE "${LINPHONE_SDK_TMP}/share/java")
file(REMOVE_RECURSE "${LINPHONE_SDK_TMP}/share/man")
file(GLOB FILES_TO_DELETE
"${LINPHONE_SDK_TMP}/bin/cx18*"
"${LINPHONE_SDK_TMP}/bin/decode_tm*"
"${LINPHONE_SDK_TMP}/bin/dvb*"
"${LINPHONE_SDK_TMP}/bin/ir-*"
"${LINPHONE_SDK_TMP}/bin/ivtv*"
"${LINPHONE_SDK_TMP}/bin/rds-*"
"${LINPHONE_SDK_TMP}/bin/v4l*"
)
file(REMOVE ${FILES_TO_DELETE})
# Generate the tarball containing the output of the build
add_custom_target(create_tar ALL COMMAND
${CMAKE_COMMAND} -E tar "cvjf" "linphone-raspberry-${LINPHONE_GIT_REVISION}.tar.bz2" "${LINPHONE_SDK_TMP}"
)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/linphone-raspberry-${LINPHONE_GIT_REVISION}.tar.bz2" DESTINATION .)
......@@ -50,6 +50,7 @@ class Target:
self.toolchain_file = None
self.required_build_platforms = None
self.additional_args = []
self.packaging_args = None
self.work_dir = work_dir + '/' + self.name
self.abs_work_dir = os.getcwd() + '/' + self.work_dir
self.cmake_dir = self.work_dir + '/cmake'
......@@ -98,6 +99,10 @@ class Target:
cmd += ['-DENABLE_DEBUG_LOGS=YES']
if args.list_cmake_variables:
cmd += ['-L']
if args.package:
cmd += ["-DENABLE_PACKAGING=YES"]
if self.packaging_args is not None:
cmd += self.packaging_args
for arg in self.additional_args:
cmd += [arg]
for arg in additional_args:
......
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