From 7f1d3e252f8c791260f050e2abfda92235bc5f66 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Fri, 17 Jan 2020 17:49:47 +0100 Subject: [PATCH] gst-project-maker: set up a meson project instead of an autotools one Now that autotools has been removed generate a meson project template in gst-project-maker. There are some differences with the autotools project 1. gstreamer-controller-1.0 is not added to the default dependencies. 2. The '-Wall' option is not set explicitly, meson can handle that. 3. The flags in GST_PLUGIN_LDFLAGS have not been ported to meson as they are not necessary anymore. The generated project requires meson 0.53.0 for the 'fs' module. It's up to the user to remove that part in case compatibility with older versions of meson is desired. Part-of: --- tools/gst-project-maker | 222 +++++++++++++++++----------------------- 1 file changed, 94 insertions(+), 128 deletions(-) diff --git a/tools/gst-project-maker b/tools/gst-project-maker index 7d405d04c3..7dcc407e78 100755 --- a/tools/gst-project-maker +++ b/tools/gst-project-maker @@ -93,144 +93,107 @@ EOF cat >$basedir/README <$basedir/autogen.sh <$basedir/meson.build <$basedir/configure.ac <= \$GST_REQUIRED -dnl for libgstvideo-1.0: gstreamer-video-1.0 >= \$GST_REQUIRED -dnl for libgsttag-1.0: gstreamer-tag-1.0 >= \$GST_REQUIRED -dnl for libgstpbutils-1.0: gstreamer-pbutils-1.0 >= \$GST_REQUIRED -dnl for libgstfft-1.0: gstreamer-fft-1.0 >= \$GST_REQUIRED -dnl for libgstinterfaces-1.0: gstreamer-interfaces-1.0 >= \$GST_REQUIRED -dnl for libgstrtp-1.0: gstreamer-rtp-1.0 >= \$GST_REQUIRED -dnl for libgstrtsp-1.0: gstreamer-rtsp-1.0 >= \$GST_REQUIRED -dnl etc. -PKG_CHECK_MODULES(GST, [ - gstreamer-1.0 >= \$GST_REQUIRED - gstreamer-base-1.0 >= \$GST_REQUIRED - gstreamer-controller-1.0 >= \$GST_REQUIRED -], [ - AC_SUBST(GST_CFLAGS) - AC_SUBST(GST_LIBS) -], [ - AC_MSG_ERROR([ - You need to install or upgrade the GStreamer development - packages on your system. On debian-based systems these are - libgstreamer1.0-dev and libgstreamer-plugins-base1.0-dev. - on RPM-based systems gstreamer1.0-devel, libgstreamer1.0-devel - or similar. The minimum version required is \$GST_REQUIRED. - ]) -]) - -dnl check if compiler understands -Wall (if yes, add -Wall to GST_CFLAGS) -AC_MSG_CHECKING([to see if compiler understands -Wall]) -save_CFLAGS="\$CFLAGS" -CFLAGS="\$CFLAGS -Wall" -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ ], [ ])], [ - GST_CFLAGS="\$GST_CFLAGS -Wall" - AC_MSG_RESULT([yes]) -], [ - AC_MSG_RESULT([no]) -]) - -dnl set the plugindir where plugins should be installed (for plugins/Makefile.am) -if test "x\${prefix}" = "x\$HOME"; then - plugindir="\$HOME/.gstreamer-1.0/plugins" +# Set the directory where plugins should be installed. +# +# If the prefix is the user home directory, adjust the plugin installation +# path so that GStreamer can find it. Requires meson >= 0.53.0 +fs = import('fs') +if fs.is_samepath(get_option('prefix'), '~') + plugins_install_dir = '@0@/.local/share/gstreamer-1.0/plugins'.format(get_option('prefix')) else - plugindir="\\\$(libdir)/gstreamer-1.0" -fi -AC_SUBST(plugindir) + plugins_install_dir = '@0@/gstreamer-1.0'.format(get_option('libdir')) +endif -dnl set proper LDFLAGS for plugins -GST_PLUGIN_LDFLAGS='-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*' -AC_SUBST(GST_PLUGIN_LDFLAGS) +plugin_deps = [gst_dep, gst_base_dep] +tool_deps = [gst_dep] -AC_CONFIG_FILES([Makefile plugins/Makefile tools/Makefile]) -AC_OUTPUT +subdir('plugins') +subdir('tools') EOF -cat >$basedir/Makefile.am <$basedir/plugins/Makefile.am <$basedir/plugins/meson.build < - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation @@ -323,7 +286,7 @@ generate | sed \ -e "s/gstreplace/$gstreplace/g" \ -e "s/replace/$replace/g" >$basedir/plugins/${gstreplace}plugin.c -gst-indent $basedir/plugins/${gstreplace}plugin.c +gst-indent $basedir/plugins/${gstreplace}plugin.c || echo "Warning: could not run gst-indent on the generated code." 1>&2 rm -f $basedir/plugins/${gstreplace}plugin.c~ cat >$basedir/plugins/${gstreplace}.c <$basedir/tools/Makefile.am <$basedir/tools/meson.build <$basedir/tools/${gstreplace}.c <$basedir/tools/${gstreplace}.c < int main (void) { printf ("FIXME\n"); return 0; } EOF - -