From f1bf765fd60dc67a00d7da024b178b5bd02af31c Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Wed, 1 Apr 2020 18:09:35 +0200 Subject: [PATCH] Use specific runner on Centos7 Move create appimage script in app folder Change the appimage name with current version Add qt plugin to install with appimage --- .../job-linux-desktop-centos7.yml | 28 +++++++++++++++---- CMakeLists.txt | 4 +-- linphone-app/CMakeLists.txt | 14 ++++++++-- .../linphone_package/CMakeLists.txt | 1 + .../linphone_package/packaging.cmake.in | 10 ++++--- .../tools}/create_appimage.sh | 11 ++++++-- 6 files changed, 51 insertions(+), 17 deletions(-) rename {tools => linphone-app/tools}/create_appimage.sh (79%) diff --git a/.gitlab-ci-files/job-linux-desktop-centos7.yml b/.gitlab-ci-files/job-linux-desktop-centos7.yml index ee5249052..839a17b8c 100644 --- a/.gitlab-ci-files/job-linux-desktop-centos7.yml +++ b/.gitlab-ci-files/job-linux-desktop-centos7.yml @@ -31,7 +31,7 @@ ################################################# job-centos7-ninja-gcc: tags: [ "docker" ] - image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-centos:7 + image: gitlab.linphone.org:4567/bc/public/linphone-desktop/bc-dev-centos7-qt-fuse-wget:5.12.5 except: refs: - schedules @@ -62,8 +62,9 @@ job-centos7-ninja-gcc: job-centos7-ninja-gcc-package: stage: package - tags: [ "docker" ] - image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-centos:7 + tags: [ "docker-test-centos7-liblinphone-nuc" ] + #image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-centos:7 + image: gitlab.linphone.org:4567/bc/public/linphone-desktop/bc-dev-centos7-qt-fuse-wget:5.12.5 only: variables: - $NIGHTLY_MASTER @@ -76,7 +77,7 @@ job-centos7-ninja-gcc-package: extends: .job-linux-desktop artifacts: paths: - - build/OUTPUT/Packages/Linphone*.AppImage + - build/OUTPUT/Packages/*.AppImage expire_in: 1 week ################################################# @@ -85,7 +86,7 @@ job-centos7-ninja-gcc-package: job-centos7-ninja-gcc-deploy: stage: deploy - tags: [ "docker" ] + tags: [ "deploy" ] dependencies: - job-centos7-ninja-gcc-package only: @@ -93,4 +94,19 @@ job-centos7-ninja-gcc-deploy: - $NIGHTLY_MASTER - $DEPLOY_LINUX script: - - scp build/OUTPUT/Packages/Linphone*.AppImage $DEPLOY_SERVER:$APPIMAGE_UPLOAD_DIRECTORY/ + - scp build/OUTPUT/Packages/*.AppImage $DEPLOY_SERVER:$APPIMAGE_UPLOAD_DIRECTORY/ + +################################################# +# Debug +################################################# + +job-centos7-debug: + stage: deploy + tags: [ "docker-test-centos7-liblinphone-nuc" ] + #image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-centos:7 + image: gitlab.linphone.org:4567/bc/public/linphone-desktop/bc-dev-centos7-qt-fuse-wget:5.12.5 + only: + variables: + - $DEBUG_CENTOS7 + script: + - sleep 10m diff --git a/CMakeLists.txt b/CMakeLists.txt index 4520578f9..5197cdb96 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,7 @@ endforeach() if(ENABLE_BUILD_VERBOSE) message("User Args : ${USER_ARGS}") endif() -project(linphoneqt VERSION 4.1.1) +project(linphoneqt) include(GNUInstallDirs) include(CheckCXXCompilerFlag) @@ -169,7 +169,7 @@ find_package(minizip QUIET) if(ENABLE_BUILD_VERBOSE) message("MINIZIP from superbuild :${MINIZIP_PREFIX}, ${MINIZIP_INCLUDE_DIRS} => ${MINIZIP_LIBRARIES}") endif() -if(NOT (LinphoneCxx_FOUND) OR NOT (Linphone_FOUND) OR NOT (bctoolbox_FOUND) OR NOT (belcard_FOUND) OR NOT (Mediastreamer2_FOUND) OR NOT (ortp_FOUND) OR NOT(MINIZIP_FOUND) ) +if(NOT (LinphoneCxx_FOUND) OR NOT (Linphone_FOUND) OR NOT (bctoolbox_FOUND) OR NOT (belcard_FOUND) OR NOT (Mediastreamer2_FOUND) OR NOT (ortp_FOUND) OR NOT(MINIZIP_FOUND) OR FORCE_APP_EXTERNAL_PROJECTS) message("Projects are set as External projects. You can start building them by using for example : cmake --build . --target all") ExternalProject_Add(linphone-qt PREFIX "${CMAKE_BINARY_DIR}/linphoneqt" SOURCE_DIR "${CMAKE_SOURCE_DIR}/linphone-app" diff --git a/linphone-app/CMakeLists.txt b/linphone-app/CMakeLists.txt index 8930a4ce0..20fa847f4 100644 --- a/linphone-app/CMakeLists.txt +++ b/linphone-app/CMakeLists.txt @@ -20,6 +20,7 @@ # ################################################################################ cmake_minimum_required(VERSION 3.1) + project(linphoneqt VERSION 4.1.1) if(ENABLE_BUILD_VERBOSE) @@ -58,11 +59,12 @@ endif() find_package(LinphoneCxx CONFIG) find_package(Linphone CONFIG) -find_package(bctoolbox CONFIG) find_package(belcard CONFIG) find_package(Mediastreamer2 CONFIG) find_package(ortp CONFIG) find_package(minizip) +find_package(bctoolbox CONFIG) + set(MINIZIP_INCLUDE_DIRS "${MINIZIP_PREFIX}/${MINIZIP_INCLUDE_DIRS}") if(ENABLE_BUILD_VERBOSE) message("MINIZIP : ${MINIZIP_PREFIX}, ${MINIZIP_INCLUDE_DIRS} => ${MINIZIP_LIBRARIES}") @@ -86,6 +88,12 @@ if (UNIX AND NOT APPLE) endif () set(QT5_PACKAGES_OPTIONAL TextToSpeech) set(CMAKE_AUTOMOC ON) + + +bc_compute_full_version(APP_PROJECT_VERSION) +bc_git_version(${TARGET_NAME} ${PROJECT_VERSION}) +string(REGEX MATCH "^([0-9]+)[.]([0-9]+)[.]([0-9]+)" APP_VERSION ${APP_PROJECT_VERSION}) +message(STATUS "Versions : ${PROJECT_VERSION}, ${APP_VERSION}, ${APP_PROJECT_VERSION}") #------------------------------------------------- set(ASSETS_DIR "assets") set(SOURCES @@ -314,6 +322,8 @@ list(APPEND _QML_IMPORT_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/ui/views") set(QML_IMPORT_PATH ${_QML_IMPORT_PATHS} CACHE STRING "Path used to locate CMake modules by Qt Creator" FORCE) set(QML2_IMPORT_PATH ${_QML_IMPORT_PATHS} CACHE STRING "Path used to locate CMake modules by Qt Creator" FORCE) +set(QML_SOURCES_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/ui/") +set(QML_MODULES_PATHS ${QML_SOURCES_PATHS}) message("QML_IMPORT_PATH=${QML_IMPORT_PATH}" ) if(APPLE) if(MS2_PLUGINS_LOCATION) @@ -384,7 +394,7 @@ set_property(TARGET ${APP_LIBRARY} PROPERTY POSITION_INDEPENDENT_CODE ON) #Nee #Instead of excplicitely calling qt5_add_resources set_property(TARGET ${APP_LIBRARY} PROPERTY AUTORCC ON) -bc_git_version(${TARGET_NAME} ${PROJECT_VERSION}) + set_target_properties(${TARGET_NAME} PROPERTIES OUTPUT_NAME "${EXECUTABLE_NAME}") diff --git a/linphone-app/cmake_builder/linphone_package/CMakeLists.txt b/linphone-app/cmake_builder/linphone_package/CMakeLists.txt index 4507bd5d3..2659a5c79 100644 --- a/linphone-app/cmake_builder/linphone_package/CMakeLists.txt +++ b/linphone-app/cmake_builder/linphone_package/CMakeLists.txt @@ -296,6 +296,7 @@ if(${ENABLE_APP_PACKAGING}) message(STATUS "Set DragNDrop CPack generator in OUTPUT/Packages") elseif(NOT(WIN32)) set(DO_APPIMAGE YES) + set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${LINPHONE_GIT_REVISION}") message(STATUS "Set AppImage CPack generator in OUTPUT/Packages") else() set(CPACK_GENERATOR "NSIS") diff --git a/linphone-app/cmake_builder/linphone_package/packaging.cmake.in b/linphone-app/cmake_builder/linphone_package/packaging.cmake.in index 89d63060c..89e130737 100644 --- a/linphone-app/cmake_builder/linphone_package/packaging.cmake.in +++ b/linphone-app/cmake_builder/linphone_package/packaging.cmake.in @@ -59,11 +59,13 @@ if (NOT "${CMAKE_INSTALL_PREFIX}" MATCHES .*/_CPack_Packages/.*) endif() endif() if(DO_APPIMAGE) -# execute_process( COMMAND cp -rfv "@CMAKE_SOURCE_DIR@/../tools/linuxdeploy-x86_64.AppImage" "@CMAKE_INSTALL_PREFIX@/..") -# execute_process( COMMAND chmod +x "@CMAKE_INSTALL_PREFIX@/../linuxdeploy-x86_64.AppImage") - execute_process( COMMAND "@CMAKE_SOURCE_DIR@/../tools/create_appimage.sh" RESULT_VARIABLE CPACK_COMMAND_RESULT WORKING_DIRECTORY "@CMAKE_INSTALL_PREFIX@/.." ) + set(ENV QML_SOURCES_PATHS="@QML_SOURCES_PATHS@") + set(ENV QML_MODULES_PATHS="@QML_MODULES_PATHS@") + execute_process( COMMAND mkdir -p "WORK/Packages/AppImageDir/" WORKING_DIRECTORY "@CMAKE_INSTALL_PREFIX@/..") + execute_process( COMMAND cp -rfv "@CMAKE_CURRENT_SOURCE_DIR@/../../ui" "WORK/Packages/AppImageDir/" WORKING_DIRECTORY "@CMAKE_INSTALL_PREFIX@/..") + execute_process( COMMAND "@CMAKE_CURRENT_SOURCE_DIR@/../../tools/create_appimage.sh" @CPACK_PACKAGE_FILE_NAME@ RESULT_VARIABLE CPACK_COMMAND_RESULT WORKING_DIRECTORY "@CMAKE_INSTALL_PREFIX@/.." ) if(CPACK_COMMAND_RESULT) - message(FATAL_ERROR "Failed to create AppImage package with this command : @CMAKE_SOURCE_DIR@/../tools/create_appimage.sh at @CMAKE_INSTALL_PREFIX@/..\nMaybe the .appimage already exists and is running. Please remove the file before packaging if it is the case.") + message(FATAL_ERROR "Failed to create AppImage package with this command : '@CMAKE_CURRENT_SOURCE_DIR@/../../tools/create_appimage.sh @APP_PROJECT_VERSION@' at @CMAKE_INSTALL_PREFIX@/..\nMaybe the .appimage already exists and is running. Please remove the file before packaging if it is the case.") endif() endif() if (@PERFORM_SIGNING@) diff --git a/tools/create_appimage.sh b/linphone-app/tools/create_appimage.sh similarity index 79% rename from tools/create_appimage.sh rename to linphone-app/tools/create_appimage.sh index 181a0acf9..947f98a43 100755 --- a/tools/create_appimage.sh +++ b/linphone-app/tools/create_appimage.sh @@ -38,9 +38,14 @@ else wget -P "${WORK_DIR}/AppBin" https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage chmod +x "${WORK_DIR}/AppBin/linuxdeploy-x86_64.AppImage" fi - -./${WORK_DIR}/AppBin/linuxdeploy-x86_64.AppImage --appdir=${WORK_DIR}/ -e ${WORK_DIR}/app/bin/linphone --output appimage --desktop-file=${WORK_DIR}/app/share/applications/linphone.desktop -i ${WORK_DIR}/app/share/icons/hicolor/scalable/apps/linphone.svg +if [ -f "${WORK_DIR}/AppBin/linuxdeploy-plugin-qt-x86_64.AppImage" ]; then + echo "linuxdeploy-plugin-qt-x86_64.AppImage exists" +else + wget -P "${WORK_DIR}/AppBin" https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage + chmod +x "${WORK_DIR}/AppBin/linuxdeploy-plugin-qt-x86_64.AppImage" +fi +./${WORK_DIR}/AppBin/linuxdeploy-x86_64.AppImage --appdir=${WORK_DIR}/ -e ${WORK_DIR}/app/bin/linphone --output appimage --desktop-file=${WORK_DIR}/app/share/applications/linphone.desktop -i ${WORK_DIR}/app/share/icons/hicolor/scalable/apps/linphone.svg --plugin qt #./linuxdeploy-x86_64.AppImage --appdir=${WORK_DIR}/ -e ${WORK_DIR}/app/bin/linphone --output appimage --desktop-file=${WORK_DIR}/app/share/applications/linphone.desktop -i ${WORK_DIR}/app/share/icons/hicolor/scalable/apps/linphone.svg mkdir -p "${BIN_SOURCE_DIR}/Packages" -mv Linphone*.AppImage "${BIN_SOURCE_DIR}/Packages" +mv Linphone*.AppImage "${BIN_SOURCE_DIR}/Packages/$1.AppImage"