Skip to content
Merged
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
6 changes: 4 additions & 2 deletions .github/workflows/build_wheels_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,14 @@ jobs:

- name: Build a package
run: |
# Download all 3rdparty files
source scripts/source-packages-preparation.sh ${{ github.workspace }}
set -e
# Build and package
set -x
python -m pip install --upgrade pip
python -m pip install scikit-build
python setup.py sdist
python setup.py sdist --formats=xztar
set +x
# Install and run tests
set -x
Expand All @@ -186,7 +188,7 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist/opencv*.tar.gz
path: dist/opencv*.tar.xz

test_release_opencv_python:
if: github.event_name == 'release' && github.event.release.prerelease
Expand Down
20 changes: 20 additions & 0 deletions scripts/source-packages-preparation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# ${1} variable is a path to repository opencv-python

# Define flags
if [ "0" == $ENABLE_CONTRIB ]; then
git submodule update --init opencv
EXTRA_CMAKE_OPTIONS="-DOPENCV_DOWNLOAD_PATH=${1}/opencv/3rdparty"
else
git submodule update --init opencv opencv_contrib
EXTRA_CMAKE_OPTIONS="-DOPENCV_DOWNLOAD_PATH=${1}/opencv/3rdparty -DOPENCV_EXTRA_MODULES_PATH=${1}/opencv_contrib/modules"
fi

# Download 3rdparty files
cd opencv && \
mkdir generate && \
cd generate && \
cmake $EXTRA_CMAKE_OPTIONS ${1}/opencv && \
cd ${1} && \
rm -rf opencv/generate
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ def main():
"-DPYTHON3_LIMITED_API=ON",
"-DBUILD_OPENEXR=ON",
"-DBUILD_PNG=ON",
# To have all 3rdparty files in one place for source packages
"-DOPENCV_DOWNLOAD_PATH=%s" % (os.path.join(os.path.dirname(os.path.abspath(__file__)), "opencv", "3rdparty")),
]
+ (
# If it is not defined 'linker flags: /machine:X86' on Windows x64
Expand Down