diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index efee5f1..1a3820a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,14 +34,14 @@ jobs: with: msystem: UCRT64 update: true - install: mingw-w64-ucrt-x86_64-gtk4 mingw-w64-ucrt-x86_64-libadwaita mingw-w64-ucrt-x86_64-python-gobject mingw-w64-ucrt-x86_64-python-yaml mingw-w64-ucrt-x86_64-python-requests mingw-w64-ucrt-x86_64-python-pillow mingw-w64-ucrt-x86_64-desktop-file-utils mingw-w64-ucrt-x86_64-ca-certificates mingw-w64-ucrt-x86_64-meson git + install: mingw-w64-ucrt-x86_64-gtk4 mingw-w64-ucrt-x86_64-libadwaita mingw-w64-ucrt-x86_64-python-gobject mingw-w64-ucrt-x86_64-python-yaml mingw-w64-ucrt-x86_64-python-requests mingw-w64-ucrt-x86_64-python-pillow mingw-w64-ucrt-x86_64-ca-certificates mingw-w64-ucrt-x86_64-meson git - name: Compile shell: msys2 {0} run: | meson setup _build ninja -C _build install - pacman --noconfirm -Rs mingw-w64-ucrt-x86_64-desktop-file-utils mingw-w64-ucrt-x86_64-meson git + pacman --noconfirm -Rs mingw-w64-ucrt-x86_64-meson git - name: Test shell: msys2 {0} diff --git a/data/meson.build b/data/meson.build index 5150b8e..7a467b1 100644 --- a/data/meson.build +++ b/data/meson.build @@ -22,43 +22,68 @@ gnome.compile_resources('cartridges', dependencies: blueprints, ) -desktop_file = i18n.merge_file( - input: configure_file( - input: 'page.kramo.Cartridges.desktop.in', - output: app_id + '.desktop.in', - configuration: conf - ), - output: app_id + '.desktop', - type: 'desktop', - po_dir: '../po', - install: true, - install_dir: join_paths(get_option('datadir'), 'applications') -) -desktop_utils = find_program('desktop-file-validate', required: false) -if desktop_utils.found() - test('Validate desktop file', desktop_utils, args: [desktop_file]) +if host_machine.system() == 'windows' + desktop_file = configure_file( + input: 'page.kramo.Cartridges.desktop.in', + output: app_id + '.desktop.in', + configuration: conf, + install: true, + install_dir: join_paths(get_option('datadir'), 'applications') + ) +else + desktop_file = i18n.merge_file( + input: configure_file( + input: 'page.kramo.Cartridges.desktop.in', + output: app_id + '.desktop.in', + configuration: conf + ), + output: app_id + '.desktop', + type: 'desktop', + po_dir: '../po', + install: true, + install_dir: join_paths(get_option('datadir'), 'applications') + ) endif -appstream_file = i18n.merge_file( - input: configure_file( - input: 'page.kramo.Cartridges.metainfo.xml.in', - output: app_id + '.metainfo.xml.in', - configuration: conf - ), - output: app_id + '.metainfo.xml', - po_dir: '../po', - install: true, - install_dir: join_paths(get_option('datadir'), 'metainfo') -) +if host_machine.system() != 'windows' + desktop_utils = find_program('desktop-file-validate', required: false) + if desktop_utils.found() + test('Validate desktop file', desktop_utils, args: [desktop_file]) + endif +endif -appstreamcli = find_program('appstreamcli', required: false) -if appstreamcli.found() - test('Validate appstream file', - appstreamcli, - args: ['validate', '--no-net', '--explain', appstream_file], - workdir: meson.current_build_dir() +if host_machine.system() == 'windows' + appstream_file = configure_file( + input: 'page.kramo.Cartridges.metainfo.xml.in', + output: app_id + '.metainfo.xml', + configuration: conf, + install: true, + install_dir: join_paths(get_option('datadir'), 'metainfo') ) +else + appstream_file = i18n.merge_file( + input: configure_file( + input: 'page.kramo.Cartridges.metainfo.xml.in', + output: app_id + '.metainfo.xml.in', + configuration: conf + ), + output: app_id + '.metainfo.xml', + po_dir: '../po', + install: true, + install_dir: join_paths(get_option('datadir'), 'metainfo') + ) +endif + +if host_machine.system() != 'windows' + appstreamcli = find_program('appstreamcli', required: false) + if appstreamcli.found() + test('Validate appstream file', + appstreamcli, + args: ['validate', '--no-net', '--explain', appstream_file], + workdir: meson.current_build_dir() + ) + endif endif install_data( diff --git a/meson.build b/meson.build index b72d5fa..9879fb6 100644 --- a/meson.build +++ b/meson.build @@ -4,7 +4,12 @@ project('cartridges', default_options: [ 'warning_level=2', 'werror=false', ], ) -i18n = import('i18n') +# Translations are broken on Windows for multiple reasons +# gresources don't work and MSYS2 seems to have also broken the gettext package +if host_machine.system() != 'windows' + i18n = import('i18n') +endif + gnome = import('gnome') python = import('python') @@ -42,8 +47,6 @@ if host_machine.system() == 'windows' subdir('windows') else subdir('search-provider') - # Translations are broken on Windows for multiple reasons - # gresources don't work and MSYS2 seems to have also broken the gettext package subdir('po') endif