blender: build with ninja for less build messages.

This commit is contained in:
Mehdi Chinoune
2021-10-31 13:51:31 +01:00
parent 5e0ab12005
commit f9da99cd52

View File

@@ -58,7 +58,8 @@ depends=("${MINGW_PACKAGE_PREFIX}-alembic"
"${MINGW_PACKAGE_PREFIX}-SDL2"
"${MINGW_PACKAGE_PREFIX}-wintab-sdk"
"${MINGW_PACKAGE_PREFIX}-zlib")
makedepends=("${MINGW_PACKAGE_PREFIX}-cmake")
makedepends=("${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-ninja")
#[[ $CARCH == x86_64 ]] && makedepends+=('cuda')
#optdepends=('cuda: cycles renderer cuda support')
options=(!strip staticlibs !debug)
@@ -106,34 +107,45 @@ sha256sums=('e791cfc403292383577c3c8ce2cd34e5aa2cd8da0a7483041049a1609ddb4595'
'86814ae1e91100b903fb65ceb61d67766ff6386e55ae892aa72278a6dd20f86a'
'55b6d79dbbfd1ac182c26b868c16867e42729a5537da29f3527e9017b19b41f6')
apply_patch_with_msg() {
for _patch in "$@"
do
msg2 "Applying ${_patch}"
patch -Nbp1 -i "${srcdir}/${_patch}"
done
}
prepare() {
cd ${srcdir}/${_realname}-${pkgver}
[[ -d build_files/cmake/platform/platform_win32_mingw64.cmake ]] && rm build_files/cmake/platform/platform_win32_mingw64.cmake
patch -p1 -i "${srcdir}"/0001-mingw-buildsystem.patch
patch -p1 -i "${srcdir}"/0002-fix-mingw-w64-definitions.patch
patch -p1 -i "${srcdir}"/0004-fix-finding-glew.patch
patch -p1 -i "${srcdir}"/0005-fix-define-syntax.patch
patch -p1 -i "${srcdir}"/0006-mingw-DEBUG-libmv-avoid-too-many-sections.patch
patch -p1 -i "${srcdir}"/0008-mingw-use-X11-like-path-layout.patch
patch -p1 -i "${srcdir}"/0011-c++11-defines-__i386__-not-i386.patch
patch -p1 -i "${srcdir}"/0012-re-enable-SSE-on-mingw-w64-i686.patch
patch -p1 -i "${srcdir}"/0014-libstdc++-not-support-utf-stream.patch
patch -p1 -i "${srcdir}"/0015-mingw-python-like-msvc.patch
patch -p1 -i "${srcdir}"/0016-mingw-windres.patch
patch -p1 -i "${srcdir}"/0017-find-pugixml.patch
patch -p1 -i "${srcdir}"/0019-fix-casts.patch
patch -p1 -i "${srcdir}"/0020-blendthumb-build.patch
patch -p1 -i "${srcdir}"/0021-comctl32-v6-for-TaskDialogIndirect.patch
patch -p1 -i "${srcdir}"/0022-find-llvm-convert-paths.patch
patch -p1 -i "${srcdir}"/0023-link-errors.patch
patch -p1 -i "${srcdir}"/0025-callback-function-prototype-fix.patch
patch -p1 -i "${srcdir}"/0026-embree-shared.patch
patch -p1 -i "${srcdir}"/0027-broken-32bit-support.patch
apply_patch_with_msg \
0001-mingw-buildsystem.patch \
0002-fix-mingw-w64-definitions.patch \
0004-fix-finding-glew.patch \
0005-fix-define-syntax.patch \
0006-mingw-DEBUG-libmv-avoid-too-many-sections.patch \
0008-mingw-use-X11-like-path-layout.patch \
0011-c++11-defines-__i386__-not-i386.patch \
0012-re-enable-SSE-on-mingw-w64-i686.patch \
0014-libstdc++-not-support-utf-stream.patch \
0015-mingw-python-like-msvc.patch \
0016-mingw-windres.patch \
0017-find-pugixml.patch \
0019-fix-casts.patch \
0020-blendthumb-build.patch \
0021-comctl32-v6-for-TaskDialogIndirect.patch \
0022-find-llvm-convert-paths.patch \
0023-link-errors.patch \
0025-callback-function-prototype-fix.patch \
0026-embree-shared.patch \
0027-broken-32bit-support.patch
}
build() {
[[ -d "${srcdir}"/build-${CARCH} ]] && rm -rf ${srcdir}/build-${CARCH}
mkdir "${srcdir}"/build-${CARCH} && cd "${srcdir}"/build-${CARCH}
[[ -d "${srcdir}"/build-${MSYSTEM} ]] && rm -rf ${srcdir}/build-${MSYSTEM}
mkdir "${srcdir}"/build-${MSYSTEM} && cd "${srcdir}"/build-${MSYSTEM}
# i686 SSE is problematic with Cycles: https://developer.blender.org/T36316
# .. but commit:
@@ -152,7 +164,7 @@ build() {
else
_btype=Release
fi
export XR_OPENXR_SDK_ROOT_DIR=${MINGW_PREFIX}
export EMBREE_ROOT_DIR=${MINGW_PREFIX}
@@ -160,7 +172,7 @@ build() {
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake \
-G"MSYS Makefiles" \
-G"Ninja" \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
-DMINGW_LIBS=${MINGW_PREFIX} \
-DCMAKE_BUILD_TYPE=${_btype} \
@@ -201,18 +213,20 @@ build() {
-DLLVM_STATIC=ON \
../${_realname}-${pkgver}
make
cmake --build .
}
package() {
cd ${srcdir}/build-${CARCH}
make DESTDIR=${pkgdir} install
cd ${srcdir}/build-${MSYSTEM}
DESTDIR=${pkgdir} cmake --install .
cp -r bin ${pkgdir}${MINGW_PREFIX}/
rm ${pkgdir}${MINGW_PREFIX}/bin/msgfmt.exe
${MINGW_PREFIX}/bin/python -m compileall "${pkgdir}${MINGW_PREFIX}/share/blender/${pkgver}"
${MINGW_PREFIX}/bin/python -m compileall \
${pkgdir}${MINGW_PREFIX}/share/blender/${pkgver}/scripts/startup \
${pkgdir}${MINGW_PREFIX}/share/blender/${pkgver}/scripts/modules \
${pkgdir}${MINGW_PREFIX}/share/blender/${pkgver}/scripts/addons
${pkgdir}${MINGW_PREFIX}/share/blender/${pkgver}/scripts/startup \
${pkgdir}${MINGW_PREFIX}/share/blender/${pkgver}/scripts/modules \
${pkgdir}${MINGW_PREFIX}/share/blender/${pkgver}/scripts/addons
}