media-video/mpv-0.35.0-r1 fails to emerge with USE=raspberry-pi The error is: ../mpv-0.35.0/video/out/opengl/context_rpi.c:42:5: error: unknown type name ‘EGL_DISPMANX_WINDOW_T’ 42 | EGL_DISPMANX_WINDOW_T egl_window; | ^~~~~~~~~~~~~~~~~~~~~ ../mpv-0.35.0/video/out/opengl/context_rpi.c: In function ‘recreate_dispmanx’: ../mpv-0.35.0/video/out/opengl/context_rpi.c:156:22: error: ‘EGL_DISPMANX_WINDOW_T’ undeclared (first use in this function) 156 | p->egl_window = (EGL_DISPMANX_WINDOW_T){ | ^~~~~~~~~~~~~~~~~~~~~ ../mpv-0.35.0/video/out/opengl/context_rpi.c:156:22: note: each undeclared identifier is reported onl y once for each function it appears in ../mpv-0.35.0/video/out/opengl/context_rpi.c:156:44: error: expected ‘;’ before ‘{’ token 156 | p->egl_window = (EGL_DISPMANX_WINDOW_T){ | ^ | ; Reproducible: Always Steps to Reproduce: 1. USE=raspberry-pi emerge =media-video/mpv-0.35.0-r1 Actual Results: emerge fails; looking at build log I see the error described above Expected Results: package should compile with no errors Using raspberry pi 3B. emerge --info: Portage 3.0.41 (python 3.10.9-final-0, default/linux/arm/17.0/armv7a, gcc-11.3.0, glibc-2.36-r5, 5.10.63-v7+ armv7l) ================================================================= System Settings ================================================================= System uname: Linux-5.10.63-v7+-armv7l-ARMv7_Processor_rev_4_-v7l-with-glibc2.36 KiB Mem: 996096 total, 261160 free KiB Swap: 5242872 total, 5242872 free Timestamp of repository gentoo: Wed, 25 Jan 2023 01:45:01 +0000 Head commit of repository gentoo: ab78927407cc3ec4b89add96df66663bc2dc358c sh bash 5.1_p16-r2 ld GNU ld (Gentoo 2.39 p5) 2.39.0 distcc 3.4 armv7a-unknown-linux-gnueabihf [enabled] app-misc/pax-utils: 1.3.5::gentoo app-shells/bash: 5.1_p16-r2::gentoo dev-lang/perl: 5.36.0-r1::gentoo dev-lang/python: 3.9.16::gentoo, 3.10.9::gentoo dev-util/cmake: 3.24.3::gentoo dev-util/meson: 0.64.1::gentoo sys-apps/baselayout: 2.9::gentoo sys-apps/openrc: 0.45.2-r2::gentoo sys-apps/sandbox: 2.29::gentoo sys-devel/autoconf: 2.71-r5::gentoo sys-devel/automake: 1.16.5::gentoo sys-devel/binutils: 2.39-r4::gentoo sys-devel/binutils-config: 5.4.1::gentoo sys-devel/gcc: 11.3.0::gentoo sys-devel/gcc-config: 2.8::gentoo sys-devel/libtool: 2.4.7::gentoo sys-devel/llvm: 15.0.6-r1::gentoo sys-devel/make: 4.3::gentoo sys-kernel/linux-headers: 5.15-r3::gentoo (virtual/os-headers) sys-libs/glibc: 2.36-r5::gentoo Repositories: gentoo location: /var/db/repos/gentoo sync-type: rsync sync-uri: rsync://ftp.rnl.tecnico.ulisboa.pt/pub/gentoo/gentoo-portage priority: -1000 sync-rsync-extra-opts: sync-rsync-verify-max-age: 24 sync-rsync-verify-jobs: 1 sync-rsync-verify-metamanifest: no ACCEPT_KEYWORDS="arm" ACCEPT_LICENSE="* -@EULA" CBUILD="armv7a-unknown-linux-gnueabihf" CFLAGS="-O2 -pipe -mfloat-abi=hard -mtls-dialect=gnu -march=armv7-a" CHOST="armv7a-unknown-linux-gnueabihf" CONFIG_PROTECT="/boot/cmdline.txt /boot/config.txt /etc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.4/ext-active/ /etc/php/apache2-php8.1/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cgi-php8.1/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/php/cli-php8.1/ext-active/ /etc/php/fpm-php7.4/ext-active/ /etc/php/fpm-php8.1/ext-active/ /etc/php/phpdbg-php7.4/ext-active/ /etc/php/phpdbg-php8.1/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-O2 -pipe -mfloat-abi=hard -mtls-dialect=gnu -march=armv7-a" DISTDIR="/var/cache/distfiles" EMERGE_DEFAULT_OPTS=" --quiet-build --quiet-fail --ask-enter-invalid -A --jobs=2 --load-average=1.5 --buildpkg-exclude 'virtual/* acct-*/* sys-kernel/*-sources */raspberrypi*' --binpkg-respect-use=y --getbinpkg --rebuilt-binaries=y --usepkg-exclude 'virtual/* acct-group/* */*-bin'" ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME" FCFLAGS="-O2 -pipe -march=armv7-a" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg buildpkg-live compress-index compressdebug config-protect-if-modified distcc distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe -march=armv7-a" GENTOO_MIRRORS="http://distfiles.gentoo.org https://ftp.rnl.tecnico.ulisboa.pt/pub/gentoo/gentoo-distfiles/" LANG="en_GB.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LEX="flex" LINGUAS="en_GB" MAKEOPTS="-j9 -l4" PKGDIR="/var/db/repos/gentoo-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 --exclude=/.git" PORTAGE_TMPDIR="/var/tmp" SHELL="/bin/bash" USE="X acl alsa arm bash-completion bindist bzip2 cli crypt dri dvb ffmpeg flac fortran gdbm gnutls iconv ipv6 jpeg libglvnd mp3 ncurses neon nls nptl openmp pam pcre php png readline samba seccomp snmp split-usr ssl svg test-rust threads udev unicode v4l vhosts vim-syntax x264 xattr zlib" ADA_TARGET="gnat_2021" 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="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_ARM="edsp neon thumb thumb2 v4 v5 v6 v7 vfp vfp-d32 vfpv3 vfpv4" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en-GB" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" RUBY_TARGETS="ruby27 ruby30" USERLAND="GNU" VIDEO_CARDS="exynos fbdev omap dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Created attachment 850014 [details] build.log.gz
Created attachment 850016 [details] environment emerge --pretend mpv [ebuild N ] media-video/mpv-0.35.0-r1 USE="X alsa cli drm dvb egl iconv jpeg libmpv lua uchardet xv zlib (-aqua) -archive -bluray -cdda (-coreaudio) -debug -dvd -gamepad -jack -javascript -lcms -libcaca (-libplacebo) -mmal (-nvenc) -openal -opengl -pipewire -pulseaudio -raspberry-pi -rubberband -sdl (-selinux) -sixel -sndio -test -tools (-vaapi) (-vdpau) (-vulkan) -wayland -zimg" LUA_SINGLE_TARGET="lua5-1 -luajit" PYTHON_SINGLE_TARGET="python3_10 -python3_9 -python3_11"
Haven't dug that deep into it but my guess is that this is caused by bug #770994. Builds fine if I use raspberrypi-userland-bin which has all files in /opt/vc and mpv does find and use them. lddtree /usr/armv7a-unknown-linux-gnueabihf/usr/bin/mpv | grep /opt/vc libbcm_host.so => /usr/armv7a-unknown-linux-gnueabihf/opt/vc/lib/libbcm_host.so libvcos.so => /usr/armv7a-unknown-linux-gnueabihf/opt/vc/lib/libvcos.so libvchiq_arm.so => /usr/armv7a-unknown-linux-gnueabihf/opt/vc/lib/libvchiq_arm.so I feel like one solution to that bug would be to install non-bin in /opt/vc too. Not that I have a raspberry-pi, so I'm not going to venture in changing anything myself (really know nothing about that package too). Least I can do is let the mpv ebuild allow -bin too, so you could try that.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=66abe318f165c27ecd761c0639f11de3b768ae86 commit 66abe318f165c27ecd761c0639f11de3b768ae86 Author: Ionen Wolkens <ionen@gentoo.org> AuthorDate: 2023-02-07 04:09:16 +0000 Commit: Ionen Wolkens <ionen@gentoo.org> CommitDate: 2023-02-07 04:24:32 +0000 media-video/mpv: allow using raspberry-userland-bin Currently fails to build with non-bin wrt bug #893422, so let's at least allow this one. Runtime untested (have no raspberry-pi). (no revbump needed given it currently doesn't build with non-bin) Bug: https://bugs.gentoo.org/893422 Signed-off-by: Ionen Wolkens <ionen@gentoo.org> media-video/mpv/mpv-0.35.0-r1.ebuild | 8 +++++++- media-video/mpv/mpv-0.35.1.ebuild | 8 +++++++- media-video/mpv/mpv-9999.ebuild | 8 +++++++- 3 files changed, 21 insertions(+), 3 deletions(-)
Created attachment 850370 [details, diff] mpv-0.35.1-raspberrypi-userland-non-bin.patch I am able to compile media-video/mpv-0.35.1 successfully on my Raspberry Pi 1 with media-libs/raspberrypi-userland-0_pre20201022 by placing the attached patch file in /etc/portage/patches/media-video/mpv/. [ebuild R ~] media-video/mpv-0.35.1:0/2::gentoo USE="alsa cli iconv mmal raspberry-pi uchardet zlib -X (-aqua) -archive -bluray -cdda (-coreaudio) -debug -drm -dvb -dvd -egl -gamepad -jack -javascript -jpeg -lcms -libcaca -libmpv (-libplacebo) -lua (-nvenc) -openal -opengl -pipewire -pulseaudio -rubberband -sdl (-selinux) -sixel -sndio -test -tools (-vaapi) (-vdpau) (-vulkan) -wayland -xv -zimg" LUA_SINGLE_TARGET="-lua5-1 -luajit" PYTHON_SINGLE_TARGET="python3_10 -python3_9 -python3_11" 0 KiB Note: media-libs/libglvnd is required at build time (for <EGL/egl.h>) but is *missing* from the ebuild's DEPEND, so you will have to install it manually. It is *not* required at run time (RDEPEND) since /usr/bin/mpv links with /usr/lib/libbrcmEGL.so and /usr/lib/libbrcmGLESv2.so (from media-libs/raspberrypi-userland) instead of /usr/lib/libEGL.so.1 and /usr/lib/libGLESv2.so.2 (from media-libs/libglvnd).
With -bin, it uses raspberrypi-userland-bin's EGL.h and mpv doesn't need modification though (aka it works like what upstream is likely expecting). While patch can be handy for /etc/portage/patches, don't think working around a mangled install in the ebuild is the right solution.
Oh, I agree! It's definitely a hack so people can have a working MPV while we wait for the raspberrypi-userland mess to be sorted out. Note: The '#ifdef EGL_CAST' guards are in my patch so that it won't break things if you switch to the RPi EGL headers, which do define EGL_DISPMANX_WINDOW_T but do not define EGL_CAST.
Confirming it builds with media-libs/raspberrypi-userland-bin-1.20201201::gentoo. Thanks! pi3 ~ # emerge -c media-libs/raspberrypi-userland && emerge -v media-libs/raspberrypi-userland-bin && USE=raspberry-pi emerge -1 =media-video/mpv-0.35.0-r1 Calculating dependencies... done! >>> Calculating removal order... media-libs/raspberrypi-userland selected: 0_pre20201022 protected: none omitted: none All selected packages: =media-libs/raspberrypi-userland-0_pre20201022 >>> 'Selected' packages are slated for removal. >>> 'Protected' and 'omitted' packages will not be removed. >>> Waiting 5 seconds before starting... >>> (Control-C to abort)... >>> Unmerging in: 5 4 3 2 1 >>> Unmerging (1 of 1) media-libs/raspberrypi-userland-0_pre20201022... Packages installed: 669 Packages in world: 91 Packages in system: 48 Required packages: 669 Number removed: 1 These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild N ] media-libs/raspberrypi-userland-bin-1.20201201::gentoo USE="hardfp -examples" 184,895 KiB Total: 1 package (1 new), Size of downloads: 184,895 KiB >>> Verifying ebuild manifests >>> Emerging (1 of 1) media-libs/raspberrypi-userland-bin-1.20201201::gentoo >>> Installing (1 of 1) media-libs/raspberrypi-userland-bin-1.20201201::gentoo >>> Recording media-libs/raspberrypi-userland-bin in "world" favorites file... >>> Jobs: 1 of 1 complete Load avg: 1.06, 0.79, 1.07 Calculating dependencies... done! >>> Verifying ebuild manifests >>> Emerging (1 of 1) media-video/mpv-0.35.0-r1::gentoo >>> Installing (1 of 1) media-video/mpv-0.35.0-r1::gentoo >>> Jobs: 1 of 1 complete Load avg: 2.02, 2.38, 1.76
I think this really needs addressing in raspberrypi-userland, not mpv. I just hit this while working on a new package. libglvnd's eglplatform.h isn't so different to the Pi one, the main difference being the latter having EGL_DISPMANX_WINDOW_T. I'm thinking we could install our own eglplatform.h header with this definition and #include_next <EGL/eglplatform.h> or #include <../../EGL/eglplatform.h> or something. The question is where to put it. Unfortunately, the pkg-config file only adds /usr/include and a couple of seemingly unrelated directories to the include list. Perhaps we could add our own. Or perhaps /usr/include/interface/vmcs_host/linux will just have to do.
(In reply to James Le Cuirot from comment #9) > I think this really needs addressing in raspberrypi-userland, not mpv. I > just hit this while working on a new package. Yes, that's why this bug been depending on bug #770994, this was just kept open for tracking that it affects mpv.
Also, it could probably just be installed the same or similar way as userland-bin which doesn't conflict with anything (and at least mpv finds it fine). Not that I have a raspberrypi so I won't be touching this.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=251affd864fc5ba4a690222a05cf3067992bfee3 commit 251affd864fc5ba4a690222a05cf3067992bfee3 Author: Ionen Wolkens <ionen@gentoo.org> AuthorDate: 2024-06-06 12:39:01 +0000 Commit: Ionen Wolkens <ionen@gentoo.org> CommitDate: 2024-06-06 13:18:57 +0000 media-video/mpv: drop 0.37.0 Closes: https://bugs.gentoo.org/893422 Signed-off-by: Ionen Wolkens <ionen@gentoo.org> media-video/mpv/Manifest | 1 - media-video/mpv/files/mpv-0.37.0-drm-fix.patch | 41 ---- media-video/mpv/metadata.xml | 2 - media-video/mpv/mpv-0.37.0.ebuild | 286 ------------------------- profiles/arch/arm/package.use.mask | 5 - profiles/arch/arm/package.use.stable.mask | 4 - profiles/arch/base/package.use.mask | 7 - 7 files changed, 346 deletions(-)