Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 472234

Summary: media-libs/gst-plugins-base-0.10.36: build depend on host when cross compiling
Product: Gentoo Linux Reporter: Bertrand Jacquin <bertrand>
Component: Current packagesAssignee: GStreamer package maintainers <gstreamer>
Status: RESOLVED OBSOLETE    
Severity: normal CC: bertrand
Priority: Normal Keywords: PATCH, STABLE
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 662714    
Attachments: build.log
emerge --info
gst-plugins-base-0.10.36.ebuild-GST_CONFIGPATH.diff

Description Bertrand Jacquin 2013-06-03 23:22:54 UTC
Trying to cross compile media-libs/gst-plugins-base-0.10.36 for i686-w64-mingw32 make the fail build as attached in build.log

The fact is that sami_* functions are used in gst/subparse/samiparse.{c,h}.
Theses files are compiled only if USE_XML is defined

From gst/subparse/Makefile.am
if USE_XML
SAMIPARSE_SOURCES = samiparse.c samiparse.h
else
SAMIPARSE_SOURCES =
endif

USE_XML itself if defined to 0 or 1 by configure(.ac) like this :

dnl check for gstreamer core features (subsystems)
dnl FIXME: this assumes srcdir == builddir for uninstalled setups
GST_CONFIGPATH=`$PKG_CONFIG --variable=includedir gstreamer-0.10`"/gst/gstconfig.h"
AG_GST_PARSE_SUBSYSTEM_DISABLES($GST_CONFIGPATH)
AM_CONDITIONAL(USE_XML, test $GST_DISABLE_XML != "1")

"$PKG_CONFIG --variable=includedir gstreamer-0.10" at the src_configure moment is equivalent to this in case of cross compiling :

# i686-w64-mingw32-pkg-config --variable=includedir gstreamer-0.10
/usr/include/gstreamer-0.10

This is ok, but then configure do the following :

  grep >/dev/null "#undef GST_DISABLE_XML" $GST_CONFIGPATH
  if test $? = 0; then
    GST_DISABLE_XML=0
  else
    GST_DISABLE_XML=1
  fi

 if test $GST_DISABLE_XML != "1"; then
  USE_XML_TRUE=
  USE_XML_FALSE='#'
else
  USE_XML_TRUE='#'
  USE_XML_FALSE=
fi

That is terribly wrong as the 'grep' is done on HOST gstconfig.h instead of $ROOT/usr/include/gstreamer-0.10/gst/gstconfig.h

This can be observed in the build.log as 

grep: /usr/include/gstreamer-0.10/gst/gstconfig.h: No such file or directory

The way all this is done is quiet irrelevant, but here is a patch proposal to fix this.

Also attached, emerge --info and full build.log

Reproducible: Always

Steps to Reproduce:
1. crossdev -t i686-w64-mingw32
2. emerge -Cv gstreamer
3. i686-w64-mingw32-emerge -vt gst-plugins-base:0.10
Comment 1 Bertrand Jacquin 2013-06-03 23:23:10 UTC
Created attachment 350034 [details]
build.log
Comment 2 Bertrand Jacquin 2013-06-03 23:23:19 UTC
Created attachment 350036 [details]
emerge --info
Comment 3 Bertrand Jacquin 2013-06-03 23:24:05 UTC
Created attachment 350038 [details, diff]
gst-plugins-base-0.10.36.ebuild-GST_CONFIGPATH.diff
Comment 4 Alexandre Rostovtsev (RETIRED) gentoo-dev 2013-06-15 18:54:21 UTC
I am wondering if there is a more generic/upstreamable way we can fix this.

For example, having configure.ac set GST_CONFIGPATH only if it's already unset. Then the ebuild can e.g. pass GST_CONFIGPATH=${ROOT}/$($(tc-getPKG_CONFIG) --variable=includedir gstreamer-0.10) as an argument to configure if it knows that it's cross-compiling.

In any case, the same would have to do be done for all of the -good and -bad plugins too because they also the AG_GST_PARSE_SUBSYSTEM_DISABLES macro. So whatever the fix is, it should go into gstreamer's eclasses.
Comment 5 Mart Raudsepp gentoo-dev 2019-06-22 08:49:01 UTC
gstreamer 0.10 has been finally removed from the tree. If this is an issue with the 1.0 series too, please file a new bug against that version.
Also the next 1.18 version (and maybe a 1.16.x version) will be built with meson, changing all cross-compile things.