Skip to content

Commit

Permalink
Include data files in meson build (#57)
Browse files Browse the repository at this point in the history
- Add icons, desktop files and schema files
  using meson
- Update ci build
  • Loading branch information
hsbasu authored Oct 18, 2024
1 parent fafe87b commit f3b3822
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ jobs:

- name: install-deps
run: |
sudo apt install acpi gobject-introspection gir1.2-appindicator3-0.1 gir1.2-gtk-3.0 \
gir1.2-notify-0.7 libappindicator3-1 python3 python3-configobj python3-gi python3-setproctitle \
python3-tldextract
sudo apt install acpi gobject-introspection gir1.2-appindicator3-0.1 \
gir1.2-gtk-3.0 gir1.2-notify-0.7 libappindicator3-1 meson python3 \
python3-configobj python3-gi python3-setproctitle python3-tldextract
- name: make
run: ./test/test -qq
10 changes: 0 additions & 10 deletions data/applications/battery-monitor.desktop

This file was deleted.

52 changes: 52 additions & 0 deletions data/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
autostart_dir = join_paths(get_option('sysconfdir'), 'autostart')
desktop_dir = join_paths(datadir, 'applications')
app_icon_dir = join_paths(datadir, 'icons', 'hicolor', 'scalable', 'apps')
schema_dir = join_paths(datadir, 'glib-2.0', 'schemas')
message(f'Autostart dir: @autostart_dir@')
message(f'Desktop file dir: @desktop_dir@')
message(f'Icon dir: @app_icon_dir@')
message(f'Schema dir: @schema_dir@')

# install icon
install_emptydir(app_icon_dir)
install_data(
join_paths(meson.current_source_dir(), 'icons', f'@application_id@.svg'),
install_dir: app_icon_dir,
)


# Install desktop file
desktop_file = i18n.merge_file(
input: 'battery-monitor.desktop.in',
output: 'battery-monitor.desktop',
type: 'desktop',
po_dir: '../po',
install: true,
install_dir: desktop_dir
)

# autostart_file = i18n.merge_file(
# input: 'battery-monitor-autostart.desktop.in',
# output: 'battery-monitor-autostart.desktop',
# type: 'desktop',
# po_dir: '../po',
# install: true,
# install_dir: autostart_dir
# )

# Install schema file
schema_file = i18n.merge_file(
input: 'org.mamolinux.battery-monitor.gschema.xml.in',
output: 'org.mamolinux.battery-monitor.gschema.xml',
type: 'xml',
po_dir: '../po',
install: true,
install_dir: schema_dir
)

compile_schemas = find_program('glib-compile-schemas', required: false)
if compile_schemas.found()
test('Validate schema file',
compile_schemas,
args: ['--strict', '--dry-run', meson.current_source_dir()])
endif
5 changes: 0 additions & 5 deletions data/org.mamolinux.battery-monitor.gschema.xml

This file was deleted.

0 comments on commit f3b3822

Please sign in to comment.