diff --git a/conda/bld.bat b/conda/bld.bat.bak similarity index 100% rename from conda/bld.bat rename to conda/bld.bat.bak diff --git a/conda/build.sh b/conda/build.sh deleted file mode 100644 index 604d590..0000000 --- a/conda/build.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/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 PKG_CONFIG_EXECUTABLE=$(basename $(which pkg-config)) - - export PATH=${PWD}:${PATH} -fi - - -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" diff --git a/conda/build.sh.bak b/conda/build.sh.bak new file mode 100644 index 0000000..18ce957 --- /dev/null +++ b/conda/build.sh.bak @@ -0,0 +1,63 @@ +#!/bin/bash + +# Inspired from https://github.com/conda-forge/pyqt-feedstock/tree/main/recipe + +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} + + 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" +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 + +${PYTHON} -m pip install --force-reinstall sip pyqt5-sip pyqt5 + +echo "**** BUILD" +${PYTHON} -m pip install . -v --no-build-isolation --no-deps + +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" diff --git a/conda/meta.yaml b/conda/meta.yaml index 545a1ed..a7db505 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -19,27 +19,31 @@ build: string: py{{ PY_VER }} script_env: - SETUPTOOLS_SCM_PRETEND_VERSION + script: + - {{ PYTHON }} -m pip install . -v --no-build-isolation requirements: build: - - {{ compiler('cxx')}} + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - {{ stdlib('c') }} - make # [unix] - - pkg-config # [linux] - - {{ cdt('mesa-libgl-devel') }} # [linux] # match libqglviewer CDT GL strategy + - pkg-config # [unix] + - 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] + - python + # - sip + # - pyqt + # - pyqt-builder host: - python - pip + # - sip + # - pyqt-builder + - packaging - qt-main - - pyqt - libqglviewer - - sip - - pyqt5-sip - - pyqt-builder - - {{ cdt('mesa-libgl-devel') }} # [linux] + - libgl-devel # [linux] - libxcb # [linux] - pthread-stubs # [linux] - xorg-libxfixes # [linux] @@ -47,8 +51,8 @@ requirements: 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..636b8ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,6 +15,10 @@ readme = "README.md" authors = [ { name = "Frederic Boudon", email = "frederic.boudon@cirad.fr" } ] +dependencies = [ + "PyQt5", + "PyQt5-sip" +] [tool.sip.project] sip-module = "PyQt5.sip" @@ -23,6 +27,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