File libqt5-qtdeclarative.spec of Package libqt5-qtdeclarative

#
# spec file for package libqt5-qtdeclarative
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#


%define qt5_snapshot 0

%define libname libQtQuick5

Name:           libqt5-qtdeclarative
Version:        5.6.1
Release:        10.1
Summary:        Qt 5 Declarative Library
License:        SUSE-LGPL-2.1-with-digia-exception-1.1 or GPL-3.0
Group:          Development/Libraries/X11
Url:            http://qt.digia.com
%define base_name libqt5
%define real_version 5.6.1
%define so_version 5.6.1
%define tar_version qtdeclarative-opensource-src-%{real_version}
Source:         %{tar_version}.tar.xz
Source1:        baselibs.conf
# PATCH-FIX-OPENSUSE overflow.patch -- Statement might be overflowing a buffer
Patch0:         overflow.patch
# PATCH-FIX-UPSTREAM qml_only_release_types_if_they_arent_referenced_anymore.patch
Patch1:         qml_only_release_types_if_they_arent_referenced_anymore.patch
# PATCH-FIX-OPENSUSE: qtdeclarative-opensource-src-5.6.0-qml_no-lifetime-dse.patch - fix crashes with i586 and Plasma (boo #985768)
Patch2:         qtdeclarative-opensource-src-5.6.0-qml_no-lifetime-dse.patch
BuildRequires:  fdupes
BuildRequires:  libQt5Core-private-headers-devel >= %{version}
BuildRequires:  libQt5Gui-private-headers-devel >= %{version}
BuildRequires:  libQt5Test-private-headers-devel >= %{version}
BuildRequires:  libQt5Widgets-private-headers-devel >= %{version}
BuildRequires:  python-base
BuildRequires:  libQt5Core-devel >= %{version}
BuildRequires:  libQt5Gui-devel >= %{version}
BuildRequires:  libQt5Network-devel >= %{version}
BuildRequires:  libQt5Sql-devel >= %{version}
BuildRequires:  libQt5Widgets-devel >= %{version}
BuildRequires:  libQt5Xml-devel >= %{version}
BuildRequires:  libqt5-qtxmlpatterns-devel >= %{version}
%if %qt5_snapshot
#to create the forwarding headers
BuildRequires:  perl
%endif
BuildRequires:  xz
# NOTE recheck this once/if this package gets further splitted
%requires_ge libQt5Core5
%requires_ge libQt5Gui5
%requires_ge libQt5Network5
%requires_ge libQt5Sql5
%requires_ge libQt5Test5
%requires_ge libQt5Widgets5
%requires_ge libQt5XmlPatterns5
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Qt is a set of libraries for developing applications.

This package contains base tools, like string, xml, and network
handling.

%prep
%setup -q -n qtdeclarative-opensource-src-%{real_version}
%patch0 -p1
%patch1 -p1
%patch2 -p1

%package -n %libname
Summary:        Qt 5 Declarative Library
Group:          Development/Libraries/X11

%description -n %libname
Qt is a set of libraries for developing applications.

This package contains base tools, like string, xml, and network
handling.

%package devel
Summary:        Qt Development Kit
Group:          Development/Libraries/X11
Requires:       %libname = %{version}
Requires:       %{name}-tools = %{version}
Provides:       libQt5Quick-devel = %{version}
Obsoletes:      libQt5Quick-devel < %{version}

%description devel
You need this package, if you want to compile programs with qtdeclarative.

%package tools
Summary:        Qt 5 Declarative Tools
Group:          Development/Tools/Debuggers

%description tools
Qt is a set of libraries for developing applications.

This package contains aditional tools for inspecting, testing, viewing, etc, QML imports and files.

%package private-headers-devel
Summary:        Non-ABI stable experimental API
Group:          Development/Libraries/C and C++
#BuildArch:      noarch
Requires:       %{name}-devel = %{version}
Requires:       libQt5Core-private-headers-devel >= %{version}
Requires:       libQt5Gui-private-headers-devel >= %{version}
Requires:       libQt5Test-private-headers-devel >= %{version}
Requires:       libQt5Widgets-private-headers-devel >= %{version}
Provides:       libQt5Quick-private-headers-devel = %{version}
Obsoletes:      libQt5Quick-private-headers-devel < %{version}

