File deepin-screen-recorder.spec of Package deepin-screen-recorder
#
# spec file for package deepin-screen-recorder
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define procps_version %(rpm -q --queryformat '%%{VERSION}' procps-devel)
Name: deepin-screen-recorder
Version: 6.5.18
Release: 0
Summary: Deepin Screen Recorder
License: GPL-3.0-or-later
Group: Productivity/Multimedia/Video/Editors and Convertors
URL: https://github.com/linuxdeepin/deepin-screen-recorder
Source0: https://github.com/linuxdeepin/deepin-screen-recorder/archive/%{version}/%{name}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM fix-include-path.patch hillwood@opensuse.org - Add ffmpeg include path
Patch0: fix-include-path.patch
# PATCH-FOR-OPENSUSE use-opencv4.patch hillwood@opensuse.org - Use opencv4 instead of opencv_mobile
Patch1: use-opencv4.patch
# PATCH-FIX-UPSTREAM fix-hardcord-plugin-dir.patch hillwood@opensuse.org - Don't hardcord plugin path
Patch2: fix-hardcord-plugin-dir.patch
# PATCH-FIX-UPSTREAM fix-ffmpeg_7.patch hillwood@opensuse.org - Support ffmpeg 7
Patch4: fix-ffmpeg_7.patch
Patch5: fix-conflicting-types-error-on-gcc15.patch
# fdupes macro works
Source1: %{name}-rpmlintrc
%ifnarch ppc ppc64 ppc64le s390 s390x
BuildRequires: deepin-manual
%endif
BuildRequires: deepin-desktop-base
BuildRequires: deepin-dock > 6.0.35
BuildRequires: deepin-dock-devel > 6.0.35
BuildRequires: fdupes
BuildRequires: gtest
BuildRequires: hicolor-icon-theme
BuildRequires: libimagevisualresult-devel
BuildRequires: qt6-tools-linguist
BuildRequires: procps-devel
BuildRequires: cmake(KF5I18n)
BuildRequires: cmake(KWayland)
BuildRequires: cmake(Qt6WaylandClientPrivate)
BuildRequires: pkgconfig(Qt6Concurrent)
BuildRequires: pkgconfig(Qt6Core)
BuildRequires: pkgconfig(Qt6DBus)
BuildRequires: pkgconfig(Qt6Gui)
BuildRequires: pkgconfig(Qt6Multimedia)
BuildRequires: pkgconfig(Qt6MultimediaWidgets)
BuildRequires: pkgconfig(Qt6OpenGLWidgets)
BuildRequires: pkgconfig(Qt6Network)
BuildRequires: pkgconfig(Qt6OpenGL)
BuildRequires: pkgconfig(Qt6PrintSupport)
BuildRequires: pkgconfig(Qt6Sql)
BuildRequires: pkgconfig(Qt6Svg)
BuildRequires: pkgconfig(Qt6Test)
BuildRequires: pkgconfig(Qt6Linguist)
BuildRequires: pkgconfig(Qt6WaylandClient)
BuildRequires: pkgconfig(Qt6Widgets)
BuildRequires: pkgconfig(Qt6Xml)
BuildRequires: pkgconfig(dde-dock)
# BuildRequires: pkgconfig(dframeworkdbus)
BuildRequires: pkgconfig(dtk6gui)
BuildRequires: pkgconfig(dtk6widget)
BuildRequires: pkgconfig(gsettings-qt)
BuildRequires: pkgconfig(gstreamer-plugins-base-1.0)
BuildRequires: pkgconfig(xinerama)
%if 0%{?suse_version} > 1500
# BuildRequires: ffmpeg-6-mini-devel
BuildRequires: pkgconfig(opencv4)
%else
BuildRequires: pkgconfig(opencv)
%endif
BuildRequires: pkgconfig(libavcodec)
BuildRequires: pkgconfig(libavformat)
BuildRequires: pkgconfig(libffmpegthumbnailer)
BuildRequires: pkgconfig(libswscale)
BuildRequires: pkgconfig(libusb-1.0)
BuildRequires: pkgconfig(libv4l1)
BuildRequires: pkgconfig(portaudio-2.0)
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xcb)
BuildRequires: pkgconfig(xcb-util)
BuildRequires: pkgconfig(xcursor)
BuildRequires: pkgconfig(xext)
BuildRequires: pkgconfig(xfixes)
BuildRequires: pkgconfig(xtst)
Recommends: %{name}-lang = %{version}-%{release}
Requires: byzanz
Requires: libportaudio2
Requires: ffmpeg
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
deepin-screen-recorder is free and open source software for screen recording.
%package -n deepin-dock-plugin-screen-recorder
Summary: The screen recorder plugin of deepin dock
Group: Productivity/Multimedia/Video/Editors and Convertors
Requires: %{name} = %{version}
Requires: deepin-dock > 6.0.35
%description -n deepin-dock-plugin-screen-recorder
The deepin screen recorder plugin of deepin dock
%package -n deepin-dock-plugin-shot-start
Summary: The shot start plugin of deepin dock
Group: Productivity/Multimedia/Video/Editors and Convertors
Requires: %{name} = %{version}
Requires: deepin-dock > 6.0.35
%description -n deepin-dock-plugin-shot-start
The shot start of deepin dock.
%package -n deepin-dock-plugin-shot-start-record
Summary: The shot start record plugin of deepin dock
Group: Productivity/Multimedia/Video/Editors and Convertors
Requires: %{name} = %{version}
Requires: deepin-dock > 6.0.35
%description -n deepin-dock-plugin-shot-start-record
The shot start record of deepin dock.
%lang_package
%prep
%autosetup -p1 -n %{name}-%{version}
# sed -i '/#include<opencv2/i #include <opencv2/imgproc/types_c.h>' src/utils/pixmergethread.h
sed -i '/include <X11.extensions.XTest.h>/a #undef min' src/event_monitor.cpp
# sed -i '/#include <iostream>/d;1i #include <iostream>' src/screen_shot_event.cpp
# sed -i '/include <X11.extensions.shape.h>/a #undef None' src/utils.cpp
# https://github.com/linuxdeepin/deepin-screen-recorder/pull/416
sed -i "s|/etc/os-version|/etc/dde-version|;s|c++11|c++14|" src/src.pro
%if "%{procps_version}" >= "4.0.0"
sed -i 's|procps|proc-2|' src/CMakeLists.txt
%endif
%build
export CXXFLAGS="$CXXFLAGS -std=gnu++14"
%qmake6 LIB_INSTALL_DIR=%{_libdir} \
lupdate=lupdate6 \
lrelease=lrelease6
%make_build
%install
%qmake6_install
%fdupes %{buildroot}%{_datadir}
%find_lang %{name} --with-qt
find %{buildroot}%{_datadir}/deepin-manual -name '*.svg' -type f -print -exec chmod -x {} \;
find %{buildroot}%{_datadir}/deepin-manual -name '*.md' -type f -print -exec chmod -x {} \;
chmod -x %{buildroot}%{_datadir}/dbus-1/services/com.deepin.PinScreenShots.service
%files
%doc README.md CHANGELOG.md
%license LICENSE
%{_bindir}/%{name}
%{_bindir}/deepin-pin-screenshots
%{_datadir}/applications/*.desktop
%dir %{_datadir}/icons/hicolor/scalable
%dir %{_datadir}/icons/hicolor/scalable/apps
%{_datadir}/icons/hicolor/scalable/apps/*.svg
%{_datadir}/dbus-1/services/com.deepin.PinScreenShots.service
%{_datadir}/dbus-1/services/com.deepin.ScreenRecorder.service
%{_datadir}/dbus-1/services/com.deepin.Screenshot.service
%{_datadir}/deepin-manual/manual-assets/application/%{name}
%files -n deepin-dock-plugin-screen-recorder
%{_libdir}/dde-dock/plugins/libdeepin-screen-recorder-plugin.so
%files -n deepin-dock-plugin-shot-start
%{_libdir}/dde-dock/plugins/libshot-start-plugin.so
%{_datadir}/glib-2.0/schemas/com.deepin.dde.dock.module.shot-start-plugin.gschema.xml
%files -n deepin-dock-plugin-shot-start-record
%dir %{_datadir}/dde-dock
%dir %{_datadir}/dde-dock/icons
%dir %{_datadir}/dde-dock/icons/dcc-setting
%{_datadir}/dde-dock/icons/dcc-setting/*.dci
%{_libdir}/dde-dock/plugins/libshot-start-record-plugin.so
%{_datadir}/glib-2.0/schemas/com.deepin.dde.dock.module.shot-start-record-plugin.gschema.xml
%files lang -f %{name}.lang
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/translations
%changelog