summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorPatrick Griffis <pgriffis@igalia.com>2021-07-13 11:12:22 -0500
committerPatrick Griffis <pgriffis@igalia.com>2021-07-13 11:26:59 -0500
commitcbb0927a7a9113d3b6b772e7b0566752dd54e6dd (patch)
treecae52705307854fdf61f863f9c019f1e1fc81102
parent25440a07c3b421134b4376d7db3ee4b7ed57ad98 (diff)
build: Misc cleanup of options
Cleanup of option names, use features where applicable, and printing
of summary.
-rw-r--r--.github/workflows/ubuntu-build.yml5
-rw-r--r--data/meson.build6
-rw-r--r--data/misc/meson.build12
-rw-r--r--meson.build49
-rw-r--r--meson_options.txt33
-rw-r--r--src/common/dbus/meson.build2
-rw-r--r--src/common/meson.build11
-rw-r--r--src/fe-gtk/meson.build6
-rw-r--r--src/meson.build6
9 files changed, 83 insertions, 47 deletions
diff --git a/.github/workflows/ubuntu-build.yml b/.github/workflows/ubuntu-build.yml
index fdeb9b00..cf5a60c1 100644
--- a/.github/workflows/ubuntu-build.yml
+++ b/.github/workflows/ubuntu-build.yml
@@ -10,10 +10,11 @@ jobs:
       - name: Install Dependencies
         run: |
           sudo apt-get update
-          sudo apt-get install -y meson libcanberra-dev libdbus-glib-1-dev libglib2.0-dev libgtk2.0-dev libluajit-5.1-dev libnotify-dev libpci-dev libperl-dev libproxy-dev libssl-dev python3-dev python3-cffi mono-devel desktop-file-utils
+          sudo apt-get install -y python3-setuptools python3-pip libcanberra-dev libdbus-glib-1-dev libglib2.0-dev libgtk2.0-dev libluajit-5.1-dev libnotify-dev libpci-dev libperl-dev libproxy-dev libssl-dev python3-dev python3-cffi mono-devel desktop-file-utils
+          sudo pip3 install meson
 
       - name: Configure
-        run: meson build -Dwith-text=true -Dwith-theme-manager=true
+        run: meson build -Dtext=true -Dtheme-manager=true -Dauto_features=enabled
 
       - name: Build
         run: ninja -C build
diff --git a/data/meson.build b/data/meson.build
index b905c314..6c6b1a9c 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -1,11 +1,11 @@
-if get_option('with-plugin')
+if get_option('plugin')
   subdir('pkgconfig')
 endif
 
-if get_option('with-gtk')
+if get_option('gtk-frontend')
   subdir('icons')
   subdir('misc')
   subdir('man')
-elif get_option('with-theme-manager')
+elif get_option('theme-manager')
   subdir('misc')
 endif
diff --git a/data/misc/meson.build b/data/misc/meson.build
index f7f1c27f..2abf3075 100644
--- a/data/misc/meson.build
+++ b/data/misc/meson.build
@@ -2,8 +2,8 @@ appdir = join_paths(get_option('datadir'), 'applications')
 metainfodir = join_paths(get_option('datadir'), 'metainfo')
 desktop_utils = find_program('desktop-file-validate', required: false)
 
-if get_option('with-gtk')
-  if get_option('with-appdata')
+if get_option('gtk-frontend')
+  if get_option('install-appdata')
     hexchat_appdata = i18n.merge_file(
       input: 'io.github.Hexchat.appdata.xml.in',
       output: 'io.github.Hexchat.appdata.xml',
@@ -21,7 +21,7 @@ if get_option('with-gtk')
   endif
 
   desktop_conf = configuration_data()
-  if get_option('with-dbus')
+  if dbus_glib_dep.found()
     desktop_conf.set('exec_command', 'hexchat --existing %U')
   else
     desktop_conf.set('exec_command', 'hexchat %U')
@@ -49,7 +49,7 @@ if get_option('with-gtk')
   endif
 endif
 
-if get_option('with-theme-manager')
+if get_option('theme-manager')
   htm_desktop = i18n.merge_file(
     input: 'io.github.Hexchat.ThemeManager.desktop.in',
     output: 'io.github.Hexchat.ThemeManager.desktop',
@@ -70,7 +70,7 @@ if get_option('with-theme-manager')
   )
 endif
 
-if get_option('with-plugin') and get_option('with-appdata')
+if get_option('plugin')
   plugin_metainfo = []
 
   # FIXME: These should all get translated somewhere
@@ -124,4 +124,4 @@ if get_option('with-plugin') and get_option('with-appdata')
       install_dir: get_option('install-plugin-metainfo') ? metainfodir : '',
     )
   endforeach