%description private-headers-devel
This package provides private headers of libqt5-qtdeclarative that are normally
not used by application development and that do not have any ABI or
API guarantees. The packages that build against these have to require
the exact Qt version.

%package examples
Summary:        Qt5 quick/qml examples
Group:          Development/Libraries/X11
Recommends:     %{name}-devel
Recommends:     %{name}-tools

%description examples
Examples for libqt5-qtdeclarative (quick/qml) modules.

%post -n %libname -p /sbin/ldconfig

%postun -n %libname -p /sbin/ldconfig

%build
%if %qt5_snapshot
#force the configure script to generate the forwarding headers (it checks whether .git directory exists)
mkdir .git
%endif

mkdir -p %{_target_platform}
pushd %{_target_platform}
%qmake5 ..
popd

%make_jobs -C %{_target_platform}

%install
pushd %{_target_platform}
%qmake5_install
popd

find %{buildroot}/%{_libdir} -type f -name '*la' -print -exec perl -pi -e 's, -L%{_builddir}/\S+,,g' {} \;
find %{buildroot}/%{_libdir}/pkgconfig -type f -name '*pc' -print -exec perl -pi -e 's, -L%{_builddir}/\S+,,g' {} \;
# kill .la files
rm -f %{buildroot}%{_libqt5_libdir}/lib*.la

# put all the binaries to %%_bindir, add -qt5 suffix, and symlink them back to %%_qt5_bindir
mkdir -p %{buildroot}%{_bindir}
pushd %{buildroot}%{_libqt5_bindir}
for i in * ; do
  case "${i}" in
    qmlplugindump|qmlprofiler)
      mv $i ../../../bin/${i}-qt5
      ln -s ../../../bin/${i}-qt5 .
      ln -s ../../../bin/${i}-qt5 $i
      ;;
   *)
      mv $i ../../../bin/
      ln -s ../../../bin/$i .
      ;;
  esac
done
popd

%fdupes -s %{buildroot}%{_libqt5_includedir}
%fdupes -s %{buildroot}%{_libqt5_examplesdir}

%files -n %libname
%defattr(-,root,root,755)
%doc LGPL_EXCEPTION.txt LICENSE.*
%{_libqt5_libdir}/libQt5Q*.so.*
%{_libqt5_archdatadir}/qml/QtQuick
%{_libqt5_archdatadir}/qml/QtQuick.2
%{_libqt5_archdatadir}/qml/QtQml/Models.2
%{_libqt5_archdatadir}/qml/QtQml/StateMachine/
%dir %{_libqt5_archdatadir}/qml
%dir %{_libqt5_archdatadir}/qml/Qt
%dir %{_libqt5_archdatadir}/qml/Qt/labs
%dir %{_libqt5_archdatadir}/qml/QtQml
%{_libqt5_archdatadir}/qml/Qt/labs/folderlistmodel
%{_libqt5_archdatadir}/qml/Qt/labs/settings/
%{_libqt5_archdatadir}/qml/QtQml
%{_libqt5_archdatadir}/qml/builtins.qmltypes
%{_libqt5_plugindir}/qmltooling

%files private-headers-devel
%defattr(-,root,root,755)
%doc LGPL_EXCEPTION.txt LICENSE.*
%{_libqt5_includedir}/Qt*/%{so_version}

