[packages/cmake] - extend lib64 patch with minor fix for zlib - add libx32 patch to support x32 arch and libx32 dirs
baggins
baggins at pld-linux.org
Thu Dec 25 00:07:40 CET 2014
commit 90b41c6c67667e881d80c473b0bcac9b286d9ef9
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Wed Dec 24 23:07:04 2014 +0000
- extend lib64 patch with minor fix for zlib
- add libx32 patch to support x32 arch and libx32 dirs
- added doc bcond to build without sphing-pdg
cmake-lib64.patch | 11 +++++
cmake-libx32.patch | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++++
cmake.spec | 15 +++++--
3 files changed, 140 insertions(+), 3 deletions(-)
---
diff --git a/cmake.spec b/cmake.spec
index 4f67080..61c68d0 100644
--- a/cmake.spec
+++ b/cmake.spec
@@ -8,6 +8,7 @@
%bcond_with bootstrap # use internal versions of some libraries
%bcond_without gui # don't build gui package
%bcond_without tests # do not perform "make test"
+%bcond_without doc # don't build documentation
Summary: Cross-platform, open-source make system
Summary(pl.UTF-8): Wieloplatformowy system make o otwartych źródłach
@@ -25,6 +26,7 @@ Patch3: %{name}-tests.patch
Patch4: %{name}-bug-0015258.patch
Patch5: %{name}-findruby2.patch
Patch6: %{name}-findpython.patch
+Patch7: %{name}-libx32.patch
URL: http://www.cmake.org/
%{?with_gui:BuildRequires: QtGui-devel}
BuildRequires: libarchive-devel
@@ -33,7 +35,7 @@ BuildRequires: ncurses-devel > 5.9-3
%{?with_gui:BuildRequires: qt4-build}
%{?with_gui:BuildRequires: qt4-qmake}
BuildRequires: rpmbuild(macros) >= 1.167
-BuildRequires: sphinx-pdg
+%{?with_doc:BuildRequires: sphinx-pdg}
%{!?with_bootstrap:BuildRequires: xmlrpc-c-devel >= 1.4.12-2}
Requires: filesystem >= 3.0-52
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -118,6 +120,9 @@ Bashowe dopełnianie parametrów dla cmake'a.
%patch4 -p1
%patch5 -p1
%patch6 -p1
+%if "%{_lib}" == "libx32"
+%patch7 -p1
+%endif
cat > "init.cmake" <<EOF
SET (CURSES_INCLUDE_PATH "/usr/include/ncurses" CACHE PATH " " FORCE)
@@ -142,8 +147,8 @@ export LDFLAGS="%{rpmldflags}"
%{!?with_bootstrap:--system-libs} \
%{?with_gui:--qt-gui} \
--qt-qmake=/usr/bin/qmake-qt4 \
- --sphinx-html \
- --sphinx-man \
+ %{?with_doc:--sphinx-html} \
+ %{?with_doc:--sphinx-man} \
--verbose
%{__make} VERBOSE=1
@@ -167,6 +172,7 @@ rm -rf $RPM_BUILD_ROOT
%attr(755,root,root) %{_bindir}/cmake
%attr(755,root,root) %{_bindir}/cpack
%attr(755,root,root) %{_bindir}/ctest
+%if %{with doc}
%{_mandir}/man1/ccmake.1*
%{_mandir}/man1/cmake.1*
%{_mandir}/man1/cpack.1*
@@ -185,6 +191,7 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man7/cmake-qt.7*
%{_mandir}/man7/cmake-toolchains.7*
%{_mandir}/man7/cmake-variables.7*
+%endif
# top cmake/Modules dirs belong to filesystem
%{_datadir}/cmake/Modules/.NoDartCoverage
%{_datadir}/cmake/Modules/*
@@ -193,9 +200,11 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/cmake/include
%{_aclocaldir}/cmake.m4
+%if %{with doc}
%files doc-html
%defattr(644,root,root,755)
%doc Utilities/Sphinx/html/*
+%endif
%if %{with gui}
%files gui
diff --git a/cmake-lib64.patch b/cmake-lib64.patch
index 808dd95..8a69ea1 100644
--- a/cmake-lib64.patch
+++ b/cmake-lib64.patch
@@ -9,3 +9,14 @@
install_files(${KDE3_LIBTOOL_DIR} FILES ${_laname})
endmacro()
+--- cmake-3.1.0/Modules/FindZLIB.cmake~ 2014-12-15 20:07:43.000000000 +0000
++++ cmake-3.1.0/Modules/FindZLIB.cmake 2014-12-24 21:00:27.139263296 +0000
+@@ -79,7 +79,7 @@
+ # Try each search configuration.
+ foreach(search ${_ZLIB_SEARCHES})
+ find_path(ZLIB_INCLUDE_DIR NAMES zlib.h ${${search}} PATH_SUFFIXES include)
+- find_library(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} ${${search}} PATH_SUFFIXES lib)
++ find_library(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} ${${search}} PATH_SUFFIXES lib64)
+ endforeach()
+
+ mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
diff --git a/cmake-libx32.patch b/cmake-libx32.patch
new file mode 100644
index 0000000..06ea4e4
--- /dev/null
+++ b/cmake-libx32.patch
@@ -0,0 +1,117 @@
+--- cmake-2.4.10/Modules/KDE3Macros.cmake.orig 2012-11-03 08:29:52.205394821 +0100
++++ cmake-2.4.10/Modules/KDE3Macros.cmake 2012-11-03 08:31:27.108749182 +0100
+@@ -336,7 +336,7 @@
+ file(APPEND ${_laname} "# Should we warn about portability when linking against -modules?\nshouldnotlink=yes\n")
+ file(APPEND ${_laname} "# Files to dlopen/dlpreopen\ndlopen=''\ndlpreopen=''\n")
+ file(APPEND ${_laname} "# Directory that this library needs to be installed in:\n")
+- file(APPEND ${_laname} "libdir='${CMAKE_INSTALL_PREFIX}/lib/kde3'\n")
++ file(APPEND ${_laname} "libdir='${CMAKE_INSTALL_PREFIX}/libx32/kde3'\n")
+
+ install_files(${KDE3_LIBTOOL_DIR} FILES ${_laname})
+ endmacro()
+--- cmake-3.1.0/Modules/FindZLIB.cmake~ 2014-12-15 20:07:43.000000000 +0000
++++ cmake-3.1.0/Modules/FindZLIB.cmake 2014-12-24 21:00:27.139263296 +0000
+@@ -79,7 +79,7 @@
+ # Try each search configuration.
+ foreach(search ${_ZLIB_SEARCHES})
+ find_path(ZLIB_INCLUDE_DIR NAMES zlib.h ${${search}} PATH_SUFFIXES include)
+- find_library(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} ${${search}} PATH_SUFFIXES lib)
++ find_library(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} ${${search}} PATH_SUFFIXES libx32)
+ endforeach()
+
+ mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
+--- cmake-3.1.0/Source/cmFindLibraryCommand.cxx~ 2014-12-15 20:07:43.000000000 +0000
++++ cmake-3.1.0/Source/cmFindLibraryCommand.cxx 2014-12-24 21:33:33.561835255 +0000
+@@ -65,6 +65,16 @@
+ }
+ }
+
++ if(this->Makefile->GetCMakeInstance()
++ ->GetPropertyAsBool("FIND_LIBRARY_USE_LIBX32_PATHS"))
++ {
++ // add special 64 bit paths if this is a 64 bit compile.
++ if(this->Makefile->PlatformIsx32Bit())
++ {
++ this->AddArchitecturePaths("x32");
++ }
++ }
++
+ std::string library = this->FindLibrary();
+ if(library != "")
+ {
+--- cmake-3.1.0/Source/cmFindPackageCommand.cxx.orig 2014-12-15 20:07:43.000000000 +0000
++++ cmake-3.1.0/Source/cmFindPackageCommand.cxx 2014-12-24 21:35:01.094694382 +0000
+@@ -90,6 +90,14 @@
+ this->UseLib64Paths = true;
+ }
+
++ // Lookup whether libx32 paths should be used.
++ if(this->Makefile->PlatformIsx32Bit() &&
++ this->Makefile->GetCMakeInstance()
++ ->GetPropertyAsBool("FIND_LIBRARY_USE_LIBX32_PATHS"))
++ {
++ this->UseLibx32Paths = true;
++ }
++
+ // Check if User Package Registry should be disabled
+ if(this->Makefile->IsOn("CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY"))
+ {
+--- cmake-3.1.0/Source/cmMakefile.cxx~ 2014-12-15 20:07:43.000000000 +0000
++++ cmake-3.1.0/Source/cmMakefile.cxx 2014-12-24 21:50:15.543073723 +0000
+@@ -2370,6 +2370,15 @@
+ return false;
+ }
+
++bool cmMakefile::PlatformIsx32Bit() const
++{
++#ifdef __ILP32__
++ return true;
++#else
++ return false;
++#endif
++}
++
+ const char* cmMakefile::GetSONameFlag(const std::string& language) const
+ {
+ std::string name = "CMAKE_SHARED_LIBRARY_SONAME";
+--- cmake-3.1.0/Source/cmMakefile.h~ 2014-12-15 20:07:43.000000000 +0000
++++ cmake-3.1.0/Source/cmMakefile.h 2014-12-24 21:51:51.335888102 +0000
+@@ -648,6 +648,8 @@
+
+ /** Return whether the target platform is 64-bit. */
+ bool PlatformIs64Bit() const;
++ /** Return whether the target platform is x32-bit. */
++ bool PlatformIsx32Bit() const;
+
+ /** Retrieve soname flag for the specified language if supported */
+ const char* GetSONameFlag(const std::string& language) const;
+--- cmake-3.1.0/Source/cmFindPackageCommand.h~ 2014-12-15 20:07:43.000000000 +0000
++++ cmake-3.1.0/Source/cmFindPackageCommand.h 2014-12-24 22:05:38.051409399 +0000
+@@ -124,6 +124,7 @@
+ bool NoBuilds;
+ bool DebugMode;
+ bool UseLib64Paths;
++ bool UseLibx32Paths;
+ bool PolicyScope;
+ std::string LibraryArchitecture;
+ std::vector<std::string> Names;
+--- cmake-3.1.0/Modules/Platform/UnixPaths.cmake~ 2014-12-15 20:07:43.000000000 +0000
++++ cmake-3.1.0/Modules/Platform/UnixPaths.cmake 2014-12-24 22:14:56.025053263 +0000
+@@ -95,3 +95,4 @@
+
+ # Enable use of lib64 search path variants by default.
+ set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)
++set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS TRUE)
+--- cmake-3.1.0/Modules/FindPkgConfig.cmake~ 2014-12-15 20:07:43.000000000 +0000
++++ cmake-3.1.0/Modules/FindPkgConfig.cmake 2014-12-24 22:17:04.721022724 +0000
+@@ -241,6 +241,10 @@
+ list(APPEND _lib_dirs "lib64/pkgconfig")
+ endif()
+ endif()
++ get_property(uselibx32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS)
++ if(uselibx32)
++ list(APPEND _lib_dirs "libx32/pkgconfig")
++ endif()
+ endif()
+ list(APPEND _lib_dirs "lib/pkgconfig")
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/cmake.git/commitdiff/90b41c6c67667e881d80c473b0bcac9b286d9ef9
More information about the pld-cvs-commit
mailing list