Skip to content

Commit 8ec9f17

Browse files
committed
flatpak: add OpenCV module and rebuild camera-linux from source
1 parent afb40b8 commit 8ec9f17

3 files changed

Lines changed: 145 additions & 3 deletions

File tree

flatpak/com.cypherstack.campfire.yaml

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,39 @@ finish-args:
99
- --share=ipc
1010
- --socket=fallback-x11
1111
- --socket=wayland
12-
- --device=dri
12+
- --device=all
1313
- --filesystem=~/.campfire
1414
- --talk-name=org.freedesktop.secrets
1515
- --talk-name=org.freedesktop.Notifications
1616

1717
modules:
18+
- name: opencv
19+
buildsystem: cmake-ninja
20+
builddir: true
21+
config-opts:
22+
- -DCMAKE_BUILD_TYPE=Release
23+
- -DBUILD_LIST=core,imgcodecs,imgproc,videoio
24+
- -DBUILD_EXAMPLES=OFF
25+
- -DBUILD_TESTS=OFF
26+
- -DBUILD_PERF_TESTS=OFF
27+
- -DBUILD_DOCS=OFF
28+
- -DBUILD_opencv_python3=OFF
29+
- -DBUILD_opencv_python_bindings_generator=OFF
30+
- -DWITH_GTK=OFF
31+
- -DWITH_QT=OFF
32+
- -DWITH_OPENGL=OFF
33+
- -DWITH_OPENCL=OFF
34+
- -DWITH_CUDA=OFF
35+
- -DWITH_FFMPEG=OFF
36+
- -DWITH_GSTREAMER=OFF
37+
- -DWITH_V4L=ON
38+
- -DWITH_LIBV4L=ON
39+
sources:
40+
- type: git
41+
url: https://github.com/opencv/opencv
42+
tag: '4.10.0'
43+
commit: 71d3237a093b60a27601c20e9ee6c3e52154e8b1
44+
1845
- name: campfire
1946
buildsystem: simple
2047
build-commands:
@@ -31,3 +58,21 @@ modules:
3158
sources:
3259
- type: dir
3360
path: .
61+
62+
- name: camera-linux
63+
buildsystem: simple
64+
build-commands:
65+
- cmake -S src -B _build
66+
-DCMAKE_BUILD_TYPE=Release
67+
-DCMAKE_PREFIX_PATH=/app
68+
-DCMAKE_INSTALL_RPATH=/app/lib/campfire/lib:/app/lib
69+
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
70+
- cmake --build _build --parallel
71+
- install -Dm755 _build/libopencv_wrapper.so
72+
/app/lib/campfire/lib/libopencv_wrapper.so
73+
- install -Dm755 _build/libcamera_linux.so
74+
/app/lib/campfire/lib/libcamera_linux.so
75+
sources:
76+
- type: git
77+
url: https://github.com/cypherstack/camera-linux
78+
commit: ecb412474c5d240347b04ac1eb9f019802ff7034

flatpak/com.cypherstack.stackduo.yaml

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,39 @@ finish-args:
99
- --share=ipc
1010
- --socket=fallback-x11
1111
- --socket=wayland
12-
- --device=dri
12+
- --device=all
1313
- --filesystem=~/.stackduo
1414
- --talk-name=org.freedesktop.secrets
1515
- --talk-name=org.freedesktop.Notifications
1616

1717
modules:
18+
- name: opencv
19+
buildsystem: cmake-ninja
20+
builddir: true
21+
config-opts:
22+
- -DCMAKE_BUILD_TYPE=Release
23+
- -DBUILD_LIST=core,imgcodecs,imgproc,videoio
24+
- -DBUILD_EXAMPLES=OFF
25+
- -DBUILD_TESTS=OFF
26+
- -DBUILD_PERF_TESTS=OFF
27+
- -DBUILD_DOCS=OFF
28+
- -DBUILD_opencv_python3=OFF
29+
- -DBUILD_opencv_python_bindings_generator=OFF
30+
- -DWITH_GTK=OFF
31+
- -DWITH_QT=OFF
32+
- -DWITH_OPENGL=OFF
33+
- -DWITH_OPENCL=OFF
34+
- -DWITH_CUDA=OFF
35+
- -DWITH_FFMPEG=OFF
36+
- -DWITH_GSTREAMER=OFF
37+
- -DWITH_V4L=ON
38+
- -DWITH_LIBV4L=ON
39+
sources:
40+
- type: git
41+
url: https://github.com/opencv/opencv
42+
tag: '4.10.0'
43+
commit: 71d3237a093b60a27601c20e9ee6c3e52154e8b1
44+
1845
- name: stack_duo
1946
buildsystem: simple
2047
build-commands:
@@ -31,3 +58,21 @@ modules:
3158
sources:
3259
- type: dir
3360
path: .
61+
62+
- name: camera-linux
63+
buildsystem: simple
64+
build-commands:
65+
- cmake -S src -B _build
66+
-DCMAKE_BUILD_TYPE=Release
67+
-DCMAKE_PREFIX_PATH=/app
68+
-DCMAKE_INSTALL_RPATH=/app/lib/stack_duo/lib:/app/lib
69+
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
70+
- cmake --build _build --parallel
71+
- install -Dm755 _build/libopencv_wrapper.so
72+
/app/lib/stack_duo/lib/libopencv_wrapper.so
73+
- install -Dm755 _build/libcamera_linux.so
74+
/app/lib/stack_duo/lib/libcamera_linux.so
75+
sources:
76+
- type: git
77+
url: https://github.com/cypherstack/camera-linux
78+
commit: ecb412474c5d240347b04ac1eb9f019802ff7034