%files tools
%defattr(-,root,root,755)
%doc LGPL_EXCEPTION.txt LICENSE.*
%{_bindir}/*
%{_libqt5_bindir}/*

%files devel
%defattr(-,root,root,755)
%doc LGPL_EXCEPTION.txt LICENSE.*
%exclude %{_libqt5_includedir}/Qt*/%{so_version}
%{_libqt5_includedir}/Qt*
%{_libqt5_libdir}/cmake/Qt5*
%{_libqt5_libdir}/libQt5*.prl
%{_libqt5_libdir}/libQt5Q*.so
%{_libqt5_libdir}/libQt5Q*.a
%{_libqt5_libdir}/pkgconfig/Qt5Q*.pc
%{_libqt5_archdatadir}/mkspecs/modules/*.pri
%{_libqt5_archdatadir}/qml/QtTest

%files examples
%defattr(-,root,root,755)
%doc LGPL_EXCEPTION.txt LICENSE.*
%{_libqt5_examplesdir}/

%changelog
* Tue Jun 21 2016 lbeltrame@kde.org
- Add qtdeclarative-opensource-src-5.6.0-qml_no-lifetime-dse.patch
  * Fix crash with i586 and QML loaders (boo#985768)
* Thu Jun 16 2016 hrvoje.senjan@gmail.com
- Added qml_only_release_types_if_they_arent_referenced_anymore.patch
* Wed Jun  8 2016 hrvoje.senjan@gmail.com
- Update to 5.6.1
  * For more details please see:
    http://blog.qt.io/blog/2016/06/08/qt-5-6-1-released/
- Drop upstreamed
  Workaround-for-crashes-in-QtQml-code-relating-to-null-this-pointers.patch
* Thu May 26 2016 hrvoje.senjan@gmail.com
- Added Workaround-for-crashes-in-QtQml-code-relating-to-null-this-pointers.patch
  to prevent issues with GCC 6
* Fri Mar 18 2016 hrvoje.senjan@gmail.com
- Update to 5.6.0
- Drop support for non-SSE2 machines
- Drop sse2_nojit.patch
- Drop upstreamed patches:
  0001-scene-graph-fixed-memory-leak-in-qsgbatchrenderer-re.patch,
  Refactor-FxViewItem-releasing-code.patch and
  sanitize-visibleItems-list-after-model-insertions.patch
- Add overflow.patch to resolve
  "Statement might be overflowing a buffer" post-build-check error
  * For more details please see:
    http://blog.qt.io/blog/2016/03/16/qt-5-6-released/
    and https://wiki.qt.io/New_Features_in_Qt_5.6
* Sat Feb 13 2016 matz@suse.com
- Add 0001-scene-graph-fixed-memory-leak-in-qsgbatchrenderer-re.patch
  fixing a memory leak, QTBUG#48799.
* Mon Feb  1 2016 hrvoje.senjan@gmail.com
- Added sanitize-visibleItems-list-after-model-insertions.patch
  and Refactor-FxViewItem-releasing-code.patch to help in resolving
  kde#352055 and qtbug#48870
* Fri Oct 16 2015 hrvoje.senjan@gmail.com
- Update to 5.5.1 (boo#954149)
  * For more details please see:
    http://blog.qt.io/blog/2015/10/15/qt-5-5-1-released/
* Sun Aug 16 2015 hrvoje.senjan@gmail.com
- Update to 5.5.0
  * For more details please see:
    http://blog.qt.io/blog/2015/07/01/qt-5-5-released/
    and https://wiki.qt.io/New_Features_in_Qt_5.5
- Drop avoid-calling-potentially-pure-virtual-method.patch, merged
  upstream
* Wed Jun  3 2015 hrvoje.senjan@gmail.com
- Update to 5.4.2
  * Bugfix release, for more details please see:
    http://blog.qt.io/blog/2015/06/02/qt-5-4-2-released/
* Mon Apr 27 2015 hrvoje.senjan@gmail.com
- Add avoid-calling-potentially-pure-virtual-method.patch, QTBUG#45753
* Sat Apr 25 2015 hrvoje.senjan@gmail.com
- Extend sse2_nojit.patch to warn users without SSE2 extension that
  their processor is officially not supported.
  Also pass -msse2 -mfpmath=sse flags when we are building with SSE2
* Thu Apr  9 2015 hrvoje.senjan@gmail.com
- Adjust usage of latest %%qmake5_install macro
* Tue Feb 24 2015 hrvoje.senjan@gmail.com
- Update to 5.4.1
  * For more details please see:
    http://blog.qt.io/blog/2015/02/24/qt-5-4-1-released/
- Add minimal requires on other Qt5 libs
* Wed Dec 10 2014 hrvoje.senjan@gmail.com
- Update to 5.4 Final
  * For more details please see:
    http://blog.qt.digia.com/blog/2014/12/10/qt-5-4-released/
    and http://qt-project.org/wiki/New-Features-in-Qt-5.4
* Thu Nov 27 2014 hrvoje.senjan@gmail.com
- Update to 5.4 RC
  * For more details please see:
    http://blog.qt.digia.com/blog/2014/11/27/qt-5-4-release-candidate-available/
    and http://qt-project.org/wiki/New-Features-in-Qt-5.4
- Drop patches merged upstream:
  0005-Fix-crash-with-foreach-on-arguments-object.patch
  0004-QML-parse-.js-files-as-JavaScript-not-QML.patch
  0006-Move-syncTimer-measurment-to-the-correct-place.patch
  0003-Fix-crashes-when-calling-Array.sort-with-imperfect-s.patch
  0001-Fix-crash-with-cleanup-of-animators.patch
  0002-Support-padding-in-images-stored-in-atlas-texture.patch
* Mon Sep 22 2014 hrvoje.senjan@gmail.com
- Add sse2_nojit.patch: enable JIT and sse2 only on sse2 case
- Build QtQML module twice on ix86, without and with sse2 (sse2
  library is placed to %%_libdir/sse2/ (bnc#897758)
* Tue Sep 16 2014 hrvoje.senjan@gmail.com
- Update to 5.3.2 final
  * No changes since previous snapshot
  * Use official tars
- Added patches from upstream 5.3 branch:
  0001-Fix-crash-with-cleanup-of-animators.patch (QTBUG#37833),
  0002-Support-padding-in-images-stored-in-atlas-texture.patch,
  0003-Fix-crashes-when-calling-Array.sort-with-imperfect-s.patch
  (QTBUG#39072),
  0004-QML-parse-.js-files-as-JavaScript-not-QML.patch (QTBUG#40143),
  0005-Fix-crash-with-foreach-on-arguments-object.patch (QTBUG#40844)
  and 0006-Move-syncTimer-measurment-to-the-correct-place.patch
  (QTBUG#40556)
* Thu Sep  4 2014 hrvoje.senjan@gmail.com
- Update to 5.3.2~git20140904 (rd8bc98b):
  * Tip of the bugfix 5.3.2 branch
  * Contains many bugfixes over 5.3.1 release:
  * Doc: Added a link to the QML advanced tutorial
  * Don't use d->instanceModel after free'ing it
  * Fix crash with early QObject property access
  * Fix typo in DelegateModelGroup documentation
  * Protect some members in QQmlObjectCreator
  * Initialize variable
  * Don't abuse new to do a reinterpret_cast
  * Protect incubation against its creator being deleted.
  * Add 5.3.2 changelog for qtdeclarative
  * Fix crash with recursively loading cached compilation units
  * Fix typo in StateChangeScript documentation.
  * Added the QtSQL dependency info. to the project file
  * tst_dialogs: verify that rootObject is valid
  * tst_dialogs: QTRY_ on the expression
    (spyVisibilityChanged.count) not the variable.
  * The cached objects can be deleted, so keep them in a QPointer
  * Fix potential deadlook in threaded renderloop.
  * Added a signal handler
  * Fix typo in Context2D documentation.
  * Disable threaded FBO canvas drawing when not supported.
  * V4 JIT: fix JS stack frame size calculation.
  * Correct strokeRect documentation.
  * Silence harmless compiler warning.
  * benchmarks: Skip compilation of (and mark with FIXME) a few
    benchmarks that don't build.
  * benchmarks/particles: fix projects to actually build
  * Fix compilation of tst_compilation (:-P) benchmark.
  * Avoid double deletion when deleting an incubating component.
  * Invalidate the scenegraph properly in the rendercontrol
  * Fix crash when loading invalid QML with behavior on
    invalid group property
  * Fix crash when animators are deleted just after being started
  * Don't try to reload QQuick images when changing to
    null screen
  * Clarify Component.onCompleted/onDestruction docs
  * Fix fbo creation and resize logic in QQuickWidget
  * Fix Qt.include with cached compilation units and resources
  * Synchronize PathView gesture grabbing with other items.
  * Fix FBO recreated every time the QSG node is updated under
    some conditions
  * More QQuickCanvas cleanup handling.
  * Make canvas cleanup work propertly...
  * Use the current context to resolve extensions.
  * qmlplugindumper: do not pop up a window if
    an assert is triggered
  * Fix assertion: ASSERT: "hasException" in file
    jsruntime/qv4engine.cpp, line 933
  * Fix QQmlDelegateModel getting out of sync
  * QQuickWindow: add some links to resetOpenGLState
  * Remove metaobject revisioning for QQuickScreenAttached
  * Don't dereference null pointer.
  * Flickable: Cancel interaction on interactive changes
  * Don't try to draw shader effect sources with dims < 0.
  * QQuickMouseArea: Mark override functions with Q_DECL_OVERRIDE
  * Fix interaction of garbage collector with JS objects during
    QML type instantiation
  * Do not use mark() when marking ExecutionContexts
  * Don't recreate header and footer unnecessarily
  * Clear the visibleImgTags list when setting up the text layout
  * Improve programmatic flicking of ListView (and Flickable).
  * V4: work around a bug in libc++'s std::vector<bool>
  * QQmlComponent::create(): visual items must have
    a visual parent
  * Clean up the textures when deleting the content
  * Schedule layout changes to avoid refill() recursion.
  * Add autotest for incorrect steal of flick.
  * Do not crash AtlasTexture if image is null
  * Fix Node object leak in QQuickTextEditPrivate
  * shift and unshift fail for QQmlSequence types
  * Check for window != 0 in QuickTestResult::grabImage().
  * Doc: add documentation for the RSS News example
  * Fix typo in documentation
  * Binding Text width to implicitWidth can result in
    incorrect layout
  * Docs: fix "classname" indentation in the qmldir specs
  * Fix role for generic Accessible items
  * Calqlatr demo: Remove unused files
  * Remove usage of external dependencies from the RSS News demo
  * Fix crash on QQmlEngine destruction.
  * Don't dereference null QQuickWindowPrivate.
  * Add opt-out environment variable for @2x images
  * Doc: correct link/compilation errors in Qt Declarative
  * Fix crash in Flickable with pressDelay.
  * Skip rssnews demo if xmlpatterns is not present
  * Delete objects created by qmlplugindump
  * Avoid double deletion of QQuickWindow
  * Fix QQmlDelegateModel ignoring layoutChange in
    certain situations
  * Fix intermittent crash with older MinGW releases
  * Doc: Add documentation for the Maroon in Trouble example
  * Fix crash when deleting component in Component.onComplete
    through loader
  * Fix memory leak in QQmlComponent::createObject
  * Update QtQuick import value to 2.3
  * Set locked state while locking for grab.
  * QQmlObjectCreator: Clear sharedState componentAttached
    in destruction/clear
  * Initialize velocity
  * Improve RSS News Qt Quick Demo
  * Fix QQmlComponent detailed description.
  * Add a QQuickWidget - QQuickView comparison example
  * Fix crash in QObjectWrapper
- libqt5-fix-crash-with-early-QObject-property-access.patch,
  merged upstream
* Fri Aug 29 2014 mlin@suse.com
- Added upstream patch libqt5-fix-crash-with-early-QObject-property-access.patch
  * Fix crash with early QObject property access, QTBUG-40018
* Tue Aug  5 2014 hrvoje.senjan@gmail.com
- Create tools subpackage
* Wed Jun 25 2014 hrvoje.senjan@gmail.com
- Update to 5.3.1
  * Bugfix release, for more details please see:
    http://blog.qt.digia.com/blog/2014/06/25/qt-5-3-1-released/
- Added pkgconfig(Qt5Xml) BuildRequires
* Mon Jun  2 2014 hrvoje.senjan@gmail.com
- Added baselibs.conf
- Make private headers noarch
* Mon May 19 2014 hrvoje.senjan@gmail.com
- Update to 5.3.0 final
  * Minor bugfixes over previous RC
* Thu May  8 2014 hrvoje.senjan@gmail.com
- Update to 5.3.0 RC
  * For more details, please see
  http://blog.qt.digia.com/blog/2014/05/08/qt-5-3-release-candidate-available/
  and http://qt-project.org/wiki/New-Features-in-Qt-5.3
* Tue May  6 2014 hrvoje.senjan@gmail.com
- Explicitly BuildRequire python-base
* Tue Mar 25 2014 hrvoje.senjan@gmail.com
- Update to 5.3.0 beta
  * New feature release, please see
  http://blog.qt.digia.com/blog/2014/03/25/qt-5-3-beta-released/
  and http://qt-project.org/wiki/New-Features-in-Qt-5.3
- Added libQt5Widgets-private-headers-devel BuildRequires: they are
  now needed for building QQuickWidgets
- Droped aarch64-support.patch, merged upstream
* Fri Mar 21 2014 hrvoje.senjan@gmail.com
- Build, and add examples subpackage
* Mon Feb 10 2014 mlin@suse.com
- Add License files to %%doc
* Wed Feb  5 2014 hrvoje.senjan@gmail.com
- Update to 5.2.1:
  * For more details please see:
    http://blog.qt.digia.com/blog/2014/02/05/qt-5-2-1-released/
- Remove libtool archives from packages
- Added aarch64-support.patch from upstream (merged for 5.3)
* Mon Dec 16 2013 hrvoje.senjan@gmail.com
- Make devel packages naming consistent:
  use libqt5-$upstreammodulename-(devel, private-headers-devel)
* Thu Dec 12 2013 hrvoje.senjan@gmail.com
- Update to 5.2.0 final:
  * For more details please see:
    http://blog.qt.digia.com/blog/2013/12/12/qt-5-2-released-the-best-qt-yet/
    http://qt-project.org/qt5/qt52
    http://qt.digia.com/Product/Whats-New/Qt-52/
* Fri Nov 29 2013 hrvoje.senjan@gmail.com
- Update to 5.2 rc1
  * New feature release, please see
  http://blog.qt.digia.com/blog/2013/11/29/qt-5-2-release-candidate-1-available/
  and http://qt-project.org/wiki/New-Features-in-Qt-5.2
* Wed Oct 23 2013 hrvoje.senjan@gmail.com
- Update to 5.2 beta1
  * New feature release, please see
  http://blog.qt.digia.com/blog/2013/10/23/qt-5-2-beta-available/
  and http://qt-project.org/wiki/New-Features-in-Qt-5.2
* Thu Aug 29 2013 hrvoje.senjan@gmail.com
- Update to version 5.1.1:
  * Bugfix release, please see
  http://blog.qt.digia.com/blog/2013/08/28/qt-5-1-1-released/
  http://qt.gitorious.org/qt/qtdeclarative/blobs/release/dist/changes-5.1.1
  and http://qt-project.org/wiki/Qt511KnownIssues for known issues
- Small spec cleanup
* Sat Aug  3 2013 tittiatcoke@gmail.com
- Rename packages according to Factory standards
* Sun Jul  7 2013 stephan.binner@basyskom.com
- update to Qt 5.1 release
* Tue Jun 18 2013 stephan.binner@basyskom.com
- update to Qt 5.1 RC 1
* Mon May 20 2013 stephan.binner@basyskom.com
- update to Qt 5.1 Beta 1
* Tue Apr  9 2013 stephan.binner@basyskom.com
- update to Qt 5.1 Alpha 1
* Wed Jan 30 2013 stephan.binner@basyskom.com
- update to Qt 5.0.1
* Wed Dec 19 2012 stephan.binner@basyskom.com
- update to Qt 5.0 release
* Thu Dec 13 2012 stephan.binner@basyskom.com
- update to Qt 5.0 Release Candidate 2
* Thu Dec  6 2012 stephan.binner@basyskom.com
- update to Qt 5.0 Release Candidate 1
* Thu Nov 15 2012 stephan.binner@basyskom.com
- update to Qt 5.0 Beta 2
* Thu Aug 30 2012 stephan.binner@basyskom.com
- update to Qt 5.0 Beta 1 release
* Thu May 24 2012 stephan.binner@basyskom.com
- update to newer Alpha snapshot / Beta candidate
* Fri Apr 13 2012 stephan.binner@basyskom.com
- rework package splitting for Qt 5 modularization
* Thu Apr  5 2012 dmueller@suse.com
- Initial packaging (Qt 5.0 Alpha)