diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6dff2cc0..ec9ce193 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,31 +16,31 @@ 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 @@ -48,5 +48,4 @@ jobs: with: name: test logs path: | - tests/*.log - test-suite.log + _build/meson-logs/* diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 6fa88683..00000000 --- a/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -SUBDIRS = po - -BUILT_SOURCES = -CLEANFILES = -EXTRA_DIST = - -include src/Makefile.am.inc -include data/Makefile.am.inc diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index 52843e5d..00000000 --- a/autogen.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# Run this to generate all the initial makefiles, etc. - -test -n "$srcdir" || srcdir=`dirname "$0"` -test -n "$srcdir" || srcdir=. - -olddir=`pwd` -cd "$srcdir" - -AUTORECONF=`which autoreconf` -if test -z $AUTORECONF; then - echo "*** No autoreconf found, please install it ***" - exit 1 -fi - -# INSTALL are required by automake, but may be deleted by clean -# up rules. to get automake to work, simply touch these here, they will be -# regenerated from their corresponding *.in files by ./configure anyway. -touch INSTALL - -autoreconf --force --install --verbose || exit $? - -cd "$olddir" -test -n "$NOCONFIGURE" || "$srcdir/configure" "$@" diff --git a/configure.ac b/configure.ac deleted file mode 100644 index a8dec78f..00000000 --- a/configure.ac +++ /dev/null @@ -1,117 +0,0 @@ -AC_PREREQ([2.63]) - -AC_INIT([xdg-desktop-portal-gtk],[1.14.1]) - -AC_PROG_CC -AM_PROG_CC_C_O -AC_DISABLE_STATIC - -LT_PREREQ([2.2.6]) -LT_INIT([disable-static]) - -AC_CONFIG_SRCDIR([src/xdg-desktop-portal-gtk.c]) -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_MACRO_DIR([m4]) -AM_INIT_AUTOMAKE([1.11 no-define no-dist-gzip dist-xz tar-ustar foreign subdir-objects]) -AC_PROG_SED - -# Enable silent rules is available -AM_SILENT_RULES([yes]) -AM_MAINTAINER_MODE([enable]) - -if test "x$GCC" = "xyes"; then - case " $CFLAGS " in - *[[\ \ ]]-Wall[[\ \ ]]*) ;; - *) CFLAGS="$CFLAGS -Wall" ;; - esac -fi - -# i18n stuff -GETTEXT_PACKAGE=xdg-desktop-portal-gtk -AC_SUBST(GETTEXT_PACKAGE) -AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", - [The prefix for our gettext translation domains.]) - -AM_GNU_GETTEXT([external]) -AM_GNU_GETTEXT_VERSION(0.18.3) - -PKG_PROG_PKG_CONFIG([0.24]) - -AC_ARG_WITH(dbus_service_dir, - AS_HELP_STRING([--with-dbus-service-dir=PATH],[choose directory for dbus service files, [default=PREFIX/share/dbus-1/services]]), - with_dbus_service_dir="$withval", with_dbus_service_dir=$datadir/dbus-1/services) -DBUS_SERVICE_DIR=$with_dbus_service_dir -AC_SUBST(DBUS_SERVICE_DIR) - -AC_ARG_WITH([systemduserunitdir], - [AS_HELP_STRING([--with-systemduserunitdir=DIR], - [Directory for systemd user service files (default=PREFIX/lib/systemd/user)])], - [], - dnl This is deliberately not ${libdir}: systemd units always go in - dnl .../lib, never .../lib64 or .../lib/x86_64-linux-gnu - [with_systemduserunitdir='${prefix}/lib/systemd/user']) -AC_SUBST([systemduserunitdir], [$with_systemduserunitdir]) - -AC_SUBST([DESKTOP_PORTAL_INTERFACES_DIR], [`$PKG_CONFIG --variable=interfaces_dir xdg-desktop-portal`]) -AC_SUBST([DBUS_INTERFACES_DIR], [`$PKG_CONFIG --variable=interfaces_dir dbus-1`]) -AC_SUBST([GDBUS_CODEGEN], [`$PKG_CONFIG --variable gdbus_codegen gio-2.0`]) -AC_SUBST([GLIB_COMPILE_RESOURCES], [`$PKG_CONFIG --variable glib_compile_resources gio-2.0`]) - -AC_ARG_ENABLE([wallpaper], - [AS_HELP_STRING([--enable-wallpaper],[Build wallpaper portal. Needs gnome-desktop])]) -AS_IF([test "x$enable_wallpaper" = "xyes"], [ - PKG_CHECK_MODULES(WALLPAPER, [gnome-desktop-3.0]) - AC_DEFINE([BUILD_WALLPAPER], [1], [Define to enable wallpaper portal]) -]) -AM_CONDITIONAL([BUILD_WALLPAPER],[test "$enable_wallpaper" = "yes"]) - -AC_ARG_ENABLE([settings], - [AS_HELP_STRING([--disable-settings],[Disable the settings portal, which needs dconf])]) -AS_IF([test "x$enable_settings" != "xno"], [ - PKG_CHECK_MODULES(SETTINGS, [fontconfig gsettings-desktop-schemas]) - AC_DEFINE([BUILD_SETTINGS], [1], [Define to enable settings portal]) -]) -AM_CONDITIONAL([BUILD_SETTINGS],[test "$enable_settings" != "no"]) - -AC_ARG_ENABLE([appchooser], - [AS_HELP_STRING([--disable-appchooser],[Disable the appchooser portal.])]) -AS_IF([test "x$enable_appchooser" != "xno"], [ - AC_DEFINE([BUILD_APPCHOOSER], [1], [Define to enable appchooser portal]) -]) -AM_CONDITIONAL([BUILD_APPCHOOSER],[test "$enable_appchooser" != "no"]) - -AC_ARG_ENABLE(lockdown, - [AS_HELP_STRING([--enable-lockdown],[Build lockdown portal.])], - enable_lockdown=$enableval, enable_lockdown=yes) -if test x$enable_lockdown = xyes; then - AC_DEFINE([BUILD_LOCKDOWN], [1], [Define to enable lockdown portal]) -fi -AM_CONDITIONAL([BUILD_LOCKDOWN],[test "$enable_lockdown" = "yes"]) - -PKG_CHECK_MODULES(GTK, [xdg-desktop-portal >= 1.14.0 glib-2.0 >= 2.44 gio-unix-2.0 gtk+-3.0 >= 3.14 gtk+-unix-print-3.0]) -AC_SUBST(GTK_CFLAGS) -AC_SUBST(GTK_LIBS) - -PKG_CHECK_MODULES(GTK_X11, gtk+-x11-3.0, - have_gtk_x11=yes, have_gtk_x11=no) -if test "$have_gtk_x11" = "yes"; then - AC_DEFINE(HAVE_GTK_X11, 1, [define if we we have gtk+-x11]) - AC_SUBST(GTK_X11_CFLAGS) - AC_SUBST(GTK_X11_LIBS) -fi -AM_CONDITIONAL([HAVE_GTK_X11], [test "$have_gtk_x11" = "yes"]) - -PKG_CHECK_MODULES(GTK_WAYLAND, gtk+-wayland-3.0 >= 3.21.5, - have_gtk_wayland=yes, have_gtk_wayland=no) -if test "$have_gtk_wayland" = "yes"; then - AC_DEFINE(HAVE_GTK_WAYLAND, 1, [define if we we have gtk+-wayland]) - AC_SUBST(GTK_WAYLAND_CFLAGS) - AC_SUBST(GTK_WAYLAND_LIBS) -fi -AM_CONDITIONAL([HAVE_GTK_WAYLAND], [test "$have_gtk_wayland" = "yes"]) - -AC_CONFIG_FILES([ -Makefile -po/Makefile.in -]) -AC_OUTPUT diff --git a/data/Makefile.am.inc b/data/Makefile.am.inc deleted file mode 100644 index 2efc9a82..00000000 --- a/data/Makefile.am.inc +++ /dev/null @@ -1,70 +0,0 @@ -if BUILD_WALLPAPER -wallpaper_iface = org.freedesktop.impl.portal.Wallpaper; -endif - -if BUILD_SETTINGS -settings_iface = org.freedesktop.impl.portal.Settings; -endif - -if BUILD_APPCHOOSER -appchooser_iface = org.freedesktop.impl.portal.AppChooser; -endif - -if BUILD_LOCKDOWN -lockdown_iface = org.freedesktop.impl.portal.Lockdown; -endif - -%.portal: data/%.portal.in config.log - $(AM_V_GEN) $(SED) -e "s|\@wallpaper_iface\@|$(wallpaper_iface)|" \ - -e "s|\@settings_iface\@|$(settings_iface)|" \ - -e "s|\@appchooser_iface\@|$(appchooser_iface)|" \ - -e "s|\@lockdown_iface\@|$(lockdown_iface)|" \ - $< > $@ - -portaldir = $(datadir)/xdg-desktop-portal/portals -portal_in_files = data/gtk.portal.in -portal_DATA = gtk.portal - -%.service: data/%.service.in config.log - $(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@ - -dbus_servicedir = $(DBUS_SERVICE_DIR) -dbus_service_in_files = data/org.freedesktop.impl.portal.desktop.gtk.service.in -dbus_service_DATA = org.freedesktop.impl.portal.desktop.gtk.service - -CLEANFILES += $(dbus_service_DATA) - -systemduserunit_in_files = data/xdg-desktop-portal-gtk.service.in -systemduserunit_DATA = xdg-desktop-portal-gtk.service - -CLEANFILES += $(systemduserunit_DATA) - -%.desktop.in: data/%.desktop.in.in - $(AM_V_GEN) msgfmt --desktop -d po --template $< -o $@ - -%.desktop: %.desktop.in - $(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@ - -desktopdir = $(datadir)/applications -desktop_in_in_files = data/xdg-desktop-portal-gtk.desktop.in.in -desktop_in_files = xdg-desktop-portal-gtk.desktop.in -desktop_DATA = xdg-desktop-portal-gtk.desktop - -CLEANFILES += \ - $(portal_DATA) \ - $(desktop_in_files) \ - $(desktop_DATA) \ - $(NULL) - -EXTRA_DIST += \ - $(portal_in_files) \ - $(dbus_service_in_files) \ - $(systemduserunit_in_files) \ - $(desktop_in_in_files) \ - data/org.gtk.Notifications.xml \ - data/org.gnome.SessionManager.xml \ - data/org.gnome.ScreenSaver.xml \ - data/org.freedesktop.ScreenSaver.xml \ - data/org.freedesktop.Accounts.xml \ - data/org.freedesktop.Accounts.User.xml \ - $(NULL) diff --git a/data/meson.build b/data/meson.build new file mode 100644 index 00000000..900ce24f --- /dev/null +++ b/data/meson.build @@ -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', +) + diff --git a/meson.build b/meson.build new file mode 100644 index 00000000..dfe7f2dd --- /dev/null +++ b/meson.build @@ -0,0 +1,97 @@ +project( + 'xdg-desktop-portal-gtk', + 'c', + version: '1.14.1', + meson_version: '>= 0.61.2', + license: 'LGPL-2.1-or-later', + default_options: ['warning_level=2'], +) + +prefix = get_option('prefix') +datadir = prefix / get_option('datadir') +libexecdir = prefix / get_option('libexecdir') +sysconfdir = prefix / get_option('sysconfdir') +localedir = prefix / get_option('localedir') +dbus_service_dir = get_option('dbus-service-dir') +if dbus_service_dir == '' + dbus_service_dir = prefix / datadir / 'dbus-1' / 'services' +endif + +systemd_userunit_dir = get_option('systemd-user-unit-dir') +if systemd_userunit_dir == '' + # This is deliberately not ${libdir}: systemd units always go in + # .../lib, never .../lib64 or .../lib/x86_64-linux-gnu + systemd_userunit_dir = prefix / 'lib' / 'systemd' / 'user' +endif + +dataroot_dir = get_option('datarootdir') +if dataroot_dir == '' + dataroot_dir = datadir +endif + +i18n = import('i18n') +gnome = import('gnome') +pkgconfig = import('pkgconfig') + +root_inc = include_directories('.') + +config_h = configuration_data() + +config_h.set_quoted('G_LOG_DOMAIN', 'xdg-desktop-portal-gtk') +config_h.set_quoted('DATADIR', datadir) +config_h.set_quoted('LIBEXECDIR', libexecdir) +config_h.set_quoted('LOCALEDIR', localedir) +config_h.set_quoted('SYSCONFDIR', sysconfdir) +config_h.set_quoted('GETTEXT_PACKAGE', meson.project_name()) +config_h.set_quoted('PACKAGE_NAME', meson.project_name()) +config_h.set_quoted('PACKAGE_VERSION', meson.project_version()) +config_h.set_quoted('PACKAGE_STRING', '@0@ @1@'.format(meson.project_name(), meson.project_version())) + +xdp_dep = dependency('xdg-desktop-portal') +desktop_portal_interfaces_dir = xdp_dep.get_variable(pkgconfig: 'interfaces_dir') + +portal_deps = [ + dependency('xdg-desktop-portal', version: '>=1.14.0'), + dependency('glib-2.0', version: '>=2.44'), + dependency('gio-unix-2.0'), + dependency('gtk+-3.0', version: '>=3.14'), + dependency('gtk+-unix-print-3.0'), +] + +gtkx11_dep = dependency('gtk+-x11-3.0', required: false) +config_h.set('HAVE_GTK_X11', gtkx11_dep.found()) + +gtkwayland_dep = dependency('gtk+-wayland-3.0', version: '>=3.21.5', required: false) +config_h.set('HAVE_GTK_WAYLAND', gtkwayland_dep.found()) + +configure_file(output: 'config.h', configuration: config_h) + +subdir('data') +subdir('src') +subdir('po') + +summary({ + 'DBus service dir': dbus_service_dir, + 'Portal interfaces dir': desktop_portal_interfaces_dir, + 'systemd user unit dir': systemd_userunit_dir, + }, + section: 'Directories', +) + +summary({ + 'X11': gtkx11_dep.found(), + 'Wayland': gtkwayland_dep.found(), + }, + bool_yn: true, + section: 'Dependencies', +) + +summary({ + 'Wallpaper': get_option('wallpaper'), + 'Settings': get_option('settings'), + 'AppChooser': get_option('appchooser'), + 'Lockdown': get_option('lockdown'), + }, + bool_yn: true, + section: 'Portals', +) diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 00000000..91ab8e2b --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,30 @@ +option('dbus-service-dir', + type: 'string', + value: '', + description: 'directory for dbus service files (default: PREFIX/share/dbus-1/services)') +option('systemd-user-unit-dir', + type: 'string', + value: '', + description: 'directory for systemd user service files (default: PREFIX/lib/systemd/user)') +option('datarootdir', + type: 'string', + value: '', + description: 'Define the datarootdir for the pkgconf file') + +# Features +option('wallpaper', + type: 'feature', + value: 'auto', + description: 'Enable Wallpaper portal (requires: gnome-desktop)') +option('settings', + type: 'feature', + value: 'auto', + description: 'Enable Settings portal (requires: fontconfig, gsettings-desktop-schemas)') +option('appchooser', + type: 'feature', + value: 'auto', + description: 'Enable AppChooser portal') +option('lockdown', + type: 'feature', + value: 'auto', + description: 'Enable Lockdown portal') diff --git a/po/Makevars b/po/Makevars deleted file mode 100644 index e3fb1ffa..00000000 --- a/po/Makevars +++ /dev/null @@ -1,78 +0,0 @@ -# Makefile variables for PO directory in any package using GNU gettext. - -# Usually the message domain is the same as the package name. -DOMAIN = $(PACKAGE) - -# These two variables depend on the location of this directory. -subdir = po -top_builddir = .. - -# These options get passed to xgettext. -XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --from-code=UTF-8 --keyword=C_:1c,2 --keyword=NC_:1c,2 --keyword=g_dngettext:2,3 - -# This is the copyright holder that gets inserted into the header of the -# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding -# package. (Note that the msgstr strings, extracted from the package's -# sources, belong to the copyright holder of the package.) Translators are -# expected to transfer the copyright for their translations to this person -# or entity, or to disclaim their copyright. The empty string stands for -# the public domain; in this case the translators are expected to disclaim -# their copyright. -COPYRIGHT_HOLDER = Copyright © 2016 Red Hat - -# This tells whether or not to prepend "GNU " prefix to the package -# name that gets inserted into the header of the $(DOMAIN).pot file. -# Possible values are "yes", "no", or empty. If it is empty, try to -# detect it automatically by scanning the files in $(top_srcdir) for -# "GNU packagename" string. -PACKAGE_GNU = no - -# This is the email address or URL to which the translators shall report -# bugs in the untranslated strings: -# - Strings which are not entire sentences, see the maintainer guidelines -# in the GNU gettext documentation, section 'Preparing Strings'. -# - Strings which use unclear terms or require additional context to be -# understood. -# - Strings which make invalid assumptions about notation of date, time or -# money. -# - Pluralisation problems. -# - Incorrect English spelling. -# - Incorrect formatting. -# It can be your email address, or a mailing list address where translators -# can write to without being subscribed, or the URL of a web page through -# which the translators can contact you. -MSGID_BUGS_ADDRESS = https://github.com/flatpak/xdg-desktop-portal-gtk/issues - -# This is the list of locale categories, beyond LC_MESSAGES, for which the -# message catalogs shall be used. It is usually empty. -EXTRA_LOCALE_CATEGORIES = - -# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' -# context. Possible values are "yes" and "no". Set this to yes if the -# package uses functions taking also a message context, like pgettext(), or -# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. -USE_MSGCTXT = no - -# These options get passed to msgmerge. -# Useful options are in particular: -# --previous to keep previous msgids of translated messages, -# --quiet to reduce the verbosity. -MSGMERGE_OPTIONS = - -# These options get passed to msginit. -# If you want to disable line wrapping when writing PO files, add -# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and -# MSGINIT_OPTIONS. -MSGINIT_OPTIONS = - -# This tells whether or not to regenerate a PO file when $(DOMAIN).pot -# has changed. Possible values are "yes" and "no". Set this to no if -# the POT file is checked in the repository and the version control -# program ignores timestamps. -PO_DEPENDS_ON_POT = no - -# This tells whether or not to forcibly update $(DOMAIN).pot and -# regenerate PO files on "make dist". Possible values are "yes" and -# "no". Set this to no if the POT file and PO files are maintained -# externally. -DIST_DEPENDS_ON_UPDATE_PO = no diff --git a/po/meson.build b/po/meson.build new file mode 100644 index 00000000..e9b77d79 --- /dev/null +++ b/po/meson.build @@ -0,0 +1 @@ +i18n.gettext(meson.project_name(), preset: 'glib') diff --git a/src/Makefile.am.inc b/src/Makefile.am.inc deleted file mode 100644 index 48706d9d..00000000 --- a/src/Makefile.am.inc +++ /dev/null @@ -1,207 +0,0 @@ -dbus_built_sources = src/xdg-desktop-portal-dbus.c src/xdg-desktop-portal-dbus.h -BUILT_SOURCES += $(dbus_built_sources) -CLEANFILES += $(dbus_built_sources) - -if BUILD_WALLPAPER - WALLPAPER_IFACE=$(DESKTOP_PORTAL_INTERFACES_DIR)/org.freedesktop.impl.portal.Wallpaper.xml -endif - -if BUILD_SETTINGS - SETTINGS_IFACE=$(DESKTOP_PORTAL_INTERFACES_DIR)/org.freedesktop.impl.portal.Settings.xml -endif - -if BUILD_SETTINGS - SHELL_INTROSPECT_IFACE=$(top_srcdir)/data/org.gnome.Shell.Introspect.xml -endif - -if BUILD_APPCHOOSER - APPCHOOSER_IFACE=$(DESKTOP_PORTAL_INTERFACES_DIR)/org.freedesktop.impl.portal.AppChooser.xml -endif - -if BUILD_LOCKDOWN - LOCKDOWN_IFACE=$(DESKTOP_PORTAL_INTERFACES_DIR)/org.freedesktop.impl.portal.Lockdown.xml -endif - -$(dbus_built_sources): src/Makefile.am.inc - $(AM_V_GEN) $(GDBUS_CODEGEN) \ - --interface-prefix org.freedesktop.impl.portal. \ - --c-namespace XdpImpl \ - --generate-c-code src/xdg-desktop-portal-dbus \ - --annotate "org.freedesktop.impl.portal.Print.Print()" "org.gtk.GDBus.C.UnixFD" "true" \ - $(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 \ - $(WALLPAPER_IFACE) \ - $(BACKGROUND_IFACE) \ - $(SETTINGS_IFACE) \ - $(APPCHOOSER_IFACE) \ - $(LOCKDOWN_IFACE) \ - $(NULL) - -shell_built_sources = src/shell-dbus.c src/shell-dbus.h -BUILT_SOURCES += $(shell_built_sources) -CLEANFILES += $(shell_built_sources) - -$(shell_built_sources): src/Makefile.am.inc - $(AM_V_GEN) $(GDBUS_CODEGEN) \ - --generate-c-code src/shell-dbus \ - $(top_srcdir)/data/org.gtk.Notifications.xml \ - $(top_srcdir)/data/org.gnome.SessionManager.xml \ - $(top_srcdir)/data/org.gnome.ScreenSaver.xml \ - $(top_srcdir)/data/org.freedesktop.ScreenSaver.xml \ - $(top_srcdir)/data/org.freedesktop.Accounts.xml \ - $(top_srcdir)/data/org.freedesktop.Accounts.User.xml \ - $(NULL) - -resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(top_srcdir)/src --generate-dependencies $(top_srcdir)/src/xdg-desktop-portal-gtk.gresource.xml) - -src/resources.c: src/xdg-desktop-portal-gtk.gresource.xml $(resource_files) - $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< \ - --target=$@ --sourcedir=$(top_srcdir)/src --c-name _xdg_desktop --generate-source -CLEANFILES += src/resources.c - -EXTRA_DIST += \ - src/xdg-desktop-portal-gtk.gresource.xml \ - src/appchooserdialog.ui \ - src/appchooserrow.ui \ - src/accountdialog.ui \ - src/wallpaperdialog.ui \ - src/wallpaperpreview.ui \ - src/wallpaperpreview.css \ - $(NULL) - -libexec_PROGRAMS = \ - xdg-desktop-portal-gtk \ - $(NULL) - -xdg_desktop_portal_gtk_SOURCES = \ - src/xdg-desktop-portal-gtk.c \ - src/utils.h \ - src/utils.c \ - src/request.h \ - src/request.c \ - src/session.c \ - src/session.h \ - src/filechooser.h \ - src/filechooser.c \ - src/notification.h \ - src/notification.c \ - src/fdonotification.h \ - src/fdonotification.c \ - src/inhibit.h \ - src/inhibit.c \ - src/print.h \ - src/print.c \ - src/access.h \ - src/access.c \ - src/account.h \ - src/account.c \ - src/accountdialog.h \ - src/accountdialog.c \ - src/email.h \ - src/email.c \ - src/gtkbackports.h \ - src/gtkbackports.c \ - src/externalwindow.h \ - src/externalwindow.c \ - src/dynamic-launcher.h \ - src/dynamic-launcher.c \ - $(NULL) - -if BUILD_WALLPAPER -xdg_desktop_portal_gtk_SOURCES += \ - src/wallpaperdialog.c \ - src/wallpaperdialog.h \ - src/wallpaperpreview.c \ - src/wallpaperpreview.h \ - src/wallpaper.c \ - src/wallpaper.h \ - $(NULL) -endif - -if BUILD_SETTINGS -xdg_desktop_portal_gtk_SOURCES += \ - src/fc-monitor.c \ - src/fc-monitor.h \ - src/settings.c \ - src/settings.h \ - $(NULL) -endif - -if BUILD_APPCHOOSER -xdg_desktop_portal_gtk_SOURCES += \ - src/appchooser.h \ - src/appchooser.c \ - src/appchooserrow.h \ - src/appchooserrow.c \ - src/appchooserdialog.h \ - src/appchooserdialog.c \ - $(NULL) -endif - -if BUILD_LOCKDOWN -xdg_desktop_portal_gtk_SOURCES += \ - src/lockdown.c \ - src/lockdown.h \ - $(NULL) -endif - -nodist_xdg_desktop_portal_gtk_SOURCES = \ - src/resources.c \ - $(dbus_built_sources) \ - $(shell_built_sources) \ - $(NULL) - -if HAVE_GTK_X11 -xdg_desktop_portal_gtk_SOURCES += \ - src/externalwindow-x11.h \ - src/externalwindow-x11.c \ - $(NULL) -endif - -if HAVE_GTK_WAYLAND -xdg_desktop_portal_gtk_SOURCES += \ - src/externalwindow-wayland.h \ - src/externalwindow-wayland.c \ - $(NULL) -endif - -xdg_desktop_portal_gtk_LDADD = $(BASE_LIBS) $(GTK_LIBS) $(GTK_X11_LIBS) $(WALLPAPER_LIBS) $(SETTINGS_LIBS) -xdg_desktop_portal_gtk_CFLAGS = $(BASE_CFLAGS) $(GTK_CFLAGS) $(GTK_X11_CFLAGS) $(WALLPAPER_CFLAGS) $(SETTINGS_CFLAGS) -xdg_desktop_portal_gtk_CPPFLAGS = \ - -DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" \ - -DLOCALEDIR=\"$(localedir)\" \ - -I$(top_srcdir)/src \ - -I$(top_builddir)/src \ - $(NULL) - -noinst_PROGRAMS = \ - testappchooser - -testappchooser_LDADD = $(GTK_LIBS) $(GTK_X11_LIBS) -testappchooser_CFLAGS = $(GTK_CFLAGS) $(GTK_X11_CFLAGS) -testappchooser_CPPFLAGS = \ - -DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" \ - -DLOCALEDIR=\"$(localedir)\" \ - -I$(top_srcdir)/src \ - -I$(top_builddir)/src \ - $(NULL) - -testappchooser_SOURCES = \ - src/testappchooser.c \ - src/appchooserrow.h \ - src/appchooserrow.c \ - src/appchooserdialog.h \ - src/appchooserdialog.c \ - $(NULL) - -nodist_testappchooser_SOURCES = \ - src/resources.c \ - $(NULL) diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 00000000..e70f520a --- /dev/null +++ b/src/meson.build @@ -0,0 +1,122 @@ +portal_sources = files( + 'utils.c', + 'request.c', + 'session.c', + 'filechooser.c', + 'notification.c', + 'fdonotification.c', + 'inhibit.c', + 'print.c', + 'access.c', + 'account.c', + 'accountdialog.c', + 'email.c', + 'gtkbackports.c', + 'externalwindow.c', + 'dynamic-launcher.c', +) + +if get_option('wallpaper').allowed() + portal_deps += dependency('gnome-desktop-3.0') + portal_sources += files( + 'wallpaper.c', + 'wallpaperpreview.c', + 'wallpaperdialog.c', + ) +endif + +if get_option('settings').allowed() + portal_deps += [ + dependency('gsettings-desktop-schemas'), + dependency('fontconfig'), + ] + portal_sources += files( + 'fc-monitor.c', + 'settings.c', + ) +endif + +if get_option('appchooser').allowed() + portal_sources += files( + 'appchooser.c', + 'appchooserrow.c', + 'appchooserdialog.c', + ) +endif + +if get_option('lockdown').allowed() + portal_sources += files('lockdown.c') +endif + +if gtkx11_dep.found() + portal_sources += files('externalwindow-x11.c') +endif + +if gtkwayland_dep.found() + portal_sources += files('externalwindow-wayland.c') +endif + +portal_resources = gnome.compile_resources( + 'xdg-desktop-portal-gtk-resources', + 'xdg-desktop-portal-gtk.gresource.xml', + c_name: '_xdg_desktop', + source_dir: '.', +) + +portal_built_sources = [ + portal_resources, +] + +portal_built_sources += gnome.gdbus_codegen('xdg-desktop-portal-dbus', + sources: portal_dbus_interfaces, + interface_prefix: 'org.freedesktop.impl.portal.', + namespace: 'XdpImpl', + annotations: [ + [ 'org.freedesktop.impl.portal.Print.Print()', 'org.gtk.GDBus.C.UnixFD', 'true' ], + ], +) + +portal_built_sources += gnome.gdbus_codegen('shell-dbus', + sources: [ + gtk_dbus_interfaces, + fdo_dbus_interfaces, + gnome_dbus_interfaces, + ], +) + +executable('xdg-desktop-portal-gtk', + sources: [ + 'xdg-desktop-portal-gtk.c', + portal_sources, + portal_built_sources, + ], + dependencies: [ + portal_deps, + gtkx11_dep, + gtkwayland_dep, + ], + c_args: [ + '-DLOCALEDIR="@0@"'.format(localedir), + ], + include_directories: [root_inc], + install: true, + install_dir: libexecdir, +) + +executable('testappchooser', + sources: [ + 'testappchooser.c', + 'appchooserrow.c', + 'appchooserdialog.c', + portal_resources, + ], + dependencies: [ + portal_deps, + gtkx11_dep, + ], + c_args: [ + '-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()), + '-DLOCALEDIR="@0@"'.format(localedir), + ], + include_directories: [root_inc], +) diff --git a/src/wallpaper.c b/src/wallpaper.c index 646f9072..11c06141 100644 --- a/src/wallpaper.c +++ b/src/wallpaper.c @@ -131,7 +131,7 @@ set_wallpaper (WallpaperDialogHandle *handle, { g_autoptr(GFile) source = NULL; g_autoptr(GError) error = NULL; - g_autrofree gchar *path = NULL; + g_autofree gchar *path = NULL; path = g_build_filename (g_get_user_config_dir (), "background", NULL); handle->picture_uri = g_filename_to_uri (path, NULL, &error);