From 225d6058f32d074f9aee4a80b552a86af4d05407 Mon Sep 17 00:00:00 2001 From: Robert Ancell Date: Thu, 17 Oct 2019 11:26:44 +1300 Subject: [PATCH] Replace autotools with meson --- CVSVERSION | 0 Makefile.am | 41 ------------------------ autogen.sh | 24 -------------- configure.ac | 86 -------------------------------------------------- meson.build | 30 ++++++++++++++++++ po/meson.build | 3 ++ update.c | 4 +-- 7 files changed, 34 insertions(+), 154 deletions(-) delete mode 100644 CVSVERSION delete mode 100644 Makefile.am delete mode 100755 autogen.sh delete mode 100644 configure.ac create mode 100644 meson.build create mode 100644 po/meson.build diff --git a/CVSVERSION b/CVSVERSION deleted file mode 100644 index e69de29..0000000 diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 044e49c..0000000 --- a/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -NULL = - -SUBDIRS=po - -autostartdir = $(sysconfdir)/xdg/autostart -autostart_in_files = user-dirs-update-gtk.desktop.in -autostart_DATA = $(autostart_in_files:.desktop.in=.desktop) - -@INTLTOOL_DESKTOP_RULE@ - -INCLUDES = \ - -I$(top_srcdir) \ - -I$(top_builddir) \ - -DLOCALEDIR=\"$(datadir)/locale\" \ - -DXDG_USER_DIRS_UPDATE=\"$(XDG_USER_DIRS_UPDATE)\" \ - $(GTK_CFLAGS) \ - $(NULL) - -EXTRA_DIST = \ - intltool-extract.in \ - intltool-merge.in \ - intltool-update.in \ - $(autostart_in_files) \ - $(NULL) - - -libraries = $(GTK_LIBS) - -bin_PROGRAMS = \ - xdg-user-dirs-gtk-update \ - $(NULL) - -xdg_user_dirs_gtk_update_SOURCES = parse.c parse.h update.c -xdg_user_dirs_gtk_update_LDADD = $(libraries) - -CLEANFILES = $(autostart_DATA) - -DISTCLEANFILES = \ - intltool-extract \ - intltool-merge \ - intltool-update diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index 6863c94..0000000 --- a/autogen.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# Run this to generate all the initial makefiles, etc. - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -PKG_NAME="xdg-user-dirs-gtk" - -(test -f $srcdir/parse.c) || { - echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" - echo " top-level $PKG_NAME directory" - exit 1 -} - -which gnome-autogen.sh || { - echo "You need to install gnome-common from the GNOME git" - exit 1 -} - -REQUIRED_AUTOCONF_VERSION=2.59 -REQUIRED_AUTOMAKE_VERSION=1.9 -REQUIRED_INTLTOOL_VERSION=0.40.0 -REQUIRED_PKG_CONFIG_VERSION=0.22 -. gnome-autogen.sh diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 99b97bc..0000000 --- a/configure.ac +++ /dev/null @@ -1,86 +0,0 @@ -AC_PREREQ(2.53) - -AC_INIT([xdg-user-dirs-gtk], [0.11], - [https://gitlab.gnome.org/GNOME/xdg-user-dirs-gtk/-/issues/]) -AC_CONFIG_SRCDIR([parse.c]) -AM_INIT_AUTOMAKE([1.9 dist-xz no-dist-gzip tar-ustar foreign]) -AC_CONFIG_HEADERS([config.h]) - -AM_SANITY_CHECK -AM_MAINTAINER_MODE - -AC_C_CONST -AC_ISC_POSIX -AC_PROG_CC -AC_PROG_CPP -AC_PROG_INSTALL -AC_PROG_LN_S -AC_PROG_MAKE_SET -AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - -GETTEXT_PACKAGE=xdg-user-dirs-gtk -AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [The gettext domain name]) -AC_SUBST(GETTEXT_PACKAGE) - -AM_GLIB_GNU_GETTEXT -GLIB_DEFINE_LOCALEDIR(GLIBLOCALEDIR) - -IT_PROG_INTLTOOL([0.35.0]) - -PKG_CHECK_MODULES(GTK, gtk+-3.0) -AC_SUBST(GTK_CFLAGS) -AC_SUBST(GTK_LIBS) - -AC_PATH_PROG(XDG_USER_DIRS_UPDATE, xdg-user-dirs-update, no) -if test "x${XDG_USER_DIRS_UPDATE}" = "xno"; then - AC_MSG_ERROR([You need to install xdg-user-dirs]) -fi - -dnl ========================================================================== - -dnl Turn on the additional warnings last, so -Werror doesn't affect other tests. - -AC_ARG_ENABLE(more-warnings, -[ --enable-more-warnings Maximum compiler warnings], -set_more_warnings="$enableval",[ -if test -f $srcdir/CVSVERSION; then - is_cvs_version=true - set_more_warnings=yes -else - set_more_warnings=no -fi -]) -AC_MSG_CHECKING(for more warnings, including -Werror) -if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then - AC_MSG_RESULT(yes) - CFLAGS="\ - -Wall \ - -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \ - -Wnested-externs -Wpointer-arith \ - -Wcast-align -Wsign-compare \ - -Werror \ - $CFLAGS" - - for option in -Wno-strict-aliasing -Wno-sign-compare; do - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $option" - AC_MSG_CHECKING([whether gcc understands $option]) - AC_TRY_COMPILE([], [], - has_option=yes, - has_option=no,) - if test $has_option = no; then - CFLAGS="$SAVE_CFLAGS" - fi - AC_MSG_RESULT($has_option) - unset has_option - unset SAVE_CFLAGS - done - unset option -else - AC_MSG_RESULT(no) -fi - -AC_OUTPUT([ -Makefile -po/Makefile.in -]) diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..6bd13ed --- /dev/null +++ b/meson.build @@ -0,0 +1,30 @@ +project( + 'xdg-user-dirs-gtk', 'c', + version : '0.11', + license : 'GPL2+', + meson_version : '>= 0.50.0' +) + +localedir = join_paths (get_option ('prefix'), get_option ('localedir')) +sysconfdir = join_paths (get_option ('prefix'), get_option ('sysconfdir')) + +executable ('xdg-user-dirs-gtk-update', + [ 'parse.c', + 'update.c' ], + dependencies: dependency('gtk+-3.0'), + c_args: [ '-DGETTEXT_PACKAGE="xdg-user-dirs-gtk"', + '-DGLIBLOCALEDIR="@0@"'.format (localedir), + '-DXDG_USER_DIRS_UPDATE=""' ], + install: true ) + +i18n = import('i18n') + +i18n.merge_file ( + input: 'user-dirs-update-gtk.desktop.in', + output: 'user-dirs-update-gtk.desktop', + install: true, + install_dir: join_paths (sysconfdir, 'xdg', 'autostart'), + po_dir: 'po', + type: 'desktop') + +subdir('po') diff --git a/po/meson.build b/po/meson.build new file mode 100644 index 0000000..93f475a --- /dev/null +++ b/po/meson.build @@ -0,0 +1,3 @@ +i18n.gettext ('xdg-user-dirs-gtk', preset: 'glib') + +podir = meson.current_source_dir () diff --git a/update.c b/update.c index 8710c79..7491704 100644 --- a/update.c +++ b/update.c @@ -1,5 +1,3 @@ -#include "config.h" - #include #include #include @@ -106,7 +104,7 @@ update_locale (XdgDirEntry *old_entries) return; close (fd); - cmdline = g_strdup_printf (XDG_USER_DIRS_UPDATE " --force --dummy-output %s", filename); + cmdline = g_strdup_printf ("xdg-user-dirs-update --force --dummy-output %s", filename); if (!g_spawn_command_line_sync (cmdline, &std_out, &std_err, &exit_status, NULL)) { g_free (std_out); -- GitLab