meson: generate pkg-config -uninstalled pc files

Generating those files is useful for users building the GStreamer stack
using meson and having to link it to another project which is still
using the autotools.

https://bugzilla.gnome.org/show_bug.cgi?id=776810
This commit is contained in:
Guillaume Desmottes 2017-01-04 14:56:36 +01:00 committed by Thibault Saunier
parent fe0e51914a
commit b01f8891f4
14 changed files with 48 additions and 13 deletions

View file

@ -36,7 +36,21 @@ cp_verbose_0 = @echo " CP $@";
%-@GST_API_VERSION@.pc: %.pc
$(cp_verbose_0)cp $< $@
%-@GST_API_VERSION@-uninstalled.pc: %-uninstalled.pc
$(cp_verbose_0)cp $< $@
### the uninstalled libdir is depend of the build system used so set it here
### rather than hardcoding it in the file directly.
$(AM_V_GEN) sed \
-e "s|[@]allocatorslibdir[@]|$(abs_top_builddir)/gst-libs/gst/allocators/.libs|" \
-e "s|[@]audiolibdir[@]|$(abs_top_builddir)/gst-libs/gst/audio/.libs|" \
-e "s|[@]applibdir[@]|$(abs_top_builddir)/gst-libs/gst/app/.libs|" \
-e "s|[@]fftlibdir[@]|$(abs_top_builddir)/gst-libs/gst/fft/.libs|" \
-e "s|[@]pbutilslibdir[@]|$(abs_top_builddir)/gst-libs/gst/pbutils/.libs|" \
-e "s|[@]rifflibdir[@]|$(abs_top_builddir)/gst-libs/gst/riff/.libs|" \
-e "s|[@]rtplibdir[@]|$(abs_top_builddir)/gst-libs/gst/rtp/.libs|" \
-e "s|[@]rtsplibdir[@]|$(abs_top_builddir)/gst-libs/gst/rtsp/.libs|" \
-e "s|[@]sdplibdir[@]|$(abs_top_builddir)/gst-libs/gst/sdp/.libs|" \
-e "s|[@]taglibdir[@]|$(abs_top_builddir)/gst-libs/gst/tag/.libs|" \
-e "s|[@]videolibdir[@]|$(abs_top_builddir)/gst-libs/gst/video/.libs|" \
$< > $@.tmp && mv $@.tmp $@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = $(pcverfiles)

View file

@ -1,7 +1,7 @@
# the standard variables don't make sense for an uninstalled copy
prefix=
exec_prefix=
libdir=@abs_top_builddir@/gst-libs/gst/allocators/.libs
libdir=@allocatorslibdir@
# includedir is builddir because it is used to find gstconfig.h in places
includedir=@abs_top_builddir@/gst-libs
girdir=@abs_top_builddir@/gst-libs/gst/allocators

View file

@ -1,7 +1,7 @@
# the standard variables don't make sense for an uninstalled copy
prefix=
exec_prefix=
libdir=@abs_top_builddir@/gst-libs/gst/app/.libs
libdir=@applibdir@
# includedir is builddir because it is used to find gstconfig.h in places
includedir=@abs_top_builddir@/gst-libs
girdir=@abs_top_builddir@/gst-libs/gst/app

View file

@ -1,7 +1,7 @@
# the standard variables don't make sense for an uninstalled copy
prefix=
exec_prefix=
libdir=@abs_top_builddir@/gst-libs/gst/audio/.libs
libdir=@audiolibdir@
# includedir is builddir because it is used to find gstconfig.h in places
includedir=@abs_top_builddir@/gst-libs
girdir=@abs_top_builddir@/gst-libs/gst/audio

View file

@ -1,7 +1,7 @@
# the standard variables don't make sense for an uninstalled copy
prefix=
exec_prefix=
libdir=@abs_top_builddir@/gst-libs/gst/fft/.libs
libdir=@fftlibdir@
# includedir is builddir because it is used to find gstconfig.h in places
includedir=@abs_top_builddir@/gst-libs
girdir=@abs_top_builddir@/gst-libs/gst/fft

View file

@ -1,7 +1,7 @@
# the standard variables don't make sense for an uninstalled copy
prefix=
exec_prefix=
libdir=@abs_top_builddir@/gst-libs/gst/pbutils/.libs
libdir=@pbutilslibdir@
# includedir is builddir because it is used to find gstconfig.h in places
includedir=@abs_top_builddir@/gst-libs
girdir=@abs_top_builddir@/gst-libs/gst/pbutils

View file

@ -10,7 +10,7 @@ Name: GStreamer Base Plugins Libraries, Uninstalled
Description: Streaming media framework, base plugins libraries, uninstalled
Version: @VERSION@
Requires: gstreamer-@GST_API_VERSION@
Libs: -L@abs_top_builddir@/gst-libs/gst/allocators/.libs -L@abs_top_builddir@/gst-libs/gst/app/.libs -L@abs_top_builddir@/gst-libs/gst/audio/.libs -L@abs_top_builddir@/gst-libs/gst/fft/.libs -L@abs_top_builddir@/gst-libs/gst/pbutils/.libs -L@abs_top_builddir@/gst-libs/gst/riff/.libs -L@abs_top_builddir@/gst-libs/gst/rtp/.libs -L@abs_top_builddir@/gst-libs/gst/rtsp/.libs -L@abs_top_builddir@/gst-libs/gst/sdp/.libs -L@abs_top_builddir@/gst-libs/gst/tag/.libs -L@abs_top_builddir@/gst-libs/gst/video/.libs
Libs: -L@allocatorslibdir@ -L@applibdir@ -L@audiolibdir@ -L@fftlibdir@ -L@pbutilslibdir@ -L@rifflibdir@ -L@rtplibdir@ -L@rtsplibdir@ -L@sdplibdir@ -L@taglibdir@ -L@videolibdir@
Cflags: -I@abs_top_srcdir@/gst-libs -I@abs_top_builddir@/gst-libs
libraries=allocators app audio fft pbutils riff rtp rtsp sdp tag video

