File shotcut.spec of Package shotcut

# spec file for package shotcut
# Copyright (c) 2020 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

# Find qt version used to build
%define qt5version %(pkg-config --modversion Qt5Core)

%bcond_with    x264

Name:           shotcut
Version:        20.09.27
Release:        0
# This package creates a build time version from the current date and uses it to check
# for updates. See patch1 and prep/build section. For reproducible builds.
%define _vstring %(echo %{version} |tr -d ".")
Summary:        Video and audio editor and creator
License:        GPL-3.0-or-later
Group:          Productivity/Multimedia/Video/Editors and Convertors
# PATCH-FIX-UPSTREAM shotcut-with-mlt-6.16.0.patch -- Fix missing type define with mlt < 6.17.0
Patch1:         shotcut-with-mlt-6.16.0.patch
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  libqt5-qtdeclarative-private-headers-devel
BuildRequires:  mc
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(Qt5Concurrent)
BuildRequires:  pkgconfig(Qt5Core) >= 5.9.0
BuildRequires:  pkgconfig(Qt5Gui)
BuildRequires:  pkgconfig(Qt5Multimedia)
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(Qt5OpenGL)
BuildRequires:  pkgconfig(Qt5PrintSupport)
BuildRequires:  pkgconfig(Qt5Quick)
BuildRequires:  pkgconfig(Qt5UiTools)
BuildRequires:  pkgconfig(Qt5WebKitWidgets)
BuildRequires:  pkgconfig(Qt5WebSockets)
BuildRequires:  pkgconfig(Qt5X11Extras)
BuildRequires:  pkgconfig(Qt5Xml)
BuildRequires:  pkgconfig(mlt++) >= 6.7.0
BuildRequires:  pkgconfig(mlt-framework) >= 6.7.0
BuildRequires:  pkgconfig(sdl2)
BuildRequires:  pkgconfig(vpx)
# frei0r-plugins prior to 1.4-7.1 are built against qt4 and cause a segfault on startup.
Requires:       frei0r-plugins >= 1.4-7.1
Requires:       ladspa
Requires:       libmlt6-modules > 6.6.0
Requires:       melt > 6.6.0
Requires:       qmelt
Recommends:     lame
Requires:       ffmpeg >= 2.7
Requires:       %(rpm -qf $(readlink -qne %{_libdir}/ --qf '%%{NAME} >= %%{VERSION}')
%if %{with x264}
BuildRequires:  pkgconfig(x264)
Requires:       %(rpm -qf $(readlink -qne %{_libdir}/ --qf '%%{NAME} >= %%{VERSION}')
# needed on runtime for the timeline to work see
Requires:       libQt5Sql5-sqlite
Requires:       libqt5-qtgraphicaleffects >= %{qt5version}
Requires:       libqt5-qtquickcontrols >= %{qt5version}

Shotcut is an audio/video editor. It supports most audio, video and
image formats, as well as image sequences with a wide range of
filters and effects. It's compatible with JACK Audio and Melted
Server, and offers an experimental GPU Processing feature.
Shotcut can test MLT XML files, too.


%setup -q
echo "Qt5Core = %{qt5version}"
%autopatch -p1

# Search for executable files
find . \
\( -name \*.html -o -name \*.js \) -type f -executable -exec chmod a-x {} + || :

%qmake5 \
        PREFIX="%{_prefix}" -Wall -recursive \
        SHOTCUT_VERSION=%{version} \

make %{_smp_mflags} VERBOSE=1
# CC=gcc-8 CPP=cpp-8 CXX=g++-8

install -D icons/%{name}-logo-64.png %{buildroot}/%{_datadir}/pixmaps/%{name}.png

# Install language files
basedir=$(basename "$langdir")
pushd $basedir
	for ts in *.ts; do
		[ -e "$ts" ] || continue
		lupdate-qt5 "$ts" && lrelease-qt5 "$ts"
	for qm in *.qm; do
		[ -e "$qm" ] || continue
		if ! grep -wqs "%dir\ $langdir" "$langlist"; then
			echo "%dir $langdir" >>"$langlist"
		install -Dm0644 "$qm" "%{buildroot}/$langdir/$qm"
		echo "%lang($lang) $langdir/$qm" >>"$langlist"
%suse_update_desktop_file -i org.%{name}.Shotcut
chmod 0755 %{buildroot}/%{_datadir}/%{name}/qml/export-edl/
%fdupes -s %{buildroot}/%{_datadir}



%license COPYING
%exclude %{_datadir}/%{name}/translations

%files lang -f %{name}.lang