Fix Windows builds

This commit is contained in:
kramo
2024-04-16 20:16:48 +02:00
parent 4a530ce92e
commit 8244b16c17
3 changed files with 65 additions and 37 deletions

View File

@@ -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}

View File

@@ -22,7 +22,17 @@ gnome.compile_resources('cartridges',
dependencies: blueprints,
)
desktop_file = i18n.merge_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',
@@ -33,14 +43,26 @@ desktop_file = i18n.merge_file(
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])
)
endif
appstream_file = i18n.merge_file(
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
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',
@@ -50,15 +72,18 @@ appstream_file = i18n.merge_file(
po_dir: '../po',
install: true,
install_dir: join_paths(get_option('datadir'), 'metainfo')
)
)
endif
appstreamcli = find_program('appstreamcli', required: false)
if appstreamcli.found()
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(

View File

@@ -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