[file-roller] build: Format meson files



commit 385d55ffe1172d0e03bed0f8546534365f86fdfa
Author: Jan Tojnar <jtojnar gmail com>
Date:   Sat Sep 17 12:22:31 2022 +0200

    build: Format meson files
    
    Ran the following with some manual clean-ups.
    
    for f in (fd meson.build) meson_options.txt
      muon fmt -i -c muon_fmt.ini "$f"
    end

 data/icons/meson.build   |   2 +-
 data/meson.build         |  74 +++++++++++++++++-------------
 help/meson.build         |  13 +++---
 meson.build              |  44 +++++++++---------
 meson_options.txt        |  83 +++++++++++++++++++---------------
 muon_fmt.ini             |   2 +
 nautilus/meson.build     |  25 ++++++-----
 po/meson.build           |   5 ++-
 src/commands/meson.build |  18 ++++----
 src/meson.build          | 115 ++++++++++++++++++++++++++---------------------
 src/sh/meson.build       |   2 +-
 11 files changed, 213 insertions(+), 170 deletions(-)
---
diff --git a/data/icons/meson.build b/data/icons/meson.build
index 6ce89866..c86d9ed1 100644
--- a/data/icons/meson.build
+++ b/data/icons/meson.build
@@ -1 +1 @@
-install_subdir('hicolor', install_dir : join_paths(datadir, 'icons'))
+install_subdir('hicolor', install_dir: join_paths(datadir, 'icons'))
diff --git a/data/meson.build b/data/meson.build
index 54adbd86..099d1082 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -1,62 +1,72 @@
 po_dir = join_paths(meson.project_source_root(), 'po')
 
