Freedom Issue #3107

[opencv] Downloads and installs binary blobs

nona - about 1 year ago - . Updated 7 months ago.

in progress
freedom issue
% Done:



  • steps to reproduce:
    1. Download the PKGBUILD and libre.patch
    2. Run makepkg
  • expected result:
    binary-(blob)-free package and compilation
 parallel 'file {} | grep " data" | grep -v "\(image\|text\|JSON\|gzip\)"' ::: $(find . -type f)

Besides is downloaded during compilation.
  • proposed solution
    either rm -fr modules/{aruco,cnn_3dobj,dnns_easily_fooled,wechat_qrcode} or add -DOPENCV_FORCE_3DPARTY_BUILD=ON to configuration options (still testing, will report later)

    regarding the ADE file, add to sources and (sym)link to "${srcdir}"/"${pkgbase}"-"${pkgver}"/.cache/ade/


opencv-4.5.3-patches.tar.gz (2.08 KB) opencv-4.5.3-patches.tar.gz 4 patches to de-blob sources nona, 2021-10-07 05:18 PM
PKGBUILD (13.1 KB) PKGBUILD binary examples go in opencv-contrib samples dir nona, 2021-10-07 10:15 PM



Updated by nona about 1 year ago


Updated by nona about 1 year ago

  • File deleted (PKGBUILD)

Updated by nona about 1 year ago

  • File PKGBUILD added

I am attaching a PKGBUILD which works in my computer. I still don't know how to use mksource, but should be simple enough to adapt the prepare function.


Updated by nona about 1 year ago

  • File deleted (PKGBUILD)

Updated by nona about 1 year ago


Updated by Zuss 7 months ago

  • Status changed from unconfirmed to in progress

I was updating OpenCV to 4.5.5 and noticed it trying to download external files as well.
It tried to download ADE, IPPICV, face, wechat_qrcode. I had opened a PR (#51) to update the package before noticing this issue.
The command you listed in the description returns a lot of files and I'm not quite sure what is meant to happen with them.

Though I assume we can merge the ADE patch and can leave out the rest? The PKGBUILD can't fetch the third party dependencies because network access is disabled within build() anyways.
I'm just looking to bring down the maintenance and testing required for newer releases.
We could possibly mention that Parabola's OpenCV package won't have xyz module support and leave the downloads fail, or add them into the sources much like how you did it with ADE. Though I'm not sure what's actually needed. Removing the folder from the module directory seems like the way to go about it if we were to strip them from the package.

Lapack is found but I don't really know why LAPACK_ is appended to those lines in the patch.

 |  -- LAPACK(Unknown): LAPACK_LIBRARIES: /usr/lib/;/usr/lib/;/usr/lib/
 |  -- Looking for /usr/include/cblas.h
 |  -- Looking for /usr/include/cblas.h - found
 |  -- Looking for /usr/include/lapacke.h
 |  -- Looking for /usr/include/lapacke.h - found
 |  -- LAPACK(Unknown): Support is enabled.

Also available in: Atom PDF