From aeaf863046f1987e955aa3246e3e1b53c21106cb597c8a9d1858f10b35b11d92 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Tue, 5 Nov 2019 10:58:37 +0000 Subject: [PATCH] Accepting request 745353 from home:simotek:branches:devel:tools:building - Update cmake conditionals to make sure the multibuild is nicely leveraged OBS-URL: https://build.opensuse.org/request/show/745353 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/cmake?expand=0&rev=380 --- cmake.changes | 6 +++ cmake.spec | 64 ++++++++++++++------------- feature-suse-cmake-gui-drop-qt4.patch | 13 ++++++ 3 files changed, 53 insertions(+), 30 deletions(-) create mode 100644 feature-suse-cmake-gui-drop-qt4.patch diff --git a/cmake.changes b/cmake.changes index afe5a0e..74dfd13 100644 --- a/cmake.changes +++ b/cmake.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Nov 1 08:02:01 UTC 2019 - Tomáš Chvátal + +- Update cmake conditionals to make sure the multibuild is + nicely leveraged + ------------------------------------------------------------------- Sun Oct 27 23:24:39 UTC 2019 - Simon Lees diff --git a/cmake.spec b/cmake.spec index dbad3fe..ebeea8f 100644 --- a/cmake.spec +++ b/cmake.spec @@ -16,21 +16,24 @@ # -%define flavor @BUILD_FLAVOR@%{nil} -%define shortversion 3.15 +%global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "gui" -Name: cmake-%{flavor} -Summary: CMake graphical user interface -License: BSD-3-Clause -Group: Development/Tools/Building +%define psuffix -gui +%bcond_without gui %else -Name: cmake -Summary: Cross-platform make system -License: BSD-3-Clause -Group: Development/Tools/Building +%define psuffix %{nil} +%bcond_with gui %endif +%define shortversion 3.15 +Name: cmake%{psuffix} Version: 3.15.4 Release: 0 +%if %{with gui} +Summary: CMake graphical user interface +%else +Summary: Cross-platform make system +%endif +License: BSD-3-Clause URL: https://www.cmake.org/ Source0: https://www.cmake.org/files/v%{shortversion}/cmake-%{version}.tar.gz Source1: cmake.macros @@ -45,24 +48,25 @@ Patch2: cmake-fix-ruby-test.patch Patch4: form.patch # Search for python interpreters from newest to oldest rather then picking up /usr/bin/python as first choice Patch7: feature-suse-python-interp-search-order.patch +Patch8: feature-suse-cmake-gui-drop-qt4.patch BuildRequires: fdupes BuildRequires: gcc-c++ -BuildRequires: pkgconfig(bzip2) -BuildRequires: pkgconfig(expat) -BuildRequires: pkgconfig(libarchive) >= 3.0.2 -BuildRequires: pkgconfig(libcurl) -BuildRequires: pkgconfig(libuv) >= 1.10 -BuildRequires: pkgconfig(ncurses) # this is commented as it would create dependancy cycle between jsoncpp and cmake #if 0 % { ? suse_version} > 1320 #BuildRequires: pkgconfig(jsoncpp) #endif BuildRequires: pkgconfig BuildRequires: rhash-devel +BuildRequires: pkgconfig(bzip2) +BuildRequires: pkgconfig(expat) +BuildRequires: pkgconfig(libarchive) >= 3.0.2 +BuildRequires: pkgconfig(libcurl) BuildRequires: pkgconfig(liblzma) +BuildRequires: pkgconfig(libuv) >= 1.10 +BuildRequires: pkgconfig(ncurses) BuildRequires: pkgconfig(zlib) Requires: make -%if "{%flavor}" == "gui" +%if %{with gui} BuildRequires: python-sphinx BuildRequires: update-desktop-files BuildRequires: pkgconfig(Qt5Widgets) @@ -72,17 +76,17 @@ Recommends: cmake-man # bnc#953842 - A python file is shipped so require python base so it can be run. Requires: python3-base %endif -%if "%{flavor}" == "gui" -%description -This is a Graphical User Interface for CMake, a cross-platform -build system. %package -n cmake-man Summary: Manual pages for cmake, a cross-platform make system -Group: Development/Tools/Building %description -n cmake-man Manual pages for cmake, a cross-platform make system. + +%if %{with gui} +%description +This is a Graphical User Interface for CMake, a cross-platform +build system. %else %description CMake is a cross-platform build system. @@ -110,20 +114,20 @@ export CXXFLAGS="%{optflags}" --no-system-zstd \ --parallel=0%{jobs} \ --verbose \ - %if "%{flavor}" == "gui" +%if %{with gui} --qt-gui \ --sphinx-man \ - %else +%else --no-qt-gui \ - %endif - -- +%endif + %{nil} make VERBOSE=1 %{?_smp_mflags} %install %make_install mkdir -p %{buildroot}%{_libdir}/cmake -%if "%{flavor}" == "gui" -%suse_update_desktop_file -r %{name} CMake Development IDE Tools Qt +%if %{with gui} +%suse_update_desktop_file -r cmake-gui CMake Development IDE Tools Qt # delete files that belong to the 'cmake' package rm -rf %{buildroot}%{_bindir}/{cpack,cmake,ctest,ccmake} @@ -166,8 +170,8 @@ rm %{buildroot}%{_docdir}/%{name}/Copyright.txt -E "(TestUpload|SimpleInstall|SimpleInstall-Stage2|CPackComponentsForAll-RPM-(default|OnePackPerGroup|IgnoreGroup|AllInOne)|CPack_RPM)" %endif -%if "%{flavor}" == "gui" -%files +%if %{with gui} +%files -n cmake-gui %license Copyright.txt %{_bindir}/cmake-gui %{_datadir}/applications/%{name}.desktop diff --git a/feature-suse-cmake-gui-drop-qt4.patch b/feature-suse-cmake-gui-drop-qt4.patch new file mode 100644 index 0000000..b2aa37c --- /dev/null +++ b/feature-suse-cmake-gui-drop-qt4.patch @@ -0,0 +1,13 @@ +Index: cmake-3.15.4/Source/QtDialog/CMakeLists.txt +=================================================================== +--- cmake-3.15.4.orig/Source/QtDialog/CMakeLists.txt ++++ cmake-3.15.4/Source/QtDialog/CMakeLists.txt +@@ -3,7 +3,7 @@ + + project(QtDialog) + CMake_OPTIONAL_COMPONENT(cmake-gui) +-find_package(Qt5Widgets QUIET) ++find_package(Qt5Widgets) + if (Qt5Widgets_FOUND) + include_directories(${Qt5Widgets_INCLUDE_DIRS}) + add_definitions(${Qt5Widgets_DEFINITONS})