nanogui-git: New package. Prereq for MaterialX (#24567)
* 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>
This commit is contained in:
parent
0cdd7a9d12
commit
6226d10ce8
10
mingw-w64-nanogui/001-python-disable-lto.patch
Normal file
10
mingw-w64-nanogui/001-python-disable-lto.patch
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
--- nanogui/src/python/CMakeLists.txt.orig 2025-06-16 11:18:54.754796600 +0300
|
||||||
|
+++ nanogui/src/python/CMakeLists.txt 2025-06-16 11:18:58.648275300 +0300
|
||||||
|
@@ -11,7 +11,6 @@
|
||||||
|
|
||||||
|
nanobind_add_module(nanogui-python MODULE
|
||||||
|
NB_STATIC
|
||||||
|
- LTO
|
||||||
|
main.cpp
|
||||||
|
glfw.cpp
|
||||||
|
icons.cpp
|
||||||
11
mingw-w64-nanogui/002-disable-native-target.patch
Normal file
11
mingw-w64-nanogui/002-disable-native-target.patch
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
--- nanogui/CMakeLists.txt.orig 2025-06-16 14:56:58.689929800 +0300
|
||||||
|
+++ nanogui/CMakeLists.txt 2025-06-16 14:57:03.182056800 +0300
|
||||||
|
@@ -79,7 +79,7 @@
|
||||||
|
# default. You may want to set MTS_NATIVE_FLAGS to "-march=native" to use all
|
||||||
|
# instructions available on a particular machine.
|
||||||
|
|
||||||
|
-if (MSVC)
|
||||||
|
+if (WIN32)
|
||||||
|
set(NANOGUI_NATIVE_FLAGS_DEFAULT "")
|
||||||
|
elseif (APPLE AND ((CMAKE_OSX_ARCHITECTURES MATCHES "arm64") OR
|
||||||
|
(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm64")))
|
||||||
88
mingw-w64-nanogui/PKGBUILD
Normal file
88
mingw-w64-nanogui/PKGBUILD
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
# 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"
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user