Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port build to Meson #450

Merged
merged 4 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,36 @@ jobs:
apt-get upgrade -y
apt-get build-dep -y xdg-desktop-portal-gtk
apt-get build-dep -y xdg-desktop-portal
apt-get install -y git libfuse3-dev
apt-get install -y git gsettings-desktop-schemas-dev libfuse3-dev libgnome-desktop-3-dev meson ninja-build

# Build from git so we can test against the newest portals
- name: Build xdg-desktop-portal dependency
run: |
git clone -b 1.14.0 https://github.com/flatpak/xdg-desktop-portal.git ./xdg-desktop-portal
git clone -b 1.18.0 https://github.com/flatpak/xdg-desktop-portal.git ./xdg-desktop-portal
cd ./xdg-desktop-portal
./autogen.sh --sysconfdir=/etc --disable-dependency-tracking --disable-libportal
make -j $(getconf _NPROCESSORS_ONLN)
make install
meson setup -Dsysconfdir=/etc -Dprefix=/usr -Dlibportal=disabled _build .
meson compile -C _build
meson install -C _build
cd ..

- uses: actions/checkout@v4

- name: Configure
run: ./autogen.sh --disable-dependency-tracking
run: meson setup -Dsysconfdir=/etc -Dprefix=/usr _build .

- name: Build
run: make -j $(getconf _NPROCESSORS_ONLN)
run: meson compile -C _build

- name: Check
run: make check -j $(getconf _NPROCESSORS_ONLN)
run: meson test -C _build

- name: Install
run: make install
run: meson install -C _build

- name: Upload test logs
uses: actions/upload-artifact@v3
if: failure() || cancelled()
with:
name: test logs
path: |
tests/*.log
test-suite.log
_build/meson-logs/*
8 changes: 0 additions & 8 deletions Makefile.am

This file was deleted.

24 changes: 0 additions & 24 deletions autogen.sh

This file was deleted.

117 changes: 0 additions & 117 deletions configure.ac

This file was deleted.

70 changes: 0 additions & 70 deletions data/Makefile.am.inc

This file was deleted.

96 changes: 96 additions & 0 deletions data/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
portal_dbus_interfaces = [
desktop_portal_interfaces_dir / 'org.freedesktop.impl.portal.Request.xml',
desktop_portal_interfaces_dir / 'org.freedesktop.impl.portal.Session.xml',
desktop_portal_interfaces_dir / 'org.freedesktop.impl.portal.FileChooser.xml',
desktop_portal_interfaces_dir / 'org.freedesktop.impl.portal.Print.xml',
desktop_portal_interfaces_dir / 'org.freedesktop.impl.portal.Notification.xml',
desktop_portal_interfaces_dir / 'org.freedesktop.impl.portal.Inhibit.xml',
desktop_portal_interfaces_dir / 'org.freedesktop.impl.portal.Access.xml',
desktop_portal_interfaces_dir / 'org.freedesktop.impl.portal.Account.xml',
desktop_portal_interfaces_dir / 'org.freedesktop.impl.portal.Email.xml',
desktop_portal_interfaces_dir / 'org.freedesktop.impl.portal.DynamicLauncher.xml',
]

fdo_dbus_interfaces = files(
'org.freedesktop.ScreenSaver.xml',
'org.freedesktop.Accounts.xml',
'org.freedesktop.Accounts.User.xml',
)

gtk_dbus_interfaces = files('org.gtk.Notifications.xml')

gnome_dbus_interfaces = files(
'org.gnome.SessionManager.xml',
'org.gnome.ScreenSaver.xml',
)

gtk_portal = configuration_data()

if get_option('wallpaper').allowed()
portal_dbus_interfaces += desktop_portal_interfaces_dir / 'org.freedesktop.impl.portal.Wallpaper.xml'
gtk_portal.set('wallpaper_iface', 'org.freedesktop.impl.portal.Wallpaper;')
else
gtk_portal.set('wallpaper_iface', '')
endif

if get_option('settings').allowed()
portal_dbus_interfaces += desktop_portal_interfaces_dir / 'org.freedesktop.impl.portal.Settings.xml'
gtk_portal.set('settings_iface', 'org.freedesktop.impl.portal.Settings;')
else
gtk_portal.set('settings_iface', '')
endif

if get_option('appchooser').allowed()
portal_dbus_interfaces += desktop_portal_interfaces_dir / 'org.freedesktop.impl.portal.AppChooser.xml'
gtk_portal.set('appchooser_iface', 'org.freedesktop.impl.portal.AppChooser;')
else
gtk_portal.set('appchooser_iface', '')
endif

if get_option('lockdown').allowed()
portal_dbus_interfaces += desktop_portal_interfaces_dir / 'org.freedesktop.impl.portal.Lockdown.xml'
gtk_portal.set('lockdown_iface', 'org.freedesktop.impl.portal.Lockdown;')
else
gtk_portal.set('lockdown_iface', '')
endif

configure_file(
input: 'gtk.portal.in',
output: 'gtk.portal',
configuration: gtk_portal,
install: true,
install_dir: datadir / 'xdg-desktop-portal/portals',
)

service_conf = configuration_data()
service_conf.set('libexecdir', libexecdir)
configure_file(
input: 'org.freedesktop.impl.portal.desktop.gtk.service.in',
output: 'org.freedesktop.impl.portal.desktop.gtk.service',
configuration: service_conf,
install: true,
install_dir: dbus_service_dir,
)
configure_file(
input: 'xdg-desktop-portal-gtk.service.in',
output: 'xdg-desktop-portal-gtk.service',
configuration: service_conf,
install: true,
install_dir: systemd_userunit_dir,
)

desktop_conf = configuration_data()
desktop_conf.set('libexecdir', libexecdir)
i18n.merge_file(
type: 'desktop',
input: configure_file(
input: 'xdg-desktop-portal-gtk.desktop.in.in',
output: 'xdg-desktop-portal-gtk.desktop.in',
configuration: desktop_conf,
),
output: 'xdg-desktop-portal-gtk.desktop',
po_dir: '../po',
install: true,
install_dir: datadir / 'applications',
)

Loading