From 81253f28cc4af640c06db2ee8409f0292a0fca3a Mon Sep 17 00:00:00 2001 From: Vadim Lomovtsev Date: Fri, 29 Mar 2024 17:16:24 +0300 Subject: [PATCH] project-wide: build & run-time fixes While using meson some issues were faced with link and application startup. This commit is to put fixes for the following issues: - missed conversation_details.css file; add conversation_details.css to the main/data/gresources.xml; - the 'localtime_r' symbol can't be found while linking application add POSIX_C_SOURCES=1 macro definition - meson configure complains that xmpp-vala package version is not set set xmpp-vala version to 0.1 - application startup failures due to unresolved symbols while creating initial UI fix: put '--export-all-symbols' to the main/meson.build for mingw64 build - segmentation fault while running app built by meson meson.build: add _WIN32 definefor vala compilation - main/meson.build: add _FILE_OFFSET_BITS definition (sync with cmake cfg) - main/meson.build: compile window resources (fix missed window icon) Signed-off-by: Vadim Lomovtsev --- main/data/gresource.xml | 1 + main/meson.build | 12 +++++++++++- meson.build | 3 ++- xmpp-vala/meson.build | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/main/data/gresource.xml b/main/data/gresource.xml index 797fb86e..637da159 100644 --- a/main/data/gresource.xml +++ b/main/data/gresource.xml @@ -11,6 +11,7 @@ conversation_content_view/item_metadata_header.ui conversation_content_view/view.ui conversation_details.ui + conversation_details.css conversation_item_widget.ui conversation_list_titlebar.ui conversation_list_titlebar_csd.ui diff --git a/main/meson.build b/main/meson.build index 69069f64..0eca6686 100644 --- a/main/meson.build +++ b/main/meson.build @@ -104,6 +104,8 @@ sources += gnome.compile_resources( c_args = [ '-DG_LOG_DOMAIN="dino"', '-DGETTEXT_PACKAGE="dino"', + '-D_POSIX_C_SOURCE=1', + '-D_FILE_OFFSET_BITS=64', '-DLOCALE_INSTALL_DIR="@0@"'.format(get_option('prefix') / get_option('localedir')), ] vala_args = [ @@ -118,7 +120,15 @@ endif if dep_gtk4.version() == 'unknown' or dep_gtk4.version().version_compare('>=4.8') vala_args += ['-D', 'GTK_4_8'] endif -exe_dino = executable('dino', sources, c_args: c_args, vala_args: vala_args, dependencies: dependencies, install: true) + +link_args = [] +if host_machine.system() == 'windows' + link_args += ['-Wl,--export-all-symbols'] + windows = import('windows') + sources += windows.compile_resources('dino-info.rc') +endif + +exe_dino = executable('dino', sources, c_args: c_args, vala_args: vala_args, dependencies: dependencies, install: true, link_args: link_args) install_data('data/icons/scalable/apps/im.dino.Dino-symbolic.svg', install_dir: get_option('datadir') / 'hicolor/symbolic/apps') install_data('data/icons/scalable/apps/im.dino.Dino.svg', install_dir: get_option('datadir') / 'hicolor/scalable/apps') diff --git a/meson.build b/meson.build index f3372953..aabf9c21 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -project('xmpp-vala', 'c', 'cpp', 'vala') +project('xmpp-vala', 'c', 'cpp', 'vala', version:'0.1') fs = import('fs') gnome = import('gnome') @@ -12,6 +12,7 @@ python = import('python') # On Windows, it's always required because we need it for glib-networking. if host_machine.system() == 'windows' plugin_crypto = true + add_project_arguments('-D', '_WIN32', language: 'vala') else plugin_crypto = get_option('plugin-ice') foreach plugin : ['plugin-ice', 'plugin-omemo', 'plugin-rtp'] diff --git a/xmpp-vala/meson.build b/xmpp-vala/meson.build index be5e96a8..0b92be99 100644 --- a/xmpp-vala/meson.build +++ b/xmpp-vala/meson.build @@ -132,7 +132,7 @@ c_args = [ vala_args = [ '--vapidir', meson.current_source_dir() / 'vapi', ] -lib_xmpp_vala = library('xmpp-vala', sources, c_args: c_args, vala_args: vala_args, dependencies: dependencies, version: '0.1', install: true, install_dir: [true, true, true]) +lib_xmpp_vala = library('xmpp-vala', sources, c_args: c_args, vala_args: vala_args, dependencies: dependencies, version: meson.project_version(), install: true, install_dir: [true, true, true]) dep_xmpp_vala = declare_dependency(link_with: lib_xmpp_vala, include_directories: include_directories('.')) install_data('xmpp-vala.deps', install_dir: get_option('datadir') / 'vala/vapi') # TODO: workaround for https://github.com/mesonbuild/meson/issues/9756