You are not logged in.

#1 2021-11-10 13:24:43

mstankie
Member
Registered: 2021-11-10
Posts: 1

Wrong URL to OpenCV github in mingw-w64-opencv

I am trying to prepare a buildsystem to cross-compile an application written in C++ with Qt5-based GUI and OpenCV for Windows.
As I use GitLab, I want to make a Docker container which then will be used in my GitLab-CI.

I base on a great Docker image from mdimura which uses Arch and mingw Qt packages to create a cross-compile container which may be used in CI to compile Windows Qt apps.
Unfortunately it does not contain OpenCV.

Adding mingw-OpenCV seems easy in Arch, so I just added one line (last one in the excerpt below) to the clonned Dockerfile script, but it failed.

# Install AUR packages
USER devel
RUN yay -S --noconfirm --noprogressbar --needed \
        mingw-w64-boost \
        mingw-w64-eigen \
        mingw-w64-qt5-quickcontrols2 \
        mingw-w64-qt5-serialport \
        mingw-w64-configure \
        mingw-w64-python-bin \
        mingw-w64-opencv

After short investigation it looks that the URLs for archive tarballs (ln. 12 in PKGBUILD) changed.
I have prepared patch to fix this:

diff --git a/PKGBUILD b/PKGBUILD
index f8646ac..ce248a9 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -9,8 +9,8 @@ url="http://opencv.org/"
 options=('!buildflags' 'staticlibs' '!strip')
 depends=('mingw-w64-crt' 'mingw-w64-libpng' 'mingw-w64-libjpeg-turbo' 'mingw-w64-libtiff' 'mingw-w64-zlib' 'mingw-w64-libwebp' 'mingw-w64-lapack' 'mingw-w64-cblas' 'mingw-w64-openjpeg2')
 makedepends=('mingw-w64-cmake' 'mingw-w64-eigen' 'mingw-w64-lapacke')
-source=("opencv-$pkgver.tar.gz::https://github.com/opencv/opencv/archive/$pkgver.tar.gz"
-  "opencv_contrib-$pkgver.tar.gz::https://github.com/opencv/opencv_contrib/archive/$pkgver.tar.gz"
+source=("opencv-$pkgver.tar.gz::https://github.com/opencv/opencv/archive/refs/tags/$pkgver.tar.gz"
+  "opencv_contrib-$pkgver.tar.gz::https://github.com/opencv/opencv_contrib/archive/refs/tags/$pkgver.tar.gz"
   "opencv-lapack-3.10.patch"
   "0105-wechat-iconv-dependency.patch"
   "0012-make-header-usable-with-C-compiler.patch"

Unfortunately when I tried to build fixed PKGBUILD with

makepkg -si

it failed as well.

The code below was added to the Dockerfile to manually install fixed opencv-AUR.

# install OpenCV from AUR pkgfile
# there is a wrong path to OpenCV archive which needs to be patched
USER root
RUN mkdir /workdir/mingw-w64-opencv
RUN chown devel /workdir/mingw-w64-opencv
USER devel
WORKDIR /workdir/mingw-w64-opencv
RUN git clone [url]https://aur.archlinux.org/mingw-w64-opencv.git[/url] .
RUN git checkout 0b2bc093213691cd7aadf360625cea43ec1312fa
ADD fix_broken_github_archive_paths.patch .
RUN git apply fix_broken_github_archive_paths.patch
RUN makepkg -si
# clean after installing opencv
RUN makepkg --clean
WORKDIR /workdir
RUN rm -rf mingw-w64-opencv

Code below is the output from

docker build

on the Dockerfile.

==> Creating package "mingw-w64-opencv"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: mingw-w64-opencv 4.5.4-1 (Wed 10 Nov 2021 01:40:16 AM UTC)
==> Installing package mingw-w64-opencv with pacman -U...
loading packages...
resolving dependencies...
looking for conflicting packages...
:: Proceed with installation? [Y/n] 
Packages (1) mingw-w64-opencv-4.5.4-1

Total Installed Size:  349.88 MiB

==> WARNING: Failed to install built package(s).
The command '/bin/sh -c makepkg -si' returned a non-zero code: 14

The questions:

  • is there any obvious mistake in my dockerfile that makes

    makepkg -si

    fail?

  • how can I send the patch to mingw-w64-opencv, without registering?

I cannot register to comment in AUR, as I have no installed Arch to answer the question below and it does not accept the one I generate in a docker-contenerised Arch.

To protect the AUR against automated account creation, we kindly ask you to provide the output of the following command: LC_ALL=C pacman -V|sed -r 's#[0-9]+#562#g'|md5sum|cut -c1-6

Last edited by mstankie (2021-11-10 13:32:57)

Offline

Board footer

Powered by FluxBB