* nanogui-git: New package. Prereq for MaterialX * Fix make dependencies * Try fix search right python * Disable hardcoded native target processor * nanogui: pin to commit * nanogui: checksum git checkout as well --------- Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
89 lines
3.0 KiB
Bash
89 lines
3.0 KiB
Bash
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
|
|
|
|
_realname=nanogui
|
|
pkgbase=mingw-w64-${_realname}
|
|
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
|
|
pkgver=0.2.0.r7.g6452dd6
|
|
pkgrel=1
|
|
pkgdesc="Minimalistic cross-platform widget library for OpenGL 3+, GLES 2/3, and Metal (mingw-w64)"
|
|
arch=('any')
|
|
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
|
|
url='https://github.com/mitsuba-renderer/nanogui'
|
|
license=('spdx:BSD-3-Clause')
|
|
depends=("${MINGW_PACKAGE_PREFIX}-python")
|
|
makedepends=(
|
|
"${MINGW_PACKAGE_PREFIX}-cc"
|
|
"${MINGW_PACKAGE_PREFIX}-cmake"
|
|
"${MINGW_PACKAGE_PREFIX}-nanobind"
|
|
"${MINGW_PACKAGE_PREFIX}-python-build"
|
|
"${MINGW_PACKAGE_PREFIX}-python-wheel"
|
|
"${MINGW_PACKAGE_PREFIX}-python-setuptools"
|
|
"${MINGW_PACKAGE_PREFIX}-python-scikit-build-core"
|
|
"git"
|
|
)
|
|
_commit="6452dd6944d2ba5c0c9bc0042a1894f703ce1ace"
|
|
source=("${_realname}::git+https://github.com/mitsuba-renderer/${_realname}#commit=${_commit}"
|
|
001-python-disable-lto.patch
|
|
002-disable-native-target.patch)
|
|
sha256sums=('9a844902e8b1c3f373f0ccb57680a804e71e368c180ee327caa37a247354c128'
|
|
'9526ed81ad4a0ac4fa0d44b052e5fbddbf3b3084a4ea0a98e66efd305723757b'
|
|
'4a26a27913d4fd8cccd6d59f0f0a4b0dcd1c913d46de0c9b9974307552b51911')
|
|
|
|
pkgver() {
|
|
cd "${_realname}"
|
|
git describe --long "${_commit}" | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//g'
|
|
}
|
|
|
|
prepare() {
|
|
cd ${_realname}
|
|
git submodule update --init --recursive
|
|
sed -i "3i include(CMakePackageConfigHelpers)" CMakeLists.txt
|
|
|
|
patch -p1 -i ${srcdir}/001-python-disable-lto.patch
|
|
patch -p1 -i ${srcdir}/002-disable-native-target.patch
|
|
}
|
|
|
|
build() {
|
|
declare -a _extra_config
|
|
if check_option "debug" "n"; then
|
|
_extra_config+=("-DCMAKE_BUILD_TYPE=Release")
|
|
else
|
|
_extra_config+=("-DCMAKE_BUILD_TYPE=Debug")
|
|
fi
|
|
|
|
[[ -d ${srcdir}/build-${MINGW_CHOST} ]] && rm -rf ${srcdir}/build-${MINGW_CHOST}
|
|
mkdir -p ${srcdir}/build-${MINGW_CHOST} && cd ${srcdir}/build-${MINGW_CHOST}
|
|
|
|
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
|
|
${MINGW_PREFIX}/bin/cmake.exe \
|
|
-G"Ninja" \
|
|
-Wno-dev \
|
|
"${_extra_config[@]}" \
|
|
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
|
|
-DNANOGUI_BUILD_EXAMPLES=OFF \
|
|
-DNANOGUI_BUILD_GLFW=ON \
|
|
-DPython_EXECUTABLE=${MINGW_PREFIX}/bin/python.exe \
|
|
-DPython_ROOT_DIR=${MINGW_PREFIX} \
|
|
-DPython_FIND_REGISTRY=NEVER \
|
|
../${_realname}
|
|
|
|
${MINGW_PREFIX}/bin/cmake --build .
|
|
}
|
|
|
|
package() {
|
|
cd ${srcdir}/build-${MINGW_CHOST}
|
|
DESTDIR=${pkgdir} ${MINGW_PREFIX}/bin/cmake --install .
|
|
|
|
#_pyver=$(${MINGW_PREFIX}/bin/python -c "import sys;sys.stdout.write('.'.join(map(str, sys.version_info[:2])))")
|
|
_purelib="$(python -c "import sysconfig; print(sysconfig.get_path('purelib'))")"
|
|
_site_packages="${pkgdir}$(cygpath "${_purelib}")"
|
|
|
|
mkdir -p ${_site_packages}
|
|
mv ${pkgdir}${MINGW_PREFIX}/lib/*.pyd ${_site_packages}/
|
|
|
|
rm -rf ${pkgdir}${MINGW_PREFIX}/include/GLFW
|
|
|
|
install -Dm644 ${srcdir}/${_realname}/LICENSE.txt "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
|
|
}
|
|
|