From 2a80f54f00e46d5013cf74adb6fdcbe5fae6ec43 Mon Sep 17 00:00:00 2001 From: Christian Fournier Date: Tue, 6 Oct 2026 08:17:14 +0200 Subject: [PATCH 1/5] simplify build --- conda/build.sh | 54 -------------------------------------------------- 1 file changed, 54 deletions(-) diff --git a/conda/build.sh b/conda/build.sh index 3f73cd7..bb50b53 100644 --- a/conda/build.sh +++ b/conda/build.sh @@ -1,56 +1,2 @@ #!/bin/bash - -# Inspired from https://github.com/conda-forge/pyqt-feedstock/tree/main/recipe - -if [ "$(uname)" == "Linux" ]; then - # USED_BUILD_PREFIX=${BUILD_PREFIX:-${PREFIX}} - - # ln -s ${GXX} g++ || true - # ln -s ${GCC} gcc || true - # ln -s ${USED_BUILD_PREFIX}/bin/${HOST}-gcc-ar gcc-ar || true - - export LD=${GXX} - export CC=${GCC} - export CXX=${GXX} - export QMAKE_CXX="${CXX}" - export QMAKE_CC="${CC}" - export PKG_CONFIG_EXECUTABLE=$(basename $(which pkg-config)) - -# export PATH=${PWD}:${PATH} -fi - -echo "CC=${CC}" -echo "CXX=${CXX}" -echo "GCC=${GCC}" -echo "GXX=${GXX}" - -which gcc -which g++ - -readlink -f "$(which gcc)" || true -readlink -f "$(which g++)" || true -readlink -f "$GCC" || true -readlink -f "$GXX" || true - -"${CC}" --version -"${CXX}" --version - -"$GXX" -v -E -x c++ /dev/null - -echo "**** BUILD" sip-install --verbose - -echo -echo "****** CHECK PYTHON LIB" - -# To check if Python lib is not in the dependencies with conda-forge distribution. -# See https://github.com/conda-forge/boost-feedstock/issues/81 -if [ $(uname) = "Darwin" ]; then - otool -L $(${PYTHON} -c "import PyQGLViewer as pyqgl ; print(pyqgl.__file__)") -fi - -if [ "$(uname)" == "Linux" ]; then - ldd $(${PYTHON} -c "import PyQGLViewer as pyqgl ; print(pyqgl.__file__)") - -fi -echo "****** END OF BUILD PROCESS" From 035b7469399624cddec3d370967b3e43ff0baade Mon Sep 17 00:00:00 2001 From: Christian Fournier Date: Tue, 6 Oct 2026 22:19:11 +0200 Subject: [PATCH 2/5] simplify project.py --- project.py | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/project.py b/project.py index 77dd049..e048cfa 100644 --- a/project.py +++ b/project.py @@ -18,7 +18,7 @@ # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -import os +import platform, os from pyqtbuild import PyQtBindings, PyQtProject @@ -68,27 +68,10 @@ def __init__(self, project): print("Instanciation of the PyQGLViewerBindings ") def apply_user_defaults(self, tool): - import platform, os - - - CONDA_PREFIX = os.environ.get('CONDA_PREFIX',None) - PREFIX = os.environ.get('PREFIX',None) - CONDA_BUILD_SYSROOT = os.environ.get('CONDA_BUILD_SYSROOT',None) - if platform.system() in ['Darwin','Linux'] : self.libraries.append('QGLViewer') - if not CONDA_PREFIX is None: - self.include_dirs.append(f'{CONDA_PREFIX}/include') - self.library_dirs.append(f'{CONDA_PREFIX}/lib') - if not PREFIX is None: - self.include_dirs.append(f'{PREFIX}/include') - self.library_dirs.append(f'{PREFIX}/lib') - if platform.system() == 'Linux': self.libraries.append('GLU') - if not CONDA_BUILD_SYSROOT is None : - self.include_dirs.append(f'{CONDA_BUILD_SYSROOT}/usr/include') - elif platform.system() == 'Windows': self.libraries.append('QGLViewer2') self.libraries.append('opengl32') From ea5e5b0965fdc51d3f2f20547fd0f2e693be24fa Mon Sep 17 00:00:00 2001 From: Christian Fournier Date: Tue, 6 Oct 2026 22:43:10 +0200 Subject: [PATCH 3/5] restore patch for mac, use stdlib for libpthread --- conda/meta.yaml | 1 - project.py | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/conda/meta.yaml b/conda/meta.yaml index 9d5ead7..b975f81 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -42,7 +42,6 @@ requirements: - pyqt-builder - libgl-devel # [linux] - libxcb # [linux] - - pthread-stubs # [linux] - xorg-libxfixes # [linux] diff --git a/project.py b/project.py index e048cfa..8a76a1a 100644 --- a/project.py +++ b/project.py @@ -68,10 +68,23 @@ def __init__(self, project): print("Instanciation of the PyQGLViewerBindings ") def apply_user_defaults(self, tool): - if platform.system() in ['Darwin','Linux'] : + + CONDA_PREFIX = os.environ.get('CONDA_PREFIX',None) + PREFIX = os.environ.get('PREFIX',None) + + if platform.system() in ['Darwin'] : self.libraries.append('QGLViewer') + if not CONDA_PREFIX is None: + self.include_dirs.append(f'{CONDA_PREFIX}/include') + self.library_dirs.append(f'{CONDA_PREFIX}/lib') + if not PREFIX is None: + self.include_dirs.append(f'{PREFIX}/include') + self.library_dirs.append(f'{PREFIX}/lib') + if platform.system() == 'Linux': self.libraries.append('GLU') + self.libraries.append('QGLViewer') + elif platform.system() == 'Windows': self.libraries.append('QGLViewer2') self.libraries.append('opengl32') From 9928b98a58113933370857626b902baba399ce7f Mon Sep 17 00:00:00 2001 From: Christian Fournier Date: Tue, 6 Oct 2026 23:11:33 +0200 Subject: [PATCH 4/5] try config in pyproject --- project.py | 22 +--------------------- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/project.py b/project.py index 8a76a1a..6fe803b 100644 --- a/project.py +++ b/project.py @@ -69,27 +69,7 @@ def __init__(self, project): def apply_user_defaults(self, tool): - CONDA_PREFIX = os.environ.get('CONDA_PREFIX',None) - PREFIX = os.environ.get('PREFIX',None) - - if platform.system() in ['Darwin'] : - self.libraries.append('QGLViewer') - if not CONDA_PREFIX is None: - self.include_dirs.append(f'{CONDA_PREFIX}/include') - self.library_dirs.append(f'{CONDA_PREFIX}/lib') - if not PREFIX is None: - self.include_dirs.append(f'{PREFIX}/include') - self.library_dirs.append(f'{PREFIX}/lib') - - if platform.system() == 'Linux': - self.libraries.append('GLU') - self.libraries.append('QGLViewer') - - elif platform.system() == 'Windows': - self.libraries.append('QGLViewer2') - self.libraries.append('opengl32') - self.libraries.append('glu32') - + self.define_macros.append('PYQGLVIEWER_VERSION="'+PYQGLVIEWER_VERSION+'"') super().apply_user_defaults(tool) diff --git a/pyproject.toml b/pyproject.toml index 9b3ae39..4c7afc6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,4 +25,4 @@ qmake-QT = ['xml', 'opengl', 'gui', 'widgets'] tags = ['QGLViewer_2_9_1'] # Could specified directly with new construct but currently only working on MacOS. Instead options set in project.py -# libraries = ['QGLViewer ; system_platform == "Linux"','GLU ; system_platform == "Linux"'] \ No newline at end of file +libraries = ['QGLViewer ; system_platform == "Linux"','GLU ; system_platform == "Linux"'] \ No newline at end of file From ffd088eae3f3e0efe8d59c59add25126c69e0517 Mon Sep 17 00:00:00 2001 From: Christian Fournier Date: Tue, 6 Oct 2026 23:22:56 +0200 Subject: [PATCH 5/5] restore pyproject --- project.py | 23 ++++++++++++++++++++++- pyproject.toml | 2 +- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/project.py b/project.py index 6fe803b..d55f34e 100644 --- a/project.py +++ b/project.py @@ -68,7 +68,28 @@ def __init__(self, project): print("Instanciation of the PyQGLViewerBindings ") def apply_user_defaults(self, tool): - + CONDA_PREFIX = os.environ.get('CONDA_PREFIX',None) + PREFIX = os.environ.get('PREFIX',None) + CONDA_BUILD_SYSROOT = os.environ.get('CONDA_BUILD_SYSROOT',None) + + if platform.system() in ['Darwin','Linux'] : + self.libraries.append('QGLViewer') + if not CONDA_PREFIX is None: + self.include_dirs.append(f'{CONDA_PREFIX}/include') + self.library_dirs.append(f'{CONDA_PREFIX}/lib') + if not PREFIX is None: + self.include_dirs.append(f'{PREFIX}/include') + self.library_dirs.append(f'{PREFIX}/lib') + + if platform.system() == 'Linux': + self.libraries.append('GLU') + if not CONDA_BUILD_SYSROOT is None : + self.include_dirs.append(f'{CONDA_BUILD_SYSROOT}/usr/include') + + elif platform.system() == 'Windows': + self.libraries.append('QGLViewer2') + self.libraries.append('opengl32') + self.libraries.append('glu32') self.define_macros.append('PYQGLVIEWER_VERSION="'+PYQGLVIEWER_VERSION+'"') diff --git a/pyproject.toml b/pyproject.toml index 4c7afc6..9b3ae39 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,4 +25,4 @@ qmake-QT = ['xml', 'opengl', 'gui', 'widgets'] tags = ['QGLViewer_2_9_1'] # Could specified directly with new construct but currently only working on MacOS. Instead options set in project.py -libraries = ['QGLViewer ; system_platform == "Linux"','GLU ; system_platform == "Linux"'] \ No newline at end of file +# libraries = ['QGLViewer ; system_platform == "Linux"','GLU ; system_platform == "Linux"'] \ No newline at end of file