meson.build (2812B)
1 # 2 # This file is part of GNUnet. 3 # Copyright (C) 2023--2024 GNUnet e.V. 4 # 5 # GNUnet is free software: you can redistribute it and/or modify it 6 # under the terms of the GNU Affero General Public License as published 7 # by the Free Software Foundation, either version 3 of the License, 8 # or (at your option) any later version. 9 # 10 # GNUnet is distributed in the hope that it will be useful, but 11 # WITHOUT ANY WARRANTY; without even the implied warranty of 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 # Affero General Public License for more details. 14 # 15 # You should have received a copy of the GNU Affero General Public License 16 # along with this program. If not, see <http://www.gnu.org/licenses/>. 17 # 18 # SPDX-License-Identifier: AGPL3.0-or-later 19 # 20 21 project( 22 'messenger-gtk', 23 'c', 24 license: 'AGPL3.0-or-later', 25 version: run_command('contrib/get_version.sh').stdout().strip(), 26 meson_version: '>= 1.1.0', 27 default_options: [ 28 'use_libportal=true', 29 'use_eventfd=true' 30 ] 31 ) 32 33 meson.add_dist_script('contrib/distribute_version.sh', meson.project_version()) 34 35 use_libportal = get_option('use_libportal') 36 use_eventfd = get_option('use_eventfd') 37 38 messenger_gtk_id = 'org.gnunet.Messenger' 39 40 gnome = import('gnome') 41 42 src_resources = include_directories('src', 'resources') 43 44 subdir('submodules') 45 46 messenger_gtk_deps = [ 47 dependency('gnunetchat'), 48 dependency('gnunetutil'), 49 dependency('glib-2.0'), 50 dependency('gtk+-3.0'), 51 dependency('libhandy-1'), 52 dependency('gstreamer-1.0'), 53 dependency('gstreamer-rtp-1.0'), 54 dependency('libnotify'), 55 dependency('libqrencode'), 56 dependency('libpipewire-0.3'), 57 dependency('libsecret-1'), 58 declare_dependency(link_args: '-lunistring'), 59 ] 60 61 messenger_gtk_args = [ 62 '-DENABLE_NLS=1', 63 '-DMESSENGER_APPLICATION_BINARY="@0@"'.format(meson.project_name()), 64 '-DMESSENGER_APPLICATION_ID="@0@"'.format(messenger_gtk_id), 65 '-DMESSENGER_APPLICATION_VERSION="@0@"'.format(meson.project_version()), 66 ] 67 68 if use_libportal 69 messenger_gtk_deps += [ 70 dependency('libportal'), 71 dependency('libportal-gtk3'), 72 ] 73 else 74 messenger_gtk_args += [ 75 '-DMESSENGER_APPLICATION_NO_PORTAL=1', 76 ] 77 endif 78 79 if use_eventfd 80 else 81 messenger_gtk_args += [ 82 '-DMESSENGER_APPLICATION_NO_EVENT_FD=1', 83 ] 84 endif 85 86 subdir('po') 87 subdir('resources') 88 subdir('src') 89 90 messenger_gtk_exec = executable( 91 meson.project_name(), 92 messenger_gtk_resources + messenger_gtk_sources, 93 c_args: messenger_gtk_args, 94 install: true, 95 dependencies: messenger_gtk_deps, 96 extra_files: submodules_headers, 97 include_directories: [ 98 src_resources, 99 submodules_includes, 100 ], 101 ) 102 103 gnome.post_install( 104 gtk_update_icon_cache: true, 105 update_desktop_database: true, 106 )