diff --git a/conda/build.sh b/conda/build.sh index 604d590..a277df2 100644 --- a/conda/build.sh +++ b/conda/build.sh @@ -2,22 +2,45 @@ # 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 +if [ "$(uname)" == "Linux" ]; then + GXX_PATH=$(command -v "${GXX}") + GCC_PATH=$(command -v "${GCC}") + GCC_AR_PATH=$(command -v "${GCC_AR}") + ln -sf "${GXX_PATH}" g++ + ln -sf "${GCC_PATH}" gcc + ln -sf "${GCC_AR_PATH}" gcc-ar export LD=${GXX} export CC=${GCC} export CXX=${GXX} export PKG_CONFIG_EXECUTABLE=$(basename $(which pkg-config)) + chmod +x g++ gcc gcc-ar export PATH=${PWD}:${PATH} -fi + SYSROOT_FLAGS="-L ${BUILD_PREFIX}/${HOST}/sysroot/usr/lib64 -L ${BUILD_PREFIX}/${HOST}/sysroot/usr/lib" + export CFLAGS="$SYSROOT_FLAGS $CFLAGS" + export CXXFLAGS="$SYSROOT_FLAGS $CXXFLAGS" + export LDFLAGS="$SYSROOT_FLAGS $LDFLAGS" + + 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 +fi echo "**** BUILD" sip-install --verbose @@ -27,14 +50,12 @@ 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) = "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__)"` +if [ "$(uname)" == "Linux" ]; then + ldd $(${PYTHON} -c "import PyQGLViewer as pyqgl ; print(pyqgl.__file__)") fi echo "****** END OF BUILD PROCESS" diff --git a/conda/meta.yaml b/conda/meta.yaml index 545a1ed..e4e4754 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -16,39 +16,32 @@ about: build: number: 2 - string: py{{ PY_VER }} script_env: - SETUPTOOLS_SCM_PRETEND_VERSION requirements: build: - - {{ compiler('cxx')}} + - {{ compiler('cxx') }} + - {{ stdlib('c') }} - make # [unix] - - pkg-config # [linux] - - {{ cdt('mesa-libgl-devel') }} # [linux] # match libqglviewer CDT GL strategy - # from https://conda-forge.org/docs/maintainer/knowledge_base.html#libgl - - python # [build_platform != target_platform] - - sip # [build_platform != target_platform] - - pyqt-builder # [build_platform != target_platform] + - pkg-config # [unix] host: - python - pip - - qt-main + - sip<=6.10 - pyqt - - libqglviewer - - sip - pyqt5-sip - - pyqt-builder - - {{ cdt('mesa-libgl-devel') }} # [linux] - - libxcb # [linux] - - pthread-stubs # [linux] + - pyqt-builder 1.18.* + - packaging + - qt-main + - libqglviewer + - libgl-devel # [linux] - xorg-libxfixes # [linux] - run: - python - - {{ pin_compatible('pyqt', max_pin='x.x') }} - - {{ pin_compatible('libqglviewer', max_pin='x.x') }} + - pyqt + - libqglviewer - pyopengl - xorg-libxfixes # [linux] diff --git a/pyproject.toml b/pyproject.toml index 9b3ae39..8a38146 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ # Specify the build system. [build-system] # "setuptools", "setuptools-scm" not used -requires = ["sip", "PyQt-builder"] +requires = ["sip<=6.10", "PyQt-builder"] build-backend = "sipbuild.api" @@ -15,6 +15,11 @@ readme = "README.md" authors = [ { name = "Frederic Boudon", email = "frederic.boudon@cirad.fr" } ] +dependencies = [ + "sip<=6.10", + "PyQt5", + "PyQt5-sip" +] [tool.sip.project] sip-module = "PyQt5.sip" @@ -23,6 +28,8 @@ sip-files-dir = "sip" [tool.sip.bindings.PyQGLViewer] qmake-QT = ['xml', 'opengl', 'gui', 'widgets'] tags = ['QGLViewer_2_9_1'] +# include-dirs=['${CONDA_PREFIX}/include'] +# library-dirs=['${CONDA_PREFIX}/lib'] # 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