-install_data('org.gnome.FileRoller.gschema.xml',
-  install_dir : join_paths(datadir, 'glib-2.0', 'schemas')
+install_data(
+  'org.gnome.FileRoller.gschema.xml',
+  install_dir: join_paths(datadir, 'glib-2.0', 'schemas'),
 )
 
-install_data('packages.match',
-  install_dir : join_paths(datadir, meson.project_name())
+install_data(
+  'packages.match',
+  install_dir: join_paths(datadir, meson.project_name()),
 )
 
 # .desktop file
 
-desktop_in_file = custom_target('org.gnome.FileRoller.desktop.in',
-  input : [ 'supported-mime-types', 'org.gnome.FileRoller.desktop.in.in' ],
-  output : 'org.gnome.FileRoller.desktop.in',
-  command : [ find_program('python3'), files('set-mime-type-entry.py'), '@INPUT@' ],
+desktop_in_file = custom_target(
+  'org.gnome.FileRoller.desktop.in',
+  input: [
+    'supported-mime-types',
+    'org.gnome.FileRoller.desktop.in.in',
+  ],
+  output: 'org.gnome.FileRoller.desktop.in',
+  command: [
+    find_program('python3'),
+    files('set-mime-type-entry.py'),
+    '@INPUT@',
+  ],
   capture: true,
-  install : false
+  install: false,
 )
 
 i18n.merge_file(
-  input : desktop_in_file,
-  output : 'org.gnome.FileRoller.desktop',
-  type : 'desktop',
-  po_dir : po_dir,
-  install : true,
-  install_dir : join_paths(datadir, 'applications')
+  input: desktop_in_file,
+  output: 'org.gnome.FileRoller.desktop',
+  type: 'desktop',
+  po_dir: po_dir,
+  install: true,
+  install_dir: join_paths(datadir, 'applications'),
 )
 
 # .service files
 
 service_data = configuration_data()
-service_data.set('bindir', join_paths(prefix, get_option('bindir'))) 
+service_data.set('bindir', join_paths(prefix, get_option('bindir')))
 
 configure_file(
-  input : 'org.gnome.FileRoller.service.in',
-  output : 'org.gnome.FileRoller.service',
-  configuration : service_data,
-  install : true,
-  install_dir : join_paths(datadir, 'dbus-1/services')
+  input: 'org.gnome.FileRoller.service.in',
+  output: 'org.gnome.FileRoller.service',
+  configuration: service_data,
+  install: true,
+  install_dir: join_paths(datadir, 'dbus-1/services'),
 )
 
 configure_file(
-  input : 'org.gnome.ArchiveManager1.service.in',
-  output : 'org.gnome.ArchiveManager1.service',
-  configuration : service_data,
-  install : true,
-  install_dir : join_paths(datadir, 'dbus-1/services')
+  input: 'org.gnome.ArchiveManager1.service.in',
+  output: 'org.gnome.ArchiveManager1.service',
+  configuration: service_data,
+  install: true,
+  install_dir: join_paths(datadir, 'dbus-1/services'),
 )
 
 # .appdata file
 
 i18n.merge_file(
-  input : 'org.gnome.FileRoller.appdata.xml.in',
-  output : 'org.gnome.FileRoller.appdata.xml',
-  type : 'xml',
-  po_dir : po_dir,
-  install : true,
-  install_dir : join_paths(datadir, 'metainfo')
+  input: 'org.gnome.FileRoller.appdata.xml.in',
+  output: 'org.gnome.FileRoller.appdata.xml',
+  type: 'xml',
+  po_dir: po_dir,
+  install: true,
+  install_dir: join_paths(datadir, 'metainfo'),
 )
 
 # Subdirectories
diff --git a/help/meson.build b/help/meson.build
index bd42ee1c..a0297147 100644
--- a/help/meson.build
+++ b/help/meson.build
@@ -1,5 +1,6 @@
-gnome.yelp('file-roller',
-  sources : [
+gnome.yelp(
+  'file-roller',
+  sources: [
     'archive-create.page',
     'archive-edit.page',
     'archive-extract.page',
@@ -14,9 +15,9 @@ gnome.yelp('file-roller',
     'supported-formats.page',
     'test-integrity.page',
     'troubleshooting-archive-open.page',
-    'troubleshooting-password.page'
+    'troubleshooting-password.page',
+  ],
+  media: [
+    'figures/org.gnome.FileRoller.svg',
   ],
-  media : [
-    'figures/org.gnome.FileRoller.svg'
-  ]
 )
diff --git a/meson.build b/meson.build
index 6d7a1135..07bf97c7 100644
--- a/meson.build
+++ b/meson.build
@@ -1,7 +1,9 @@
-project('file-roller', 'c',
-  license : 'GPL2+',
-  version : '43.alpha',
-  meson_version : '>=0.59'
+project(
+  'file-roller',
+  'c',
+  license: 'GPL2+',
+  version: '43.alpha',
+  meson_version: '>=0.59',
 )
 
 glib_version = '>=2.38'
@@ -27,9 +29,9 @@ use_native_appchooser = get_option('use_native_appchooser')
 
 libm_dep = c_comp.find_library('m')
 thread_dep = dependency('threads')
-glib_dep = dependency('glib-2.0', version : glib_version)
+glib_dep = dependency('glib-2.0', version: glib_version)
 gthread_dep = dependency('gthread-2.0')
-gtk_dep = dependency('gtk+-3.0', version : gtk_version)
+gtk_dep = dependency('gtk+-3.0', version: gtk_version)
 hdy_dep = dependency('libhandy-1', version: hdy_version)
 libportal_dep = dependency('libportal', version: '>= 0.5', required: use_native_appchooser)
 libportal_gtk3_dep = dependency('libportal-gtk3', version: '>= 0.5', required: use_native_appchooser)
@@ -37,18 +39,18 @@ libportal_gtk3_dep = dependency('libportal-gtk3', version: '>= 0.5', required: u
 # Optional dependencies
 gobject_introspection_dep = dependency('gobject-introspection-1.0', required: get_option('introspection'))
 
-libnautilus_extension_dep = dependency('libnautilus-extension-4', version : nautilus_version, required : 
get_option('nautilus-actions'))
+libnautilus_extension_dep = dependency('libnautilus-extension-4', version: nautilus_version, required: 
get_option('nautilus-actions'))
 build_nautilus_actions = libnautilus_extension_dep.found()
 
-libjson_glib_dep = dependency('json-glib-1.0', version : json_glib_version, required : false)
+libjson_glib_dep = dependency('json-glib-1.0', version: json_glib_version, required: false)
 use_json_glib = libjson_glib_dep.found()
 
-libarchive_dep = dependency('libarchive', version : libarchive_version, required : get_option('libarchive'))
+libarchive_dep = dependency('libarchive', version: libarchive_version, required: get_option('libarchive'))
 use_libarchive = libarchive_dep.found()
 
 cpio_path = 'cpio'
 if get_option('cpio') == 'auto'
-  cpio = find_program('gcpio', 'cpio', required : false)
+  cpio = find_program('gcpio', 'cpio', required: false)
   if cpio.found()
     cpio_path = cpio.full_path()
   endif
@@ -82,9 +84,9 @@ if get_option('run-in-place')
   config_data.set_quoted('SHDIR', join_paths(meson.project_source_root(), 'src', 'sh'))
 else
   config_data.set_quoted('PRIVDATADIR', join_paths(datadir, meson.project_name()))
-  config_data.set_quoted('PRIVEXECDIR', privexecdir)  
+  config_data.set_quoted('PRIVEXECDIR', privexecdir)
   config_data.set_quoted('UIDIR', join_paths(datadir, meson.project_name(), 'ui'))
-  config_data.set_quoted('SHDIR', join_paths(prefix, get_option('libexecdir'), meson.project_name()))  
+  config_data.set_quoted('SHDIR', join_paths(prefix, get_option('libexecdir'), meson.project_name()))
 endif
 if build_introspection
   config_data.set('ENABLE_INTROSPECTION', 1)
@@ -103,26 +105,26 @@ if get_option('buildtype').contains('debug')
 endif
 config_data.set_quoted('CPIO_PATH', cpio_path)
 config_data.set('USE_NATIVE_APPCHOOSER', use_native_appchooser)
-config_file = configure_file(output : 'config.h', configuration : config_data)
+config_file = configure_file(output: 'config.h', configuration: config_data)
 config_inc = include_directories('.')
 
 # C args
 
-c_args = [ '-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_38' ]
+c_args = ['-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_38']
 if get_option('buildtype').contains('debug')
-  test_args = [ 
-    '-Wall', 
+  test_args = [
+    '-Wall',
     '-Wextra',
-    '-Wcast-align', 
+    '-Wcast-align',
     '-Wmissing-prototypes',
-    '-Wnested-externs', 
-    '-Wpointer-arith', 
+    '-Wnested-externs',
+    '-Wpointer-arith',
     '-Wformat-security',
     '-Wno-unused-parameter',
   ]
 else
-  c_args += [ '-Wno-deprecated-declarations' ]
-  test_args = [ '-Wall' ]
+  c_args += ['-Wno-deprecated-declarations']
+  test_args = ['-Wall']
 endif
 c_args += c_comp.get_supported_arguments(test_args)
 
diff --git a/meson_options.txt b/meson_options.txt
index ca5aff63..30b9d5f9 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,55 +1,64 @@
-option('run-in-place', 
-  type : 'boolean', 
-  value : false, 
-  description : 'Load ui data from the source tree'
+option(
+  'run-in-place',
+  type: 'boolean',
+  value: false,
+  description: 'Load ui data from the source tree',
 )
 
-option('nautilus-actions',
-  type : 'feature',
-  value : 'auto',
-  description : 'Build the nautilus context menu actions'
+option(
+  'nautilus-actions',
+  type: 'feature',
+  value: 'auto',
+  description: 'Build the nautilus context menu actions',
 )
 
-option('notification',
-  type : 'feature',
-  value : 'auto',
-  description : 'Enable operation completion notification'
+option(
+  'notification',
+  type: 'feature',
+  value: 'auto',
+  description: 'Enable operation completion notification',
 )
 
-option('use_native_appchooser',
-  type : 'boolean',
-  value : true,
-  description : '''Whether to use desktop environment’s native app chooser via
+option(
+  'use_native_appchooser',
+  type: 'boolean',
+  value: true,
+  description: '''Whether to use desktop environment’s native app chooser via
   XDG portal. Offers better desktop integration but ‘Open with…’ dialogue will
-  ask for each file individually, when opening multiple files.'''
+  ask for each file individually, when opening multiple files.''',
 )
 
-option('packagekit',
-  type : 'boolean', 
-  value : true, 
-  description : 'Build PackageKit installer for missing utilities'
+option(
+  'packagekit',
+  type: 'boolean',
+  value: true,
+  description: 'Build PackageKit installer for missing utilities',
 )
 
-option('libarchive',
-  type : 'feature',
-  value : 'auto',
-  description : 'Enable code that requires libarchive'
+option(
+  'libarchive',
+  type: 'feature',
+  value: 'auto',
+  description: 'Enable code that requires libarchive',
 )
 
-option('cpio',
-  type : 'string',
-  value : 'auto',
-  description : 'Path to the cpio program'
+option(
+  'cpio',
+  type: 'string',
+  value: 'auto',
+  description: 'Path to the cpio program',
 )
 
-option('introspection',
-  type : 'feature',
-  value : 'disabled',
-  description : 'Generate introspection data for the executable (e.g. for static analysis and API docs)'
+option(
+  'introspection',
+  type: 'feature',
+  value: 'disabled',
+  description: 'Generate introspection data for the executable (e.g. for static analysis and API docs)',
 )
 
-option('api_docs',
-  type : 'feature',
-  value : 'disabled',
-  description : 'Use gi-docgen to build API documentation (only useful for people developing File Roller)'
+option(
+  'api_docs',
+  type: 'feature',
+  value: 'disabled',
+  description: 'Use gi-docgen to build API documentation (only useful for people developing File Roller)',
 )
diff --git a/muon_fmt.ini b/muon_fmt.ini
new file mode 100644
index 00000000..ed61b2e2
--- /dev/null
+++ b/muon_fmt.ini
@@ -0,0 +1,2 @@
+max_line_len=144
+indent_by='  '
diff --git a/nautilus/meson.build b/nautilus/meson.build
index b31cd16e..fe14555b 100644
--- a/nautilus/meson.build
+++ b/nautilus/meson.build
@@ -1,18 +1,19 @@
-shared_module('nautilus-fileroller', 
-  sources : [
+shared_module(
+  'nautilus-fileroller',
+  sources: [
     'nautilus-fileroller.c',
-    'fileroller-module.c'
+    'fileroller-module.c',
   ],
-  dependencies : [ 
-    libm_dep, 
+  dependencies: [
+    libm_dep,
     thread_dep,
-    glib_dep, 
-    gthread_dep, 
+    glib_dep,
+    gthread_dep,
     libnautilus_extension_dep,
     use_json_glib ? libjson_glib_dep : [],
-  ],  
-  include_directories : config_inc,
-  c_args : c_args,
-  install : true,
-  install_dir : libnautilus_extension_dep.get_variable('extensiondir', pkgconfig_define: ['libdir', libdir])
+  ],
+  include_directories: config_inc,
+  c_args: c_args,
+  install: true,
+  install_dir: libnautilus_extension_dep.get_variable('extensiondir', pkgconfig_define: ['libdir', libdir]),
 )
diff --git a/po/meson.build b/po/meson.build
index 5159141f..58501777 100644
--- a/po/meson.build
+++ b/po/meson.build
@@ -1 +1,4 @@
-i18n.gettext(gettext_package, preset : 'glib')
+i18n.gettext(
+  gettext_package,
+  preset: 'glib',
+)
diff --git a/src/commands/meson.build b/src/commands/meson.build
index 6b6d3ea7..d2cc0132 100644
--- a/src/commands/meson.build
+++ b/src/commands/meson.build
@@ -1,10 +1,12 @@
-executable('rpm2cpio', 'rpm2cpio.c',
-  dependencies : [ 
-    libm_dep, 
-    glib_dep 
+executable(
+  'rpm2cpio',
+  'rpm2cpio.c',
+  dependencies: [
+    libm_dep,
+    glib_dep,
   ],
-  include_directories : config_inc,
-  c_args : c_args,
-  install : true,
-  install_dir : privexecdir
+  include_directories: config_inc,
+  c_args: c_args,
+  install: true,
+  install_dir: privexecdir,
 )
diff --git a/src/meson.build b/src/meson.build
index 335e1b9b..c4357269 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -54,7 +54,7 @@ source_files = files(
   'main.c',
   'open-file.c',
   'preferences.c',
-  'rar-utils.c'
+  'rar-utils.c',
 )
 
 fr_headers = files(
@@ -95,48 +95,60 @@ fr_headers = files(
 )
 
 if libjson_glib_dep.found()
-  source_files += [ 'fr-command-unarchiver.c' ]
-  fr_headers += [ 'fr-command-unarchiver.h' ]
+  source_files += ['fr-command-unarchiver.c']
+  fr_headers += ['fr-command-unarchiver.h']
 endif
 if use_libarchive
-  source_files += [ 'fr-archive-libarchive.c' ]
-  fr_headers += [ 'fr-archive-libarchive.h' ]
-endif 
+  source_files += ['fr-archive-libarchive.c']
+  fr_headers += ['fr-archive-libarchive.h']
+endif
 
-gresource_files = gnome.compile_resources('fr-resources', 'file-roller.gresource.xml', c_name : 'fr')
+gresource_files = gnome.compile_resources(
+  'fr-resources',
+  'file-roller.gresource.xml',
+  c_name: 'fr',
+)
 
-marshal_files = gnome.genmarshal('fr-marshal', prefix : 'fr_marshal', sources : 'fr-marshal.list' )
+marshal_files = gnome.genmarshal(
+  'fr-marshal',
+  prefix: 'fr_marshal',
+  sources: 'fr-marshal.list',
+)
 
-enum_files = gnome.mkenums_simple('fr-enum-types', 
-  sources: [ 'typedefs.h' ]
+enum_files = gnome.mkenums_simple(
+  'fr-enum-types',
+  sources: [
+    'typedefs.h',
+  ],
 )
 
 # Build targets
 
-fr_exe = executable('file-roller',
-  sources : [ 
-    config_file, 
-    source_files, 
-    gresource_files, 
+fr_exe = executable(
+  'file-roller',
+  sources: [
+    config_file,
+    source_files,
+    gresource_files,
     marshal_files,
-    enum_files
-  ],     
-  dependencies : [ 
-    libm_dep, 
+    enum_files,
+  ],
+  dependencies: [
+    libm_dep,
     thread_dep,
-    glib_dep, 
-    gthread_dep, 
-    gtk_dep, 
+    glib_dep,
+    gthread_dep,
+    gtk_dep,
     hdy_dep,
     use_native_appchooser ? libportal_dep : [],
     use_native_appchooser ? libportal_gtk3_dep : [],
     build_introspection ? gobject_introspection_dep : [],
     use_json_glib ? libjson_glib_dep : [],
-    use_libarchive ? libarchive_dep : []
+    use_libarchive ? libarchive_dep : [],
   ],
-  include_directories : config_inc,
-  c_args : c_args,
-  install : true,
+  include_directories: config_inc,
+  c_args: c_args,
+  install: true,
   # Required for GIRepository to be able to dump symbols.
   export_dynamic: build_introspection,
 )
@@ -153,7 +165,7 @@ if build_introspection
     namespace: 'FileRoller',
     nsversion: '1.0',
     identifier_prefix: 'Fr',
-    includes : [
+    includes: [
       'Gio-2.0',
       'GObject-2.0',
       'Gtk-3.0',
@@ -161,36 +173,37 @@ if build_introspection
   )
 endif
 
-executable('test-server', 'test-server.c',
-  dependencies : [ 
-    libm_dep, 
+executable(
+  'test-server',
+  'test-server.c',
+  dependencies: [
+    libm_dep,
     thread_dep,
-    glib_dep, 
-    gthread_dep, 
-    gtk_dep, 
-    use_json_glib ? libjson_glib_dep : []
-  ],  
-  include_directories : config_inc,
-  c_args : c_args,
-  install : false
+    glib_dep,
+    gthread_dep,
+    gtk_dep,
+    use_json_glib ? libjson_glib_dep : [],
+  ],
+  include_directories: config_inc,
+  c_args: c_args,
+  install: false,
 )
 
-test('safe-path', 
-  executable('test-safe-path',
-    sources : [ 
-      'test-safe-path.c', 
-      'glib-utils.c'
-    ],
-    dependencies : [ 
-      libm_dep, 
+test(
+  'safe-path',
+  executable(
+    'test-safe-path',
+    sources: ['test-safe-path.c', 'glib-utils.c'],
+    dependencies: [
+      libm_dep,
       thread_dep,
-      glib_dep, 
+      glib_dep,
       gthread_dep,
-      gtk_dep, 
+      gtk_dep,
     ],
-    include_directories : config_inc,
-    c_args : c_args,
-  )
+    include_directories: config_inc,
+    c_args: c_args,
+  ),
 )
 
 # Subdirectories
diff --git a/src/sh/meson.build b/src/sh/meson.build
index 5c7c45d5..8cbd7c37 100644
--- a/src/sh/meson.build
+++ b/src/sh/meson.build
@@ -1 +1 @@
-install_data('isoinfo.sh', install_dir : privexecdir)
+install_data('isoinfo.sh', install_dir: privexecdir)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]