101 lines
3.5 KiB
Bash
101 lines
3.5 KiB
Bash
# Contributor: Mehdi Chinoune <mehdi.chinoune@hotmail.com>
|
|
|
|
_realname=qt5-imageformats
|
|
pkgbase="mingw-w64-${_realname}"
|
|
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}"
|
|
"${MINGW_PACKAGE_PREFIX}-${_realname}-debug")
|
|
pkgver=5.15.17
|
|
pkgrel=1
|
|
pkgdesc="Plugins for additional image formats: TIFF, MNG, TGA, WBMP (mingw-w64)"
|
|
arch=('any')
|
|
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
|
|
url='https://www.qt.io/'
|
|
msys2_references=(
|
|
"cpe: cpe:/a:qt:qt"
|
|
)
|
|
license=('spdx:LGPL-3.0-only WITH Qt-GPL-exception-1.0 AND LGPL-2.1-or-later AND GPL-3.0-or-later AND GPL-2.0-or-later AND GPL-2.0-only AND GFDL-1.3-no-invariants-only')
|
|
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-base"
|
|
"${MINGW_PACKAGE_PREFIX}-jasper"
|
|
"${MINGW_PACKAGE_PREFIX}-libmng"
|
|
"${MINGW_PACKAGE_PREFIX}-libtiff"
|
|
"${MINGW_PACKAGE_PREFIX}-libwebp"
|
|
"rsync")
|
|
_pkgfn="${_realname/5-/}-everywhere-opensource-src-${pkgver}"
|
|
source=("https://download.qt.io/official_releases/qt/${pkgver%.*}/$pkgver/submodules/$_pkgfn.tar.xz"
|
|
"0001-qmng-fix-build.patch")
|
|
sha256sums=('3925f0f9fab0a5e5fee83cf1b4770d52235733977392553b87518f666f5379b0'
|
|
'727602791c21070a08c97c9423a4343e2a44d2f7ea48731b3720da50e4797ea5')
|
|
|
|
prepare() {
|
|
cd "${srcdir}/${_pkgfn/opensource-/}"
|
|
patch -p1 -i "${srcdir}/0001-qmng-fix-build.patch"
|
|
}
|
|
|
|
build() {
|
|
mkdir -p build-${MSYSTEM} && cd build-${MSYSTEM}
|
|
|
|
qmake ../${_pkgfn/opensource-/}
|
|
|
|
make
|
|
}
|
|
|
|
check() {
|
|
cd build-${MSYSTEM}
|
|
make check -j1 -k
|
|
}
|
|
|
|
package_qt5-imageformats() {
|
|
depends=("${MINGW_PACKAGE_PREFIX}-qt5-base"
|
|
"${MINGW_PACKAGE_PREFIX}-jasper"
|
|
"${MINGW_PACKAGE_PREFIX}-libmng"
|
|
"${MINGW_PACKAGE_PREFIX}-libtiff"
|
|
"${MINGW_PACKAGE_PREFIX}-libwebp")
|
|
groups=("${MINGW_PACKAGE_PREFIX}-qt5")
|
|
|
|
cd build-${MSYSTEM}
|
|
|
|
# Fix Makefiles
|
|
local PREFIX_WIN=$(cygpath -am ${MINGW_PREFIX})
|
|
find "${srcdir}/build-${MSYSTEM}" -type f \( -name 'Makefile*' \) \
|
|
-exec sed -i -e "s|${PREFIX_WIN:0:2}\$(INSTALL_ROOT|\$(INSTALL_ROOT|g" {} \;
|
|
find "${srcdir}/build-${MSYSTEM}" -type f \( -name 'Makefile*' \) \
|
|
-exec sed -i -e "s|)${PREFIX_WIN:2}|)${MINGW_PREFIX}|g" {} \;
|
|
|
|
make INSTALL_ROOT="${pkgdir}" install
|
|
|
|
install -d "$pkgdir${MINGW_PREFIX}"/share/licenses/${_realname}
|
|
install -Dm644 $srcdir/${_pkgfn/opensource-/}/LICENSE* -t "$pkgdir${MINGW_PREFIX}"/share/licenses/${_realname}
|
|
|
|
# Seperate debug-info files
|
|
mv -f "${pkgdir}${MINGW_PREFIX}/lib"/*.debug "${pkgdir}${MINGW_PREFIX}/bin"/ || true
|
|
rsync -armR --remove-source-files --include="*/" --include="*.debug" --exclude="*" --prune-empty-dirs "${pkgdir}"/.${MINGW_PREFIX} "${srcdir}"/${MSYSTEM}-debug/
|
|
|
|
# Fix paths in *.cmake files:
|
|
# $(cygpath -m ${MINGW_PREFIX}) -> $(cygpath -m "${pkgdir}"${MINGW_PREFIX})
|
|
local FAKE_PREFIX_FOR_REPLACE="@@QT_REAL_PREFIX/dir@@"
|
|
|
|
find "${pkgdir}${MINGW_PREFIX}/lib" -type f -name '*.cmake' \
|
|
-exec sed -i -e "s|${PREFIX_WIN}|${FAKE_PREFIX_FOR_REPLACE}|g" {} \;
|
|
}
|
|
|
|
package_qt5-imageformats-debug() {
|
|
depends=("${MINGW_PACKAGE_PREFIX}-qt5-base-debug"
|
|
"${MINGW_PACKAGE_PREFIX}-${_realname}")
|
|
groups=("${MINGW_PACKAGE_PREFIX}-qt5-debug")
|
|
options=('!strip')
|
|
|
|
cp -rf "${srcdir}"/${MSYSTEM}-debug${MINGW_PREFIX} "${pkgdir}"/
|
|
}
|
|
|
|
# template start; name=mingw-w64-splitpkg-wrappers; version=1.0;
|
|
# vim: set ft=bash :
|
|
|
|
# generate wrappers
|
|
for _name in "${pkgname[@]}"; do
|
|
_short="package_${_name#${MINGW_PACKAGE_PREFIX}-}"
|
|
_func="$(declare -f "${_short}")"
|
|
eval "${_func/#${_short}/package_${_name}}"
|
|
done
|
|
# template end;
|