summaryrefslogtreecommitdiff
path: root/depthai-v3.spec
blob: d3ad8ff12a776bbfe2feb0cfe7cdfdd226a774f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
%define ros_distro humble
%define RosPkgName depthai-v3
%define src_version 3.7.1

Name:           ros-%{ros_distro}-%{RosPkgName}
Version:        3.7.1
Release:        2%{?dist}
Summary:        DepthAI core is a C++ library which comes with firmware and an API to interact 
License:        MIT
URL:            https://github.com/luxonis/depthai-core.git
Source0:        %{RosPkgName}-%{src_version}.tar.gz

%global debug_package %{nil}
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
%global __provides_exclude_from ^/opt/ros/%{ros_distro}/.*$
%global __requires_exclude_from ^/opt/ros/%{ros_distro}/.*$

BuildRequires:  cmake
BuildRequires:  pkgconf
BuildRequires:  ros-%{ros_distro}-ament-cmake
BuildRequires:  ros-%{ros_distro}-ros-environment
BuildRequires:  bzip2-devel
BuildRequires:  eigen3-devel
BuildRequires:  fmt-devel
BuildRequires:  libarchive-devel
BuildRequires:  libudev-devel
BuildRequires:  libusbx-devel
BuildRequires:  lz4-devel
BuildRequires:  nlohmann-json-devel
BuildRequires:  opencv
BuildRequires:  protobuf-devel
BuildRequires:  spdlog-devel
BuildRequires:  xz-devel
BuildRequires:  yaml-cpp-devel
BuildRequires:  curl
BuildRequires:  gfortran
BuildRequires:  unzip
BuildRequires:  zip

Requires:       ros-%{ros_distro}-ros-workspace
Requires:       ros-%{ros_distro}-ament-cmake
Requires:       fmt-devel
Requires:       libudev-devel
Requires:       libusbx-devel
Requires:       nlohmann-json-devel
Requires:       opencv
Requires:       spdlog-devel
Requires:       curl
Requires:       gfortran
Requires:       unzip
Requires:       zip

Provides:       %{name}-devel = %{version}-%{release}
Provides:       %{name}-doc = %{version}-%{release}
Provides:       %{name}-runtime = %{version}-%{release}

%description
DepthAI core is a C++ library which comes with firmware and an API to interact with
        OAK Platform

%prep
%autosetup -n %{RosPkgName}-%{src_version}

%build
[ -f /opt/ros/%{ros_distro}/setup.sh ] && source /opt/ros/%{ros_distro}/setup.sh || true
export PYTHONPATH=/opt/ros/%{ros_distro}/lib/python%{python3_version}/site-packages${PYTHONPATH:+:$PYTHONPATH}
export PKG_CONFIG_PATH=/opt/ros/%{ros_distro}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}
mkdir -p .obj && cd .obj
%cmake3 \
    -DCMAKE_INSTALL_PREFIX="/opt/ros/%{ros_distro}" \
    -DAMENT_PREFIX_PATH="/opt/ros/%{ros_distro}" \
    -DCMAKE_PREFIX_PATH="/opt/ros/%{ros_distro};/usr/share/eigen3/cmake" \
    -UINCLUDE_INSTALL_DIR -ULIB_INSTALL_DIR -USYSCONF_INSTALL_DIR -USHARE_INSTALL_PREFIX -ULIB_SUFFIX \
    -DSETUPTOOLS_DEB_LAYOUT=OFF \
    -DBUILD_TESTING=OFF -DTESTING=OFF -DCMAKE_SUPPRESS_REGENERATION=ON \
    -DDEPTHAI_BOOTSTRAP_VCPKG=OFF \
    -DDEPTHAI_JSON_EXTERNAL=ON \
    -DDEPTHAI_XTENSOR_SUPPORT=OFF \
    -DDEPTHAI_DYNAMIC_CALIBRATION_SUPPORT=OFF \
    -DDEPTHAI_ENABLE_REMOTE_CONNECTION=OFF \
    -DDEPTHAI_ENABLE_EVENTS_MANAGER=OFF \
    -DDEPTHAI_ENABLE_CURL=OFF \
    -DDEPTHAI_ENABLE_APRIL_TAG=OFF \
    -DDEPTHAI_ENABLE_BACKWARD=OFF \
    -DDEPTHAI_ENABLE_MP4V2=OFF \
    -DDEPTHAI_BASALT_SUPPORT=OFF \
    -DDEPTHAI_RTABMAP_SUPPORT=OFF \
    -DDEPTHAI_BUILD_EXAMPLES=OFF \
    -DDEPTHAI_BUILD_TESTS=OFF \
    -DDEPTHAI_BUILD_DOCS=OFF \
    -DDEPTHAI_ENABLE_DEVICE_FW=OFF \
    -DDEPTHAI_ENABLE_DEVICE_BOOTLOADER_FW=OFF \
    -DDEPTHAI_ENABLE_DEVICE_RVC4_FW=OFF \
    -DDEPTHAI_BINARIES_RESOURCE_COMPILE=OFF \
    -DDEPTHAI_CLANG_FORMAT=OFF \
    ..
make %{?_smp_mflags}

%install
[ -f /opt/ros/%{ros_distro}/setup.sh ] && source /opt/ros/%{ros_distro}/setup.sh || true
export PYTHONPATH=/opt/ros/%{ros_distro}/lib/python%{python3_version}/site-packages${PYTHONPATH:+:$PYTHONPATH}
export PKG_CONFIG_PATH=/opt/ros/%{ros_distro}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}
cd .obj
make install DESTDIR=%{buildroot}

%files
/opt/ros/%{ros_distro}

%changelog
* Mon Oct 26 2026 ai-importer <ai-importer@openeuler.org> - 3.7.1-2
- Disable vcpkg bootstrap, vendor missing header-only deps (magic_enum, semver,
  fp16, cpp-httplib, libnop, XLink) into 3rdparty/ tree
- Patch depthaiDependencies.cmake to find vendored deps locally instead of
  FetchContent/GitHub clone; use pkg-config for lz4/liblzma (no cmake config)
- Disable firmware downloads, dynamic_calibration, remote_connection, curl,
  apriltag, backward, mp4v2, basalt, rtabmap, xtensor (all need network or
  packages unavailable on openEuler 24.03)
- Add system BuildRequires: bzip2-devel, eigen3-devel, libarchive-devel,
  lz4-devel, protobuf-devel, xz-devel, yaml-cpp-devel, pkgconf