telegram-desktop: update to 1.9.3.

This commit is contained in:
John 2019-11-06 11:01:10 +01:00 committed by John Zimmermann
parent 9074286cf3
commit 1122d81f83
24 changed files with 566 additions and 1189 deletions

View File

@ -1,19 +0,0 @@
find_path(BREAKPAD_CLIENT_INCLUDE_DIR
NAMES client/linux/handler/exception_handler.h
PATH_SUFFIXES breakpad
)
find_library(BREAKPAD_CLIENT_LIBRARY
NAMES breakpad_client
)
find_package_handle_standard_args(Breakpad DEFAULT_MSG
BREAKPAD_CLIENT_LIBRARY
BREAKPAD_CLIENT_INCLUDE_DIR
)
add_library(breakpad_client STATIC IMPORTED)
add_dependencies(breakpad_client breakpad_build)
set_property(TARGET breakpad_client PROPERTY IMPORTED_LOCATION ${BREAKPAD_CLIENT_LIBRARY})
set_property(TARGET breakpad_client PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${BREAKPAD_CLIENT_INCLUDE_DIR})

View File

@ -1,260 +0,0 @@
cmake_minimum_required(VERSION 3.8)
project(TelegramDesktop)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
include(GNUInstallDirs)
list(APPEND CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/gyp
${CMAKE_SOURCE_DIR}/cmake
)
option(BUILD_TESTS "Build all available test suites" OFF)
option(ENABLE_CRASH_REPORTS "Enable crash reports" ON)
option(ENABLE_GTK_INTEGRATION "Enable GTK integration" ON)
option(USE_LIBATOMIC "Link Statically against libatomic.a" OFF)
option(ENABLE_OPENAL_EFFECTS "Enable OpenAL effects" ON)
find_package(LibLZMA REQUIRED)
find_package(OpenAL REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(Threads REQUIRED)
find_package(X11 REQUIRED)
find_package(ZLIB REQUIRED)
find_package(RapidJSON REQUIRED)
find_package(Qt5 REQUIRED COMPONENTS Core DBus Gui Widgets Network)
get_target_property(QTCORE_INCLUDE_DIRS Qt5::Core INTERFACE_INCLUDE_DIRECTORIES)
list(GET QTCORE_INCLUDE_DIRS 0 QT_INCLUDE_DIR)
foreach(__qt_module IN ITEMS QtCore QtGui)
list(APPEND QT_PRIVATE_INCLUDE_DIRS
${QT_INCLUDE_DIR}/${__qt_module}/${Qt5_VERSION}
${QT_INCLUDE_DIR}/${__qt_module}/${Qt5_VERSION}/${__qt_module}
)
endforeach()
message(STATUS "Using Qt private include directories: ${QT_PRIVATE_INCLUDE_DIRS}")
find_package(PkgConfig REQUIRED)
pkg_check_modules(FFMPEG REQUIRED libavcodec libavformat libavutil libswresample libswscale)
pkg_check_modules(LIBDRM REQUIRED libdrm)
pkg_check_modules(LIBVA REQUIRED libva libva-drm libva-x11)
pkg_check_modules(MINIZIP REQUIRED minizip)
pkg_check_modules(LIBLZ4 REQUIRED liblz4)
pkg_check_modules(RLOTTIE REQUIRED rlottie)
set(THIRD_PARTY_DIR ${CMAKE_SOURCE_DIR}/ThirdParty)
list(APPEND THIRD_PARTY_INCLUDE_DIRS
${THIRD_PARTY_DIR}/crl/src
${THIRD_PARTY_DIR}/GSL/include
${THIRD_PARTY_DIR}/emoji_suggestions
${THIRD_PARTY_DIR}/libtgvoip
${THIRD_PARTY_DIR}/variant/include
)
add_subdirectory(${THIRD_PARTY_DIR}/crl)
add_subdirectory(${THIRD_PARTY_DIR}/libtgvoip)
set(TELEGRAM_SOURCES_DIR ${CMAKE_SOURCE_DIR}/SourceFiles)
set(TELEGRAM_RESOURCES_DIR ${CMAKE_SOURCE_DIR}/Resources)
include_directories(${TELEGRAM_SOURCES_DIR})
set(GENERATED_DIR ${CMAKE_BINARY_DIR}/generated)
file(MAKE_DIRECTORY ${GENERATED_DIR})
include(TelegramCodegen)
set_property(SOURCE ${TELEGRAM_GENERATED_SOURCES} PROPERTY SKIP_AUTOMOC ON)
set(QRC_FILES
Resources/qrc/telegram/sounds.qrc
Resources/qrc/telegram/telegram.qrc
Resources/qrc/emoji_1.qrc
Resources/qrc/emoji_2.qrc
Resources/qrc/emoji_3.qrc
Resources/qrc/emoji_4.qrc
Resources/qrc/emoji_5.qrc
Resources/qrc/emoji_preview.qrc
# This only disables system plugin search path
# We do not want this behavior for system build
# Resources/qrc/telegram_linux.qrc
)
file(GLOB FLAT_SOURCE_FILES
SourceFiles/*.cpp
SourceFiles/api/*.cpp
SourceFiles/base/*.cpp
SourceFiles/calls/*.cpp
SourceFiles/chat_helpers/*.cpp
SourceFiles/core/*.cpp
SourceFiles/data/*.cpp
SourceFiles/dialogs/*.cpp
SourceFiles/ffmpeg/*.cpp
SourceFiles/inline_bots/*.cpp
SourceFiles/intro/*.cpp
SourceFiles/lang/*.cpp
SourceFiles/lottie/*.cpp
SourceFiles/main/*.cpp
SourceFiles/mtproto/*.cpp
SourceFiles/overview/*.cpp
SourceFiles/passport/*.cpp
SourceFiles/platform/linux/*.cpp
SourceFiles/profile/*.cpp
SourceFiles/settings/*.cpp
SourceFiles/storage/*.cpp
SourceFiles/storage/cache/*.cpp
SourceFiles/support/*cpp
${THIRD_PARTY_DIR}/emoji_suggestions/*.cpp
)
file(GLOB FLAT_EXTRA_FILES
SourceFiles/qt_static_plugins.cpp
SourceFiles/base/*_tests.cpp
SourceFiles/base/tests_main.cpp
SourceFiles/passport/passport_edit_identity_box.cpp
SourceFiles/passport/passport_form_row.cpp
SourceFiles/storage/*_tests.cpp
SourceFiles/storage/*_win.cpp
SourceFiles/storage/storage_feed_messages.cpp
SourceFiles/storage/cache/*_tests.cpp
SourceFiles/data/data_feed_messages.cpp
)
list(REMOVE_ITEM FLAT_SOURCE_FILES ${FLAT_EXTRA_FILES})
file(GLOB_RECURSE SUBDIRS_SOURCE_FILES
SourceFiles/boxes/*.cpp
SourceFiles/export/*.cpp
SourceFiles/history/*.cpp
SourceFiles/info/*.cpp
SourceFiles/media/*.cpp
SourceFiles/ui/*.cpp
SourceFiles/window/*.cpp
)
file(GLOB SUBDIRS_EXTRA_FILES
SourceFiles/info/feed/*.cpp
SourceFiles/info/channels/*.cpp
SourceFiles/history/feed/*.cpp
SourceFiles/ui/platform/mac/*.cpp
SourceFiles/ui/platform/win/*.cpp
)
list(REMOVE_ITEM SUBDIRS_SOURCE_FILES ${SUBDIRS_EXTRA_FILES})
add_executable(Telegram WIN32 ${QRC_FILES} ${FLAT_SOURCE_FILES} ${SUBDIRS_SOURCE_FILES})
set(TELEGRAM_COMPILE_DEFINITIONS
TDESKTOP_DISABLE_AUTOUPDATE
TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION
NOMINMAX
__STDC_FORMAT_MACROS
)
set(TELEGRAM_INCLUDE_DIRS
${GENERATED_DIR}
${LIBDRM_INCLUDE_DIRS}
${LIBLZMA_INCLUDE_DIRS}
${MINIZIP_INCLUDE_DIRS}
${OPENAL_INCLUDE_DIR}
${QT_PRIVATE_INCLUDE_DIRS}
${THIRD_PARTY_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIR}
)
set(TELEGRAM_LINK_LIBRARIES
xxhash
crl
tgvoip
OpenSSL::Crypto
OpenSSL::SSL
Qt5::DBus
Qt5::Network
Qt5::Widgets
Threads::Threads
${FFMPEG_LIBRARIES}
${LIBDRM_LIBRARIES}
${LIBLZMA_LIBRARIES}
${LIBVA_LIBRARIES}
${MINIZIP_LIBRARIES}
${OPENAL_LIBRARY}
${X11_X11_LIB}
${ZLIB_LIBRARY_RELEASE}
${LIBLZ4_LIBRARIES}
${RLOTTIE_LIBRARIES}
)
if(ENABLE_CRASH_REPORTS)
find_package(Breakpad REQUIRED)
list(APPEND TELEGRAM_LINK_LIBRARIES
breakpad_client
)
else()
list(APPEND TELEGRAM_COMPILE_DEFINITIONS
TDESKTOP_DISABLE_CRASH_REPORTS
)
endif()
if(USE_LIBATOMIC)
list(APPEND TELEGRAM_LINK_LIBRARIES libatomic.a)
endif(USE_LIBATOMIC)
if(ENABLE_GTK_INTEGRATION)
pkg_check_modules(APPINDICATOR REQUIRED appindicator3-0.1)
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
list(APPEND TELEGRAM_INCLUDE_DIRS
${APPINDICATOR_INCLUDE_DIRS}
${GTK3_INCLUDE_DIRS}
)
list(APPEND TELEGRAM_LINK_LIBRARIES
${APPINDICATOR_LIBRARIES}
${GTK3_LIBRARIES}
)
else()
list(APPEND TELEGRAM_COMPILE_DEFINITIONS
TDESKTOP_DISABLE_GTK_INTEGRATION
)
endif()
if(ENABLE_OPENAL_EFFECTS)
list(APPEND TELEGRAM_COMPILE_DEFINITIONS
AL_ALEXT_PROTOTYPES
)
else()
list(APPEND TELEGRAM_COMPILE_DEFINITIONS
TDESKTOP_DISABLE_OPENAL_EFFECTS
)
endif()
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
list(APPEND TELEGRAM_COMPILE_DEFINITIONS
Q_OS_LINUX64
)
else()
list(APPEND TELEGRAM_COMPILE_DEFINITIONS
Q_OS_LINUX32
)
endif()
target_sources(Telegram PRIVATE ${TELEGRAM_GENERATED_SOURCES})
add_dependencies(Telegram telegram_codegen)
include(PrecompiledHeader)
add_precompiled_header(Telegram SourceFiles/stdafx.h)
target_compile_definitions(Telegram PUBLIC ${TELEGRAM_COMPILE_DEFINITIONS})
target_include_directories(Telegram PUBLIC ${TELEGRAM_INCLUDE_DIRS})
target_link_libraries(Telegram ${TELEGRAM_LINK_LIBRARIES})
set_target_properties(Telegram PROPERTIES AUTOMOC_MOC_OPTIONS -bTelegram_pch/stdafx.h)
if(BUILD_TESTS)
include(TelegramTests)
endif()
install(TARGETS Telegram RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_SOURCE_DIR}/../lib/xdg/telegramdesktop.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)

View File

@ -1,99 +0,0 @@
set(TELEGRAM_GENERATED_SOURCES)
set(IMPORT_EXECUTABLES "native/ImportExecutables.cmake" CACHE FILEPATH "POINT")
INCLUDE(${IMPORT_EXECUTABLES})
add_custom_command(
OUTPUT
${GENERATED_DIR}/scheme.h
${GENERATED_DIR}/scheme.cpp
COMMAND python ${TELEGRAM_SOURCES_DIR}/codegen/scheme/codegen_scheme.py
-o${GENERATED_DIR} ${TELEGRAM_RESOURCES_DIR}/tl/mtproto.tl
${TELEGRAM_RESOURCES_DIR}/tl/api.tl
DEPENDS ${TELEGRAM_RESOURCES_DIR}/tl/mtproto.tl
${TELEGRAM_RESOURCES_DIR}/tl/api.tl
COMMENT "Codegen scheme.tl"
)
list(APPEND TELEGRAM_GENERATED_SOURCES
${GENERATED_DIR}/scheme.h
${GENERATED_DIR}/scheme.cpp
)
file(GLOB_RECURSE STYLES
${TELEGRAM_RESOURCES_DIR}/*.palette
${TELEGRAM_RESOURCES_DIR}/*.style
${TELEGRAM_SOURCES_DIR}/*.style
)
set(GENERATED_STYLES)
foreach(STYLE ${STYLES})
get_filename_component(STYLE_FILENAME ${STYLE} NAME)
get_filename_component(STYLE_NAME ${STYLE} NAME_WE)
if (${STYLE} MATCHES \\.palette$)
set(THIS_GENERATED_STYLES
${GENERATED_DIR}/styles/palette.h
${GENERATED_DIR}/styles/palette.cpp
)
else()
set(THIS_GENERATED_STYLES
${GENERATED_DIR}/styles/style_${STYLE_NAME}.h
${GENERATED_DIR}/styles/style_${STYLE_NAME}.cpp
)
endif()
# style generator does not like '-' in file path, so let's use relative paths...
add_custom_command(
OUTPUT ${THIS_GENERATED_STYLES}
COMMAND codegen_style -IResources -ISourceFiles -o${GENERATED_DIR}/styles ${STYLE}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS codegen_style ${STYLE}
COMMENT "Codegen style ${STYLE_FILENAME}"
)
set(GENERATED_STYLES ${GENERATED_STYLES} ${THIS_GENERATED_STYLES})
endforeach()
list(APPEND TELEGRAM_GENERATED_SOURCES ${GENERATED_STYLES})
add_custom_command(
OUTPUT
${GENERATED_DIR}/emoji.h
${GENERATED_DIR}/emoji.cpp
${GENERATED_DIR}/emoji_suggestions_data.h
${GENERATED_DIR}/emoji_suggestions_data.cpp
COMMAND codegen_emoji -o${GENERATED_DIR} ${TELEGRAM_RESOURCES_DIR}/emoji_autocomplete.json
DEPENDS codegen_emoji
COMMENT "Codegen emoji"
)
list(APPEND TELEGRAM_GENERATED_SOURCES
${GENERATED_DIR}/emoji.h
${GENERATED_DIR}/emoji.cpp
${GENERATED_DIR}/emoji_suggestions_data.h
${GENERATED_DIR}/emoji_suggestions_data.cpp
)
add_custom_command(
OUTPUT
${GENERATED_DIR}/lang_auto.h
${GENERATED_DIR}/lang_auto.cpp
COMMAND codegen_lang -o${GENERATED_DIR} ${TELEGRAM_RESOURCES_DIR}/langs/lang.strings
DEPENDS codegen_lang
COMMENT "Codegen lang"
)
list(APPEND TELEGRAM_GENERATED_SOURCES
${GENERATED_DIR}/lang_auto.h
${GENERATED_DIR}/lang_auto.cpp
)
add_custom_command(
OUTPUT
${GENERATED_DIR}/numbers.h
${GENERATED_DIR}/numbers.cpp
COMMAND codegen_numbers -o${GENERATED_DIR} ${TELEGRAM_RESOURCES_DIR}/numbers.txt
DEPENDS codegen_numbers
COMMENT "Codegen numbers"
)
list(APPEND TELEGRAM_GENERATED_SOURCES
${GENERATED_DIR}/numbers.h
${GENERATED_DIR}/numbers.cpp
)
add_custom_target(telegram_codegen DEPENDS ${TELEGRAM_GENERATED_SOURCES})

View File

@ -1,34 +0,0 @@
cmake_minimum_required(VERSION 3.8)
project(TelegramCodegen)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package(Qt5 REQUIRED Core Gui)
set(TELEGRAM_SOURCES_DIR ${CMAKE_SOURCE_DIR}/../SourceFiles)
include_directories(${TELEGRAM_SOURCES_DIR})
file(GLOB CODEGEN_COMMON_SOURCES
${TELEGRAM_SOURCES_DIR}/codegen/common/*.h
${TELEGRAM_SOURCES_DIR}/codegen/common/*.cpp
${TELEGRAM_SOURCES_DIR}/base/crc32hash.cpp
${TELEGRAM_SOURCES_DIR}/base/crc32hash.h
)
add_library(codegen_common OBJECT ${CODEGEN_COMMON_SOURCES})
target_include_directories(codegen_common PUBLIC $<TARGET_PROPERTY:Qt5::Core,INTERFACE_INCLUDE_DIRECTORIES>)
target_compile_options(codegen_common PUBLIC $<TARGET_PROPERTY:Qt5::Core,INTERFACE_COMPILE_OPTIONS>)
foreach(TOOL emoji lang numbers style)
file(GLOB CODEGEN_${TOOL}_SOURCES
${TELEGRAM_SOURCES_DIR}/codegen/${TOOL}/*.h
${TELEGRAM_SOURCES_DIR}/codegen/${TOOL}/*.cpp
)
add_executable(codegen_${TOOL} ${CODEGEN_${TOOL}_SOURCES} $<TARGET_OBJECTS:codegen_common>)
target_link_libraries(codegen_${TOOL} Qt5::Core Qt5::Gui)
endforeach()
EXPORT(TARGETS codegen_emoji codegen_lang codegen_numbers codegen_style FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake )

View File

@ -1,61 +0,0 @@
#find_package(catch REQUIRED)
set(catch_INCLUDE /usr/include/catch)
file(GLOB LIST_TESTS_PY gyp/tests/list_tests.py)
file(GLOB TESTS_LIST_TXT gyp/tests/tests_list.txt)
add_executable(tests_algorithm
SourceFiles/base/algorithm_tests.cpp
SourceFiles/base/tests_main.cpp
)
add_executable(tests_flags
SourceFiles/base/flags_tests.cpp
SourceFiles/base/tests_main.cpp
)
add_executable(tests_flat_map
SourceFiles/base/flat_map_tests.cpp
SourceFiles/base/tests_main.cpp
)
add_executable(tests_flat_set
SourceFiles/base/flat_set_tests.cpp
SourceFiles/base/tests_main.cpp
)
add_executable(tests_rpl
SourceFiles/rpl/operators_tests.cpp
SourceFiles/rpl/producer_tests.cpp
SourceFiles/rpl/variable_tests.cpp
SourceFiles/base/tests_main.cpp
)
target_link_libraries(tests_algorithm Qt5::Core)
target_link_libraries(tests_flags Qt5::Core)
target_link_libraries(tests_flat_map Qt5::Core)
target_link_libraries(tests_flat_set Qt5::Core)
target_link_libraries(tests_rpl Qt5::Core)
target_include_directories(tests_algorithm PUBLIC
${catch_INCLUDE}
)
target_include_directories(tests_flags PUBLIC
${catch_INCLUDE}
)
target_include_directories(tests_flat_map PUBLIC
${catch_INCLUDE}
${THIRD_PARTY_DIR}/GSL/include
${THIRD_PARTY_DIR}/variant/include
)
target_include_directories(tests_flat_set PUBLIC
${catch_INCLUDE}
)
target_include_directories(tests_rpl PUBLIC
${catch_INCLUDE}
${THIRD_PARTY_DIR}/GSL/include
${THIRD_PARTY_DIR}/variant/include
)
enable_testing()
add_test(tests python ${LIST_TESTS_PY} --input ${TESTS_LIST_TXT})

View File

@ -1,17 +0,0 @@
project(crl)
find_package(Qt5 REQUIRED COMPONENTS Core)
file(GLOB CRL_SOURCE_FILES
src/crl/common/*.cpp
src/crl/dispatch/*.cpp
src/crl/qt/*.cpp
src/crl/winapi/*.cpp
src/crl/linux/*.cpp
src/crl/crl_time.cpp
)
add_library(${PROJECT_NAME} STATIC ${CRL_SOURCE_FILES})
target_include_directories(${PROJECT_NAME} PUBLIC src)
target_link_libraries(${PROJECT_NAME} Qt5::Core)

View File

@ -1,370 +0,0 @@
project(webrtc)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
list(APPEND WEBRTC_C_SOURCE_FILES
"modules/third_party/fft/fft.c"
"modules/audio_coding/codecs/isac/main/source/pitch_estimator.c"
"modules/audio_coding/codecs/isac/main/source/lpc_shape_swb16_tables.c"
"modules/audio_coding/codecs/isac/main/source/pitch_gain_tables.c"
"modules/audio_coding/codecs/isac/main/source/arith_routines_logist.c"
"modules/audio_coding/codecs/isac/main/source/filterbanks.c"
"modules/audio_coding/codecs/isac/main/source/transform.c"
"modules/audio_coding/codecs/isac/main/source/pitch_filter.c"
"modules/audio_coding/codecs/isac/main/source/encode_lpc_swb.c"
"modules/audio_coding/codecs/isac/main/source/filter_functions.c"
"modules/audio_coding/codecs/isac/main/source/decode.c"
"modules/audio_coding/codecs/isac/main/source/lattice.c"
"modules/audio_coding/codecs/isac/main/source/intialize.c"
"modules/audio_coding/codecs/isac/main/source/lpc_tables.c"
"modules/audio_coding/codecs/isac/main/source/lpc_gain_swb_tables.c"
"modules/audio_coding/codecs/isac/main/source/bandwidth_estimator.c"
"modules/audio_coding/codecs/isac/main/source/encode.c"
"modules/audio_coding/codecs/isac/main/source/lpc_analysis.c"
"modules/audio_coding/codecs/isac/main/source/arith_routines_hist.c"
"modules/audio_coding/codecs/isac/main/source/entropy_coding.c"
"modules/audio_coding/codecs/isac/main/source/isac_vad.c"
"modules/audio_coding/codecs/isac/main/source/arith_routines.c"
"modules/audio_coding/codecs/isac/main/source/crc.c"
"modules/audio_coding/codecs/isac/main/source/lpc_shape_swb12_tables.c"
"modules/audio_coding/codecs/isac/main/source/decode_bwe.c"
"modules/audio_coding/codecs/isac/main/source/spectrum_ar_model_tables.c"
"modules/audio_coding/codecs/isac/main/source/pitch_lag_tables.c"
"modules/audio_coding/codecs/isac/main/source/isac.c"
"modules/audio_processing/ns/nsx_core.c"
"modules/audio_processing/ns/noise_suppression_x.c"
"modules/audio_processing/ns/nsx_core_c.c"
"modules/audio_processing/ns/ns_core.c"
"modules/audio_processing/ns/noise_suppression.c"
"modules/audio_processing/agc/legacy/analog_agc.c"
"modules/audio_processing/agc/legacy/digital_agc.c"
"common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c"
"common_audio/third_party/fft4g/fft4g.c"
"common_audio/ring_buffer.c"
"common_audio/signal_processing/complex_fft.c"
"common_audio/signal_processing/filter_ma_fast_q12.c"
"common_audio/signal_processing/levinson_durbin.c"
"common_audio/signal_processing/auto_corr_to_refl_coef.c"
"common_audio/signal_processing/resample_by_2_internal.c"
"common_audio/signal_processing/energy.c"
"common_audio/signal_processing/sqrt_of_one_minus_x_squared.c"
"common_audio/signal_processing/downsample_fast.c"
"common_audio/signal_processing/splitting_filter1.c"
"common_audio/signal_processing/filter_ar_fast_q12.c"
"common_audio/signal_processing/spl_init.c"
"common_audio/signal_processing/lpc_to_refl_coef.c"
"common_audio/signal_processing/cross_correlation.c"
"common_audio/signal_processing/division_operations.c"
"common_audio/signal_processing/auto_correlation.c"
"common_audio/signal_processing/get_scaling_square.c"
"common_audio/signal_processing/resample.c"
"common_audio/signal_processing/min_max_operations.c"
"common_audio/signal_processing/refl_coef_to_lpc.c"
"common_audio/signal_processing/filter_ar.c"
"common_audio/signal_processing/vector_scaling_operations.c"
"common_audio/signal_processing/resample_fractional.c"
"common_audio/signal_processing/real_fft.c"
"common_audio/signal_processing/ilbc_specific_functions.c"
"common_audio/signal_processing/complex_bit_reverse.c"
"common_audio/signal_processing/randomization_functions.c"
"common_audio/signal_processing/copy_set_operations.c"
"common_audio/signal_processing/resample_by_2.c"
"common_audio/signal_processing/get_hanning_window.c"
"common_audio/signal_processing/resample_48khz.c"
"common_audio/signal_processing/spl_inl.c"
"common_audio/signal_processing/spl_sqrt.c"
"common_audio/vad/vad_sp.c"
"common_audio/vad/webrtc_vad.c"
"common_audio/vad/vad_filterbank.c"
"common_audio/vad/vad_core.c"
"common_audio/vad/vad_gmm.c"
)
list(APPEND WEBRTC_CXX_SOURCE_FILES
"system_wrappers/source/field_trial.cc"
"system_wrappers/source/metrics.cc"
"system_wrappers/source/cpu_features.cc"
"absl/strings/internal/memutil.cc"
"absl/strings/string_view.cc"
"absl/strings/ascii.cc"
"absl/types/bad_optional_access.cc"
"absl/types/optional.cc"
"absl/base/internal/raw_logging.cc"
"absl/base/internal/throw_delegate.cc"
"rtc_base/race_checker.cc"
"rtc_base/strings/string_builder.cc"
"rtc_base/memory/aligned_malloc.cc"
"rtc_base/timeutils.cc"
"rtc_base/platform_file.cc"
"rtc_base/string_to_number.cc"
"rtc_base/thread_checker_impl.cc"
"rtc_base/stringencode.cc"
"rtc_base/stringutils.cc"
"rtc_base/checks.cc"
"rtc_base/platform_thread.cc"
"rtc_base/criticalsection.cc"
"rtc_base/platform_thread_types.cc"
"rtc_base/event.cc"
"rtc_base/event_tracer.cc"
"rtc_base/logging_webrtc.cc"
"third_party/rnnoise/src/rnn_vad_weights.cc"
"third_party/rnnoise/src/kiss_fft.cc"
"api/audio/audio_frame.cc"
"api/audio/echo_canceller3_config.cc"
"api/audio/echo_canceller3_factory.cc"
"modules/third_party/fft/fft.c"
"modules/audio_coding/codecs/isac/main/source/pitch_estimator.c"
"modules/audio_coding/codecs/isac/main/source/lpc_shape_swb16_tables.c"
"modules/audio_coding/codecs/isac/main/source/pitch_gain_tables.c"
"modules/audio_coding/codecs/isac/main/source/arith_routines_logist.c"
"modules/audio_coding/codecs/isac/main/source/filterbanks.c"
"modules/audio_coding/codecs/isac/main/source/transform.c"
"modules/audio_coding/codecs/isac/main/source/pitch_filter.c"
"modules/audio_coding/codecs/isac/main/source/encode_lpc_swb.c"
"modules/audio_coding/codecs/isac/main/source/filter_functions.c"
"modules/audio_coding/codecs/isac/main/source/decode.c"
"modules/audio_coding/codecs/isac/main/source/lattice.c"
"modules/audio_coding/codecs/isac/main/source/intialize.c"
"modules/audio_coding/codecs/isac/main/source/lpc_tables.c"
"modules/audio_coding/codecs/isac/main/source/lpc_gain_swb_tables.c"
"modules/audio_coding/codecs/isac/main/source/bandwidth_estimator.c"
"modules/audio_coding/codecs/isac/main/source/encode.c"
"modules/audio_coding/codecs/isac/main/source/lpc_analysis.c"
"modules/audio_coding/codecs/isac/main/source/arith_routines_hist.c"
"modules/audio_coding/codecs/isac/main/source/entropy_coding.c"
"modules/audio_coding/codecs/isac/main/source/isac_vad.c"
"modules/audio_coding/codecs/isac/main/source/arith_routines.c"
"modules/audio_coding/codecs/isac/main/source/crc.c"
"modules/audio_coding/codecs/isac/main/source/lpc_shape_swb12_tables.c"
"modules/audio_coding/codecs/isac/main/source/decode_bwe.c"
"modules/audio_coding/codecs/isac/main/source/spectrum_ar_model_tables.c"
"modules/audio_coding/codecs/isac/main/source/pitch_lag_tables.c"
"modules/audio_coding/codecs/isac/main/source/isac.c"
"modules/audio_processing/rms_level.cc"
"modules/audio_processing/echo_detector/normalized_covariance_estimator.cc"
"modules/audio_processing/echo_detector/moving_max.cc"
"modules/audio_processing/echo_detector/circular_buffer.cc"
"modules/audio_processing/echo_detector/mean_variance_estimator.cc"
"modules/audio_processing/splitting_filter.cc"
"modules/audio_processing/gain_control_impl.cc"
"modules/audio_processing/ns/nsx_core.c"
"modules/audio_processing/ns/noise_suppression_x.c"
"modules/audio_processing/ns/nsx_core_c.c"
"modules/audio_processing/ns/ns_core.c"
"modules/audio_processing/ns/noise_suppression.c"
"modules/audio_processing/audio_buffer.cc"
"modules/audio_processing/typing_detection.cc"
"modules/audio_processing/include/audio_processing_statistics.cc"
"modules/audio_processing/include/audio_generator_factory.cc"
"modules/audio_processing/include/aec_dump.cc"
"modules/audio_processing/include/audio_processing.cc"
"modules/audio_processing/include/config.cc"
"modules/audio_processing/agc2/interpolated_gain_curve.cc"
"modules/audio_processing/agc2/agc2_common.cc"
"modules/audio_processing/agc2/gain_applier.cc"
"modules/audio_processing/agc2/adaptive_agc.cc"
"modules/audio_processing/agc2/adaptive_digital_gain_applier.cc"
"modules/audio_processing/agc2/limiter.cc"
"modules/audio_processing/agc2/saturation_protector.cc"
"modules/audio_processing/agc2/rnn_vad/spectral_features_internal.cc"
"modules/audio_processing/agc2/rnn_vad/rnn.cc"
"modules/audio_processing/agc2/rnn_vad/pitch_search_internal.cc"
"modules/audio_processing/agc2/rnn_vad/spectral_features.cc"
"modules/audio_processing/agc2/rnn_vad/pitch_search.cc"
"modules/audio_processing/agc2/rnn_vad/features_extraction.cc"
"modules/audio_processing/agc2/rnn_vad/fft_util.cc"
"modules/audio_processing/agc2/rnn_vad/lp_residual.cc"
"modules/audio_processing/agc2/adaptive_mode_level_estimator_agc.cc"
"modules/audio_processing/agc2/vector_float_frame.cc"
"modules/audio_processing/agc2/noise_level_estimator.cc"
"modules/audio_processing/agc2/agc2_testing_common.cc"
"modules/audio_processing/agc2/fixed_digital_level_estimator.cc"
"modules/audio_processing/agc2/fixed_gain_controller.cc"
"modules/audio_processing/agc2/vad_with_level.cc"
"modules/audio_processing/agc2/limiter_db_gain_curve.cc"
"modules/audio_processing/agc2/down_sampler.cc"
"modules/audio_processing/agc2/signal_classifier.cc"
"modules/audio_processing/agc2/noise_spectrum_estimator.cc"
"modules/audio_processing/agc2/compute_interpolated_gain_curve.cc"
"modules/audio_processing/agc2/biquad_filter.cc"
"modules/audio_processing/agc2/adaptive_mode_level_estimator.cc"
"modules/audio_processing/transient/moving_moments.cc"
"modules/audio_processing/transient/wpd_tree.cc"
"modules/audio_processing/transient/wpd_node.cc"
"modules/audio_processing/transient/transient_suppressor.cc"
"modules/audio_processing/transient/transient_detector.cc"
"modules/audio_processing/low_cut_filter.cc"
"modules/audio_processing/level_estimator_impl.cc"
"modules/audio_processing/three_band_filter_bank.cc"
"modules/audio_processing/aec/echo_cancellation.cc"
"modules/audio_processing/aec/aec_resampler.cc"
"modules/audio_processing/aec/aec_core.cc"
"modules/audio_processing/aec/aec_core_sse2.cc"
"modules/audio_processing/voice_detection_impl.cc"
"modules/audio_processing/echo_cancellation_impl.cc"
"modules/audio_processing/gain_control_for_experimental_agc.cc"
"modules/audio_processing/agc/agc.cc"
"modules/audio_processing/agc/loudness_histogram.cc"
"modules/audio_processing/agc/agc_manager_direct.cc"
"modules/audio_processing/agc/legacy/analog_agc.c"
"modules/audio_processing/agc/legacy/digital_agc.c"
"modules/audio_processing/agc/utility.cc"
"modules/audio_processing/audio_processing_impl.cc"
"modules/audio_processing/audio_generator/file_audio_generator.cc"
"modules/audio_processing/gain_controller2.cc"
"modules/audio_processing/residual_echo_detector.cc"
"modules/audio_processing/noise_suppression_impl.cc"
"modules/audio_processing/aecm/aecm_core.cc"
"modules/audio_processing/aecm/aecm_core_c.cc"
"modules/audio_processing/aecm/echo_control_mobile.cc"
"modules/audio_processing/aec3/render_reverb_model.cc"
"modules/audio_processing/aec3/reverb_model_fallback.cc"
"modules/audio_processing/aec3/echo_remover_metrics.cc"
"modules/audio_processing/aec3/matched_filter_lag_aggregator.cc"
"modules/audio_processing/aec3/render_delay_buffer2.cc"
"modules/audio_processing/aec3/echo_path_variability.cc"
"modules/audio_processing/aec3/frame_blocker.cc"
"modules/audio_processing/aec3/subtractor.cc"
"modules/audio_processing/aec3/aec3_fft.cc"
"modules/audio_processing/aec3/fullband_erle_estimator.cc"
"modules/audio_processing/aec3/suppression_filter.cc"
"modules/audio_processing/aec3/block_processor.cc"
"modules/audio_processing/aec3/subband_erle_estimator.cc"
"modules/audio_processing/aec3/render_delay_controller_metrics.cc"
"modules/audio_processing/aec3/render_delay_buffer.cc"
"modules/audio_processing/aec3/vector_buffer.cc"
"modules/audio_processing/aec3/erl_estimator.cc"
"modules/audio_processing/aec3/aec_state.cc"
"modules/audio_processing/aec3/adaptive_fir_filter.cc"
"modules/audio_processing/aec3/render_delay_controller.cc"
"modules/audio_processing/aec3/skew_estimator.cc"
"modules/audio_processing/aec3/echo_path_delay_estimator.cc"
"modules/audio_processing/aec3/block_framer.cc"
"modules/audio_processing/aec3/erle_estimator.cc"
"modules/audio_processing/aec3/reverb_model.cc"
"modules/audio_processing/aec3/cascaded_biquad_filter.cc"
"modules/audio_processing/aec3/render_buffer.cc"
"modules/audio_processing/aec3/subtractor_output.cc"
"modules/audio_processing/aec3/stationarity_estimator.cc"
"modules/audio_processing/aec3/render_signal_analyzer.cc"
"modules/audio_processing/aec3/subtractor_output_analyzer.cc"
"modules/audio_processing/aec3/suppression_gain.cc"
"modules/audio_processing/aec3/echo_audibility.cc"
"modules/audio_processing/aec3/block_processor_metrics.cc"
"modules/audio_processing/aec3/moving_average.cc"
"modules/audio_processing/aec3/reverb_model_estimator.cc"
"modules/audio_processing/aec3/aec3_common.cc"
"modules/audio_processing/aec3/residual_echo_estimator.cc"
"modules/audio_processing/aec3/matched_filter.cc"
"modules/audio_processing/aec3/reverb_decay_estimator.cc"
"modules/audio_processing/aec3/render_delay_controller2.cc"
"modules/audio_processing/aec3/suppression_gain_limiter.cc"
"modules/audio_processing/aec3/main_filter_update_gain.cc"
"modules/audio_processing/aec3/echo_remover.cc"
"modules/audio_processing/aec3/downsampled_render_buffer.cc"
"modules/audio_processing/aec3/matrix_buffer.cc"
"modules/audio_processing/aec3/block_processor2.cc"
"modules/audio_processing/aec3/echo_canceller3.cc"
"modules/audio_processing/aec3/block_delay_buffer.cc"
"modules/audio_processing/aec3/fft_buffer.cc"
"modules/audio_processing/aec3/comfort_noise_generator.cc"
"modules/audio_processing/aec3/shadow_filter_update_gain.cc"
"modules/audio_processing/aec3/filter_analyzer.cc"
"modules/audio_processing/aec3/reverb_frequency_response.cc"
"modules/audio_processing/aec3/decimator.cc"
"modules/audio_processing/echo_control_mobile_impl.cc"
"modules/audio_processing/logging/apm_data_dumper.cc"
"modules/audio_processing/vad/voice_activity_detector.cc"
"modules/audio_processing/vad/standalone_vad.cc"
"modules/audio_processing/vad/pitch_internal.cc"
"modules/audio_processing/vad/vad_circular_buffer.cc"
"modules/audio_processing/vad/vad_audio_proc.cc"
"modules/audio_processing/vad/pole_zero_filter.cc"
"modules/audio_processing/vad/pitch_based_vad.cc"
"modules/audio_processing/vad/gmm.cc"
"modules/audio_processing/utility/ooura_fft.cc"
"modules/audio_processing/utility/delay_estimator_wrapper.cc"
"modules/audio_processing/utility/ooura_fft_sse2.cc"
"modules/audio_processing/utility/delay_estimator.cc"
"modules/audio_processing/utility/block_mean_calculator.cc"
"common_audio/window_generator.cc"
"common_audio/channel_buffer.cc"
"common_audio/fir_filter_factory.cc"
"common_audio/wav_header.cc"
"common_audio/real_fourier_ooura.cc"
"common_audio/audio_util.cc"
"common_audio/fir_filter_sse.cc"
"common_audio/resampler/push_sinc_resampler.cc"
"common_audio/resampler/resampler.cc"
"common_audio/resampler/sinc_resampler_sse.cc"
"common_audio/resampler/push_resampler.cc"
"common_audio/resampler/sinc_resampler.cc"
"common_audio/resampler/sinusoidal_linear_chirp_source.cc"
"common_audio/wav_file.cc"
"common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c"
"common_audio/third_party/fft4g/fft4g.c"
"common_audio/audio_converter.cc"
"common_audio/real_fourier.cc"
"common_audio/sparse_fir_filter.cc"
"common_audio/smoothing_filter.cc"
"common_audio/fir_filter_c.cc"
"common_audio/ring_buffer.c"
"common_audio/signal_processing/complex_fft.c"
"common_audio/signal_processing/filter_ma_fast_q12.c"
"common_audio/signal_processing/levinson_durbin.c"
"common_audio/signal_processing/dot_product_with_scale.cc"
"common_audio/signal_processing/auto_corr_to_refl_coef.c"
"common_audio/signal_processing/resample_by_2_internal.c"
"common_audio/signal_processing/energy.c"
"common_audio/signal_processing/sqrt_of_one_minus_x_squared.c"
"common_audio/signal_processing/downsample_fast.c"
"common_audio/signal_processing/splitting_filter1.c"
"common_audio/signal_processing/filter_ar_fast_q12.c"
"common_audio/signal_processing/spl_init.c"
"common_audio/signal_processing/lpc_to_refl_coef.c"
"common_audio/signal_processing/cross_correlation.c"
"common_audio/signal_processing/division_operations.c"
"common_audio/signal_processing/auto_correlation.c"
"common_audio/signal_processing/get_scaling_square.c"
"common_audio/signal_processing/resample.c"
"common_audio/signal_processing/min_max_operations.c"
"common_audio/signal_processing/refl_coef_to_lpc.c"
"common_audio/signal_processing/filter_ar.c"
"common_audio/signal_processing/vector_scaling_operations.c"
"common_audio/signal_processing/resample_fractional.c"
"common_audio/signal_processing/real_fft.c"
"common_audio/signal_processing/ilbc_specific_functions.c"
"common_audio/signal_processing/complex_bit_reverse.c"
"common_audio/signal_processing/randomization_functions.c"
"common_audio/signal_processing/copy_set_operations.c"
"common_audio/signal_processing/resample_by_2.c"
"common_audio/signal_processing/get_hanning_window.c"
"common_audio/signal_processing/resample_48khz.c"
"common_audio/signal_processing/spl_inl.c"
"common_audio/signal_processing/spl_sqrt.c"
"common_audio/vad/vad_sp.c"
"common_audio/vad/vad.cc"
"common_audio/vad/webrtc_vad.c"
"common_audio/vad/vad_filterbank.c"
"common_audio/vad/vad_core.c"
"common_audio/vad/vad_gmm.c"
)
add_library(${PROJECT_NAME} OBJECT ${WEBRTC_C_SOURCE_FILES} ${WEBRTC_CXX_SOURCE_FILES})
target_compile_definitions(${PROJECT_NAME} PUBLIC
WEBRTC_APM_DEBUG_DUMP=0
WEBRTC_POSIX
WEBRTC_LINUX
WEBRTC_NS_FLOAT
)
# TODO: drop include dirs with latest webrtc
target_include_directories(${PROJECT_NAME} PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/.."
)
if( "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
endif( "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686" )

View File

@ -1,37 +0,0 @@
project(tgvoip)
option(ENABLE_PULSEAUDIO "Enable pulseaudio" ON)
add_subdirectory("${PROJECT_SOURCE_DIR}/webrtc_dsp")
find_package(PkgConfig REQUIRED)
pkg_check_modules(OPUS REQUIRED opus)
file(GLOB TGVOIP_SOURCE_FILES
*.cpp
audio/*.cpp
os/linux/*.cpp
os/posix/*.cpp
video/*.cpp
)
set(TGVOIP_COMPILE_DEFINITIONS TGVOIP_USE_DESKTOP_DSP WEBRTC_NS_FLOAT WEBRTC_POSIX WEBRTC_LINUX)
if(ENABLE_PULSEAUDIO)
pkg_check_modules(LIBPULSE REQUIRED libpulse)
else()
file(GLOB PULSEAUDIO_SOURCE_FILES
os/linux/AudioInputPulse.cpp
os/linux/AudioOutputPulse.cpp
)
list(REMOVE_ITEM TGVOIP_SOURCE_FILES ${PULSEAUDIO_SOURCE_FILES})
list(APPEND TGVOIP_COMPILE_DEFINITIONS WITHOUT_PULSE)
endif()
add_library(${PROJECT_NAME} STATIC ${TGVOIP_SOURCE_FILES} $<TARGET_OBJECTS:webrtc>)
target_compile_definitions(${PROJECT_NAME} PUBLIC ${TGVOIP_COMPILE_DEFINITIONS})
target_include_directories(${PROJECT_NAME} PUBLIC
"${OPUS_INCLUDE_DIRS}"
"${CMAKE_CURRENT_LIST_DIR}/webrtc_dsp"
)
target_link_libraries(${PROJECT_NAME} dl ${OPUS_LIBRARIES})

View File

@ -0,0 +1,342 @@
From c924d0a2b962536eb245d5c67af6f8c3a1eb54b3 Mon Sep 17 00:00:00 2001
From: John Zimmermann <johnz@posteo.net>
Date: Sun, 29 Dec 2019 20:05:02 +0100
Subject: [PATCH] Dyn linking
---
external/crash_reports/CMakeLists.txt | 2 ++
external/ffmpeg/CMakeLists.txt | 13 +++++++++++
external/openal/CMakeLists.txt | 16 ++++++++++++++
external/openssl/CMakeLists.txt | 16 +++++++++++++-
external/opus/CMakeLists.txt | 13 +++++++++++
external/qt/CMakeLists.txt | 31 +++++++++++++++++++++++++++
external/qt/package.cmake | 4 ++++
external/ranges/CMakeLists.txt | 4 ++--
external/zlib/CMakeLists.txt | 13 +++++++++++
init_target.cmake | 2 +-
options_linux.cmake | 6 +++---
variables.cmake | 4 ++--
12 files changed, 115 insertions(+), 9 deletions(-)
diff --git cmake/external/crash_reports/CMakeLists.txt cmake/external/crash_reports/CMakeLists.txt
index a741bcb..11e94e8 100644
--- cmake/external/crash_reports/CMakeLists.txt
+++ cmake/external/crash_reports/CMakeLists.txt
@@ -7,6 +7,7 @@
add_library(external_crash_reports INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_crash_reports ALIAS external_crash_reports)
+if(NOT DESKTOP_APP_DISABLE_CRASH_REPORTS)
if (WIN32 OR LINUX OR build_macstore)
add_subdirectory(breakpad)
target_link_libraries(external_crash_reports
@@ -20,3 +21,4 @@ else()
desktop-app::external_crashpad
)
endif()
+endif()
diff --git cmake/external/ffmpeg/CMakeLists.txt cmake/external/ffmpeg/CMakeLists.txt
index 014fb06..888066a 100644
--- cmake/external/ffmpeg/CMakeLists.txt
+++ cmake/external/ffmpeg/CMakeLists.txt
@@ -7,6 +7,18 @@
add_library(external_ffmpeg INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_ffmpeg ALIAS external_ffmpeg)
+if(DESKTOP_APP_USE_SYSTEM_LIBS)
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(FFMPEG REQUIRED libavcodec libavformat libavutil libswresample libswscale)
+ target_link_libraries(external_ffmpeg
+ INTERFACE
+ ${FFMPEG_LIBRARIES}
+ )
+ target_include_directories(external_ffmpeg SYSTEM
+ INTERFACE
+ ${FFMPEG_INCLUDE_DIRS}
+ )
+else()
target_include_directories(external_ffmpeg SYSTEM
INTERFACE
${libs_loc}/ffmpeg
@@ -36,3 +48,4 @@ if (LINUX)
Xrender
)
endif()
+endif()
diff --git cmake/external/openal/CMakeLists.txt cmake/external/openal/CMakeLists.txt
index e2e4992..ea32ed1 100644
--- cmake/external/openal/CMakeLists.txt
+++ cmake/external/openal/CMakeLists.txt
@@ -7,6 +7,21 @@
add_library(external_openal INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_openal ALIAS external_openal)
+if(DESKTOP_APP_USE_SYSTEM_LIBS)
+ find_package(OpenAL REQUIRED)
+ target_include_directories(external_openal SYSTEM
+ INTERFACE
+ ${OPENAL_INCLUDE_DIR}
+ )
+ target_link_libraries(external_openal
+ INTERFACE
+ ${OPENAL_LIBRARY}
+ )
+ target_compile_definitions(external_openal
+ INTERFACE
+ AL_ALEXT_PROTOTYPES
+ )
+else()
if (WIN32)
target_include_directories(external_openal SYSTEM
INTERFACE
@@ -41,3 +56,4 @@ INTERFACE
AL_LIBTYPE_STATIC
AL_ALEXT_PROTOTYPES
)
+endif()
diff --git cmake/external/openssl/CMakeLists.txt cmake/external/openssl/CMakeLists.txt
index bcbcbfa..a834a0e 100644
--- cmake/external/openssl/CMakeLists.txt
+++ cmake/external/openssl/CMakeLists.txt
@@ -7,7 +7,13 @@
add_library(external_openssl INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_openssl ALIAS external_openssl)
-if (LINUX)
+if(DESKTOP_APP_USE_SYSTEM_LIBS)
+ find_package(OpenSSL REQUIRED)
+ target_include_directories(external_openssl SYSTEM
+ INTERFACE
+ ${OPENSSL_INCLUDE_DIR}
+ )
+elseif (LINUX)
target_include_directories(external_openssl SYSTEM
INTERFACE
/usr/local/desktop-app/openssl-1.1.1/include
@@ -24,6 +30,13 @@ else()
)
endif()
+if(DESKTOP_APP_USE_SYSTEM_LIBS)
+ target_link_libraries(external_openssl
+ INTERFACE
+ OpenSSL::Crypto
+ OpenSSL::SSL
+ )
+else()
if (WIN32)
set(openssl_lib_ext lib)
set(openssl_lib_loc ${libs_loc}/openssl_1_1_1/out32$<$<CONFIG:Debug>:.dbg>)
@@ -45,6 +58,7 @@ INTERFACE
${openssl_lib_loc}/libssl.${openssl_lib_ext}
${openssl_lib_loc}/libcrypto.${openssl_lib_ext}
)
+endif()
if (LINUX)
if (DESKTOP_APP_USE_GLIBC_WRAPS)
diff --git cmake/external/opus/CMakeLists.txt cmake/external/opus/CMakeLists.txt
index 00c2508..960b7fa 100644
--- cmake/external/opus/CMakeLists.txt
+++ cmake/external/opus/CMakeLists.txt
@@ -7,6 +7,18 @@
add_library(external_opus INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_opus ALIAS external_opus)
+if(DESKTOP_APP_USE_SYSTEM_LIBS)
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(OPUS REQUIRED opus)
+ target_include_directories(external_opus SYSTEM
+ INTERFACE
+ ${OPUS_INCLUDE_DIRS}
+ )
+ target_link_libraries(external_opus
+ INTERFACE
+ ${OPUS_LIBRARIES}
+ )
+else()
target_include_directories(external_opus SYSTEM
INTERFACE
${libs_loc}/opus/include
@@ -43,3 +55,4 @@ else()
opus
)
endif()
+endif()
diff --git cmake/external/qt/CMakeLists.txt cmake/external/qt/CMakeLists.txt
index 1a56319..1744a8b 100644
--- cmake/external/qt/CMakeLists.txt
+++ cmake/external/qt/CMakeLists.txt
@@ -15,6 +15,36 @@ if (LINUX)
endif()
endif()
+if(DESKTOP_APP_USE_SYSTEM_LIBS)
+ get_target_property(QTCORE_INCLUDE_DIRS Qt5::Core INTERFACE_INCLUDE_DIRECTORIES)
+ list(GET QTCORE_INCLUDE_DIRS 0 QT_INCLUDE_DIR)
+
+ foreach(__qt_module IN ITEMS QtCore QtGui)
+ list(APPEND QT_PRIVATE_INCLUDE_DIRS
+ ${QT_INCLUDE_DIR}/${__qt_module}/${Qt5_VERSION}
+ ${QT_INCLUDE_DIR}/${__qt_module}/${Qt5_VERSION}/${__qt_module}
+ )
+ endforeach()
+ message(STATUS "Using Qt private include directories: ${QT_PRIVATE_INCLUDE_DIRS}")
+ target_include_directories(external_qt SYSTEM
+ INTERFACE
+ ${QT_PRIVATE_INCLUDE_DIRS}
+ )
+ target_link_libraries(external_qt
+ INTERFACE
+ Qt5::DBus
+ Qt5::Network
+ Qt5::Widgets
+ desktop-app::external_zlib
+ xcb
+ X11
+ X11-xcb
+ dbus-1
+ dl
+ glib-2.0
+ pthread
+ )
+else()
target_include_directories(external_qt SYSTEM
INTERFACE
${qt_loc}/include
@@ -215,3 +245,4 @@ if (LINUX)
pthread
)
endif()
+endif()
diff --git cmake/external/qt/package.cmake cmake/external/qt/package.cmake
index 36a1dfd..320edc4 100644
--- cmake/external/qt/package.cmake
+++ cmake/external/qt/package.cmake
@@ -4,6 +4,9 @@
# For license and copyright information please follow this link:
# https://github.com/desktop-app/legal/blob/master/LEGAL
+if(DESKTOP_APP_USE_SYSTEM_LIBS)
+
+else()
if (NOT APPLE OR NOT build_osx)
set(qt_version 5.12.5)
else()
@@ -17,6 +20,7 @@ else()
endif()
set(Qt5_DIR ${qt_loc}/lib/cmake/Qt5)
+endif()
find_package(Qt5 COMPONENTS Core Gui Widgets Network REQUIRED)
diff --git cmake/external/ranges/CMakeLists.txt cmake/external/ranges/CMakeLists.txt
index 4c75ecb..51f972a 100644
--- cmake/external/ranges/CMakeLists.txt
+++ cmake/external/ranges/CMakeLists.txt
@@ -9,7 +9,7 @@ add_library(desktop-app::external_ranges ALIAS external_ranges)
target_include_directories(external_ranges SYSTEM
INTERFACE
- ${libs_loc}/range-v3/include
+ /usr/include
)
if (WIN32)
@@ -18,4 +18,4 @@ if (WIN32)
/experimental:preprocessor # need for range-v3 see https://github.com/ericniebler/range-v3#supported-compilers
/wd5105 # needed for `/experimental:preprocessor`, suppressing C5105 "macro expansion producing 'defined' has undefined behavior"
)
-endif()
\ No newline at end of file
+endif()
diff --git cmake/external/zlib/CMakeLists.txt cmake/external/zlib/CMakeLists.txt
index d2bc1fc..1c65298 100644
--- cmake/external/zlib/CMakeLists.txt
+++ cmake/external/zlib/CMakeLists.txt
@@ -7,6 +7,18 @@
add_library(external_zlib INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_zlib ALIAS external_zlib)
+if(DESKTOP_APP_USE_SYSTEM_LIBS)
+ find_package(ZLIB REQUIRED)
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(MINIZIP REQUIRED minizip)
+ find_library(minizip_LIBRARY minizip)
+ target_link_libraries(external_zlib INTERFACE ZLIB::ZLIB ${minizip_LIBRARY})
+ target_include_directories(external_zlib SYSTEM
+ INTERFACE
+ ${ZLIB_INCLUDE_DIR}
+ ${MINIZIP_INCLUDE_DIRS}
+ )
+else()
if (NOT WIN32)
add_library(external_minizip STATIC)
init_target(external_minizip "(external)")
@@ -49,3 +61,4 @@ elseif (APPLE)
else()
target_link_static_libraries(external_zlib INTERFACE z)
endif()
+endif()
diff --git cmake/init_target.cmake cmake/init_target.cmake
index c7a1244..2824a60 100644
--- cmake/init_target.cmake
+++ cmake/init_target.cmake
@@ -27,7 +27,7 @@ function(init_target target_name) # init_target(my_target folder_name)
endif()
target_link_libraries(${target_name} PUBLIC desktop-app::common_options)
set_target_properties(${target_name} PROPERTIES
- LINK_SEARCH_START_STATIC 1
+ LINK_SEARCH_START_STATIC 0
XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_WEAK YES
XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN YES
XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN YES
diff --git cmake/options_linux.cmake cmake/options_linux.cmake
index a6a13c9..53cfb63 100644
--- cmake/options_linux.cmake
+++ cmake/options_linux.cmake
@@ -25,6 +25,9 @@ INTERFACE
-Wno-stringop-overflow
-Wno-maybe-uninitialized
-Wno-error=class-memaccess
+ -Wno-error=deprecated-copy
+ -Wno-error=deprecated-declarations
+ -Wno-error=redundant-move
)
target_link_options(common_options
INTERFACE
@@ -33,8 +36,5 @@ INTERFACE
if (build_linux32)
target_compile_options(common_options INTERFACE -g0)
target_link_options(common_options INTERFACE -g0)
-else()
- target_compile_options(common_options INTERFACE $<IF:$<CONFIG:Debug>,,-g -flto>)
- target_link_options(common_options INTERFACE $<IF:$<CONFIG:Debug>,,-g -flto -fuse-linker-plugin>)
endif()
diff --git cmake/variables.cmake cmake/variables.cmake
index b3d7ff4..4422b97 100644
--- cmake/variables.cmake
+++ cmake/variables.cmake
@@ -10,6 +10,7 @@ option(DESKTOP_APP_DISABLE_SPELLCHECK "Disable spellcheck library." OFF)
option(DESKTOP_APP_LOTTIE_USE_CACHE "Use caching in lottie animations." ON)
option(DESKTOP_APP_USE_GLIBC_WRAPS "Use wraps for new GLIBC features." OFF)
option(DESKTOP_APP_USE_PACKAGED "Find libraries using CMake instead of exact paths." ON)
+option(DESKTOP_APP_USE_SYSTEM_LIBS "Use system libs where possible." OFF)
function(report_bad_special_target)
message(FATAL_ERROR "Bad special target '${DESKTOP_APP_SPECIAL_TARGET}'")
@@ -59,8 +60,7 @@ elseif (APPLE)
set(DESKTOP_APP_USE_GLIBC_WRAPS OFF)
else()
set(LINUX 1)
- execute_process(COMMAND uname -m OUTPUT_VARIABLE machine_uname)
- if (NOT ${machine_uname} MATCHES "x86_64" AND NOT ${machine_uname} MATCHES "aarch64")
+ if (CMAKE_SIZEOF_VOID_P EQUAL 4)
set(build_linux32 1)
endif()
if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "linux")
--
2.24.1

View File

@ -1,9 +1,71 @@
diff --git a/Telegram/SourceFiles/qt_functions.cpp Telegram/SourceFiles/qt_functions.cpp
From 85ae791a9ebf5a2603f12d2a6e2d75549a01d701 Mon Sep 17 00:00:00 2001
From: John Zimmermann <johnz@posteo.net>
Date: Thu, 2 Jan 2020 12:38:39 +0100
Subject: [PATCH] Dynamic linking
---
Telegram/CMakeLists.txt | 7 +-
Telegram/SourceFiles/core/launcher.cpp | 8 +++
Telegram/SourceFiles/qt_functions.cpp | 96 ++++++++++++++++++++++++++
3 files changed, 107 insertions(+), 4 deletions(-)
create mode 100644 Telegram/SourceFiles/qt_functions.cpp
diff --git Telegram/CMakeLists.txt Telegram/CMakeLists.txt
index 8e6f8648d..cf5da1c13 100644
--- Telegram/CMakeLists.txt
+++ Telegram/CMakeLists.txt
@@ -934,9 +934,9 @@ PRIVATE
mainwidget.h
mainwindow.cpp
mainwindow.h
+ qt_functions.cpp
observer_peer.cpp
observer_peer.h
- qt_static_plugins.cpp
settings.cpp
settings.h
)
@@ -1104,13 +1104,12 @@ target_compile_definitions(Telegram
PRIVATE
TDESKTOP_API_ID=${TDESKTOP_API_ID}
TDESKTOP_API_HASH=${TDESKTOP_API_HASH}
- AL_LIBTYPE_STATIC
AL_ALEXT_PROTOTYPES
)
-if (${CMAKE_GENERATOR} MATCHES "(Visual Studio|Xcode|Ninja)")
+if ((${CMAKE_GENERATOR} MATCHES "(Visual Studio|Xcode)") OR ((${CMAKE_GENERATOR} MATCHES "(Ninja)") AND (NOT ${DESKTOP_APP_SPECIAL_TARGET} STREQUAL "")))
set(output_folder ${CMAKE_BINARY_DIR})
-elseif((${CMAKE_GENERATOR} MATCHES "(Unix Makefiles)") AND DESKTOP_APP_SPECIAL_TARGET STREQUAL "")
+elseif((${CMAKE_GENERATOR} MATCHES "(Unix Makefiles|Ninja)") AND DESKTOP_APP_SPECIAL_TARGET STREQUAL "")
set(output_folder ${CMAKE_BINARY_DIR}/bin)
else()
set(output_folder ${CMAKE_BINARY_DIR}/$<IF:$<CONFIG:Debug>,Debug,Release>)
diff --git Telegram/SourceFiles/core/launcher.cpp Telegram/SourceFiles/core/launcher.cpp
index 25473426f..d0319e86f 100644
--- Telegram/SourceFiles/core/launcher.cpp
+++ Telegram/SourceFiles/core/launcher.cpp
@@ -278,6 +278,14 @@ int Launcher::exec() {
Platform::start();
Ui::DisableCustomScaling();
+
+ // I don't know why path is not in QT_PLUGIN_PATH by default
+ QCoreApplication::addLibraryPath("/usr/lib/qt5/plugins");
+ // without this Telegram doesn't start on Ubuntu 17.04 due GTK errors
+ setenv("QT_STYLE_OVERRIDE", "qwerty", false);
+ // Telegram doesn't start when extraordinary theme is set, see launchpad.net/bugs/1680943
+ unsetenv("QT_QPA_PLATFORMTHEME");
+
auto result = executeApplication();
DEBUG_LOG(("Telegram finished, result: %1").arg(result));
diff --git Telegram/SourceFiles/qt_functions.cpp Telegram/SourceFiles/qt_functions.cpp
new file mode 100644
index 0000000..4a722b8
index 000000000..a12cc53f0
--- /dev/null
+++ Telegram/SourceFiles/qt_functions.cpp
@@ -0,0 +1,94 @@
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
@ -37,6 +99,8 @@ index 0000000..4a722b8
+**
+****************************************************************************/
+
+#include <private/qfontengine_p.h>
+
+/* TODO: find a dynamic library with these symbols. */
+
+/* Debian maintainer: this function is taken from qfiledialog.cpp */
@ -98,3 +162,6 @@ index 0000000..4a722b8
+ if (f->d->strikeOut || charFormat.fontStrikeOut())
+ flags |= QTextItem::StrikeOut;
+}
--
2.24.1

View File

@ -1,67 +0,0 @@
From 9202a047d23b8077a55b93e3d1c9e5fba73b3d10 Mon Sep 17 00:00:00 2001
From: John Zimmermann <johnz@posteo.net>
Date: Fri, 9 Aug 2019 22:25:34 +0200
Subject: [PATCH] Revert "Change some private header includes."
This reverts commit b9d3ba621eb8af638af46c6b3cfd7a8330bf0dd5.
---
Telegram/SourceFiles/ui/text/text.cpp | 1 -
Telegram/SourceFiles/ui/text/text.h | 2 +-
Telegram/SourceFiles/ui/text/text_block.cpp | 2 --
Telegram/SourceFiles/ui/text/text_block.h | 2 +-
4 files changed, 2 insertions(+), 5 deletions(-)
diff --git Telegram/SourceFiles/ui/text/text.cpp Telegram/SourceFiles/ui/text/text.cpp
index 99d27b60c..ba0b4844f 100644
--- Telegram/SourceFiles/ui/text/text.cpp
+++ Telegram/SourceFiles/ui/text/text.cpp
@@ -17,7 +17,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "boxes/confirm_box.h"
#include "mainwindow.h"
-#include <private/qfontengine_p.h>
#include <private/qharfbuzz_p.h>
namespace Ui {
diff --git Telegram/SourceFiles/ui/text/text.h Telegram/SourceFiles/ui/text/text.h
index 537c0b60d..7906b0eee 100644
--- Telegram/SourceFiles/ui/text/text.h
+++ Telegram/SourceFiles/ui/text/text.h
@@ -11,7 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "core/click_handler.h"
#include "base/flags.h"
-#include <private/qfixed_p.h>
+#include <private/qfontengine_p.h>
static const QChar TextCommand(0x0010);
enum TextCommands {
diff --git Telegram/SourceFiles/ui/text/text_block.cpp Telegram/SourceFiles/ui/text/text_block.cpp
index c7b3fdead..9637a2e07 100644
--- Telegram/SourceFiles/ui/text/text_block.cpp
+++ Telegram/SourceFiles/ui/text/text_block.cpp
@@ -9,8 +9,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "core/crash_reports.h"
-#include <private/qfontengine_p.h>
-
// COPIED FROM qtextlayout.cpp AND MODIFIED
namespace Ui {
namespace Text {
diff --git Telegram/SourceFiles/ui/text/text_block.h Telegram/SourceFiles/ui/text/text_block.h
index a20b8123c..38e1e0446 100644
--- Telegram/SourceFiles/ui/text/text_block.h
+++ Telegram/SourceFiles/ui/text/text_block.h
@@ -7,7 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
-#include <private/qfixed_p.h>
+#include <private/qfontengine_p.h>
namespace Ui {
namespace Text {
--
2.22.0

View File

@ -0,0 +1,25 @@
From d4c11502175e2a7821dbd92e029a90d54498e3e8 Mon Sep 17 00:00:00 2001
From: John Zimmermann <johnz@posteo.net>
Date: Thu, 2 Jan 2020 12:57:33 +0100
Subject: [PATCH] PPC big endian
---
Telegram/SourceFiles/config.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git Telegram/SourceFiles/config.h Telegram/SourceFiles/config.h
index fb7b54e4d..6a873fbd7 100644
--- Telegram/SourceFiles/config.h
+++ Telegram/SourceFiles/config.h
@@ -177,7 +177,7 @@ constexpr auto ApiHash = "344583e45741c457fe1862106095a5eb";
#endif // TDESKTOP_API_ID && TDESKTOP_API_HASH
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
-#error "Only little endian is supported!"
+#warning "Only little endian is supported!"
#endif // Q_BYTE_ORDER == Q_BIG_ENDIAN
#if (TDESKTOP_ALPHA_VERSION != 0)
--
2.24.1

View File

@ -0,0 +1,28 @@
From af5f8d19f0fdded987beee4568f02cc8dcbd20f4 Mon Sep 17 00:00:00 2001
From: John Zimmermann <johnz@posteo.net>
Date: Thu, 2 Jan 2020 12:58:45 +0100
Subject: [PATCH] PPC config
---
base/build_config.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git Telegram/lib_base/base/build_config.h Telegram/lib_base/base/build_config.h
index a02c9b0..b3f4860 100644
--- Telegram/lib_base/base/build_config.h
+++ Telegram/lib_base/base/build_config.h
@@ -46,9 +46,9 @@
#define ARCH_CPU_X86_FAMILY 1
#define ARCH_CPU_X86 1
#define ARCH_CPU_32_BITS 1
-#elif defined(__aarch64__)
+#elif defined(__aarch64__) || defined(__powerpc64__)
#define ARCH_CPU_64_BITS 1
-#elif defined(_M_ARM) || defined(__arm__)
+#elif defined(_M_ARM) || defined(__arm__) || defined(__powerpc__)
#define ARCH_CPU_32_BITS 1
#else
#error Please add support for your architecture in base/build_config.h
--
2.24.1

View File

@ -0,0 +1,27 @@
From ef30081973681f4f8d261917fa763b00adfbe6e9 Mon Sep 17 00:00:00 2001
From: John Zimmermann <johnz@posteo.net>
Date: Thu, 2 Jan 2020 13:10:31 +0100
Subject: [PATCH] gtk3
---
Telegram/CMakeLists.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git Telegram/CMakeLists.txt Telegram/CMakeLists.txt
index cf5da1c13..0d155d54a 100644
--- Telegram/CMakeLists.txt
+++ Telegram/CMakeLists.txt
@@ -1018,8 +1018,8 @@ elseif (LINUX)
if (NOT TDESKTOP_DISABLE_GTK_INTEGRATION)
find_package(PkgConfig REQUIRED)
- pkg_check_modules(GTK2 REQUIRED gtk+-2.0)
- target_include_directories(Telegram PRIVATE ${GTK2_INCLUDE_DIRS})
+ pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
+ target_include_directories(Telegram PRIVATE ${GTK3_INCLUDE_DIRS})
target_compile_options(Telegram PRIVATE -Wno-register)
set(appindicator_packages
--
2.24.1

View File

@ -0,0 +1,10 @@
--- cmake/options_linux.cmake 2020-01-02 13:29:15.748669711 +0100
+++ - 2020-01-02 13:36:08.581505523 +0100
@@ -9,7 +9,6 @@
$<IF:$<CONFIG:Debug>,,-Ofast -fno-strict-aliasing>
-pipe
-Wall
- -Werror
-W
-fPIC
-Wno-unused-variable

View File

@ -0,0 +1,18 @@
--- CMakeLists.txt 2019-12-31 16:06:54.000000000 +0100
+++ - 2020-01-02 19:50:26.729834118 +0100
@@ -10,7 +10,6 @@
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
-include(cmake/variables.cmake)
include(cmake/version.cmake)
desktop_app_parse_version(Telegram/build/version)
@@ -22,6 +21,7 @@
)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT Telegram)
+include(cmake/variables.cmake)
include(cmake/nice_target_sources.cmake)
include(cmake/target_link_static_libraries.cmake)
include(cmake/target_link_frameworks.cmake)

View File

@ -0,0 +1,25 @@
From 47a484ba63811f6d4642e702a5c27b77001165e1 Mon Sep 17 00:00:00 2001
From: Leo <thinkabit.ukim@gmail.com>
Date: Thu, 2 Jan 2020 16:05:29 +0100
Subject: [PATCH] lib_tgvoip.cmake: Match against x86 arches.
This avoids matching against other 32bit arches like armv7/armhf that
doesn't have msse2 but are 32bit and need other 32bit-specific flags to
allow for compilation like -g0.
---
Telegram/cmake/lib_tgvoip.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Telegram/cmake/lib_tgvoip.cmake b/Telegram/cmake/lib_tgvoip.cmake
index 38fa632a40..2801fbec2d 100644
--- Telegram/cmake/lib_tgvoip.cmake
+++ Telegram/cmake/lib_tgvoip.cmake
@@ -756,7 +756,7 @@ else()
-Wno-error=sequence-point
-Wno-error=unused-result
)
- if (build_linux32)
+ if (CMAKE_SYSTEM_PROCESSOR MATCHES "(i686|i386|x86)")
target_compile_options(lib_tgvoip PRIVATE -msse2)
endif()
target_compile_definitions(lib_tgvoip

View File

@ -1,20 +0,0 @@
--- Telegram/gyp/PrecompiledHeader.cmake 2019-06-06 18:14:46.443138055 +0200
+++ - 2019-06-06 18:15:45.874739539 +0200
@@ -114,7 +114,7 @@
set(_compiler_FLAGS "@${_pch_c_flags_file}")
add_custom_command(
OUTPUT "${_output_c}"
- COMMAND "${CMAKE_C_COMPILER}" ${_compiler_FLAGS} -x c-header -o "${_output_c}" -c "${_pchfile}"
+ COMMAND "${CMAKE_C_COMPILER}" ${_compiler_FLAGS} "$(C_FLAGS)" -x c-header -o "${_output_c}" -c "${_pchfile}"
DEPENDS "${_pchfile}" "${_pch_c_flags_file}"
IMPLICIT_DEPENDS C "${_pch_header}"
COMMENT "Precompiling ${_name} for ${_target} (C)")
@@ -125,7 +125,7 @@
set(_compiler_FLAGS "@${_pch_cpp_flags_file}")
add_custom_command(
OUTPUT "${_output_cxx}"
- COMMAND "${CMAKE_CXX_COMPILER}" ${_compiler_FLAGS} -x c++-header -o "${_output_cxx}" -c "${_pchfile}"
+ COMMAND "${CMAKE_CXX_COMPILER}" ${_compiler_FLAGS} "$(CXX_FLAGS)" -x c++-header -o "${_output_cxx}" -c "${_pchfile}"
DEPENDS "${_pchfile}" "${_pch_cpp_flags_file}"
IMPLICIT_DEPENDS CXX "${_pch_header}"
COMMENT "Precompiling header ${_name} for ${_target} (C++)")

View File

@ -1,10 +0,0 @@
--- Telegram/SourceFiles/storage/cache/storage_cache_database_object.cpp 2018-09-01 17:56:09.000000000 +0200
+++ - 2018-09-02 01:01:28.812511733 +0200
@@ -14,6 +14,7 @@
#include "storage/storage_encrypted_file.h"
#include "base/flat_map.h"
#include "base/algorithm.h"
+#include "base/openssl_help.h"
#include <crl/crl.h>
#include <xxhash.h>
#include <QtCore/QDir>

View File

@ -1,41 +0,0 @@
diff --git a/lib/xdg/telegramdesktop.appdata.xml lib/xdg/telegramdesktop.appdata.xml
index 7bcf8d8..4508c01 100644
--- a/lib/xdg/telegramdesktop.appdata.xml
+++ lib/xdg/telegramdesktop.appdata.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<component type="desktop">
- <id>org.telegram.desktop</id>
+ <id>telegram-desktop.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0</project_license>
<name>Telegram Desktop</name>
diff --git a/lib/xdg/telegramdesktop.desktop lib/xdg/telegramdesktop.desktop
index 0a80695..550b9f7 100644
--- a/lib/xdg/telegramdesktop.desktop
+++ lib/xdg/telegramdesktop.desktop
@@ -1,9 +1,11 @@
[Desktop Entry]
Version=1.0
Name=Telegram Desktop
+GenericName=Telegram Desktop
+Keywords=IM;Chat;
Comment=Official desktop version of Telegram messaging app
-Exec=telegram-desktop -- %u
-Icon=telegram
+Exec=env SESSION_MANAGER= Telegram -- %u
+Icon=telegram
Terminal=false
StartupWMClass=TelegramDesktop
Type=Application
diff --git a/lib/xdg/tg.protocol lib/xdg/tg.protocol
index 0a80695..550b9f7 100644
--- a/lib/xdg/tg.protocol
+++ lib/xdg/tg.protocol
@@ -1,5 +1,5 @@
[Protocol]
-exec=/usr/bin/telegram-desktop -- %u
+exec=Telegram -- %u
protocol=tg
input=none
output=none

View File

@ -1,25 +0,0 @@
--- Telegram/SourceFiles/base/build_config.h
+++ Telegram/SourceFiles/base/build_config.h
@@ -47,9 +47,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#define ARCH_CPU_X86_FAMILY 1
#define ARCH_CPU_X86 1
#define ARCH_CPU_32_BITS 1
-#elif defined(__aarch64__)
+#elif defined(__aarch64__) || defined(__powerpc64__)
#define ARCH_CPU_64_BITS 1
-#elif defined(_M_ARM) || defined(__arm__)
+#elif defined(_M_ARM) || defined(__arm__) || defined(__powerpc__)
#define ARCH_CPU_32_BITS 1
#else
#error Please add support for your architecture in base/build_config.h
--- Telegram/SourceFiles/config.h
+++ Telegram/SourceFiles/config.h
@@ -194,7 +194,7 @@ constexpr auto ApiHash = "344583e45741c457fe1862106095a5eb";
#endif // TDESKTOP_API_ID && TDESKTOP_API_HASH
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
-#error "Only little endian is supported!"
+#warning "Only little endian is supported!"
#endif // Q_BYTE_ORDER == Q_BIG_ENDIAN
#if (TDESKTOP_ALPHA_VERSION != 0)

View File

@ -1,46 +0,0 @@
From 6645b23021d169c8d3fc0f4522e1725571ace288 Mon Sep 17 00:00:00 2001
From: John Zimmermann <johnz@posteo.net>
Date: Wed, 26 Sep 2018 20:36:13 +0200
Subject: [PATCH 2/7] Fix a few bugs that are caused by dynamic linking to qt5.
---
Telegram/SourceFiles/core/launcher.cpp | 8 ++++++++
Telegram/SourceFiles/qt_static_plugins.cpp | 9 ---------
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git Telegram/SourceFiles/core/launcher.cpp Telegram/SourceFiles/core/launcher.cpp
index d4bdadc17..bf9066274 100644
--- Telegram/SourceFiles/core/launcher.cpp
+++ Telegram/SourceFiles/core/launcher.cpp
@@ -59,6 +59,14 @@ int Launcher::exec() {
Logs::start(this); // must be started before Platform is started
Platform::start(); // must be started before QApplication is created
+
+ // I don't know why path is not in QT_PLUGIN_PATH by default
+ QCoreApplication::addLibraryPath("/usr/lib/qt/plugins");
+ // without this Telegram doesn't start on Ubuntu 17.04 due GTK errors
+ setenv("QT_STYLE_OVERRIDE", "qwerty", false);
+ // Telegram doesn't start when extraordinary theme is set, see launchpad.net/bugs/1680943
+ unsetenv("QT_QPA_PLATFORMTHEME");
+
auto result = executeApplication();
DEBUG_LOG(("Telegram finished, result: %1").arg(result));
diff --git Telegram/SourceFiles/qt_static_plugins.cpp Telegram/SourceFiles/qt_static_plugins.cpp
index e29f348c8..122ff0f5d 100644
--- Telegram/SourceFiles/qt_static_plugins.cpp 2018-12-10 16:37:52.000000000 +0100
+++ - 2018-12-10 19:00:42.884810312 +0100
@@ -14,7 +14,7 @@
Q_IMPORT_PLUGIN(QWebpPlugin)
Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)
Q_IMPORT_PLUGIN(QGenericEnginePlugin)
-#elif defined Q_OS_LINUX // Q_OS_WIN | Q_OS_MAC
+#elif 0 // Q_OS_WIN | Q_OS_MAC
Q_IMPORT_PLUGIN(QWebpPlugin)
Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)
Q_IMPORT_PLUGIN(QConnmanEnginePlugin)
--
2.19.0

View File

@ -1,19 +0,0 @@
--- Telegram/SourceFiles/stdafx.h 2019-09-10 17:30:47.000000000 +0200
+++ - 2019-09-18 14:03:45.704797349 +0200
@@ -60,6 +60,8 @@
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QVector>
+#include <QtNetwork/QNetworkProxy>
+#include <QtNetwork/QTcpSocket>
#include <QtGui/QIcon>
#include <QtGui/QImage>
@@ -119,6 +121,7 @@
#include "base/basic_types.h"
#include "logs.h"
+#include "scheme.h"
#include "core/utils.h"
#include "config.h"

View File

@ -1,22 +1,16 @@
# Template file for 'telegram-desktop'
pkgname=telegram-desktop
version=1.8.15
revision=2
_libtgvoip_commit=d4a0f719ffd8d29e88474f67abc9fc862661c3b9
_GSL_commit=d846fe50a3f0bb7767c7e087a05f4be95f4da0ec
_variant_commit=550ac2f159ca883d360c196149b466955c77a573
_crl_commit=52baf11aaeb7f5ea6955a438abaa1aee4c4308d8
_Catch_commit=5ca44b68721833ae3731802ed99af67c6f38a53a
wrksrc="tdesktop-${version}"
build_wrksrc="Telegram"
version=1.9.3
revision=1
wrksrc="tdesktop-${version}-full"
build_style=cmake
cmake_builddir=build-telegram
configure_args="-DENABLE_CRASH_REPORTS=OFF -DENABLE_GTK_INTEGRATION=ON
-DENABLE_PULSEAUDIO=$(vopt_if pulseaudio 'ON' 'OFF')"
build_helper="qemu"
configure_args="-DTDESKTOP_API_ID=209235 -DTDESKTOP_API_HASH=169ee702e1df4b6e66d80311db36cc43
-DDESKTOP_APP_USE_GLIBC_WRAPS=OFF -DDESKTOP_APP_USE_SYSTEM_LIBS=ON -DDESKTOP_APP_DISABLE_CRASH_REPORTS=ON"
hostmakedepends="pkg-config qt5-qmake qt5-host-tools python"
makedepends="alsa-lib-devel ffmpeg-devel gtk+3-devel libappindicator-devel
libdbusmenu-glib-devel libopenal-devel minizip-devel opus-devel xxHash-devel
$(vopt_if pulseaudio 'pulseaudio-devel') qt5-devel range-v3 libva-devel
pulseaudio-devel qt5-devel range-v3 libva-devel enchant2-devel
rapidjson liblz4-devel rlottie-devel MesaLib-devel"
depends="qt5-imageformats qt5>=5.13.2<5.13.3"
short_desc="Telegram Desktop messaging app"
@ -24,22 +18,9 @@ maintainer="John <johnz@posteo.net>"
license="GPL-3.0-or-later WITH OpenSSL"
homepage="https://desktop.telegram.org/"
changelog="https://github.com/telegramdesktop/tdesktop/blob/v${version}/changelog.txt"
distfiles="https://github.com/telegramdesktop/tdesktop/archive/v${version}.tar.gz
https://github.com/telegramdesktop/libtgvoip/archive/${_libtgvoip_commit}.tar.gz
https://github.com/Microsoft/GSL/archive/${_GSL_commit}.tar.gz
https://github.com/mapbox/variant/archive/${_variant_commit}.tar.gz
https://github.com/telegramdesktop/crl/archive/${_crl_commit}.tar.gz
https://github.com/catchorg/Catch2/archive/${_Catch_commit}.tar.gz"
checksum="68bb6c3d007fe21847286815f22c2532a7cf9c247dc2781d749ebeb40f02ed99
bb75188b900907a5b00594ad3ddb78195c8d1fdc144e5a458b314dd666eba996
be81db4ab1b57102a0fa1cd0c4a6469294eb9daf24294347592245b754f65ff6
aa794dfefe0a90501587e36d977b958d0df888503117a8d9aa43dc14f8526d9d
9ab12f23916a66665dce9b3baf16594886322f426516d34e2166e7057d78e18e
d24e6d9df2b8aa5739d3b9077c6b0ff0ef4d5ef8acc52c3a57e32893854d8d18"
build_options="pulseaudio"
build_options_default="pulseaudio"
distfiles="https://github.com/telegramdesktop/tdesktop/releases/download/v${version}/tdesktop-${version}-full.tar.gz"
checksum=ca9c67369140952d5ffe404ca082517193e3832b2c21ba1af791f078e4d9a7bb
CXXFLAGS="-DTDESKTOP_API_ID=209235 -DTDESKTOP_API_HASH=169ee702e1df4b6e66d80311db36cc43"
case $XBPS_TARGET_MACHINE in
mips*)
@ -48,7 +29,7 @@ case $XBPS_TARGET_MACHINE in
ppc64*) ;;
armv[56]*|ppc*)
makedepends+=" libatomic-devel"
configure_args+=" -DUSE_LIBATOMIC=ON"
LDFLAGS="-latomic"
;;
esac
@ -71,40 +52,19 @@ post_extract() {
msg_red "${_qt5_version%_*} does not match ${_qt5_dep_ver}\\n"
exit 1
fi
rmdir ${wrksrc}/${build_wrksrc}/ThirdParty/libtgvoip
mv ../libtgvoip-${_libtgvoip_commit} ${wrksrc}/${build_wrksrc}/ThirdParty/libtgvoip
rmdir ${wrksrc}/${build_wrksrc}/ThirdParty/GSL
mv ../GSL-${_GSL_commit} ${wrksrc}/${build_wrksrc}/ThirdParty/GSL
rmdir ${wrksrc}/${build_wrksrc}/ThirdParty/variant
mv ../variant-${_variant_commit} ${wrksrc}/${build_wrksrc}/ThirdParty/variant
rmdir ${wrksrc}/${build_wrksrc}/ThirdParty/crl
mv ../crl-${_crl_commit} ${wrksrc}/${build_wrksrc}/ThirdParty/crl
rmdir ${wrksrc}/${build_wrksrc}/ThirdParty/Catch
mv ../Catch2-${_Catch_commit} ${wrksrc}/${build_wrksrc}/ThirdParty/Catch
cp ${FILESDIR}/Telegram.cmake ${build_wrksrc}/CMakeLists.txt
cp ${FILESDIR}/ThirdParty-crl.cmake ${build_wrksrc}/ThirdParty/crl/CMakeLists.txt
cp ${FILESDIR}/ThirdParty-libtgvoip.cmake ${build_wrksrc}/ThirdParty/libtgvoip/CMakeLists.txt
cp ${FILESDIR}/ThirdParty-libtgvoip-webrtc.cmake \
${build_wrksrc}/ThirdParty/libtgvoip/webrtc_dsp/CMakeLists.txt
mkdir -p ${build_wrksrc}/cmake
cp ${FILESDIR}/FindBreakpad.cmake ${build_wrksrc}/cmake
cp ${FILESDIR}/TelegramCodegen.cmake ${build_wrksrc}/cmake
cp ${FILESDIR}/TelegramTests.cmake ${build_wrksrc}/cmake
mkdir -p ${build_wrksrc}/native
cp ${FILESDIR}/TelegramCodegenTools.cmake ${build_wrksrc}/native/CMakeLists.txt
case "$XBPS_TARGET_MACHINE" in
ppc64*) ;;
armv[56]*|ppc*) vsed -e '/desktop-app::external_openal/ a atomic' \
-i Telegram/CMakeLists.txt ;;
esac
}
pre_configure() {
cd native
CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= cmake .
make ${makejobs}
}
post_install() {
do_install() {
for i in 16 32 48 64 128 256 512; do
vinstall Resources/art/icon$i.png 644 usr/share/icons/hicolor/${i}x${i}/apps telegram.png
vinstall Telegram/Resources/art/icon$i.png 644 usr/share/icons/hicolor/${i}x${i}/apps telegram.png
done
vbin build/bin/Telegram
vinstall lib/xdg/telegramdesktop.desktop 644 usr/share/applications
vinstall lib/xdg/telegramdesktop.appdata.xml 644 usr/share/appdata
vinstall lib/xdg/tg.protocol 644 usr/share/kservices5
}