Created attachment 431830 [details, diff] Patch to add opencv use flag to gst-plugins-bad ebuild The current media-libs/gst-plugins-bad-1.6.3 (and all prior) ebuilds are lacking the opencv use flag and associated code to build the GStreamer OpenCV Plugins: https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad-plugins/html/gst-plugins-bad-plugins-plugin-opencv.html Adding this is relatively trivial and a patch is attached to add this to the ebuild, passing --enable-opencv to the configure step when this is enabled. This will then compile cleanly against the current stable Gentoo OpenCV i.e. v2.4.9. However, this then fails at runtime with a dynamic library linking error in the plugin on the first use by GStreamer i.e. to replicate: "gst-inspect-1.0" which will list all plugins, but will blacklist the broken plugin with following error: (gst-plugin-scanner:11566): GStreamer-WARNING **: Failed to load plugin '/usr/lib64/gstreamer-1.0/libgstopencv.so': /usr/lib64/gstreamer-1.0/libgstopencv.so: undefined symbol: _ZN2cv3Mat10deallocateEv To repeat this, it is then required to delete the cached plugin registry by removing the file ~/.cache/gstreamer-1.0/registry.x86_64.bin to remove the blacklisting. The upstream gst-plugins-bad git repository shows that this has been tested against v2.4.7 and v2.4.8, so surprising that this issue occurs with v2.4.9. Have tested with v2.4.10 and the same issue is observed and the v2.4.11 opencv ebuild fails to build for me... but v2.4.12 builds and with the attached patch produces a gstreamer plugin which links correctly.
emerge --info: Portage 2.2.26 (python 3.4.3-final-0, default/linux/amd64/13.0/desktop, gcc-4.8.5, glibc-2.22-r4, 4.1.15-gentoo-r1 x86_64) ================================================================= System uname: Linux-4.1.15-gentoo-r1-x86_64-Intel-R-_Core-TM-_i7_CPU_M_640_@_2.80GHz-with-gentoo-2.2 KiB Mem: 3912040 total, 981992 free KiB Swap: 4184060 total, 4120204 free Timestamp of repository gentoo: Sun, 24 Apr 2016 00:45:01 +0000 sh bash 4.3_p42-r1 ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1 app-shells/bash: 4.3_p42-r1::gentoo dev-java/java-config: 2.2.0-r3::gentoo dev-lang/perl: 5.20.2::gentoo dev-lang/python: 2.7.10-r1::gentoo, 3.4.3-r1::gentoo dev-util/cmake: 3.3.1-r1::gentoo dev-util/pkgconfig: 0.28-r2::gentoo sys-apps/baselayout: 2.2::gentoo sys-apps/openrc: 0.19.1::gentoo sys-apps/sandbox: 2.10-r1::gentoo sys-devel/autoconf: 2.13::gentoo, 2.69::gentoo sys-devel/automake: 1.11.6-r1::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo sys-devel/binutils: 2.25.1-r1::gentoo sys-devel/gcc: 4.8.5::gentoo, 4.9.3::gentoo sys-devel/gcc-config: 1.7.3::gentoo sys-devel/libtool: 2.4.6::gentoo sys-devel/make: 4.1-r1::gentoo sys-kernel/linux-headers: 4.3::gentoo (virtual/os-headers) sys-libs/glibc: 2.22-r4::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 andy location: /var/lib/layman/andy masters: gentoo priority: 0 local-overlay location: /usr/local/portage masters: gentoo local-crossdev location: /usr/local/portage-crossdev masters: gentoo priority: 10 ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/easy-rsa /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-march=native -O2 -pipe" DISTDIR="/usr/portage/distfiles" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync webrsync-gpg xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://mirror.qubenet.net/mirror/gentoo/" LANG="en_GB.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j4" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" USE="X a52 aac acl acpi alsa amd64 berkdb bindist bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt css cups cxx dbus dri dts dvb dvd dvdr emboss encode exif fam fbcon ffmpeg firefox flac fortran gdbm gif glamor gpm gtk gtk2 hal iconv icu ipv6 joystick jpeg lcms ldap libav libnotify lock mad mmx mmxext mng modules mp3 mp4 mpeg multilib ncurses nls nptl offensive ogg opengl openmp pam pango pcre pdf png policykit ppds qt3support readline sdl seccomp session sound spell sse sse2 ssl startup-notification svg tcpd thunar tiff truetype udev udisks unicode upower usb v4l v4l2 vaapi vorbis win32codecs wxwidgets x264 xattr xcb xcomposite xml xscreensaver xv xvid zlib" ABI_X86="64" ALSA_CARDS="snd_hda_intel snd_hda_hdmi" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" DVB_CARDS="usb-dib0700" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev joystick keyboard mouse synaptics wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_US en_GB" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" QEMU_SOFTMMU_TARGETS="alpha arm i386 m68k mips mips64 mipsel ppc ppc64 sh4 sparc sparc64 x86_64" QEMU_USER_TARGETS="alpha arm i386 m68k mips mipsel ppc ppc64 sh4 sparc sparc64 x86_64" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="cirrus intel i915 i965 nouveau nv fbdev v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Anyway, the intent of this bug is to ask for the patch to be applied to Portage, but the reason for the runtime linkage breakage should be investigated as OpenCV v2.4.9 is still the current stable and thus it would be useful if this could be fixed to link correctly on OpenCV less than 2.4.12. The issue may be due to the pkg-config output for OpenCV as per: https://stackoverflow.com/questions/11094953/gstreamer-plugin-library-not-linking-against-opencv-shared-object-library-und
NAK. Make a media-plugins/gst-plugins-opencv package instead. See e.g media-plugins/gst-plugins-modplug for an example.
Ah, I see. Agreed. Will submit a media-plugins/gst-plugins-opencv ebuild instead once I have had a chance to test that this doesn't exhibit any runtime issue. Thanks.
Created attachment 432708 [details] Ebuild for GStreamer OpenCV Plugins
Sorry for delay. Busy week IRL. New ebuild attached and tested here with no runtime issues.
Thanks for testing. I'll then add a newer version with the next bump (long overdue, really intending to get done this week finally) and ask you to test the functionality of that version here.
@leio: any update on this yet? @David: update to EAPI 6 should hopefully be trivial?!
Pushed to tree with 1.8.3 bumps. This is limited to abi_x86_64 though since opencv is not multilib aware.