Skip to content

Commit

Permalink
Include data files in meson build (#81)
Browse files Browse the repository at this point in the history
- Add icons, desktop files and schema files
  using meson
- Update test script
  • Loading branch information
hsbasu authored Oct 18, 2024
1 parent 68fa232 commit 3baeb16
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 26 deletions.
10 changes: 0 additions & 10 deletions data/applications/theme-manager.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'@[email protected]'),
install_dir: app_icon_dir,
)


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

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

# Install schema file
schema_file = i18n.merge_file(
input: 'org.mamolinux.theme-manager.gschema.xml.in',
output: 'org.mamolinux.theme-manager.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
13 changes: 0 additions & 13 deletions data/schema/org.mamolinux.theme-manager.gschema.xml

This file was deleted.

1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ prefix = get_option('prefix')
bindir = get_option('bindir')
datadir = get_option('datadir')

subdir('data')
subdir('src')

gnome.post_install(
Expand Down
6 changes: 3 additions & 3 deletions test/test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
rm -rf builddir
meson setup -Dprefix=$HOME/.local builddir
meson compile -C builddir --verbose
meson install -C builddir --dry-run
# theme-manager -V
# ninja uninstall -C builddir
meson install -C builddir # --dry-run
theme-manager -V
ninja uninstall -C builddir

0 comments on commit 3baeb16

Please sign in to comment.