Skip to content
Closed
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
51 changes: 36 additions & 15 deletions conda/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
29 changes: 11 additions & 18 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"


Expand All @@ -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"
Expand All @@ -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"']
Loading