From bc3e3bc266ffd54a49912546f3f0b194a6a67c15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20M=2E=20Basto?= Date: Sat, 1 Oct 2022 15:08:01 +0100 Subject: [PATCH] Set linters as optional, adaptation of Diego Herrera PR https://src.fedoraproject.org/rpms/opencv/pull-request/17# --- opencv.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/opencv.spec b/opencv.spec index 9c8a549..f0941e6 100644 --- a/opencv.spec +++ b/opencv.spec @@ -1,6 +1,8 @@ %undefine __cmake_in_source_build %bcond_without tests %bcond_without extras +# linters are enabled by default if BUILD_DOCS OR BUILD_EXAMPLES +%bcond_without linters %bcond_with ffmpeg %bcond_without gstreamer %bcond_with eigen2 @@ -121,8 +123,10 @@ BuildRequires: zlib-devel BuildRequires: pkgconfig BuildRequires: python3-devel BuildRequires: python3-numpy +%{?with_linters: BuildRequires: pylint BuildRequires: python3-flake8 +} BuildRequires: swig >= 1.3.24 %{?with_ffmpeg:BuildRequires: ffmpeg-devel >= 0.4.9} %if 0%{?fedora} || 0%{?rhel} > 7 @@ -332,7 +336,10 @@ install -pm 0644 %{SOURCE4} .cache/ade/ -DPYTHON3_EXECUTABLE=%{__python3} \ -DPYTHON3_PACKAGES_PATH=%{python3_sitearch} \ -DOPENCV_GENERATE_SETUPVARS=OFF \ - -DENABLE_PYLINT=ON \ + %{!?with_linters: \ + -DENABLE_PYLINT=OFF \ + -DENABLE_FLAKE8=OFF \ + } \ -DBUILD_PROTOBUF=OFF \ -DPROTOBUF_UPDATE_FILES=ON \ %{?with_opencl: -DOPENCL_INCLUDE_DIR=%{_includedir}/CL } \