From 6355921998356f781d9229adf0094fe6cc9e2618 Mon Sep 17 00:00:00 2001 From: Cassidy James Blaede Date: Fri, 24 May 2024 14:45:06 -0600 Subject: [PATCH] More 3.2.0 and translations prep --- .../flatpak/com.cassidyjames.plausible.json | 26 +++++++++++++++++ build-aux/meson/post_install.py | 29 ++++++------------- com.cassidyjames.plausible.json | 26 ----------------- data/metainfo.xml | 2 ++ meson.build | 19 ++++++++---- 5 files changed, 50 insertions(+), 52 deletions(-) create mode 100644 build-aux/flatpak/com.cassidyjames.plausible.json delete mode 100644 com.cassidyjames.plausible.json diff --git a/build-aux/flatpak/com.cassidyjames.plausible.json b/build-aux/flatpak/com.cassidyjames.plausible.json new file mode 100644 index 0000000..cc48e48 --- /dev/null +++ b/build-aux/flatpak/com.cassidyjames.plausible.json @@ -0,0 +1,26 @@ +{ + "id": "com.cassidyjames.plausible", + "runtime": "org.gnome.Platform", + "runtime-version": "46", + "sdk": "org.gnome.Sdk", + "command": "com.cassidyjames.plausible", + "finish-args": [ + "--socket=wayland", + "--socket=fallback-x11", + "--share=ipc", + "--share=network", + "--device=dri" + ], + "modules": [ + { + "name": "tally", + "buildsystem": "meson", + "sources": [ + { + "type": "dir", + "path": "." + } + ] + } + ] +} diff --git a/build-aux/meson/post_install.py b/build-aux/meson/post_install.py index 6291b88..3b90a5c 100644 --- a/build-aux/meson/post_install.py +++ b/build-aux/meson/post_install.py @@ -3,23 +3,12 @@ import os import subprocess -prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr/local') -datadir = os.path.join(prefix, 'share') -schemadir = os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share', 'glib-2.0', 'schemas') - -# Packaging tools define DESTDIR and this isn't needed for them -if 'DESTDIR' not in os.environ: - print('Updating icon cache...') - icon_cache_dir = os.path.join(datadir, 'icons', 'hicolor') - if not os.path.exists(icon_cache_dir): - os.makedirs(icon_cache_dir) - subprocess.call(['gtk-update-icon-cache', '-qtf', icon_cache_dir]) - - print('Updating desktop database...') - desktop_database_dir = os.path.join(datadir, 'applications') - if not os.path.exists(desktop_database_dir): - os.makedirs(desktop_database_dir) - subprocess.call(['update-desktop-database', '-q', desktop_database_dir]) - - print('Compiling gsettings schemas...') - subprocess.call(['glib-compile-schemas', schemadir]) +print('Compiling gsettings schemas…') +subprocess.call([ + 'glib-compile-schemas', + os.path.join( + os.environ['MESON_INSTALL_PREFIX'], + 'share', + 'glib-2.0', + 'schemas') +]) diff --git a/com.cassidyjames.plausible.json b/com.cassidyjames.plausible.json deleted file mode 100644 index 9c691a8..0000000 --- a/com.cassidyjames.plausible.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "app-id" : "com.cassidyjames.plausible", - "runtime" : "org.gnome.Platform", - "runtime-version" : "46", - "sdk" : "org.gnome.Sdk", - "command" : "com.cassidyjames.plausible", - "finish-args" : [ - "--socket=wayland", - "--socket=fallback-x11", - "--share=ipc", - "--share=network", - "--device=dri" - ], - "modules" : [ - { - "name" : "tally", - "buildsystem" : "meson", - "sources" : [ - { - "type" : "dir", - "path" : "." - } - ] - } - ] -} diff --git a/data/metainfo.xml b/data/metainfo.xml index f372618..2b094f1 100644 --- a/data/metainfo.xml +++ b/data/metainfo.xml @@ -46,6 +46,8 @@ diff --git a/meson.build b/meson.build index 7f7fc40..b5d231b 100644 --- a/meson.build +++ b/meson.build @@ -1,9 +1,11 @@ project( 'com.cassidyjames.plausible', 'vala', 'c', - version: '3.2.0' + version: '3.2.0', + meson_version: '>= 0.62', ) +i18n = import('i18n') gnome = import('gnome') add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()), language:'c') @@ -11,7 +13,8 @@ add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()), lan asresources = gnome.compile_resources( 'as-resources', 'data' / 'gresource.xml', - source_dir: 'data' + source_dir: 'data', + c_name: 'as', ) config_data = configuration_data() @@ -22,7 +25,7 @@ config_data.set_quoted('VERSION', meson.project_version()) config_file = configure_file( input: 'src/Config.vala.in', output: '@BASENAME@', - configuration: config_data + configuration: config_data, ) executable( @@ -35,13 +38,17 @@ executable( dependencies: [ dependency('glib-2.0'), dependency('gtk4'), - dependency('libadwaita-1'), + dependency('libadwaita-1', version: '>=1.5'), dependency('webkitgtk-6.0'), meson.get_compiler('vala').find_library('posix'), ], - install: true + install: true, ) subdir('data') -meson.add_install_script('build-aux' / 'meson'/ 'post_install.py') +gnome.post_install( + glib_compile_schemas: true, + gtk_update_icon_cache: true, + update_desktop_database: true, +)