flatpak/com.cypherstack.stackwallet.yaml

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,42 @@ finish-args:
99
- --share=ipc
1010
- --socket=fallback-x11
1111
- --socket=wayland
12-
- --device=dri
12+
- --device=all
1313
- --filesystem=~/.stackwallet
1414
- --talk-name=org.freedesktop.secrets
1515
- --talk-name=org.freedesktop.Notifications
1616

1717
modules:
18+
# Minimal OpenCV build — only the modules needed by camera_linux (VideoCapture + imencode).
19+
# Keeps the Flatpak from pulling in the full 47-module system OpenCV dependency chain.
20+
- name: opencv
21+
buildsystem: cmake-ninja
22+
builddir: true
23+
config-opts:
24+
- -DCMAKE_BUILD_TYPE=Release
25+
- -DBUILD_LIST=core,imgcodecs,imgproc,videoio
26+
- -DBUILD_EXAMPLES=OFF
27+
- -DBUILD_TESTS=OFF
28+
- -DBUILD_PERF_TESTS=OFF
29+
- -DBUILD_DOCS=OFF
30+
- -DBUILD_opencv_python3=OFF
31+
- -DBUILD_opencv_python_bindings_generator=OFF
32+
- -DWITH_GTK=OFF
33+
- -DWITH_QT=OFF
34+
- -DWITH_OPENGL=OFF
35+
- -DWITH_OPENCL=OFF
36+
- -DWITH_CUDA=OFF
37+
- -DWITH_FFMPEG=OFF
38+
- -DWITH_GSTREAMER=OFF
39+
- -DWITH_V4L=ON
40+
- -DWITH_LIBV4L=ON
41+
sources:
42+
- type: git
43+
url: https://github.com/opencv/opencv
44+
tag: '4.10.0'
45+
commit: 71d3237a093b60a27601c20e9ee6c3e52154e8b1
46+
47+
# Install the pre-built Flutter bundle.
1848
- name: stack_wallet
1949
buildsystem: simple
2050
build-commands:
@@ -34,3 +64,25 @@ modules:
3464
sources:
3565
- type: dir
3666
path: .
67+
68+
# Rebuild camera_linux and its OpenCV wrapper against the Flatpak-built OpenCV above,
69+
# then overwrite the pre-built CI libs dropped by the stack_wallet module.
70+
# RPATH includes both the app lib dir (for libopencv_wrapper.so) and /app/lib
71+
# (for the OpenCV modules installed by the opencv module above).
72+
- name: camera-linux
73+
buildsystem: simple
74+
build-commands:
75+
- cmake -S src -B _build
76+
-DCMAKE_BUILD_TYPE=Release
77+
-DCMAKE_PREFIX_PATH=/app
78+
-DCMAKE_INSTALL_RPATH=/app/lib/stack_wallet/lib:/app/lib
79+
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
80+
- cmake --build _build --parallel
81+
- install -Dm755 _build/libopencv_wrapper.so
82+
/app/lib/stack_wallet/lib/libopencv_wrapper.so
83+
- install -Dm755 _build/libcamera_linux.so
84+
/app/lib/stack_wallet/lib/libcamera_linux.so
85+
sources:
86+
- type: git
87+
url: https://github.com/cypherstack/camera-linux
88+
commit: ecb412474c5d240347b04ac1eb9f019802ff7034

0 commit comments

Comments
 (0)