--- /dev/null
+diff -ub -purN a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt 2017-06-21 03:47:15.000000000 +0200
++++ b/CMakeLists.txt 2020-01-12 02:51:41.692331365 +0100
+@@ -65,10 +65,10 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) # for
+ # Instruct CMake to run moc automatically when needed.
+ set(CMAKE_AUTOMOC ON)
+ if(NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+- set(QTAV_INSTALL_HEADERS ${CMAKE_INSTALL_PREFIX}/include)
+- set(QTAV_INSTALL_LIBS ${CMAKE_INSTALL_PREFIX}/lib)
++ set(QTAV_INSTALL_HEADERS ${QT_INSTALL_HEADERS})
++ set(QTAV_INSTALL_LIBS ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
+ set(QTAV_INSTALL_BINS ${CMAKE_INSTALL_PREFIX}/bin)
+- set(QTAV_INSTALL_QML ${CMAKE_INSTALL_PREFIX}/qml)
++ set(QTAV_INSTALL_QML ${QT_INSTALL_QML})
+ else()
+ set(CMAKE_INSTALL_PREFIX ${QT_INSTALL_PREFIX} CACHE PATH "default install path" FORCE)
+ set(QTAV_INSTALL_HEADERS ${QT_INSTALL_HEADERS})
--- /dev/null
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+MY_PN="QtAV"
+CAPI_HASH="b43aa93"
+inherit cmake qmake-utils
+
+DESCRIPTION="Multimedia playback framework based on Qt + FFmpeg"
+HOMEPAGE="https://www.qtav.org"
+SRC_URI="https://github.com/wang-bin/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
+https://dev.gentoo.org/~johu/distfiles/${P}-capi.h-${CAPI_HASH}.xz"
+
+LICENSE="GPL-3+ LGPL-2.1+"
+SLOT="0/1"
+KEYWORDS="~amd64"
+IUSE="gui libav opengl portaudio pulseaudio vaapi"
+REQUIRED_USE="gui? ( opengl )"
+
+DEPEND="
+ dev-qt/qtcore:5
+ dev-qt/qtdeclarative:5
+ dev-qt/qtgui:5
+ dev-qt/qtwidgets:5
+ gui? ( dev-qt/qtsql:5 )
+ libav? (
+ media-video/libav:=
+ x11-libs/libX11
+ )
+ !libav? ( media-video/ffmpeg:= )
+ opengl? ( dev-qt/qtopengl:5 )
+ portaudio? ( media-libs/portaudio )
+ pulseaudio? ( media-sound/pulseaudio )
+"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-installpaths.patch
+ "${FILESDIR}"/${P}-ffmpeg4-{1,2}.patch # bugs 660852, 670765
+ "${FILESDIR}"/${P}-qt5.14.patch
+)
+
+src_prepare() {
+ cmake_src_prepare
+ cp "${WORKDIR}/${P}-capi.h-${CAPI_HASH}" contrib/capi/capi.h \
+ || die "Failed to add missing header"
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_TESTS=OFF
+ -DBUILD_EXAMPLES=OFF
+ -DBUILD_PLAYERS=$(usex gui)
+ -DBUILD_QT5OPENGL=$(usex opengl)
+ -DHAVE_PORTAUDIO=$(usex portaudio)
+ -DHAVE_PULSE=$(usex pulseaudio)
+ -DHAVE_VAAPI=$(usex vaapi)
+ )
+
+ cmake_src_configure
+ pushd tools/install_sdk >/dev/null
+ eqmake5
+ popd >/dev/null
+}
+
+src_install() {
+ cmake_src_install
+ emake -C tools/install_sdk INSTALL_ROOT="${ED}" install
+}