PKGBUILDs/qt5-multimedia/mingw-w64/PKGBUILD

121 lines
4.6 KiB
Bash
Raw Normal View History

2016-02-03 20:42:14 +01:00
# Maintainer: Martchus <martchus@gmx.net>
# Contributor: ant32 <antreimer@gmail.com>
2016-02-03 20:42:14 +01:00
# All my PKGBUILDs are managed at https://github.com/Martchus/PKGBUILDs where
# you also find the URL of a binary repository.
# This file is created from PKGBUILD.sh.ep contained by the mentioned repository.
# Do not edit it manually! See README.md in the repository's root directory
# for more information.
# All patches are managed at https://github.com/Martchus/qtmultimedia
2016-02-03 20:42:14 +01:00
_qt_module=qtmultimedia
pkgname=mingw-w64-qt5-multimedia
2024-03-15 22:47:25 +01:00
pkgver=5.15.13
2019-02-02 18:18:25 +01:00
pkgrel=1
2016-06-14 23:48:54 +02:00
arch=('any')
2016-11-01 19:46:16 +01:00
pkgdesc='Classes for audio, video, radio and camera functionality (mingw-w64)'
depends=('mingw-w64-qt5-base' 'mingw-w64-qt5-declarative')
makedepends=('mingw-w64-gcc' 'mingw-w64-pkg-config')
license=('GPL3' 'LGPL' 'FDL' 'custom')
2024-03-15 22:47:25 +01:00
_commit=7514352532f41d9f0f8b8d722e360b1854442731
_basever=${pkgver%%+*}
2023-10-08 14:26:39 +02:00
pkgver+=+kde+r2
2022-03-07 13:23:02 +01:00
makedepends+=('git')
options=('!strip' '!buildflags' 'staticlibs')
groups=('mingw-w64-qt5')
2016-11-01 19:46:16 +01:00
url='https://www.qt.io/'
2022-03-07 13:23:02 +01:00
_pkgfqn=${_qt_module}
source=(git+https://invent.kde.org/qt/qt/$_pkgfqn#commit=$_commit
'0001-Recorder-includes-to-prevent-conflict-with-vsnprintf.patch'
2018-09-19 20:39:07 +02:00
'0002-Fix-build-with-ANGLE.patch'
'0003-Workaround-multiple-definition-errors-with-amstrmid-.patch')
2024-03-15 22:47:25 +01:00
sha256sums=('eef7a053fc4d4e33bdd1ae7dd0a2db32f755eacbf2e4a144246d33c3e02a0ab5'
'36bbaf9842fb930b4f17ae7ad2349b5dc9216492caeb7292f54d8fd7c0d66399'
'b733514a287d915d74ddbbb901b2fae1a0c169becbadaf9bb63738392e383064'
'5ba3a72643af5e16b9f51ac9e5317d2f7e41dcb177f2201ac38ef0d0cd9a66e5')
2016-02-03 20:42:14 +01:00
_architectures='i686-w64-mingw32 x86_64-w64-mingw32'
_configurations+=('CONFIG+=actually_a_shared_build CONFIG+=shared')
2016-02-03 20:42:14 +01:00
2022-03-07 13:23:02 +01:00
pkgver() {
cd $_pkgfqn
echo "$_basever+kde+r"`git rev-list --count v$_basever-lts-lgpl..$_commit`
}
2016-02-03 20:42:14 +01:00
prepare() {
cd "${srcdir}/${_pkgfqn}"
# apply patches; further descriptions can be found in patch files itself
for patch in "$srcdir/"*.patch; do
patch -p1 -i "$patch"
done
2016-02-03 20:42:14 +01:00
}
build() {
cd "${srcdir}/${_pkgfqn}"
for _arch in ${_architectures}; do
for _config in "${_configurations[@]}"; do
msg2 "Building ${_config##*=} version for ${_arch}"
mkdir -p build-${_arch}-${_config##*=} && pushd build-${_arch}-${_config##*=}
${_arch}-qmake-qt5 ../${_qt_module}.pro ${_config} ${_additional_qmake_args}
2024-03-15 22:47:25 +01:00
make -j$(nproc)
popd
done
2016-02-03 20:42:14 +01:00
done
}
package() {
cd "${srcdir}/${_pkgfqn}"
2016-02-03 20:42:14 +01:00
for _arch in ${_architectures}; do
for _config in "${_configurations[@]}"; do
pushd build-${_arch}-${_config##*=}
2024-03-15 22:47:25 +01:00
make -j$(nproc) INSTALL_ROOT="$pkgdir" install
# use prl files from build directory since installed prl files seem to have incorrect QMAKE_PRL_LIBS_FOR_CMAKE
if [[ -d 'lib' ]]; then
pushd 'lib'
find -iname '*.static.prl' -exec cp --target-directory "${pkgdir}/usr/${_arch}/lib" --parents {} +
popd
fi
if [[ -d 'plugins' ]]; then
pushd 'plugins'
find -iname '*.static.prl' -exec cp --target-directory "${pkgdir}/usr/${_arch}/lib/qt/plugins" --parents {} +
popd
fi
# replace library path in *.prl files so it points to the installed location and not the build directory
find "${pkgdir}/usr/${_arch}/lib" \( -type f -name '*.prl' -o -name '*.pc' \) -exec sed -i -e "s:$PWD/lib:/usr/$_arch/lib:g" {} \;
# remove prl files for debug version
if ! [[ $MINGW_W64_QT_DEBUG_BUILD ]]; then
for file in $(find "${pkgdir}/usr/${_arch}" -name '*d.prl' -o -name '*d.static.prl'); do
[ -f "${file%d*}${file##*d}" ] && rm "${file}";
done
fi
# remove '.static.prl' files
find "${pkgdir}/usr/${_arch}" -name '.static.prl' -delete
find "${pkgdir}/usr/${_arch}/lib" -maxdepth 1 -name '*.dll' -delete
[ "$NO_STATIC_EXECUTABLES" -a "${_config##*=}" = static -o "$NO_EXECUTABLES" ] && \
find "${pkgdir}/usr/${_arch}" -name '*.exe' -delete || \
find "${pkgdir}/usr/${_arch}" -name '*.exe' -exec ${_arch}-strip --strip-all {} \;
find "${pkgdir}/usr/${_arch}" -name '*.dll' -exec ${_arch}-strip --strip-unneeded {} \;
find "${pkgdir}/usr/${_arch}" \( -name '*.a' -not -name 'libQt5QmlDevTools.a' -not -name 'libQt5Bootstrap.a' \) -exec ${_arch}-strip -g {} \;
[[ -d "${pkgdir}/usr/${_arch}/lib/qt/bin/" ]] && \
find "${pkgdir}/usr/${_arch}/lib/qt/bin/" -exec strip --strip-all {} \;
find "${pkgdir}/usr/${_arch}/lib/" -iname "*.so.$pkgver" -exec strip --strip-unneeded {} \;
popd
done
# drop QMAKE_PRL_BUILD_DIR because reference the build dir
find "${pkgdir}/usr/${_arch}/lib" -type f -name '*.prl' -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;
2016-02-03 20:42:14 +01:00
done
}