diff --git a/.gitlab-ci-files/job-linux-desktop-ubuntu-2004.yml b/.gitlab-ci-files/job-linux-desktop-ubuntu-2004.yml index 5eac89fbd..5c329ed89 100644 --- a/.gitlab-ci-files/job-linux-desktop-ubuntu-2004.yml +++ b/.gitlab-ci-files/job-linux-desktop-ubuntu-2004.yml @@ -81,6 +81,8 @@ job-ubuntu2004-makefile-gcc: - echo $CMAKE_GENERATOR - echo $DEFAULT_LINUX_CMAKE_OPTIONS - echo $CMAKE_SANITIZER_OPTIONS + - eval "$(qtchooser -qt=$QT_LINUX_VER -print-env)" + - export PATH=${QTTOOLDIR}:$PATH - cd build - cmake .. -G "$CMAKE_GENERATOR" -DCMAKE_VERBOSE_MAKEFILE=ON -DLINPHONESDK_PLATFORM=Desktop -DCMAKE_BUILD_TYPE=$CI_BUILD_TYPE $DEFAULT_LINUX_CMAKE_OPTIONS $CMAKE_OPTIONS $SCHEDULE_CMAKE_OPTIONS $CMAKE_SANITIZER_OPTIONS - cmake --build . --target install --config $CI_BUILD_TYPE $LBC_NODEBUG_OPTIONS @@ -123,6 +125,8 @@ job-ubuntu2004-makefile-gcc-package: - echo $CMAKE_GENERATOR - echo $DEFAULT_LINUX_CMAKE_OPTIONS - echo $CMAKE_SANITIZER_OPTIONS + - eval "$(qtchooser -qt=$QT_LINUX_VER -print-env)" + - export PATH=${QTTOOLDIR}:$PATH - cd build - cmake .. -G "$CMAKE_GENERATOR" -DCMAKE_VERBOSE_MAKEFILE=ON -DLINPHONESDK_PLATFORM=Desktop -DCMAKE_BUILD_TYPE=$CI_BUILD_TYPE $DEFAULT_LINUX_CMAKE_OPTIONS $CMAKE_OPTIONS $SCHEDULE_CMAKE_OPTIONS $CMAKE_SANITIZER_OPTIONS - cmake --build . --target install --config $CI_BUILD_TYPE $LBC_NODEBUG_OPTIONS diff --git a/CMakeLists.txt b/CMakeLists.txt index 05a87f359..af6683ba8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -246,7 +246,7 @@ if(NOT APPLE OR MONO_ARCH) #install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory \"${CMAKE_INSTALL_PREFIX}/share/\" \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/\")") #install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory \"${CMAKE_INSTALL_PREFIX}/mkspecs/\" \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/\")") endif() - + include (cmake/install/install.cmake) else() include(cmake/TasksMacos.cmake) endif() diff --git a/Linphone/CMakeLists.txt b/Linphone/CMakeLists.txt index 6e0cbe123..6029f257c 100644 --- a/Linphone/CMakeLists.txt +++ b/Linphone/CMakeLists.txt @@ -119,18 +119,4 @@ foreach(T ${QT_PACKAGES}) target_link_libraries(${TARGET_NAME} PRIVATE Qt6::${T}) endforeach() -################################################################ -# INSTALL -################################################################ - -install(TARGETS ${TARGET_NAME} - BUNDLE DESTINATION . - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - -if(ENABLE_APP_PACKAGE_ROOTCA) - install(FILES "${LINPHONE_OUTPUT_DIR}/share/linphone/rootca.pem" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/${EXECUTABLE_NAME}") -endif() diff --git a/Linphone/data/icon.ico b/Linphone/data/icon.ico new file mode 100644 index 000000000..9be645bdd Binary files /dev/null and b/Linphone/data/icon.ico differ diff --git a/Linphone/data/icon/genicons.sh b/Linphone/data/icon/genicons.sh index d1bbce381..38b59437b 100755 --- a/Linphone/data/icon/genicons.sh +++ b/Linphone/data/icon/genicons.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash ## -## Copyright (c) 2010-2020 Belledonne Communications SARL. +## Copyright (c) 2010-2024 Belledonne Communications SARL. ## ## This file is part of linphone-desktop ## (see https://www.linphone.org). @@ -22,7 +22,7 @@ for i in 16 22 24 32 64 128 256 do mkdir -p hicolor/${i}x${i}/apps - inkscape -z -e hicolor/${i}x${i}/apps/icon.png -w $i -h $i ../images/linphone_logo.svg + inkscape -z -e hicolor/${i}x${i}/apps/icon.png -w $i -h $i ../image/logo.svg done -convert -density 256x256 -background transparent ../images/linphone_logo.svg -define icon:auto-resize -colors 256 ../icon.ico -png2icns ../../cmake_builder/linphone_package/macos/linphone.icns hicolor/16x16/apps/icon.png hicolor/32x32/apps/icon.png hicolor/128x128/apps/icon.png hicolor/256x256/apps/icon.png +convert -density 256x256 -background transparent ../image/logo.svg -define icon:auto-resize -colors 256 ../icon.ico +png2icns ../../../cmake/install/macos/linphone.icns hicolor/16x16/apps/icon.png hicolor/32x32/apps/icon.png hicolor/128x128/apps/icon.png hicolor/256x256/apps/icon.png diff --git a/Linphone/data/icon/genicons_1.0.sh b/Linphone/data/icon/genicons_1.0.sh index af8b76a00..b142a0d36 100755 --- a/Linphone/data/icon/genicons_1.0.sh +++ b/Linphone/data/icon/genicons_1.0.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash ## -## Copyright (c) 2010-2020 Belledonne Communications SARL. +## Copyright (c) 2010-2024 Belledonne Communications SARL. ## ## This file is part of linphone-desktop ## (see https://www.linphone.org). @@ -22,7 +22,7 @@ for i in 16 22 24 32 64 128 256 do mkdir -p hicolor/${i}x${i}/apps - inkscape -z --export-type=png --export-file=hicolor/${i}x${i}/apps/icon.png -w $i -h $i ../images/linphone_logo.svg + inkscape -z --export-type=png --export-file=hicolor/${i}x${i}/apps/icon.png -w $i -h $i ../image/logo.svg done -convert -density 256x256 -background transparent ../images/linphone_logo.svg -define icon:auto-resize -colors 256 ../icon.ico -png2icns ../../cmake_builder/linphone_package/macos/linphone.icns hicolor/16x16/apps/icon.png hicolor/32x32/apps/icon.png hicolor/128x128/apps/icon.png hicolor/256x256/apps/icon.png +convert -density 256x256 -background transparent ../image/logo.svg -define icon:auto-resize -colors 256 ../icon.ico +png2icns ../../../cmake/install/macos/linphone.icns hicolor/16x16/apps/icon.png hicolor/32x32/apps/icon.png hicolor/128x128/apps/icon.png hicolor/256x256/apps/icon.png diff --git a/Linphone/data/icon/genicons_1.1.sh b/Linphone/data/icon/genicons_1.1.sh index b23d528b4..cd24fc211 100755 --- a/Linphone/data/icon/genicons_1.1.sh +++ b/Linphone/data/icon/genicons_1.1.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash ## -## Copyright (c) 2010-2020 Belledonne Communications SARL. +## Copyright (c) 2010-2024 Belledonne Communications SARL. ## ## This file is part of linphone-desktop ## (see https://www.linphone.org). @@ -22,7 +22,7 @@ for i in 16 22 24 32 64 128 256 do mkdir -p hicolor/${i}x${i}/apps - inkscape -z --export-type=png --export-filename=hicolor/${i}x${i}/apps/icon.png -w $i -h $i ../images/linphone_logo.svg + inkscape -z --export-type=png --export-filename=hicolor/${i}x${i}/apps/icon.png -w $i -h $i ../image/logo.svg done -convert -density 256x256 -background transparent ../images/linphone_logo.svg -define icon:auto-resize -colors 256 ../icon.ico -png2icns ../../cmake_builder/linphone_package/macos/linphone.icns hicolor/16x16/apps/icon.png hicolor/32x32/apps/icon.png hicolor/128x128/apps/icon.png hicolor/256x256/apps/icon.png +convert -density 256x256 -background transparent ../image/logo.svg -define icon:auto-resize -colors 256 ../icon.ico +png2icns ../../../cmake/install/macos/linphone.icns hicolor/16x16/apps/icon.png hicolor/32x32/apps/icon.png hicolor/128x128/apps/icon.png hicolor/256x256/apps/icon.png diff --git a/cmake/install/create_appimage.sh b/cmake/install/create_appimage.sh new file mode 100755 index 000000000..479d5fab7 --- /dev/null +++ b/cmake/install/create_appimage.sh @@ -0,0 +1,130 @@ +#!/bin/bash +## +## Copyright (c) 2010-2024 Belledonne Communications SARL. +## +## This file is part of linphone-desktop +## (see https://www.linphone.org). +## +## 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 3 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, see . +## + +# Arguments : +# $1 = Executable Name +# $2 = Output Filename +# $3 = Qt root path (eg. "~/Qt/5.15.2/gcc_64") +# $4 = Key of the code sign (optional but mendatory if code signing) + +APP_NAME="$1" +QT_PATH="$3" + +BIN_SOURCE_DIR="OUTPUT/" + +WORK_DIR="WORK/Packages/AppImageDir" + +# Goal : avoid fuse on CI. --appimage-extract-and-run is not enough because of not propagate to plugins. +export APPIMAGE_EXTRACT_AND_RUN=1 + +rm -rf ${WORK_DIR}/AppDir +mkdir -p "${WORK_DIR}/AppDir/usr/" + +copyFolder() +{ + mkdir -p "${WORK_DIR}/AppDir/usr/$1" + cp -rf "${BIN_SOURCE_DIR}/$1"/* "${WORK_DIR}/AppDir/usr/$1" +} + + +#Copy all files from the output project +#cp -rf "${BIN_SOURCE_DIR}"/* "${WORK_DIR}/AppDir/usr/" +copyFolder bin +#cp -rf "${BIN_SOURCE_DIR}/bin"/* "${WORK_DIR}/AppDir/usr/bin" + +# Copy share +copyFolder share/applications +copyFolder share/belr +copyFolder share/icons +copyFolder share/images +copyFolder share/linphone +copyFolder share/sounds + +#remove Packages folder : it is not part of the project +#rm -rf "${WORK_DIR}/AppDir/usr/Packages" +#remove libraries : there are automatically found by linuxdeploy +#rm -rf "${WORK_DIR}/AppDir/usr/lib" +#rm -rf "${WORK_DIR}/AppDir/usr/lib64" +#Copy soci sqlite3 backend +mkdir -p "${WORK_DIR}/AppDir/usr/lib" +cp -f "${BIN_SOURCE_DIR}/lib"/libsoci_sqlite3* "${WORK_DIR}/AppDir/usr/lib/" +cp -f "${BIN_SOURCE_DIR}/lib"/libapp-plugin* "${WORK_DIR}/AppDir/usr/lib/" +cp -f "${BIN_SOURCE_DIR}/lib64"/libsoci_sqlite3* "${WORK_DIR}/AppDir/usr/lib/" +cp -f "${BIN_SOURCE_DIR}/lib64"/libapp-plugin* "${WORK_DIR}/AppDir/usr/lib/" + +cp -f "${BIN_SOURCE_DIR}/lib"/libEQt* "${WORK_DIR}/AppDir/usr/lib/" +cp -f "${BIN_SOURCE_DIR}/lib64"/libEQt* "${WORK_DIR}/AppDir/usr/lib/" + + +if [ -d "${BIN_SOURCE_DIR}/lib64/mediastreamer" ]; then + mkdir -p "${WORK_DIR}/AppDir/usr/lib64/" + cp -rf "${BIN_SOURCE_DIR}"/lib64/mediastreamer "${WORK_DIR}/AppDir/usr/lib64/" +fi + +if [ -d "${BIN_SOURCE_DIR}/lib/mediastreamer" ]; then + mkdir -p "${WORK_DIR}/AppDir/usr/lib/" + cp -rf "${BIN_SOURCE_DIR}"/lib/mediastreamer "${WORK_DIR}/AppDir/usr/lib/" +fi + +if [ -f "${WORK_DIR}/AppBin/linuxdeploy-x86_64.AppImage" ]; then + echo "linuxdeploy-x86_64.AppImage exists" +else + wget -P "${WORK_DIR}/AppBin" https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage + #wget -P "${WORK_DIR}/AppBin" https://artifacts.assassinate-you.net/linuxdeploy/travis-456/linuxdeploy-x86_64.AppImage + chmod +x "${WORK_DIR}/AppBin/linuxdeploy-x86_64.AppImage" +fi +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 + +########################################################################################### +export QMAKE=qmake +export QML_SOURCES_PATHS=${QML_SOURCES_PATHS}:${WORK_DIR}/.. +export LD_LIBRARY_PATH=${QT_PATH}/lib:${BIN_SOURCE_DIR}/lib:${BIN_SOURCE_DIR}/lib64 +#export EXTRA_QT_PLUGINS=webenginecore;webview;webengine + +echo "QML_SOURCES_PATHS=${QML_SOURCES_PATHS}" +echo "QML_MODULES_PATHS=${QML_MODULES_PATHS}" +echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" + +echo "-- Generating AppDir for AppImage" +if [ -z "$4" ]; then + echo "./${WORK_DIR}/AppBin/linuxdeploy-x86_64.AppImage --appimage-extract-and-run --appdir=${WORK_DIR}/AppDir -e ${WORK_DIR}/AppDir/usr/bin/${APP_NAME} --output appimage --desktop-file=${WORK_DIR}/AppDir/usr/share/applications/${APP_NAME}.desktop -i ${WORK_DIR}/AppDir/usr/share/icons/hicolor/scalable/apps/${APP_NAME}.svg --plugin qt" + ./${WORK_DIR}/AppBin/linuxdeploy-x86_64.AppImage --appimage-extract-and-run --appdir=${WORK_DIR}/AppDir -e ${WORK_DIR}/AppDir/usr/bin/${APP_NAME} --output appimage --desktop-file=${WORK_DIR}/AppDir/usr/share/applications/${APP_NAME}.desktop -i ${WORK_DIR}/AppDir/usr/share/icons/hicolor/scalable/apps/${APP_NAME}.svg --plugin qt +else + if [ -f "${WORK_DIR}/AppBin/appimagetool-x86_64.AppImage" ]; then + echo "appimagetool-x86_64.AppImage exists" + else + wget -P "${WORK_DIR}/AppBin" https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage + chmod +x "${WORK_DIR}/AppBin/appimagetool-x86_64.AppImage" + fi + ./${WORK_DIR}/AppBin/linuxdeploy-x86_64.AppImage --appimage-extract-and-run --appdir=${WORK_DIR}/AppDir -e ${WORK_DIR}/AppDir/usr/bin/${APP_NAME} --desktop-file=${WORK_DIR}/AppDir/usr/share/applications/${APP_NAME}.desktop -i ${WORK_DIR}/AppDir/usr/share/icons/hicolor/scalable/apps/${APP_NAME}.svg --plugin qt + #./linuxdeploy-x86_64.AppImage --appdir=${WORK_DIR}/ -e ${WORK_DIR}/app/bin/${APP_NAME} --output appimage --desktop-file=${WORK_DIR}/app/share/applications/${APP_NAME}.desktop -i ${WORK_DIR}/app/share/icons/hicolor/scalable/apps/${APP_NAME}.svg + echo "-- Code Signing of AppImage" + # APPIMAGETOOL_SIGN_PASSPHRASE has to the parent environment (not here). Do not use export. + ./${WORK_DIR}/AppBin/appimagetool-x86_64.AppImage --appimage-extract-and-run ${WORK_DIR}/AppDir --sign --sign-key $4 +fi + +#mkdir -p "${BIN_SOURCE_DIR}/Packages" +#mv *.AppImage "${BIN_SOURCE_DIR}/Packages/$2.AppImage" diff --git a/cmake/install/install.cmake b/cmake/install/install.cmake new file mode 100644 index 000000000..ac4ba3d6d --- /dev/null +++ b/cmake/install/install.cmake @@ -0,0 +1,98 @@ +################################################################################ +# +# Copyright (c) 2017-2024 Belledonne Communications SARL. +# +# This file is part of linphone-desktop +# (see https://www.linphone.org). +# +# 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 3 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, see . +# +################################################################################ + +cmake_minimum_required(VERSION 3.1) + +set(TARGET_NAME Linphone) + +if (GIT_EXECUTABLE AND NOT(LINPHONEAPP_VERSION)) + execute_process( + COMMAND ${GIT_EXECUTABLE} describe --always + OUTPUT_VARIABLE LINPHONEAPP_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../.." + ) +elseif (NOT(LINPHONEAPP_VERSION)) + set(LINPHONEAPP_VERSION "0.0.0") +endif () + +set(LINPHONE_VERSION ${LINPHONE_MAJOR_VERSION}.${LINPHONE_MINOR_VERSION}.${LINPHONE_MICRO_VERSION}) +set(PACKAGE_VERSION "${LINPHONEAPP_VERSION}") + +install(TARGETS ${TARGET_NAME} + BUNDLE DESTINATION . + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + +if(ENABLE_APP_PACKAGE_ROOTCA) + install(FILES "${LINPHONE_OUTPUT_DIR}/share/linphone/rootca.pem" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/${EXECUTABLE_NAME}") +endif() + +# ============================================================================== +# CPack. +# ============================================================================== +set(LINPHONE_QML_DIR "${CMAKE_SOURCE_DIR}/Linphone/view") +set(QT_PATH "${Qt6Core_DIR}/../../..") + +if(${ENABLE_APP_PACKAGING}) + set(CPACK_BINARY_STGZ OFF) + set(CPACK_BINARY_TGZ OFF) + set(CPACK_BINARY_TZ OFF) + set(CPACK_PACKAGE_NAME "${APPLICATION_NAME}") + set(CPACK_PACKAGE_VENDOR "${APPLICATION_VENDOR}") + set(CPACK_PACKAGE_VERSION_MAJOR ${LINPHONE_MAJOR_VERSION}) + set(CPACK_PACKAGE_VERSION_MINOR ${LINPHONE_MINOR_VERSION}) + if (LINPHONE_MICRO_VERSION) + set(CPACK_PACKAGE_VERSION_PATCH ${LINPHONE_MICRO_VERSION}) + endif () + set(CPACK_PACKAGE_EXECUTABLES "${EXECUTABLE_NAME};${APPLICATION_NAME}") + + if(ENABLE_APP_LICENSE) + set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.txt") + else() + unset(CPACK_RESOURCE_FILE_LICENSE) + endif() + set(CPACK_RESOURCE_FILE_LICENSE_PROVIDED ${ENABLE_APP_LICENSE}) + set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/../../assets/icon.ico") + set(PERFORM_SIGNING 0) +############################################## +# LINUX +############################################## + set(DO_APPIMAGE YES) + set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${PACKAGE_VERSION}") + set(PACKAGE_EXT "AppImage") + configure_file("${CMAKE_SOURCE_DIR}/cmake/install/linux/linphone.desktop.cmake" "${CMAKE_BINARY_DIR}/cmake/install/linux/${EXECUTABLE_NAME}.desktop" @ONLY) + install(FILES "${CMAKE_BINARY_DIR}/cmake/install/linux/${EXECUTABLE_NAME}.desktop" DESTINATION "${CMAKE_INSTALL_DATADIR}/applications" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + install(FILES "${CMAKE_SOURCE_DIR}/Linphone/data/image/logo.svg" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps/" RENAME "${EXECUTABLE_NAME}.svg") + set(ICON_DIRS 16x16 22x22 24x24 32x32 64x64 128x128 256x256) + foreach (DIR ${ICON_DIRS}) + install(FILES "${CMAKE_SOURCE_DIR}/Linphone/data/icon/hicolor/${DIR}/apps/icon.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${DIR}/apps/" RENAME "${EXECUTABLE_NAME}.png") + endforeach () + message(STATUS "Set AppImage CPack generator in OUTPUT/Packages") +############################################## + configure_file("${CMAKE_SOURCE_DIR}/cmake/install/packaging.cmake.in" "${CMAKE_BINARY_DIR}/cmake/install/packaging.cmake" @ONLY) + install(SCRIPT "${CMAKE_BINARY_DIR}/cmake/install/packaging.cmake") + include(CPack) +endif() + diff --git a/cmake/install/linux/linphone.desktop.cmake b/cmake/install/linux/linphone.desktop.cmake new file mode 100644 index 000000000..2889e7b26 --- /dev/null +++ b/cmake/install/linux/linphone.desktop.cmake @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=@APPLICATION_NAME@ +GenericName=SIP Phone +Comment=@APPLICATION_DESCRIPTION@ +Type=Application +Exec=@EXECUTABLE_NAME@ %u +Icon=@EXECUTABLE_NAME@ +Terminal=false +Categories=Network;Telephony; +MimeType=x-scheme-handler/sip-@EXECUTABLE_NAME@;x-scheme-handler/sip;x-scheme-handler/sips-@EXECUTABLE_NAME@;x-scheme-handler/sips;x-scheme-handler/tel;x-scheme-handler/callto;x-scheme-handler/@EXECUTABLE_NAME@-config; +X-PulseAudio-Properties=media.role=phone diff --git a/cmake/install/macos/Info.plist.in b/cmake/install/macos/Info.plist.in new file mode 100644 index 000000000..e36a72d02 --- /dev/null +++ b/cmake/install/macos/Info.plist.in @@ -0,0 +1,87 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleAllowMixedLocalizations + + CFBundleName + @APPLICATION_NAME@ + CFBundleDisplayName + @APPLICATION_NAME@ + CFBundleExecutable + @EXECUTABLE_NAME@ + CFBundleGetInfoString + @PACKAGE_VERSION@, (C) @COPYRIGHT_RANGE_DATE@ @APPLICATION_NAME@ @APPLICATION_URL@ + CFBundleIconFile + @EXECUTABLE_NAME@.icns + CFBundleIdentifier + @APPLICATION_ID@ + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleShortVersionString + @PACKAGE_VERSION@ + CFBundleSignature + ???? + CFBundleVersion + @PACKAGE_VERSION@ + NSHumanReadableCopyright + Copyright @COPYRIGHT_RANGE_DATE@ @APPLICATION_VENDOR@ + LSMinimumSystemVersion + @CMAKE_OSX_DEPLOYMENT_TARGET@ + NSAppSleepDisabled + YES + CFBundleURLTypes + + + CFBundleURLName + @APPLICATION_ID@ + CFBundleURLSchemes + + sip + sip-@EXECUTABLE_NAME@ + sips + sips-@EXECUTABLE_NAME@ + tel + callto + @EXECUTABLE_NAME@-config + + + + NSPrincipalClass + NSApplication + NSHighResolutionCapable + True + NSCameraUsageDescription + Streaming Video between devices + NSMicrophoneUsageDescription + Streaming Audio between devices + NSPhotoLibraryUsageDescription + Store attachment and allow camera record when selected + NSPhotoLibraryAddUsageDescription + Store attachment and allow camera record when selected + NSDesktopFolderUsageDescription + Storing configuration files + NSDocumentsFolderUsageDescription + Can use Documents folder to put logs + NSDownloadsFolderUsageDescription + Getting files from Download folder for sending attachment + NSAppleEventsUsageDescription + Used for sending notifications and working with Appnap + NSBluetoothPeripheralUsageDescription + Use for wireless headsets + kTCCServiceMediaLibrary + Used media library as attachement or for the ringer + com.apple.security.device.camera + + com.apple.security.device.microphone + + com.apple.security.device.audio-input + + com.apple.security.personal-information.photos-library + + + diff --git a/cmake/install/macos/background_dmg.jpg b/cmake/install/macos/background_dmg.jpg new file mode 100644 index 000000000..8fe42444e Binary files /dev/null and b/cmake/install/macos/background_dmg.jpg differ diff --git a/cmake/install/macos/entitlements.xml.in b/cmake/install/macos/entitlements.xml.in new file mode 100644 index 000000000..2ef7410cd --- /dev/null +++ b/cmake/install/macos/entitlements.xml.in @@ -0,0 +1,20 @@ + + + + + com.apple.security.assets.music.read-write + + com.apple.security.device.microphone + + com.apple.security.device.camera + + com.apple.security.device.audio-input + + com.apple.security.network.client + + com.apple.security.personal-information.photos-library + + com.apple.security.files.user-selected.read-write + + + diff --git a/cmake/install/macos/linphone.icns b/cmake/install/macos/linphone.icns new file mode 100644 index 000000000..d35186a5e Binary files /dev/null and b/cmake/install/macos/linphone.icns differ diff --git a/cmake/install/macos/linphone_dmg.scpt.in b/cmake/install/macos/linphone_dmg.scpt.in new file mode 100755 index 000000000..866c6fcb0 --- /dev/null +++ b/cmake/install/macos/linphone_dmg.scpt.in @@ -0,0 +1,42 @@ +on run argv + set image_name to item 1 of argv + + tell application "Finder" + tell disk image_name + + -- open the image the first time and save a DS_Store with just + -- background and icon setup + open + set current view of container window to icon view + set theViewOptions to the icon view options of container window + set background picture of theViewOptions to file ".background:background.jpg" + set arrangement of theViewOptions to not arranged + set icon size of theViewOptions to 100 + delay 1 + close + + -- next setup the position of the app and Applications symlink + -- plus hide all the window decoration + open + update without registering applications + tell container window + set sidebar width to 0 + set statusbar visible to false + set toolbar visible to false + set the bounds to { 300, 100, 1000, 520 } + set position of item "@APPLICATION_NAME@.app" to { 200, 280 } + set position of item "Applications" to { 500, 280 } + end tell + update without registering applications + delay 1 + close + + -- one last open and close so you can see everything looks correct + open + delay 5 + close + + end tell + delay 1 + end tell +end run diff --git a/cmake/install/packaging.cmake.in b/cmake/install/packaging.cmake.in new file mode 100644 index 000000000..1a8e19fb7 --- /dev/null +++ b/cmake/install/packaging.cmake.in @@ -0,0 +1,91 @@ +############################################################################ +# packaging.cmake +# Copyright (C) 2017-2024 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. +# +############################################################################ +set(DO_TGZ @CPACK_BINARY_TGZ@) +set(DO_TZ @CPACK_BINARY_TZ@) +set(DO_STGZ @CPACK_BINARY_STGZ@) +set(DO_DRAGNDROP @CPACK_BINARY_DRAGNDROP@) +set(DO_GENERATOR @DO_GENERATOR@) +set(DO_APPIMAGE @DO_APPIMAGE@) + + +if (NOT "${CMAKE_INSTALL_PREFIX}" MATCHES .*/_CPack_Packages/.*) + if(DO_TGZ) + execute_process( COMMAND ${CMAKE_CPACK_COMMAND} -G TGZ RESULT_VARIABLE CPACK_COMMAND_RESULT) + if(CPACK_COMMAND_RESULT) + message(FATAL_ERROR "Failed to create TGZ package!") + endif() + endif() + if(DO_TZ) + execute_process( COMMAND ${CMAKE_CPACK_COMMAND} -G TZ RESULT_VARIABLE CPACK_COMMAND_RESULT) + if(CPACK_COMMAND_RESULT) + message(FATAL_ERROR "Failed to create TZ package!") + endif() + endif() + if(DO_STGZ) + execute_process( COMMAND ${CMAKE_CPACK_COMMAND} -G STGZ RESULT_VARIABLE CPACK_COMMAND_RESULT) + if(CPACK_COMMAND_RESULT) + message(FATAL_ERROR "Failed to create STGZ package!") + endif() + endif() + if(DO_DRAGNDROP) + execute_process( COMMAND ${CMAKE_CPACK_COMMAND} -G DragNDrop RESULT_VARIABLE CPACK_COMMAND_RESULT) + if(CPACK_COMMAND_RESULT) + message(FATAL_ERROR "Failed to create DragAndDrop package!") + endif() + endif() + if(DO_GENERATOR) + execute_process( COMMAND ${CMAKE_CPACK_COMMAND} -G @CPACK_GENERATOR@ -C @CMAKE_BUILD_TYPE@ RESULT_VARIABLE CPACK_COMMAND_RESULT) + if(CPACK_COMMAND_RESULT) + message(FATAL_ERROR "Failed to create @CPACK_GENERATOR@ package!") + endif() + endif() + if(DO_APPIMAGE) + set(ENV{QML_SOURCES_PATHS} "@LINPHONE_QML_DIR@") + set(ENV{QML_MODULES_PATHS} "@LINPHONE_QML_DIR@") + execute_process( COMMAND mkdir -p "WORK/Packages/AppImageDir/" WORKING_DIRECTORY "@CMAKE_INSTALL_PREFIX@/..") + execute_process( COMMAND cp -rf "@LINPHONE_QML_DIR@" "WORK/Packages/AppImageDir/" WORKING_DIRECTORY "@CMAKE_INSTALL_PREFIX@/..") + execute_process( COMMAND "@CMAKE_SOURCE_DIR@/cmake/install/create_appimage.sh" @EXECUTABLE_NAME@ @CPACK_PACKAGE_FILE_NAME@ @QT_PATH@ @LINPHONE_BUILDER_SIGNING_IDENTITY@ 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_CURRENT_SOURCE_DIR@/../../tools/create_appimage.sh @EXECUTABLE_NAME@ @QT_PATH@ @LINPHONEAPP_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@) + if(@PASSPHRASE_FILE@) + execute_process( + COMMAND "@CMAKE_CURRENT_SOURCE_DIR@/../../tools/sign_package.bat" 1 "@PASSPHRASE_FILE@" "@SIGNTOOL_COMMAND@" "@PFX_FILE@" "@TIMESTAMP_URL@" @CPACK_PACKAGE_FILE_NAME@.@PACKAGE_EXT@ + RESULT_VARIABLE SIGNING_RESULT WORKING_DIRECTORY "@CPACK_PACKAGE_DIRECTORY@" + ) + else() + execute_process( + COMMAND "@CMAKE_CURRENT_SOURCE_DIR@/../../tools/sign_package.bat" 2 "@SIGNTOOL_COMMAND@" "@TIMESTAMP_URL@" @SIGN_HASH@ @CPACK_PACKAGE_FILE_NAME@.@PACKAGE_EXT@ + RESULT_VARIABLE SIGNING_RESULT WORKING_DIRECTORY "@CPACK_PACKAGE_DIRECTORY@" + ) + endif() + if(SIGNING_RESULT) + message(FATAL_ERROR "Failed to sign the package! ${SIGNING_RESULT} ${RESULT_VARIABLE}") + endif() + endif () + execute_process( COMMAND mkdir -p "@CMAKE_INSTALL_PREFIX@/Packages/" WORKING_DIRECTORY "@CMAKE_BINARY_DIR@") + execute_process( COMMAND bash -c "cp -rf @CMAKE_BINARY_DIR@/*.@PACKAGE_EXT@ @CMAKE_INSTALL_PREFIX@/Packages" WORKING_DIRECTORY "@CMAKE_BINARY_DIR@") +endif () + + diff --git a/cmake/install/sign_package.bat b/cmake/install/sign_package.bat new file mode 100644 index 000000000..c1ddbb626 --- /dev/null +++ b/cmake/install/sign_package.bat @@ -0,0 +1,10 @@ +@echo off +if [%1]==[2] goto simple +set /p passphrase=<%2 +%3 sign /f %4 /fd SHA256 /p %passphrase% /t %5 %6 +goto :eof + +:simple +%2 sign /fd SHA256 /t %3 /sha1 %4 %5 + +:eof diff --git a/cmake/install/sign_package.sh b/cmake/install/sign_package.sh new file mode 100644 index 000000000..7f5b1e2aa --- /dev/null +++ b/cmake/install/sign_package.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# Arguments : +# $1 = Executable Name +# $2 = Identity +# $3 = Path to recursivly search + +find $3 -name "*" -exec $1 --force --deep --timestamp --options runtime,library -s "$2" {} \; +