View file

@ -1,7 +1,7 @@
# the standard variables don't make sense for an uninstalled copy
prefix=
exec_prefix=
libdir=@abs_top_builddir@/gst-libs/gst/riff/.libs
libdir=@rifflibdir@
# includedir is builddir because it is used to find gstconfig.h in places
includedir=@abs_top_builddir@/gst-libs
girdir=@abs_top_builddir@/gst-libs/gst/riff

View file

@ -1,7 +1,7 @@
# the standard variables don't make sense for an uninstalled copy
prefix=
exec_prefix=
libdir=@abs_top_builddir@/gst-libs/gst/rtp/.libs
libdir=@rtplibdir@
# includedir is builddir because it is used to find gstconfig.h in places
includedir=@abs_top_builddir@/gst-libs
girdir=@abs_top_builddir@/gst-libs/gst/rtp

View file

@ -1,7 +1,7 @@
# the standard variables don't make sense for an uninstalled copy
prefix=
exec_prefix=
libdir=@abs_top_builddir@/gst-libs/gst/rtsp/.libs
libdir=@rtsplibdir@
# includedir is builddir because it is used to find gstconfig.h in places
includedir=@abs_top_builddir@/gst-libs
girdir=@abs_top_builddir@/gst-libs/gst/rtsp

View file

@ -1,7 +1,7 @@
# the standard variables don't make sense for an uninstalled copy
prefix=
exec_prefix=
libdir=@abs_top_builddir@/gst-libs/gst/sdp/.libs
libdir=@sdplibdir@
# includedir is builddir because it is used to find gstconfig.h in places
includedir=@abs_top_builddir@/gst-libs
girdir=@abs_top_builddir@/gst-libs/gst/sdp

View file

@ -1,7 +1,7 @@
# the standard variables don't make sense for an uninstalled copy
prefix=
exec_prefix=
libdir=@abs_top_builddir@/gst-libs/gst/tag/.libs
libdir=@taglibdir@
# includedir is builddir because it is used to find gstconfig.h in places
includedir=@abs_top_builddir@/gst-libs
girdir=@abs_top_builddir@/gst-libs/gst/tag

View file

@ -1,7 +1,7 @@
# the standard variables don't make sense for an uninstalled copy
prefix=
exec_prefix=
libdir=@abs_top_builddir@/gst-libs/gst/video/.libs
libdir=@videolibdir@
# includedir is builddir because it is used to find gstconfig.h in places
includedir=@abs_top_builddir@/gst-libs
girdir=@abs_top_builddir@/gst-libs/gst/video

View file

@ -7,6 +7,21 @@ pkgconf.set('includedir', '${prefix}/@0@'.format(get_option('includedir')))
pkgconf.set('GST_API_VERSION', api_version)
pkgconf.set('VERSION', gst_version)
# needed for generating -uninstalled.pc files
pkgconf.set('abs_top_builddir', join_paths(meson.current_build_dir(), '..'))
pkgconf.set('abs_top_srcdir', join_paths(meson.current_source_dir(), '..'))
pkgconf.set('allocatorslibdir', join_paths(meson.build_root(), gstallocators.outdir()))
pkgconf.set('applibdir', join_paths(meson.build_root(), gstapp.outdir()))
pkgconf.set('audiolibdir', join_paths(meson.build_root(), gstaudio.outdir()))
pkgconf.set('fftlibdir', join_paths(meson.build_root(), gstfft.outdir()))
pkgconf.set('pbutilslibdir', join_paths(meson.build_root(), pbutils.outdir()))
pkgconf.set('rifflibdir', join_paths(meson.build_root(), gstriff.outdir()))
pkgconf.set('rtplibdir', join_paths(meson.build_root(), gst_rtp.outdir()))
pkgconf.set('rtsplibdir', join_paths(meson.build_root(), gst_rtsp.outdir()))
pkgconf.set('sdplibdir', join_paths(meson.build_root(), gstsdp.outdir()))
pkgconf.set('taglibdir', join_paths(meson.build_root(), gsttag.outdir()))
pkgconf.set('videolibdir', join_paths(meson.build_root(), gstvideo.outdir()))
pkg_install_dir = '@0@/pkgconfig'.format(get_option('libdir'))
pkg_files = [
@ -32,4 +47,10 @@ foreach p : pkg_files
output : outfile,
configuration : pkgconf,
install_dir : pkg_install_dir)
infile = p + '-uninstalled.pc.in'
outfile = p + '-1.0-uninstalled.pc'
configure_file(input : infile,
output : outfile,
configuration : pkgconf)
endforeach