Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ build:
script:
- readlink -f "$(which g++)" # [linux]
- g++ --version # [linux]
- sip-install --verbose
- {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation
script_env:
- SETUPTOOLS_SCM_PRETEND_VERSION

Expand All @@ -42,14 +42,12 @@ requirements:
- qt-main
- libqglviewer
- libgl-devel # [linux]
- xorg-libxfixes # [linux]

run:
- python
- pyqt
- libqglviewer
- pyopengl
- xorg-libxfixes # [linux]

test:
requires:
Expand Down
1 change: 0 additions & 1 deletion environment-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ dependencies:
- qt-main
- libqglviewer
- libgl-devel
- xorg-libxfixes
# run
- pyopengl
# test
Expand Down
23 changes: 8 additions & 15 deletions project.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,16 @@ def __init__(self, project):

def apply_user_defaults(self, tool):

# Libraries are declared in pyproject.toml. Qt only adds its own include
# dirs and links its libraries by full path, so the dirs of the conda env
# are needed to find libQGLViewer and GLU headers and libraries.
system = platform.system()
prefix = os.environ.get("PREFIX") or os.environ.get("CONDA_PREFIX")

if system in ('Darwin','Linux') :
self.libraries.append('QGLViewer')
if prefix:
self.include_dirs.append(f'{prefix}/include')
self.library_dirs.append(f'{prefix}/lib')

if system == 'Linux':
self.libraries.append('GLU')

elif system == 'Windows':
self.libraries.append('QGLViewer2')
self.libraries.append('opengl32')
self.libraries.append('glu32')


if system in ('Darwin','Linux') and prefix:
self.include_dirs.append(f'{prefix}/include')
self.library_dirs.append(f'{prefix}/lib')

self.define_macros.append('PYQGLVIEWER_VERSION="'+PYQGLVIEWER_VERSION+'"')

super().apply_user_defaults(tool)
17 changes: 12 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Specify the build system.
[build-system]
# "setuptools", "setuptools-scm" not used
requires = ["sip<=6.10", "PyQt-builder=1.18"]
# Not installed nor checked by pip with --no-build-isolation: the versions that work
# (sip<=6.10, PyQt-builder 1.18.*) are pinned in conda/meta.yaml
requires = ["sip", "PyQt-builder"]
build-backend = "sipbuild.api"


Expand All @@ -27,7 +29,12 @@ sip-files-dir = "sip"
[tool.sip.bindings.PyQGLViewer]
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"']
# Markers must follow the name without space ('name;marker'): sip keeps spaces in the
# value. Include and library dirs of the conda env are added in project.py.
libraries = [
'QGLViewer;sys_platform != "win32"',
'GLU;sys_platform == "linux"',
'QGLViewer2;sys_platform == "win32"',
'opengl32;sys_platform == "win32"',
'glu32;sys_platform == "win32"',
]
Loading