-endif
\ No newline at end of file
+endif
diff --git a/meson.build b/meson.build
index 0f5faca8..7a29fd23 100644
--- a/meson.build
+++ b/meson.build
@@ -1,6 +1,6 @@
 project('hexchat', 'c',
   version: '2.14.3',
-  meson_version: '>= 0.40.0',
+  meson_version: '>= 0.47.0',
   default_options: [
     'c_std=gnu89',
     'buildtype=debugoptimized',
@@ -15,12 +15,18 @@ cc = meson.get_compiler('c')
 
 libgio_dep = dependency('gio-2.0', version: '>= 2.34.0')
 libgmodule_dep = dependency('gmodule-2.0')
+
+libcanberra_dep = dependency('libcanberra', version: '>= 0.22',
+                             required: get_option('libcanberra'))
+dbus_glib_dep = dependency('dbus-glib-1', required: get_option('dbus'))
+libnotify_dep = dependency('libnotify', required: get_option('libnotify'))
+
 global_deps = []
 if cc.get_id() == 'msvc'
   libssl_dep = cc.find_library('libeay32')
 else
   libssl_dep = dependency('openssl', version: '>= 0.9.8',
-                          required: get_option('with-ssl'))
+                          required: get_option('tls'))
 endif
 
 config_h = configuration_data()
@@ -32,10 +38,10 @@ config_h.set_quoted('LOCALEDIR', join_paths(get_option('prefix'),
 config_h.set10('ENABLE_NLS', true)
 
 # Optional features
-config_h.set('USE_OPENSSL', get_option('with-ssl'))
-config_h.set('USE_LIBCANBERRA', get_option('with-libcanberra'))
-config_h.set('USE_DBUS', get_option('with-dbus'))
-config_h.set('USE_PLUGIN', get_option('with-plugin'))
+config_h.set('USE_OPENSSL', libssl_dep.found())
+config_h.set('USE_LIBCANBERRA', libcanberra_dep.found())
+config_h.set('USE_DBUS', dbus_glib_dep.found())
+config_h.set('USE_PLUGIN', get_option('plugin'))
 
 config_h.set('G_DISABLE_SINGLE_INCLUDES', true)
 config_h.set('GTK_DISABLE_DEPRECATED', true)
@@ -152,7 +158,7 @@ endforeach
 add_project_link_arguments(global_ldflags, language: 'c')
 
 subdir('src')
-if get_option('with-plugin')
+if get_option('plugin')
   subdir('plugins')
 endif
 if cc.get_id() != 'msvc'
@@ -160,6 +166,33 @@ if cc.get_id() != 'msvc'
   subdir('po') # FIXME: build xgettext
 
   meson.add_install_script('meson_post_install.py',
-    '@0@'.format(get_option('with-theme-manager'))
+    '@0@'.format(get_option('theme-manager'))
   )
 endif
+
+if meson.version().version_compare('>= 0.53.0')
+  summary({
+    'prefix': get_option('prefix'),
+    'bindir': get_option('bindir'),
+    'libdir': get_option('libdir'),
+    'datadir': get_option('datadir'),
+  }, section: 'Directories')
+
+  summary({
+    'TLS (openssl)': libssl_dep.found(),
+    'Plugin Support': get_option('plugin'),
+    'DBus Support': dbus_glib_dep.found(),
+    'libnotify': libnotify_dep.found(),
+    'libcanberra': libcanberra_dep.found(),
+  }, section: 'Features')
+
+  summary({
+    'Lua': get_option('with-lua'),
+    'Python': get_option('with-python'),
+    'Perl': get_option('with-perl'),
+    'Perl Legacy API': get_option('with-perl-legacy-api'),
+    'FiSH': get_option('with-fishlim'),
+    'Sysinfo': get_option('with-sysinfo'),
+    'DCC Checksum': get_option('with-checksum'),
+  }, section: 'Plugins')
+endif
diff --git a/meson_options.txt b/meson_options.txt
index ad03d6bc..58a8012a 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,33 +1,41 @@
-option('with-gtk', type: 'boolean',
+# Applications
+option('gtk-frontend', type: 'boolean',
   description: 'Main graphical interface'
 )
-option('with-text', type: 'boolean', value: false,
+option('text-frontend', type: 'boolean', value: false,
   description: 'Text interface (not generally useful)'
 )
-option('with-ssl', type: 'boolean',
+option('theme-manager', type: 'boolean', value: false,
+  description: 'Utility to help manage themes, requires mono/.net'
+)
+
+# Features
+option('tls', type: 'feature', value: 'enabled',
   description: 'Support for TLS connections, requires openssl'
 )
-option('with-plugin', type: 'boolean',
+option('plugin', type: 'boolean',
   description: 'Support for loadable plugins'
 )
-option('with-dbus', type: 'boolean',
+option('dbus', type: 'feature', value: 'auto',
   description: 'Support used for single-instance and scripting interface, Unix only'
 )
-option('with-libnotify', type: 'boolean',
+option('libnotify', type: 'feature', value: 'auto',
   description: 'Support for freedesktop notifications, Unix only'
 )
-option('with-libcanberra', type: 'boolean',
+option('libcanberra', type: 'feature', value: 'auto',
   description: 'Support for sound alerts, Unix only'
 )
-option('with-theme-manager', type: 'boolean', value: false,
-  description: 'Utility to help manage themes, requires mono/.net'
-)
+
+# Install options
 option('dbus-service-use-appid', type: 'boolean', value: false,
   description: 'Rename dbus service to match app-id, required for Flatpak'
 )
-option('with-appdata', type: 'boolean',
+option('install-appdata', type: 'boolean',
   description: 'Install appdata files for app stores'
 )
+option('install-plugin-metainfo', type: 'boolean', value: false,
+  description: 'Installs metainfo files for enabled plugins, useful when distros create split packages'
+)
 
 # Plugins
 option('with-checksum', type: 'boolean',
@@ -57,9 +65,6 @@ option('with-upd', type: 'boolean',
 option('with-winamp', type: 'boolean',
   description: 'Winamp plugin, Windows only'
 )
-option('install-plugin-metainfo', type: 'boolean', value: false,
-  description: 'Installs metainfo files for enabled plugins, useful when distros create split packages'
-)
 option('with-perl-legacy-api', type: 'boolean', value: false,
   description: 'Enables the legacy IRC perl module for compatibility with old scripts'
 )
diff --git a/src/common/dbus/meson.build b/src/common/dbus/meson.build
index 69066be0..856bbe55 100644
--- a/src/common/dbus/meson.build
+++ b/src/common/dbus/meson.build
@@ -1,5 +1,5 @@
 dbus_deps = [
-  dependency('dbus-glib-1')
+  dbus_glib_dep
 ]
 
 dbus_sources = [
diff --git a/src/common/meson.build b/src/common/meson.build
index 09491e84..6ca0f20c 100644
--- a/src/common/meson.build
+++ b/src/common/meson.build
@@ -28,6 +28,7 @@ common_sysinfo_deps = []
 
 common_deps = [
   libgio_dep,
+  libcanberra_dep,
 ] + global_deps
 
 common_includes = [
@@ -72,22 +73,18 @@ textevents = custom_target('textevents',
 #   SIGACTION
 #   HAVE_GTK_MAC
 
-if get_option('with-ssl')
+if libssl_dep.found()
   common_sources += 'ssl.c'
   common_deps += libssl_dep
 endif
 
-if get_option('with-libcanberra')
-  common_deps += dependency('libcanberra', version: '>= 0.22')
-endif
-
-if get_option('with-dbus')
+if dbus_glib_dep.found()
   subdir('dbus')
   common_deps += hexchat_dbus_dep
   common_includes += include_directories('dbus')
 endif
 
-if get_option('with-plugin')
+if get_option('plugin')
   common_deps += libgmodule_dep
   install_headers('hexchat-plugin.h')
 endif
diff --git a/src/fe-gtk/meson.build b/src/fe-gtk/meson.build
index 3dfc7427..020d2631 100644
--- a/src/fe-gtk/meson.build
+++ b/src/fe-gtk/meson.build
@@ -43,9 +43,9 @@ hexchat_gtk_cflags = []
 
 hexchat_gtk_ldflags = []
 
-if get_option('with-libnotify')
+if libnotify_dep.found()
   hexchat_gtk_sources += 'notifications/notification-libnotify.c'
-  hexchat_gtk_deps += dependency('libnotify')
+  hexchat_gtk_deps += libnotify_dep
 elif false # TODO HAVE_GTK_MAC
 elif host_machine.system() == 'windows'
   hexchat_gtk_sources += 'notifications/notification-windows.c'
@@ -69,7 +69,7 @@ if iso_codes.found()
                         join_paths(iso_codes_prefix, 'share/locale'))
 endif
 
-if get_option('with-plugin')
+if get_option('plugin')
   hexchat_gtk_sources += 'plugingui.c'
 endif
 
diff --git a/src/meson.build b/src/meson.build
index ff2c8871..23453ec1 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,13 +1,13 @@
 subdir('common')
 
-if get_option('with-gtk')
+if get_option('gtk-frontend')
   subdir('fe-gtk')
 endif
 
-if get_option('with-text')
+if get_option('text-frontend')
   subdir('fe-text')
 endif
 
-if get_option('with-theme-manager')
+if get_option('theme-manager')
   subdir('htm')
 endif