Skip to content

Commit 5946584

Browse files
committed
Added pre-downloaded 3rdparty files to source packages
1 parent b01f2cf commit 5946584

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

.github/workflows/build_wheels_linux.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,14 @@ jobs:
171171

172172
- name: Build a package
173173
run: |
174+
# Download all 3rdparty files
175+
source scripts/source-packages-preparation.sh ${{ github.workspace }}
174176
set -e
175177
# Build and package
176178
set -x
177179
python -m pip install --upgrade pip
178180
python -m pip install scikit-build
179-
python setup.py sdist
181+
python setup.py sdist --formats=xztar
180182
set +x
181183
# Install and run tests
182184
set -x
@@ -186,7 +188,7 @@ jobs:
186188
uses: actions/upload-artifact@v2
187189
with:
188190
name: wheels
189-
path: dist/opencv*.tar.gz
191+
path: dist/opencv*.tar.xz
190192

191193
test_release_opencv_python:
192194
if: github.event_name == 'release' && github.event.release.prerelease
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
# ${1} variable is a path to repository opencv-python
4+
5+
# Define flags
6+
if [ "0" == $ENABLE_CONTRIB ]; then
7+
git submodule update --init opencv
8+
EXTRA_CMAKE_OPTIONS="-DOPENCV_DOWNLOAD_PATH=${1}/opencv/3rdparty"
9+
else
10+
git submodule update --init opencv opencv_contrib
11+
EXTRA_CMAKE_OPTIONS="-DOPENCV_DOWNLOAD_PATH=${1}/opencv/3rdparty -DOPENCV_EXTRA_MODULES_PATH=${1}/opencv_contrib/modules"
12+
fi
13+
14+
# Download 3rdparty files
15+
cd opencv && \
16+
mkdir generate && \
17+
cd generate && \
18+
cmake $EXTRA_CMAKE_OPTIONS ${1}/opencv && \
19+
cd ${1} && \
20+
rm -rf opencv/generate

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ def main():
150150
"-DPYTHON3_LIMITED_API=ON",
151151
"-DBUILD_OPENEXR=ON",
152152
"-DBUILD_PNG=ON",
153+
# To have all 3rdparty files in one place for source packages
154+
"-DOPENCV_DOWNLOAD_PATH=%s" % (os.path.join(os.path.dirname(os.path.abspath(__file__)), "opencv", "3rdparty")),
153155
]
154156
+ (
155157
# If it is not defined 'linker flags: /machine:X86' on Windows x64

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy