Skip to content

Commit

Permalink
Opencv build from source on snaps (New) (#1011)
Browse files Browse the repository at this point in the history
Opencv build from source on snaps
  • Loading branch information
fernando79513 authored Feb 23, 2024
1 parent cae8ac8 commit 0bc7bfd
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
1 change: 1 addition & 0 deletions checkbox-core-snap/common_files/config/wrapper_common
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ else
append_path PYTHONHOME $RUNTIME/usr
append_path PYTHONPATH $RUNTIME/usr/lib/python3/dist-packages
append_path PYTHONPATH $RUNTIME/lib/python3*/site-packages
append_path PYTHONPATH $RUNTIME/lib/python3*/dist-packages
fi

# make sure we always know where the content snap is especially for classic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ else
append_path PYTHONHOME $RUNTIME/usr
append_path PYTHONPATH $RUNTIME/usr/lib/python3/dist-packages
append_path PYTHONPATH $RUNTIME/lib/python3*/site-packages
append_path PYTHONPATH $RUNTIME/lib/python3*/dist-packages
fi

# make sure we always know where the content snap is especially for classic
Expand Down
46 changes: 45 additions & 1 deletion checkbox-core-snap/series22/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ parts:
- python3-evdev
- python3-gi
- python3-natsort
- python3-opencv
- python3-pil
- python3-psutil
- python3-pyqrcode
Expand Down Expand Up @@ -459,6 +458,51 @@ parts:
python3 manage.py build
python3 manage.py install --layout=relocatable --prefix=/providers/checkbox-provider-tutorial --root="$SNAPCRAFT_PART_INSTALL"
after: [checkbox-provider-base]
################################################################################
opencv:
plugin: make
source: https://github.com/opencv/opencv.git
source-tag: 4.9.0
override-build: |
cd $SNAPCRAFT_PART_SRC
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=$SNAPCRAFT_PART_INSTALL \
-DBUILD_LIST=videoio,features2d,highgui,flann,python3 ..
make -j$(nproc)
make install
build-packages:
- build-essential
- cmake
- pkg-config
- libjpeg-dev
- libpng-dev
- libtiff-dev
- libavcodec-dev
- libavformat-dev
- libswscale-dev
- libv4l-dev
- libxvidcore-dev
- libx264-dev
- libgtk-3-dev
- gfortran
- python3-dev
- python3-numpy
stage-packages:
- libjpeg8
- libpng16-16
- libtiff5
- libavcodec58
- libavformat58
- libfreetype6
- libswscale5
- libv4l-0
- libxvidcore4
- libx264-dev
- python3-minimal
- python3.10-minimal
- python3-numpy
################################################################################
gnome-randr:
source: https://github.com/maxwellainatchi/gnome-randr-rust.git
Expand Down

0 comments on commit 0bc7bfd

Please sign in to comment.