├── release.md ├── opencv4_cmake_options.txt ├── justfile ├── .github └── workflows │ ├── harmonyos.yml │ ├── android.yml │ ├── macos.yml │ ├── musl-zig.yml │ ├── windows.yml │ ├── musl-gcc.yml │ └── ubuntu.yml ├── .gitignore ├── README.md └── LICENSE /release.md: -------------------------------------------------------------------------------- 1 | ## 编译环境 2 | 3 | ### Android 4 | 5 | | 操作系统 | ndk | 6 | |--------------|--------------| 7 | | ubuntu 22.04 | 25.2.9519653 | 8 | 9 | ### HarmonyOS(ohos) 10 | 11 | | 操作系统 | sdk | ndk | 12 | |--------------|-------|-----------| 13 | | ubuntu 22.04 | 4.1.4 | 4.1.10.5 | 14 | | ubuntu 22.04 | 5.1.0 | 5.1.0.107 | 15 | 16 | ### Windows 17 | 18 | | 操作系统 | vs版本 | JDK | ant | MSVC | 19 | |------|--------|-----|---------|---------------| 20 | | 2019 | vs2015 | 8 | 1.10.14 | 19.0.24247.2 | 21 | | 2019 | vs2017 | 8 | 1.10.14 | 19.16.27053.0 | 22 | | 2019 | vs2019 | 8 | 1.10.14 | 19.29.30158.0 | 23 | | 2022 | vs2022 | 8 | 1.10.14 | 19.42.34440 | 24 | 25 | ### Ubuntu 26 | 27 | | 操作系统 | gcc | libc | binutils | JDK | ant | 28 | |--------------|--------|------|----------|-----|---------| 29 | | ubuntu 14.04 | 4.8.4 | 2.19 | 2.24 | 8 | 1.10.14 | 30 | | ubuntu 16.04 | 5.4.0 | 2.23 | 2.26.1 | 8 | 1.10.14 | 31 | | ubuntu 18.04 | 7.5.0 | 2.27 | 2.30 | 8 | 1.10.14 | 32 | | ubuntu 20.04 | 9.4.0 | 2.31 | 2.34 | 8 | 1.10.14 | 33 | | ubuntu 22.04 | 11.4.0 | 2.35 | 2.38 | 8 | 1.10.14 | 34 | 35 | ### musl gcc toolchain 36 | 37 | | 操作系统 | musl gcc | 38 | |--------------|----------| 39 | | ubuntu 22.04 | 13.2.0 | 40 | 41 | ### Macos 42 | 43 | | 操作系统 | JDK | ant | 44 | |------|-----|---------| 45 | | 12 | 8 | 1.10.14 | 46 | | 13 | 8 | 1.10.14 | 47 | | 14 | 11 | 1.10.14 | 48 | -------------------------------------------------------------------------------- /opencv4_cmake_options.txt: -------------------------------------------------------------------------------- 1 | -DBUILD_ZLIB=ON 2 | -DBUILD_JPEG=ON 3 | -DWITH_JPEG=ON 4 | -DWITH_JPEGXL=OFF 5 | -DBUILD_JASPER=ON 6 | -DWITH_JASPER=ON 7 | -DBUILD_OPENEXR=ON 8 | -DWITH_OPENEXR=ON 9 | -DBUILD_OPENJPEG=ON 10 | -DWITH_OPENJPEG=ON 11 | -DBUILD_PNG=ON 12 | -DWITH_PNG=ON 13 | -DBUILD_TIFF=ON 14 | -DWITH_TIFF=ON 15 | -DBUILD_WEBP=ON 16 | -DWITH_WEBP=ON 17 | -DWITH_AVIF=OFF 18 | -DWITH_IMGCODEC_HDR=ON 19 | -DWITH_IMGCODEC_SUNRASTER=ON 20 | -DWITH_IMGCODEC_PXM=ON 21 | -DWITH_IMGCODEC_PFM=ON 22 | -DWITH_IMGCODEC_GIF=ON 23 | -DWITH_ANDROID_MEDIANDK=OFF 24 | -DBUILD_ANDROID_PROJECTS=OFF 25 | -DBUILD_ANDROID_EXAMPLES=OFF 26 | -DBUILD_ANDROID_SERVICE=OFF 27 | -DBUILD_SHARED_LIBS=OFF 28 | -DBUILD_FAT_JAVA_LIB=OFF 29 | -DBUILD_JAVA=OFF 30 | -DBUILD_TBB=OFF 31 | -DBUILD_IPP_IW=OFF 32 | -DBUILD_ITT=OFF 33 | -DWITH_AVFOUNDATION=OFF 34 | -DWITH_CAP_IOS=OFF 35 | -DWITH_CAROTENE=OFF 36 | -DWITH_CPUFEATURES=OFF 37 | -DWITH_EIGEN=OFF 38 | -DWITH_FFMPEG=OFF 39 | -DWITH_GSTREAMER=OFF 40 | -DWITH_GTK=OFF 41 | -DWITH_IPP=OFF 42 | -DWITH_HALIDE=OFF 43 | -DWITH_VULKAN=OFF 44 | -DWITH_INF_ENGINE=OFF 45 | -DWITH_NGRAPH=OFF 46 | -DWITH_OPENVX=OFF 47 | -DWITH_GDCM=OFF 48 | -DWITH_V4L=OFF 49 | -DWITH_CLP=OFF 50 | -DWITH_OPENCL=OFF 51 | -DWITH_OPENCL_SVM=OFF 52 | -DWITH_ITT=OFF 53 | -DWITH_PROTOBUF=OFF 54 | -DWITH_QUIRC=OFF 55 | -DWITH_TENGINE=OFF 56 | -DWITH_ONNX=OFF 57 | -DBUILD_DOCS=OFF 58 | -DBUILD_EXAMPLES=OFF 59 | -DBUILD_PACKAGE=OFF 60 | -DBUILD_PERF_TESTS=OFF 61 | -DBUILD_TESTS=OFF 62 | -DBUILD_OBJC=OFF 63 | -DENABLE_PRECOMPILED_HEADERS=OFF 64 | -DENABLE_FAST_MATH=OFF 65 | -DCV_TRACE=OFF 66 | -DBUILD_opencv_apps=OFF 67 | -DBUILD_opencv_java=OFF 68 | -DBUILD_opencv_gapi=OFF 69 | -DBUILD_opencv_objc=OFF 70 | -DBUILD_opencv_js=OFF 71 | -DBUILD_opencv_ts=OFF 72 | -DBUILD_opencv_python2=OFF 73 | -DBUILD_opencv_python3=OFF 74 | -DBUILD_opencv_dnn=OFF 75 | -DBUILD_opencv_imgcodecs=ON 76 | -DBUILD_opencv_videoio=OFF 77 | -DBUILD_opencv_calib3d=OFF 78 | -DBUILD_opencv_flann=OFF 79 | -DBUILD_opencv_objdetect=OFF 80 | -DBUILD_opencv_stitching=OFF 81 | -DBUILD_opencv_ml=OFF 82 | -DBUILD_opencv_world=OFF 83 | -DWITH_ADE=OFF 84 | -DWITH_TBB=OFF 85 | -DWITH_HPX=OFF 86 | -DWITH_OPENMP=OFF 87 | -DWITH_GCD=OFF 88 | -DWITH_CONCURRENCY=OFF 89 | -DWITH_PTHREADS_PF=OFF 90 | -------------------------------------------------------------------------------- /justfile: -------------------------------------------------------------------------------- 1 | # Set shell for Windows OSs: 2 | set windows-shell := ["powershell.exe", "-NoLogo", "-Command"] 3 | 4 | cv := "4.11.0" 5 | vs := "vs2022" 6 | 7 | default: 8 | @just --list 9 | 10 | # 编译opencv静态库 11 | build_lib: 12 | just _build "x64" "v143" "mt" 13 | just _build "x64" "v143" "md" 14 | just _build "x86" "v143" "mt" 15 | just _build "x86" "v143" "md" 16 | just _build "arm64" "v143" "mt" 17 | just _build "arm64" "v143" "md" 18 | 19 | _build arch ver crt: 20 | @echo ".\build-opencv4-win.ps1 -VsArch {{arch}} -VsVer {{ver}} -VsCRT {{crt}}" 21 | .\build-opencv4-win.ps1 -VsArch {{arch}} -VsVer {{ver}} -VsCRT {{crt}} 22 | @echo "cp -r build-{{arch}}-{{ver}}-{{crt}}/install opencv-{{cv}}-windows-{{vs}}-{{arch}}-{{crt}}" 23 | cp -r build-{{arch}}-{{ver}}-{{crt}}/install opencv-{{cv}}-windows-{{vs}}-{{arch}}-{{crt}} 24 | @echo "7z a opencv-{{cv}}-windows-{{vs}}-{{arch}}-{{crt}}.7z opencv-{{cv}}-windows-{{vs}}-{{arch}}-{{crt}}" 25 | 7z a opencv-{{cv}}-windows-{{vs}}-{{arch}}-{{crt}}.7z opencv-{{cv}}-windows-{{vs}}-{{arch}}-{{crt}} 26 | @echo "rm opencv-{{cv}}-windows-{{vs}}-{{arch}}-{{crt}} -r -fo" 27 | rm opencv-{{cv}}-windows-{{vs}}-{{arch}}-{{crt}} -r -fo 28 | 29 | # 编译opencv java包 30 | build_java: 31 | just _java "x64" "v143" "mt" 32 | just _java "x64" "v143" "md" 33 | just _java "x86" "v143" "mt" 34 | just _java "x86" "v143" "md" 35 | just _java "arm64" "v143" "mt" 36 | just _java "arm64" "v143" "md" 37 | 38 | _java arch ver crt: 39 | @echo ".\build-opencv4-win.ps1 -VsArch {{arch}} -VsVer {{ver}} -VsCRT {{crt}} -BuildJava" 40 | .\build-opencv4-win.ps1 -VsArch {{arch}} -VsVer {{ver}} -VsCRT {{crt}} -BuildJava 41 | @echo "cp -r build-{{arch}}-{{ver}}-{{crt}}/install/java opencv-{{cv}}-windows-{{vs}}-{{arch}}-{{crt}}-java" 42 | cp -r build-{{arch}}-{{ver}}-{{crt}}/install/java opencv-{{cv}}-windows-{{vs}}-{{arch}}-{{crt}}-java 43 | @echo "7z a opencv-{{cv}}-windows-{{vs}}-{{arch}}-{{crt}}-java.7z opencv-{{cv}}-windows-{{vs}}-{{arch}}-{{crt}}-java" 44 | 7z a opencv-{{cv}}-windows-{{vs}}-{{arch}}-{{crt}}-java.7z opencv-{{cv}}-windows-{{vs}}-{{arch}}-{{crt}}-java 45 | @echo "rm opencv-{{cv}}-windows-{{vs}}-{{arch}}-{{crt}}-java -r -fo" 46 | rm opencv-{{cv}}-windows-{{vs}}-{{arch}}-{{crt}}-java -r -fo -------------------------------------------------------------------------------- /.github/workflows/harmonyos.yml: -------------------------------------------------------------------------------- 1 | name: HarmonyOS 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | ohos: 8 | runs-on: ubuntu-22.04 9 | 10 | strategy: 11 | fail-fast: false 12 | matrix: 13 | ver: 14 | - { cv: 4.11.0, sdk: 4.1.4, ndk: 4.1.10.5 } 15 | - { cv: 4.11.0, sdk: 5.1.0, ndk: 5.1.0.107 } 16 | 17 | env: 18 | BUILD_SCRIPT: build-opencv4-ohos.sh 19 | BUILD_OPTIONS: opencv4_cmake_options.txt 20 | OHOS_NDK: /opt/native 21 | PKG_NAME: opencv-${{ matrix.ver.cv }}-ohos-${{ matrix.ver.sdk }} 22 | 23 | steps: 24 | # 下载并解压ohos ndk 25 | - name: deploy ohos ndk 26 | run: | 27 | wget https://repo.huaweicloud.com/harmonyos/os/${{ matrix.ver.sdk }}-Release/ohos-sdk-windows_linux-public.tar.gz 28 | tar -xf ohos-sdk-windows_linux-public.tar.gz 29 | cd ohos-sdk/linux 30 | unzip -q native-linux-x64-${{ matrix.ver.ndk }}-Release.zip 31 | mv native/ /opt/ 32 | echo "/opt/native" >> $GITHUB_PATH 33 | 34 | # 检出代码 35 | - uses: actions/checkout@v5 36 | 37 | # 检出opencv 38 | - name: checkout opencv 39 | uses: actions/checkout@v5 40 | with: 41 | repository: opencv/opencv 42 | path: opencv-${{ matrix.ver.cv }} 43 | ref: ${{ matrix.ver.cv }} 44 | submodules: recursive 45 | 46 | # 复制 47 | - name: copy build script 48 | run: | 49 | cp ${{ env.BUILD_SCRIPT }} opencv-${{ matrix.ver.cv }} 50 | cp ${{ env.BUILD_OPTIONS }} opencv-${{ matrix.ver.cv }} 51 | 52 | # 编译 53 | - name: build 54 | run: | 55 | cd opencv-${{ matrix.ver.cv }} 56 | chmod a+x ${{ env.BUILD_SCRIPT }} 57 | ./${{ env.BUILD_SCRIPT }} ${{ env.OHOS_NDK }} 58 | 59 | # 压缩 60 | - name: 7zip 61 | run: | 62 | mv opencv-${{ matrix.ver.cv }}/opencv-ohos ${{ env.PKG_NAME }} 63 | 7z a ${{ env.PKG_NAME }}.7z ${{ env.PKG_NAME }} 64 | 65 | # 创建release 上传release 66 | # https://github.com/marketplace/actions/create-release 67 | - name: Create release and upload-archive 68 | uses: ncipollo/release-action@v1 69 | with: 70 | prerelease: false 71 | bodyFile: release.md 72 | artifacts: ${{ env.PKG_NAME }}.7z 73 | allowUpdates: true 74 | artifactContentType: application/x-7z-compressed 75 | token: ${{ secrets.GITHUB_TOKEN }} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Python template 3 | # Byte-compiled / optimized / DLL files 4 | __pycache__/ 5 | *.py[cod] 6 | *$py.class 7 | 8 | # C extensions 9 | *.so 10 | 11 | # Distribution / packaging 12 | .Python 13 | build/ 14 | develop-eggs/ 15 | dist/ 16 | downloads/ 17 | eggs/ 18 | .eggs/ 19 | lib/ 20 | lib64/ 21 | parts/ 22 | sdist/ 23 | var/ 24 | wheels/ 25 | pip-wheel-metadata/ 26 | share/python-wheels/ 27 | *.egg-info/ 28 | .installed.cfg 29 | *.egg 30 | MANIFEST 31 | 32 | # PyInstaller 33 | # Usually these files are written by a python script from a template 34 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 35 | *.manifest 36 | *.spec 37 | 38 | # Installer logs 39 | pip-log.txt 40 | pip-delete-this-directory.txt 41 | 42 | # Unit test / coverage reports 43 | htmlcov/ 44 | .tox/ 45 | .nox/ 46 | .coverage 47 | .coverage.* 48 | .cache 49 | nosetests.xml 50 | coverage.xml 51 | *.cover 52 | *.py,cover 53 | .hypothesis/ 54 | .pytest_cache/ 55 | 56 | # Translations 57 | *.mo 58 | *.pot 59 | 60 | # Django stuff: 61 | *.log 62 | local_settings.py 63 | db.sqlite3 64 | db.sqlite3-journal 65 | 66 | # Flask stuff: 67 | instance/ 68 | .webassets-cache 69 | 70 | # Scrapy stuff: 71 | .scrapy 72 | 73 | # Sphinx documentation 74 | docs/_build/ 75 | 76 | # PyBuilder 77 | target/ 78 | 79 | # Jupyter Notebook 80 | .ipynb_checkpoints 81 | 82 | # IPython 83 | profile_default/ 84 | ipython_config.py 85 | 86 | # pyenv 87 | .python-version 88 | 89 | # pipenv 90 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 91 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 92 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 93 | # install all needed dependencies. 94 | #Pipfile.lock 95 | 96 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 97 | __pypackages__/ 98 | 99 | # Celery stuff 100 | celerybeat-schedule 101 | celerybeat.pid 102 | 103 | # SageMath parsed files 104 | *.sage.py 105 | 106 | # Environments 107 | .env 108 | .venv 109 | env/ 110 | venv/ 111 | ENV/ 112 | env.bak/ 113 | venv.bak/ 114 | 115 | # Spyder project settings 116 | .spyderproject 117 | .spyproject 118 | 119 | # Rope project settings 120 | .ropeproject 121 | 122 | # mkdocs documentation 123 | /site 124 | 125 | # mypy 126 | .mypy_cache/ 127 | .dmypy.json 128 | dmypy.json 129 | 130 | # Pyre type checker 131 | .pyre/ 132 | 133 | #idea 134 | .idea -------------------------------------------------------------------------------- /.github/workflows/android.yml: -------------------------------------------------------------------------------- 1 | name: android 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | android: 8 | runs-on: ubuntu-22.04 9 | 10 | strategy: 11 | fail-fast: false 12 | matrix: 13 | ver: 14 | - { cv: 4.11.0, ndk: 25.2.9519653 } 15 | 16 | env: 17 | BUILD_SCRIPT: build-opencv4-android.sh 18 | BUILD_OPTIONS: opencv4_cmake_options.txt 19 | PKG_NAME: opencv-${{ matrix.ver.cv }}-android 20 | 21 | steps: 22 | # 删除ndk -g参数 23 | - name: ndk del -g 24 | run: sed -i -e '/^ -g$/d' $ANDROID_NDK_HOME/build/cmake/android-legacy.toolchain.cmake 25 | 26 | # 检出代码 27 | - uses: actions/checkout@v4 28 | 29 | # 检出opencv 30 | - name: checkout opencv 31 | uses: actions/checkout@v4 32 | with: 33 | repository: opencv/opencv 34 | path: opencv-${{ matrix.ver.cv }} 35 | ref: ${{ matrix.ver.cv }} 36 | submodules: recursive 37 | 38 | # 复制 39 | - name: copy build script 40 | run: | 41 | cp ${{ env.BUILD_SCRIPT }} opencv-${{ matrix.ver.cv }} 42 | cp ${{ env.BUILD_OPTIONS }} opencv-${{ matrix.ver.cv }} 43 | 44 | # 编译 45 | - name: build 46 | run: | 47 | cd opencv-${{ matrix.ver.cv }} 48 | chmod a+x ${{ env.BUILD_SCRIPT }} 49 | ./${{ env.BUILD_SCRIPT }} $ANDROID_NDK_HOME 50 | 51 | # 压缩 52 | - name: 7zip 53 | run: | 54 | mv opencv-${{ matrix.ver.cv }}/opencv-android ${{ env.PKG_NAME }} 55 | 7z a ${{ env.PKG_NAME }}.7z ${{ env.PKG_NAME }} 56 | 57 | # 上传artifact 58 | # - name: upload 59 | # uses: actions/upload-artifact@v4 60 | # with: 61 | # name: ${{ env.PKG_NAME }} 62 | # path: ${{ env.PKG_NAME }}.7z 63 | 64 | # 获取所有的git log和tag 65 | # - name: Unshallow 66 | # run: git fetch --prune --unshallow 67 | 68 | # 获取git log 从 previousTag 到 lastTag 69 | # - name: Get git log 70 | # id: git-log 71 | # run: | 72 | # previousTag=$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`) 73 | # lastTag=$(git describe --abbrev=0 --tags) 74 | # echo "previousTag:$previousTag ~ lastTag:$lastTag" 75 | # log=$(git log $previousTag..$lastTag --pretty=format:'- %cd %an: %s\n' --date=format:'%Y-%m-%d %H:%M:%S') 76 | # echo "$log" 77 | # echo "log_state="$log"" >> $GITHUB_ENV 78 | 79 | # 创建Changelog文件 triggered by git tag push 80 | # - name: Generate Changelog 81 | # if: startsWith(github.ref, 'refs/tags/') 82 | # run: | 83 | # echo -e '${{ env.log_state }}' > release.md 84 | 85 | # 创建release 上传release 86 | # https://github.com/marketplace/actions/create-release 87 | - name: Create release and upload-archive 88 | uses: ncipollo/release-action@v1 89 | with: 90 | prerelease: false 91 | bodyFile: release.md 92 | artifacts: ${{ env.PKG_NAME }}.7z 93 | allowUpdates: true 94 | artifactContentType: application/x-7z-compressed 95 | token: ${{ secrets.GITHUB_TOKEN }} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OpenCVBuilder 2 | 3 | OpenCV Custom Builder 4 | 5 | ### 介绍 6 | 7 | OpenCV在OCR中只是做图像的读取保存、编解码、缩放等,可以去除大部分功能模块,保留几个核心功能模块即可。 8 | 9 | [模块定制说明](https://docs.opencv.org/4.9.0/db/d05/tutorial_config_reference.html) 10 | 11 | 最后利用Github Actions进行编译。 12 | 13 | ### 关于Windows静态链接CRT 14 | 15 | 编译选项添加BUILD_WITH_STATIC_CRT=ON 16 | 17 | ## 编译环境 18 | 19 | ### Android 20 | 21 | | 操作系统 | ndk | 22 | |--------------|--------------| 23 | | ubuntu 22.04 | 25.2.9519653 | 24 | 25 | ### HarmonyOS(ohos) 26 | 27 | | 操作系统 | sdk | ndk | 28 | |--------------|-------|-----------| 29 | | ubuntu 22.04 | 4.1.4 | 4.1.10.5 | 30 | | ubuntu 22.04 | 5.1.0 | 5.1.0.107 | 31 | 32 | ### Windows 33 | 34 | | 操作系统 | vs版本 | JDK | ant | 35 | |------|--------|-----|---------| 36 | | 2019 | vs2015 | 8 | 1.10.14 | 37 | | 2019 | vs2017 | 8 | 1.10.14 | 38 | | 2019 | vs2019 | 8 | 1.10.14 | 39 | | 2022 | vs2022 | 8 | 1.10.14 | 40 | 41 | - vs2019和vs2022支持arm64平台 42 | 43 | ### Ubuntu 44 | 45 | | 操作系统 | gcc | libc | binutils | JDK | ant | 46 | |--------------|--------|------|----------|-----|---------| 47 | | ubuntu 14.04 | 4.8.4 | 2.19 | 2.24 | 8 | 1.10.14 | 48 | | ubuntu 16.04 | 5.4.0 | 2.23 | 2.26.1 | 8 | 1.10.14 | 49 | | ubuntu 18.04 | 7.5.0 | 2.27 | 2.30 | 8 | 1.10.14 | 50 | | ubuntu 20.04 | 9.4.0 | 2.31 | 2.34 | 8 | 1.10.14 | 51 | | ubuntu 22.04 | 11.4.0 | 2.35 | 2.38 | 8 | 1.10.14 | 52 | 53 | - 因ubuntu14.04 arm64 gcc4.8.4 libwebp会导致编译错误,故BUILD_WEBP=OFF 54 | - 因ubuntu14.04 386 gcc4.8.4 libopenexr会导致编译错误,故BUILD_OPENEXR=OFF 55 | 56 | ### zig toolchain 57 | 58 | | 操作系统 | zig | 59 | |--------------|--------| 60 | | ubuntu 22.04 | 0.13.0 | 61 | 62 | ### musl gcc toolchain 63 | 64 | | 操作系统 | musl | 65 | |--------------|--------| 66 | | ubuntu 22.04 | 13.2.0 | 67 | 68 | ### Macos 69 | 70 | | 操作系统 | JDK | ant | 71 | |--------|-----|---------| 72 | | 10(失效) | 8 | 1.10.14 | 73 | | 11(失效) | 8 | 1.10.14 | 74 | | 12(失效) | 8 | 1.10.14 | 75 | | 13 | 8 | 1.10.14 | 76 | | 14 | 11 | 1.10.14 | 77 | 78 | - github action 已不支持低版本macos runner 79 | 80 | ### 如果7z包解压出错 81 | 82 | - 需要安装最新版的7zip工具,https://www.7-zip.org/download.html 83 | 84 | ### 关于Visual Studio 2022 MSVC编译器安装 85 | 86 | - 删除旧版:```C:\Program Files (x86)\Microsoft Visual Studio\Installer\InstallCleanup.exe``` 87 | - https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-history 88 | - 下载LTSC 17.12或选择以下链接 89 | - https://aka.ms/vs/17/release.LTSC.17.12/vs_buildtools.exe 90 | - https://aka.ms/vs/17/release.LTSC.17.12/vs_professional.exe 91 | - https://aka.ms/vs/17/release.LTSC.17.12/vs_enterprise.exe 92 | - 勾选: "使用 C++ 的桌面开发" 93 | - 在"SDK、库和框架"中勾选: 94 | 95 | ``` 96 | 适用于最新v143生成工具的C++ATL(ARM) 97 | 适用于最新v143生成工具的C++ATL(ARM64/ARM64EC) 98 | 适用于最新v143生成工具的C++ATL(x86和x64) 99 | ``` 100 | 101 | - 在"编译器、生成工具和运行时"中勾选: 102 | 103 | ``` 104 | MSVC v143 - VS 2022 C++ ARM 生成工具(最新) 105 | MSVC v143 - VS 2022 C++ ARM64/ARM64EC 生成工具(最新) 106 | MSVC v143 - VS 2022 C++ x64/x86 生成工具(最新) 107 | ``` 108 | 109 | ## 其它说明 110 | 111 | - 4.9.0 Windows WITH_OPENCL=ON, for opencv-rust 112 | - 4.10.0开始提高了对gcc版本的要求,故缺少某些平台的包 113 | - 4.11.0取消ppc64le版本 -------------------------------------------------------------------------------- /.github/workflows/macos.yml: -------------------------------------------------------------------------------- 1 | name: macos 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | macos: 8 | strategy: 9 | fail-fast: false 10 | matrix: 11 | ver: 12 | - { cv: 4.11.0, ant: 1.10.14 } 13 | list: 14 | - { os_ver: 12, java: 8 } 15 | - { os_ver: 13, java: 8 } 16 | - { os_ver: 14, java: 11 } 17 | arch: 18 | [ 19 | x86_64, 20 | arm64, 21 | arm64e, 22 | ] 23 | exclude: 24 | - list: { os_ver: 12, java: 8 } 25 | 26 | runs-on: macos-${{ matrix.list.os_ver }} 27 | 28 | env: 29 | BUILD_SCRIPT: build-opencv4-mac.sh 30 | BUILD_OPTIONS: opencv4_cmake_options.txt 31 | PKG_NAME: opencv-${{ matrix.ver.cv }}-macos-${{ matrix.list.os_ver }}-${{ matrix.arch }} 32 | JAVA_PKG_NAME: opencv-${{ matrix.ver.cv }}-macos-${{ matrix.list.os_ver }}-${{ matrix.arch }}-java 33 | 34 | steps: 35 | - name: Set up JDK 36 | uses: actions/setup-java@v4 37 | with: 38 | java-version: '${{ matrix.list.java }}' 39 | distribution: 'temurin ' 40 | 41 | - uses: cedx/setup-ant@v2 42 | if: ${{ matrix.list.os_ver != '14' }} 43 | with: 44 | optional-tasks: true 45 | version: ${{ matrix.ver.ant }} 46 | 47 | - name: ant version 48 | run: ant -version 49 | 50 | # 检出代码 51 | - uses: actions/checkout@v4 52 | 53 | # 检出opencv 54 | - name: checkout opencv 55 | uses: actions/checkout@v4 56 | with: 57 | repository: opencv/opencv 58 | path: opencv-${{ matrix.ver.cv }} 59 | ref: ${{ matrix.ver.cv }} 60 | submodules: recursive 61 | 62 | # 安装openmp 63 | #- name: install openmp 64 | # run: | 65 | # brew install libomp 66 | 67 | # 复制 68 | - name: copy 69 | run: | 70 | cp ${{ env.BUILD_SCRIPT }} opencv-${{ matrix.ver.cv }} 71 | cp ${{ env.BUILD_OPTIONS }} opencv-${{ matrix.ver.cv }} 72 | 73 | # 编译 74 | - name: build 75 | run: | 76 | cd opencv-${{ matrix.ver.cv }} 77 | chmod a+x ${{ env.BUILD_SCRIPT }} &&./${{ env.BUILD_SCRIPT }} -n '${{ matrix.arch }}' 78 | 79 | # 7z压缩 80 | - name: 7zip 81 | run: | 82 | cp -r opencv-${{ matrix.ver.cv }}/build-Release-${{ matrix.arch }}/install ${{ env.PKG_NAME }} 83 | 7z a ${{ env.PKG_NAME }}.7z ${{ env.PKG_NAME }} 84 | rm -r -f ${{ env.PKG_NAME }} 85 | 86 | # 编译 87 | - name: build java 88 | continue-on-error: true 89 | run: | 90 | cd opencv-${{ matrix.ver.cv }} 91 | chmod a+x ${{ env.BUILD_SCRIPT }} &&./${{ env.BUILD_SCRIPT }} -n '${{ matrix.arch }}' -j 92 | 93 | # 7z压缩 94 | - name: 7zip java 95 | run: | 96 | if [ -d "opencv-${{ matrix.ver.cv }}/build-Release-${{ matrix.arch }}/install/share/java/opencv4" ]; then 97 | cp -r opencv-${{ matrix.ver.cv }}/build-Release-${{ matrix.arch }}/install/share/java/opencv4 ${{ env.JAVA_PKG_NAME }} 98 | 7z a ${{ env.JAVA_PKG_NAME }}.7z ${{ env.JAVA_PKG_NAME }} 99 | rm -r -f ${{ env.JAVA_PKG_NAME }} 100 | fi 101 | 102 | # 上传artifact 103 | # - name: upload 104 | # uses: actions/upload-artifact@v4 105 | # with: 106 | # name: ${{ env.PKG_NAME }} 107 | # path: ${{ env.PKG_NAME }}.7z 108 | 109 | # - name: upload 110 | # uses: actions/upload-artifact@v4 111 | # with: 112 | # name: ${{ env.JAVA_PKG_NAME }} 113 | # path: ${{ env.JAVA_PKG_NAME }}.7z 114 | 115 | # 获取所有的git log和tag 116 | # - name: Unshallow 117 | # run: git fetch --prune --unshallow 118 | 119 | # 获取git log 从 previousTag 到 lastTag 120 | # - name: Get git log 121 | # id: git-log 122 | # run: | 123 | # previousTag=$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`) 124 | # lastTag=$(git describe --abbrev=0 --tags) 125 | # echo "previousTag:$previousTag ~ lastTag:$lastTag" 126 | # log=$(git log $previousTag..$lastTag --pretty=format:'- %cd %an: %s\n' --date=format:'%Y-%m-%d %H:%M:%S') 127 | # echo "$log" 128 | # echo "log_state="$log"" >> $GITHUB_ENV 129 | 130 | # 创建Changelog文件 triggered by git tag push 131 | # - name: Generate Changelog 132 | # if: startsWith(github.ref, 'refs/tags/') 133 | # run: | 134 | # echo -e '${{ env.log_state }}' > release.md 135 | 136 | # 创建release 上传release 137 | # https://github.com/marketplace/actions/create-release 138 | - name: Create release and upload-archive 139 | uses: ncipollo/release-action@v1 140 | with: 141 | prerelease: false 142 | bodyFile: release.md 143 | artifacts: 'opencv-*.7z' 144 | allowUpdates: true 145 | artifactContentType: application/x-7z-compressed 146 | token: ${{ secrets.GITHUB_TOKEN }} -------------------------------------------------------------------------------- /.github/workflows/musl-zig.yml: -------------------------------------------------------------------------------- 1 | name: musl-zig 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | linux-musl: 8 | runs-on: ubuntu-22.04 9 | 10 | strategy: 11 | fail-fast: false 12 | matrix: 13 | ver: 14 | - { cv: 4.11.0, zig: zig-linux-x86_64-0.13.0 } 15 | target: 16 | [ 17 | aarch64_be-linux-musl, 18 | aarch64-linux-musl, 19 | arm-linux-musleabi, 20 | arm-linux-musleabihf, 21 | thumb-linux-musleabi, 22 | thumb-linux-musleabihf, 23 | x86-linux-musl, 24 | mips64el-linux-musl, 25 | mips64-linux-musl, 26 | mipsel-linux-musl, 27 | mips-linux-musl, 28 | powerpc64le-linux-musl, 29 | powerpc64-linux-musl, 30 | powerpc-linux-musl, 31 | riscv64-linux-musl, 32 | x86_64-linux-musl, 33 | armeb-linux-musleabi, 34 | armeb-linux-musleabihf, 35 | loongarch64-linux-musl, 36 | m68k-linux-musl, 37 | riscv32-linux-musl, 38 | s390x-linux-musl, 39 | wasm32-freestanding-musl, 40 | wasm32-wasi-musl, 41 | ] 42 | exclude: 43 | - target: armeb-linux-musleabi 44 | - target: armeb-linux-musleabihf 45 | - target: loongarch64-linux-musl 46 | - target: m68k-linux-musl 47 | - target: riscv32-linux-musl 48 | - target: s390x-linux-musl 49 | - target: wasm32-freestanding-musl 50 | - target: wasm32-wasi-musl 51 | 52 | name: opencv-${{ matrix.ver.cv }}-${{ matrix.target }} 53 | 54 | env: 55 | PKG_NAME: opencv-${{ matrix.ver.cv }}-${{ matrix.target }}-zig 56 | 57 | steps: 58 | # 检出代码 59 | - uses: actions/checkout@v4 60 | 61 | # 部署zig 62 | - name: deploy zig 63 | run: | 64 | wget https://ziglang.org/download/0.13.0/${{ matrix.ver.zig }}.tar.xz -O ${{ matrix.ver.zig }}.tar.xz 65 | tar xvf ${{ matrix.ver.zig }}.tar.xz 66 | mv ${{ matrix.ver.zig }}/ /opt/${{ matrix.ver.zig }}/ 67 | echo "/opt/${{ matrix.ver.zig }}" >> $GITHUB_PATH 68 | 69 | # 检出opencv 70 | - name: checkout opencv 71 | uses: actions/checkout@v4 72 | with: 73 | repository: opencv/opencv 74 | path: opencv-${{ matrix.ver.cv }} 75 | ref: ${{ matrix.ver.cv }} 76 | submodules: recursive 77 | 78 | # 复制 79 | - name: copy 80 | run: | 81 | cp build-opencv4-musl-zig.sh opencv-${{ matrix.ver.cv }} 82 | cp opencv4_cmake_options.txt opencv-${{ matrix.ver.cv }} 83 | wget https://github.com/benjaminwan/zig-cmake-musl-toolchain/raw/main/zig-musl.toolchain.cmake -O zig-musl.toolchain.cmake 84 | cp zig-musl.toolchain.cmake opencv-${{ matrix.ver.cv }} 85 | wget https://github.com/benjaminwan/zig-cmake-musl-toolchain/raw/main/zig-ar.sh -O zig-ar.sh 86 | cp zig-ar.sh opencv-${{ matrix.ver.cv }} 87 | wget https://github.com/benjaminwan/zig-cmake-musl-toolchain/raw/main/zig-c++.sh -O zig-c++.sh 88 | cp zig-c++.sh opencv-${{ matrix.ver.cv }} 89 | wget https://github.com/benjaminwan/zig-cmake-musl-toolchain/raw/main/zig-cc.sh -O zig-cc.sh 90 | cp zig-cc.sh opencv-${{ matrix.ver.cv }} 91 | wget https://github.com/benjaminwan/zig-cmake-musl-toolchain/raw/main/zig-ranlib.sh -O zig-ranlib.sh 92 | cp zig-ranlib.sh opencv-${{ matrix.ver.cv }} 93 | 94 | # 编译 95 | - name: build opencv 96 | run: | 97 | cd opencv-${{ matrix.ver.cv }} 98 | chmod a+x zig-ar.sh 99 | chmod a+x zig-c++.sh 100 | chmod a+x zig-cc.sh 101 | chmod a+x zig-ranlib.sh 102 | chmod a+x build-opencv4-musl-zig.sh 103 | ./build-opencv4-musl-zig.sh "${{ matrix.target }}" 104 | 105 | # 7z压缩 106 | - name: 7zip 107 | run: | 108 | cp -r opencv-${{ matrix.ver.cv }}/build-Release-${{ matrix.target }}/install ${{ env.PKG_NAME }} 109 | 7z a ${{ env.PKG_NAME }}.7z ${{ env.PKG_NAME }} 110 | rm -r -f ${{ env.PKG_NAME }} 111 | 112 | # 上传artifact 113 | # - name: upload 114 | # uses: actions/upload-artifact@v4 115 | # with: 116 | # name: ${{ env.PKG_NAME }} 117 | # path: ${{ env.PKG_NAME }}.7z 118 | 119 | # 获取所有的git log和tag 120 | # - name: Unshallow 121 | # run: git fetch --prune --unshallow 122 | 123 | # 获取git log 从 previousTag 到 lastTag 124 | # - name: Get git log 125 | # id: git-log 126 | # run: | 127 | # previousTag=$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`) 128 | # lastTag=$(git describe --abbrev=0 --tags) 129 | # echo "previousTag:$previousTag ~ lastTag:$lastTag" 130 | # log=$(git log $previousTag..$lastTag --pretty=format:'- %cd %an: %s\n' --date=format:'%Y-%m-%d %H:%M:%S') 131 | # echo "$log" 132 | # echo "log_state="$log"" >> $GITHUB_ENV 133 | 134 | # 创建Changelog文件 triggered by git tag push 135 | # - name: Generate Changelog 136 | # if: startsWith(github.ref, 'refs/tags/') 137 | # run: | 138 | # echo -e '${{ env.log_state }}' > release.md 139 | 140 | # 创建release 上传release 141 | # https://github.com/marketplace/actions/create-release 142 | - name: Create release and upload-archive 143 | uses: ncipollo/release-action@v1 144 | with: 145 | prerelease: false 146 | bodyFile: release.md 147 | artifacts: ${{ env.PKG_NAME }}.7z 148 | allowUpdates: true 149 | artifactContentType: application/x-7z-compressed 150 | token: ${{ secrets.GITHUB_TOKEN }} -------------------------------------------------------------------------------- /.github/workflows/windows.yml: -------------------------------------------------------------------------------- 1 | name: windows 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | windows: 8 | strategy: 9 | fail-fast: false 10 | matrix: 11 | ver: 12 | - { cv: 4.11.0, jdk: 8, ant: 1.10.14 } 13 | list: 14 | - { win_ver: 2019, vs_name: vs2015, vs_ver: v140 } 15 | - { win_ver: 2019, vs_name: vs2017, vs_ver: v141 } 16 | - { win_ver: 2019, vs_name: vs2019, vs_ver: v142 } 17 | - { win_ver: 2022, vs_name: vs2022, vs_ver: v143 } 18 | arch: 19 | [ 20 | x64, 21 | x86, 22 | arm64, 23 | ] 24 | crt: 25 | [ 26 | md, 27 | mt, 28 | ] 29 | exclude: 30 | - list: { win_ver: 2019, vs_name: vs2015, vs_ver: v140 } 31 | arch: arm64 32 | - list: { win_ver: 2019, vs_name: vs2017, vs_ver: v141 } 33 | arch: arm64 34 | - list: { win_ver: 2022, vs_name: vs2022, vs_ver: v143 } 35 | 36 | runs-on: windows-${{ matrix.list.win_ver }} 37 | 38 | name: windows-${{ matrix.list.vs_name }}-${{ matrix.arch }}-${{ matrix.crt }} 39 | 40 | env: 41 | BUILD_SCRIPT: build-opencv4-win.ps1 42 | BUILD_OPTIONS: opencv4_cmake_options.txt 43 | PKG_NAME: opencv-${{ matrix.ver.cv }}-windows-${{ matrix.list.vs_name }}-${{ matrix.arch }}-${{ matrix.crt }} 44 | JAVA_PKG_NAME: opencv-${{ matrix.ver.cv }}-windows-${{ matrix.list.vs_name }}-${{ matrix.arch }}-${{ matrix.crt }}-java 45 | 46 | steps: 47 | # Setup JDK 48 | - name: Set up JDK 49 | uses: actions/setup-java@v4 50 | with: 51 | java-version: '${{ matrix.ver.jdk }}' 52 | distribution: 'adopt' 53 | 54 | - uses: cedx/setup-ant@v2 55 | with: 56 | optional-tasks: true 57 | version: ${{ matrix.ver.ant }} 58 | 59 | - name: ant version 60 | run: ant -version 61 | 62 | # 检出代码 63 | - uses: actions/checkout@v4 64 | 65 | # 检出opencv 66 | - name: checkout opencv 67 | uses: actions/checkout@v4 68 | with: 69 | repository: opencv/opencv 70 | path: opencv-${{ matrix.ver.cv }} 71 | ref: ${{ matrix.ver.cv }} 72 | submodules: recursive 73 | 74 | # 复制 75 | - name: copy 76 | run: | 77 | cp ${{ env.BUILD_SCRIPT }} opencv-${{ matrix.ver.cv }} 78 | cp ${{ env.BUILD_OPTIONS }} opencv-${{ matrix.ver.cv }} 79 | 80 | # 编译 81 | # https://github.com/ilammy/msvc-dev-cmd 82 | #- uses: ilammy/msvc-dev-cmd@v1 83 | 84 | - name: build 85 | shell: powershell 86 | run: | 87 | cd opencv-${{ matrix.ver.cv }} 88 | .\${{ env.BUILD_SCRIPT }} -VsArch ${{ matrix.arch }} -VsVer ${{ matrix.list.vs_ver }} -VsCRT ${{ matrix.crt }} 89 | 90 | - name: 7zip libs 91 | run: | 92 | cp -r opencv-${{ matrix.ver.cv }}/build-${{ matrix.arch }}-${{ matrix.list.vs_ver }}-${{ matrix.crt }}/install ${{ env.PKG_NAME }} 93 | 7z a ${{ env.PKG_NAME }}.7z ${{ env.PKG_NAME }} 94 | rm ${{ env.PKG_NAME }} -r -fo 95 | 96 | - name: build java 97 | shell: powershell 98 | run: | 99 | cd opencv-${{ matrix.ver.cv }} 100 | .\${{ env.BUILD_SCRIPT }} -VsArch ${{ matrix.arch }} -VsVer ${{ matrix.list.vs_ver }} -VsCRT ${{ matrix.crt }} -BuildJava 101 | 102 | - name: 7zip java 103 | run: | 104 | cp -r opencv-${{ matrix.ver.cv }}/build-${{ matrix.arch }}-${{ matrix.list.vs_ver }}-${{ matrix.crt }}/install/java ${{ env.JAVA_PKG_NAME }} 105 | 7z a ${{ env.JAVA_PKG_NAME }}.7z ${{ env.JAVA_PKG_NAME }} 106 | rm ${{ env.JAVA_PKG_NAME }} -r -fo 107 | 108 | # 上传artifact 109 | - name: upload lib 110 | uses: actions/upload-artifact@v4 111 | with: 112 | name: ${{ env.PKG_NAME }} 113 | path: ${{ env.PKG_NAME }}.7z 114 | 115 | - name: upload java lib 116 | uses: actions/upload-artifact@v4 117 | with: 118 | name: ${{ env.JAVA_PKG_NAME }} 119 | path: ${{ env.JAVA_PKG_NAME }}.7z 120 | 121 | release: 122 | needs: [ windows ] 123 | 124 | runs-on: ubuntu-latest 125 | 126 | steps: 127 | # 检出代码 128 | - uses: actions/checkout@v4 129 | 130 | # 获取所有的git log和tag 131 | # - name: Unshallow 132 | # run: git fetch --prune --unshallow 133 | 134 | # 获取git log 从 previousTag 到 lastTag 135 | # - name: Get git log 136 | # id: git-log 137 | # run: | 138 | # previousTag=$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`) 139 | # lastTag=$(git describe --abbrev=0 --tags) 140 | # echo "previousTag:$previousTag ~ lastTag:$lastTag" 141 | # log=$(git log $previousTag..$lastTag --pretty=format:'- %cd %an: %s\n' --date=format:'%Y-%m-%d %H:%M:%S') 142 | # echo "$log" 143 | # echo "log_state="$log"" >> $GITHUB_ENV 144 | 145 | # 创建Changelog文件 triggered by git tag push 146 | # - name: Generate Changelog 147 | # if: startsWith(github.ref, 'refs/tags/') 148 | # run: | 149 | # echo -e '${{ env.log_state }}' > release.md 150 | 151 | # 下载artifact 152 | - name: download 153 | uses: actions/download-artifact@v4 154 | with: 155 | path: artifacts 156 | 157 | # 查看artifact 158 | - name: list artifact 159 | run: | 160 | tree artifacts 161 | 162 | # 创建release 上传release 163 | # https://github.com/marketplace/actions/create-release 164 | - name: upload-windows 165 | uses: ncipollo/release-action@v1 166 | with: 167 | prerelease: false 168 | bodyFile: release.md 169 | artifacts: artifacts/*/*.7z 170 | allowUpdates: true 171 | artifactContentType: application/x-7z-compressed 172 | token: ${{ secrets.GITHUB_TOKEN }} 173 | -------------------------------------------------------------------------------- /.github/workflows/musl-gcc.yml: -------------------------------------------------------------------------------- 1 | name: musl-gcc 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | musl-cross-build: 8 | runs-on: ubuntu-22.04 9 | 10 | strategy: 11 | fail-fast: false 12 | matrix: 13 | ver: 14 | - { cv: 4.11.0, musl: 13.2.0 } 15 | arch: 16 | [ 17 | aarch64-linux-musl, 18 | aarch64_be-linux-musl, 19 | arm-linux-musleabi, 20 | arm-linux-musleabihf, 21 | armeb-linux-musleabi, 22 | armeb-linux-musleabihf, 23 | armel-linux-musleabi, 24 | armel-linux-musleabihf, 25 | armv5l-linux-musleabi, 26 | armv5l-linux-musleabihf, 27 | armv5te-linux-musleabi, 28 | armv6-linux-musleabi, 29 | armv6-linux-musleabihf, 30 | armv7-linux-musleabi, 31 | armv7-linux-musleabihf, 32 | armv7l-linux-musleabihf, 33 | armv7m-linux-musleabi, 34 | armv7r-linux-musleabihf, 35 | i486-linux-musl, 36 | i586-linux-musl, 37 | i686-linux-musl, 38 | m68k-linux-musl, 39 | microblaze-linux-musl, 40 | microblazeel-linux-musl, 41 | mips-linux-musl, 42 | mips-linux-muslsf, 43 | mips-linux-musln32sf, 44 | mips64-linux-musl, 45 | mips64-linux-musln32, 46 | mips64-linux-musln32sf, 47 | mips64el-linux-musl, 48 | mips64el-linux-musln32, 49 | mips64el-linux-musln32sf, 50 | mipsel-linux-musl, 51 | mipsel-linux-musln32, 52 | mipsel-linux-musln32sf, 53 | mipsel-linux-muslsf, 54 | or1k-linux-musl, 55 | powerpc-linux-musl, 56 | powerpc-linux-muslsf, 57 | powerpc64-linux-musl, 58 | powerpc64le-linux-musl, 59 | powerpcle-linux-musl, 60 | powerpcle-linux-muslsf, 61 | riscv32-linux-musl, 62 | riscv64-linux-musl, 63 | s390x-linux-musl, 64 | sh2-linux-musl, 65 | sh2-linux-muslfdpic, 66 | sh2eb-linux-musl, 67 | sh2eb-linux-muslfdpic, 68 | sh4-linux-musl, 69 | sh4eb-linux-musl, 70 | x86_64-linux-musl, 71 | x86_64-linux-muslx32, 72 | loongarch64-linux-musl, 73 | ] 74 | exclude: 75 | - arch: sh2-linux-muslfdpic 76 | - arch: sh2eb-linux-muslfdpic 77 | - arch: powerpcle-linux-musl 78 | - arch: powerpcle-linux-muslsf 79 | 80 | name: opencv-${{ matrix.ver.cv }}-${{ matrix.arch }} 81 | 82 | env: 83 | BUILD_SCRIPT: build-opencv4-musl-gcc.sh 84 | BUILD_OPTIONS: opencv4_cmake_options.txt 85 | PKG_NAME: opencv-${{ matrix.ver.cv }}-${{ matrix.arch }} 86 | MUSL_NAME: ${{ matrix.arch }}-${{ matrix.ver.musl }} 87 | 88 | steps: 89 | # 检出代码 90 | - uses: actions/checkout@v4 91 | 92 | # 部署musl 93 | - name: deploy musl gcc 94 | run: | 95 | wget https://github.com/benjaminwan/musl-cross-builder/releases/download/${{ matrix.ver.musl }}/${{ env.MUSL_NAME }}.7z -O ${{ matrix.arch }}.7z 96 | 7z x ${{ matrix.arch }}.7z -aoa 97 | mv ${{ matrix.arch }}/ /opt/ 98 | echo "/opt/${{ matrix.arch }}" >> $GITHUB_PATH 99 | 100 | # 检出opencv 101 | - name: checkout opencv 102 | uses: actions/checkout@v4 103 | with: 104 | repository: opencv/opencv 105 | path: opencv-${{ matrix.ver.cv }} 106 | ref: ${{ matrix.ver.cv }} 107 | submodules: recursive 108 | 109 | # 复制 110 | - name: copy 111 | run: | 112 | cp ${{ env.BUILD_SCRIPT }} opencv-${{ matrix.ver.cv }} 113 | cp ${{ env.BUILD_OPTIONS }} opencv-${{ matrix.ver.cv }} 114 | wget https://github.com/benjaminwan/musl-cross-builder/raw/main/musl-cross.toolchain.cmake -O musl-cross.toolchain.cmake 115 | cp musl-cross.toolchain.cmake opencv-${{ matrix.ver.cv }} 116 | 117 | # 编译 118 | - name: build opencv 119 | run: | 120 | cd opencv-${{ matrix.ver.cv }} 121 | chmod a+x ${{ env.BUILD_SCRIPT }} 122 | ./${{ env.BUILD_SCRIPT }} -n '${{ matrix.arch }}' -p '/opt/${{ matrix.arch }}' 123 | 124 | # 7z压缩 125 | - name: 7zip 126 | run: | 127 | cp -r opencv-${{ matrix.ver.cv }}/build-Release-${{ matrix.arch }}/install ${{ env.PKG_NAME }} 128 | 7z a ${{ env.PKG_NAME }}.7z ${{ env.PKG_NAME }} 129 | rm -r -f ${{ env.PKG_NAME }} 130 | 131 | # 上传artifact 132 | # - name: upload 133 | # uses: actions/upload-artifact@v4 134 | # with: 135 | # name: ${{ env.PKG_NAME }} 136 | # path: ${{ env.PKG_NAME }}.7z 137 | 138 | # 获取所有的git log和tag 139 | # - name: Unshallow 140 | # run: git fetch --prune --unshallow 141 | 142 | # 获取git log 从 previousTag 到 lastTag 143 | # - name: Get git log 144 | # id: git-log 145 | # run: | 146 | # previousTag=$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`) 147 | # lastTag=$(git describe --abbrev=0 --tags) 148 | # echo "previousTag:$previousTag ~ lastTag:$lastTag" 149 | # log=$(git log $previousTag..$lastTag --pretty=format:'- %cd %an: %s\n' --date=format:'%Y-%m-%d %H:%M:%S') 150 | # echo "$log" 151 | # echo "log_state="$log"" >> $GITHUB_ENV 152 | 153 | # 创建Changelog文件 triggered by git tag push 154 | # - name: Generate Changelog 155 | # if: startsWith(github.ref, 'refs/tags/') 156 | # run: | 157 | # echo -e '${{ env.log_state }}' > release.md 158 | 159 | # 创建release 上传release 160 | # https://github.com/marketplace/actions/create-release 161 | - name: Create release and upload-archive 162 | uses: ncipollo/release-action@v1 163 | with: 164 | prerelease: false 165 | bodyFile: release.md 166 | artifacts: ${{ env.PKG_NAME }}.7z 167 | allowUpdates: true 168 | artifactContentType: application/x-7z-compressed 169 | token: ${{ secrets.GITHUB_TOKEN }} -------------------------------------------------------------------------------- /.github/workflows/ubuntu.yml: -------------------------------------------------------------------------------- 1 | name: ubuntu 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | ubuntu: 8 | runs-on: ubuntu-22.04 9 | 10 | strategy: 11 | fail-fast: false 12 | matrix: 13 | os_name: [ubuntu] 14 | ver: 15 | - { cv: 4.11.0, cmake: 3.28.6, python: 3.8.19, ant: 1.10.14, jdk: openjdk-8-jdk } 16 | list: 17 | - { os_ver: 14.04, os_id: trusty } 18 | - { os_ver: 16.04, os_id: xenial } 19 | - { os_ver: 18.04, os_id: bionic } 20 | - { os_ver: 20.04, os_id: focal } 21 | - { os_ver: 22.04, os_id: jammy } 22 | arch: 23 | [ 24 | 386, 25 | amd64, 26 | arm, 27 | arm64, 28 | # ppc64le, 29 | ] 30 | exclude: 31 | - list: { os_ver: 20.04, os_id: focal } 32 | arch: 386 33 | - list: { os_ver: 22.04, os_id: jammy } 34 | arch: 386 35 | 36 | name: ubuntu-${{ matrix.list.os_ver }}-${{ matrix.arch }} 37 | 38 | env: 39 | BUILD_SCRIPT: build-opencv4-linux.sh 40 | BUILD_OPTIONS: opencv4_cmake_options.txt 41 | PKG_NAME: opencv-${{ matrix.ver.cv }}-ubuntu-${{ matrix.list.os_ver }}-${{ matrix.arch }} 42 | JAVA_PKG_NAME: opencv-${{ matrix.ver.cv }}-ubuntu-${{ matrix.list.os_ver }}-${{ matrix.arch }}-java 43 | CMAKE_NAME: cmake-${{ matrix.ver.cmake }}-${{ matrix.os_name }}-${{ matrix.list.os_ver }}-${{ matrix.arch }} 44 | PYTHON_NAME: python-${{ matrix.ver.python }}-${{ matrix.os_name }}-${{ matrix.list.os_ver }}-${{ matrix.arch }} 45 | ANT_NAME: apache-ant-${{ matrix.ver.ant }}-bin 46 | 47 | 48 | steps: 49 | # 检出代码 50 | - uses: actions/checkout@v4 51 | 52 | # 检出opencv 53 | - name: checkout opencv 54 | uses: actions/checkout@v4 55 | with: 56 | repository: opencv/opencv 57 | path: opencv-${{ matrix.ver.cv }} 58 | ref: ${{ matrix.ver.cv }} 59 | submodules: recursive 60 | 61 | # 复制 62 | - name: copy 63 | run: | 64 | cp ${{ env.BUILD_SCRIPT }} opencv-${{ matrix.ver.cv }} 65 | cp ${{ env.BUILD_OPTIONS }} opencv-${{ matrix.ver.cv }} 66 | 67 | - name: Host - update 68 | run: sudo apt-get update 69 | 70 | - name: Host - Install host qemu-static 71 | run: sudo apt-get install -y qemu binfmt-support qemu-user-static 72 | 73 | - name: Host - Docker multiarch bootstrap 74 | run: sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes 75 | 76 | - name: deploy cmake 77 | run: | 78 | wget https://github.com/benjaminwan/CmakeBuilder/releases/download/${{ matrix.ver.cmake }}/${{ env.CMAKE_NAME }}.7z -O ${{ env.CMAKE_NAME }}.7z 79 | 7z x ${{ env.CMAKE_NAME }}.7z -aoa 80 | rm ${{ env.CMAKE_NAME }}.7z 81 | 82 | - name: deploy python 83 | run: | 84 | wget https://github.com/benjaminwan/PythonBuilder/releases/download/${{ matrix.ver.python }}/${{ env.PYTHON_NAME }}.7z -O ${{ env.PYTHON_NAME }}.7z 85 | 7z x ${{ env.PYTHON_NAME }}.7z -aoa 86 | rm ${{ env.PYTHON_NAME }}.7z 87 | 88 | - name: deploy ant 89 | run: | 90 | wget https://dlcdn.apache.org/ant/binaries/${{ env.ANT_NAME }}.tar.gz -O ${{ env.ANT_NAME }}.tar.gz 91 | tar -xf ${{ env.ANT_NAME }}.tar.gz 92 | rm ${{ env.ANT_NAME }}.tar.gz 93 | 94 | - name: Host - Create Docker template env file 95 | run: | 96 | echo "PATH=/root/cmake-${{ matrix.ver.cmake }}/bin:/root/python-${{ matrix.ver.python }}/bin:/root/apache-ant-${{ matrix.ver.ant }}/bin:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" > env.custom 97 | echo "DEBIAN_FRONTEND=noninteractive" >> env.custom 98 | echo "TZ=Etc/UTC" >> env.custom 99 | 100 | - name: Host - Create docker container 101 | run: docker run --name ${{ matrix.os_name }} --env-file env.custom --platform linux/${{ matrix.arch }} -it -d -w /root -v ${{ github.workspace }}:/root ${{ matrix.os_name }}:${{ matrix.list.os_id }} 102 | 103 | - name: Docker - apt-get update 104 | run: docker exec --env-file env.custom -w /root ${{ matrix.os_name }} apt-get update 105 | 106 | - name: Docker - install build deps 107 | run: docker exec --env-file env.custom -w /root ${{ matrix.os_name }} apt-get install -y build-essential git software-properties-common 108 | 109 | - name: Docker - install jdk 110 | run: | 111 | docker exec --env-file env.custom -w /root ${{ matrix.os_name }} add-apt-repository -y ppa:openjdk-r/ppa 112 | docker exec --env-file env.custom -w /root ${{ matrix.os_name }} apt-get update 113 | docker exec --env-file env.custom -w /root ${{ matrix.os_name }} apt-get -y install ${{ matrix.ver.jdk }} 114 | docker exec --env-file env.custom -w /root ${{ matrix.os_name }} java -version 115 | JAVA_DIR=$(docker exec ${{ matrix.os_name }} readlink -f /usr/bin/javac | sed "s:/bin/javac::") 116 | echo "$JAVA_DIR" 117 | echo "JAVA_HOME=$JAVA_DIR" >> env.custom 118 | echo "JAVA_INCLUDE_PATH=$JAVA_DIR/include" >> env.custom 119 | 120 | - name: Docker - build 121 | run: | 122 | docker exec --env-file env.custom -w /root ${{ matrix.os_name }} git config --global --add safe.directory "*" 123 | docker exec --env-file env.custom -w /root/opencv-${{ matrix.ver.cv }} ${{ matrix.os_name }} chmod a+x ${{ env.BUILD_SCRIPT }} 124 | docker exec --env-file env.custom -w /root/opencv-${{ matrix.ver.cv }} ${{ matrix.os_name }} ./${{ env.BUILD_SCRIPT }} -n '${{ matrix.arch }}' 125 | 126 | # install文件夹改名linux,并使用7z压缩 127 | - name: 7zip 128 | run: | 129 | sudo chown -R $(id -u):$(id -g) opencv-${{ matrix.ver.cv }}/build-Release-${{ matrix.arch }}/install 130 | sudo chmod -R 755 opencv-${{ matrix.ver.cv }}/build-Release-${{ matrix.arch }}/install 131 | cp -r opencv-${{ matrix.ver.cv }}/build-Release-${{ matrix.arch }}/install ${{ env.PKG_NAME }} 132 | 7z a ${{ env.PKG_NAME }}.7z ${{ env.PKG_NAME }} 133 | rm -r -f ${{ env.PKG_NAME }} 134 | 135 | - name: Docker - build java 136 | continue-on-error: true 137 | run: | 138 | docker exec --env-file env.custom -w /root/opencv-${{ matrix.ver.cv }} ${{ matrix.os_name }} chmod a+x ${{ env.BUILD_SCRIPT }} 139 | docker exec --env-file env.custom -w /root/opencv-${{ matrix.ver.cv }} ${{ matrix.os_name }} ./${{ env.BUILD_SCRIPT }} -n '${{ matrix.arch }}' -j 140 | 141 | - name: 7zip java 142 | run: | 143 | sudo chown -R $(id -u):$(id -g) opencv-${{ matrix.ver.cv }}/build-Release-${{ matrix.arch }}/install/share/java/opencv4 144 | sudo chmod -R 755 opencv-${{ matrix.ver.cv }}/build-Release-${{ matrix.arch }}/install/share/java/opencv4 145 | cp -r opencv-${{ matrix.ver.cv }}/build-Release-${{ matrix.arch }}/install/share/java/opencv4 ${{ env.JAVA_PKG_NAME }} 146 | 7z a ${{ env.JAVA_PKG_NAME }}.7z ${{ env.JAVA_PKG_NAME }} 147 | rm -r -f ${{ env.JAVA_PKG_NAME }} 148 | 149 | # 上传artifact 150 | # - name: upload 151 | # uses: actions/upload-artifact@v4 152 | # with: 153 | # name: ${{ env.PKG_NAME }} 154 | # path: ${{ env.PKG_NAME }}.7z 155 | 156 | # - name: upload 157 | # uses: actions/upload-artifact@v4 158 | # with: 159 | # name: ${{ env.JAVA_PKG_NAME }} 160 | # path: ${{ env.JAVA_PKG_NAME }}.7z 161 | 162 | # 获取所有的git log和tag 163 | # - name: Unshallow 164 | # run: git fetch --prune --unshallow 165 | 166 | # 获取git log 从 previousTag 到 lastTag 167 | # - name: Get git log 168 | # id: git-log 169 | # run: | 170 | # previousTag=$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`) 171 | # lastTag=$(git describe --abbrev=0 --tags) 172 | # echo "previousTag:$previousTag ~ lastTag:$lastTag" 173 | # log=$(git log $previousTag..$lastTag --pretty=format:'- %cd %an: %s\n' --date=format:'%Y-%m-%d %H:%M:%S') 174 | # echo "$log" 175 | # echo "log_state="$log"" >> $GITHUB_ENV 176 | 177 | # 创建Changelog文件 triggered by git tag push 178 | # - name: Generate Changelog 179 | # if: startsWith(github.ref, 'refs/tags/') 180 | # run: | 181 | # echo -e '${{ env.log_state }}' > release.md 182 | 183 | # 创建release 上传release 184 | # https://github.com/marketplace/actions/create-release 185 | - name: Create release and upload-archive 186 | uses: ncipollo/release-action@v1 187 | with: 188 | prerelease: false 189 | bodyFile: release.md 190 | artifacts: 'opencv-*.7z' 191 | allowUpdates: true 192 | artifactContentType: application/x-7z-compressed 193 | token: ${{ secrets.GITHUB_TOKEN }} 194 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------