RHEL 9.0.0 Alpha bootstrap

The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/cmake#946181a294641a505e80490f7f68736e923be8c6
This commit is contained in:
Petr Šabata 2020-10-14 22:59:03 +02:00
parent 1bdea19cb1
commit 2856b39d77
12 changed files with 2161 additions and 0 deletions

1
.gitignore vendored
View File

@ -0,0 +1 @@
/cmake-*.tar.gz

View File

@ -0,0 +1,69 @@
diff -ur cmake-3.18.2.orig/Modules/FindBLAS.cmake cmake-3.18.2/Modules/FindBLAS.cmake
--- cmake-3.18.2.orig/Modules/FindBLAS.cmake 2020-08-20 14:20:32.000000000 +0200
+++ cmake-3.18.2/Modules/FindBLAS.cmake 2020-09-14 19:36:13.952349073 +0200
@@ -27,6 +27,7 @@
possibilities. List of vendors valid in this module:
* ``Goto``
+ * ``FlexiBLAS``
* ``OpenBLAS``
* ``FLAME``
* ``ATLAS PhiPACK``
@@ -538,6 +539,22 @@
""
""
""
+ )
+ endif()
+endif()
+
+# FlexiBLAS? (http://www.mpi-magdeburg.mpg.de/mpcsc/software/FlexiBLAS/)
+if(BLA_VENDOR STREQUAL "FlexiBLAS" OR BLA_VENDOR STREQUAL "All")
+ if(NOT BLAS_LIBRARIES)
+ check_blas_libraries(
+ BLAS_LIBRARIES
+ BLAS
+ sgemm
+ ""
+ "flexiblas"
+ ""
+ ""
+ ""
)
endif()
endif()
diff -ur cmake-3.18.2.orig/Modules/FindLAPACK.cmake cmake-3.18.2/Modules/FindLAPACK.cmake
--- cmake-3.18.2.orig/Modules/FindLAPACK.cmake 2020-08-20 14:20:32.000000000 +0200
+++ cmake-3.18.2/Modules/FindLAPACK.cmake 2020-09-14 19:38:43.204639078 +0200
@@ -26,6 +26,7 @@
If set, checks only the specified vendor, if not set checks all the
possibilities. List of vendors valid in this module:
+ * ``FlexiBLAS``
* ``OpenBLAS``
* ``FLAME``
* ``Intel10_32`` (intel mkl v10 32 bit)
@@ -349,6 +350,23 @@
""
""
""
+ "${BLAS_LIBRARIES}"
+ )
+ endif()
+ endif()
+
+ # FlexiBLAS? (http://www.mpi-magdeburg.mpg.de/mpcsc/software/FlexiBLAS/)
+ if(BLA_VENDOR STREQUAL "FlexiBLAS" OR BLA_VENDOR STREQUAL "All")
+ if(NOT LAPACK_LIBRARIES)
+ check_lapack_libraries(
+ LAPACK_LIBRARIES
+ LAPACK
+ cheev
+ ""
+ "flexiblas"
+ ""
+ ""
+ ""
"${BLAS_LIBRARIES}"
)
endif()

View File

@ -0,0 +1,168 @@
Index: cmake-3.17.0-rc1/Modules/Compiler/Absoft-Fortran.cmake
===================================================================
--- cmake-3.17.0-rc1.orig/Modules/Compiler/Absoft-Fortran.cmake
+++ cmake-3.17.0-rc1/Modules/Compiler/Absoft-Fortran.cmake
@@ -1,7 +1,7 @@
string(APPEND CMAKE_Fortran_FLAGS_INIT " ")
string(APPEND CMAKE_Fortran_FLAGS_DEBUG_INIT " -g")
string(APPEND CMAKE_Fortran_FLAGS_MINSIZEREL_INIT " ")
-string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " -O3")
+string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " -O2")
string(APPEND CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT " -O2 -g")
set(CMAKE_Fortran_MODDIR_FLAG "-YMOD_OUT_DIR=")
set(CMAKE_Fortran_MODPATH_FLAG "-p")
Index: cmake-3.17.0-rc1/Modules/Compiler/G95-Fortran.cmake
===================================================================
--- cmake-3.17.0-rc1.orig/Modules/Compiler/G95-Fortran.cmake
+++ cmake-3.17.0-rc1/Modules/Compiler/G95-Fortran.cmake
@@ -1,7 +1,7 @@
string(APPEND CMAKE_Fortran_FLAGS_INIT " ")
string(APPEND CMAKE_Fortran_FLAGS_DEBUG_INIT " -g")
string(APPEND CMAKE_Fortran_FLAGS_MINSIZEREL_INIT " -Os")
-string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " -O3")
+string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " -O2")
string(APPEND CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT " -O2 -g")
set(CMAKE_Fortran_MODDIR_FLAG "-fmod=")
set(CMAKE_Fortran_VERBOSE_FLAG "-v")
Index: cmake-3.17.0-rc1/Modules/Compiler/GNU.cmake
===================================================================
--- cmake-3.17.0-rc1.orig/Modules/Compiler/GNU.cmake
+++ cmake-3.17.0-rc1/Modules/Compiler/GNU.cmake
@@ -55,7 +55,7 @@ macro(__compiler_gnu lang)
string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g")
string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Os -DNDEBUG")
- string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O3 -DNDEBUG")
+ string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O2 -DNDEBUG")
string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g -DNDEBUG")
set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
Index: cmake-3.17.0-rc1/Modules/Compiler/GNU-Fortran.cmake
===================================================================
--- cmake-3.17.0-rc1.orig/Modules/Compiler/GNU-Fortran.cmake
+++ cmake-3.17.0-rc1/Modules/Compiler/GNU-Fortran.cmake
@@ -14,7 +14,7 @@ set(CMAKE_Fortran_POSTPROCESS_FLAG "-fpr
# No -DNDEBUG for Fortran.
string(APPEND CMAKE_Fortran_FLAGS_MINSIZEREL_INIT " -Os")
-string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " -O3")
+string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " -O2")
# No -isystem for Fortran because it will not find .mod files.
unset(CMAKE_INCLUDE_SYSTEM_FLAG_Fortran)
Index: cmake-3.17.0-rc1/Modules/Compiler/Intel.cmake
===================================================================
--- cmake-3.17.0-rc1.orig/Modules/Compiler/Intel.cmake
+++ cmake-3.17.0-rc1/Modules/Compiler/Intel.cmake
@@ -22,7 +22,7 @@ else()
string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g")
string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Os")
- string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O3")
+ string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O2")
string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g")
set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}")
Index: cmake-3.17.0-rc1/Modules/Compiler/NVIDIA-CUDA.cmake
===================================================================
--- cmake-3.17.0-rc1.orig/Modules/Compiler/NVIDIA-CUDA.cmake
+++ cmake-3.17.0-rc1/Modules/Compiler/NVIDIA-CUDA.cmake
@@ -36,7 +36,7 @@ if(NOT "x${CMAKE_CUDA_SIMULATE_ID}" STRE
set(CMAKE_SHARED_LIBRARY_CUDA_FLAGS -fPIC)
string(APPEND CMAKE_CUDA_FLAGS_INIT " ")
string(APPEND CMAKE_CUDA_FLAGS_DEBUG_INIT " -g")
- string(APPEND CMAKE_CUDA_FLAGS_RELEASE_INIT " -O3 -DNDEBUG")
+ string(APPEND CMAKE_CUDA_FLAGS_RELEASE_INIT " -O2 -DNDEBUG")
string(APPEND CMAKE_CUDA_FLAGS_MINSIZEREL_INIT " -O1 -DNDEBUG")
string(APPEND CMAKE_CUDA_FLAGS_RELWITHDEBINFO_INIT " -O2 -g -DNDEBUG")
endif()
Index: cmake-3.17.0-rc1/Modules/Compiler/PathScale.cmake
===================================================================
--- cmake-3.17.0-rc1.orig/Modules/Compiler/PathScale.cmake
+++ cmake-3.17.0-rc1/Modules/Compiler/PathScale.cmake
@@ -16,6 +16,6 @@ macro(__compiler_pathscale lang)
string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g -O0")
string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Os")
- string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O3")
+ string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O2")
string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -g -O2")
endmacro()
Index: cmake-3.17.0-rc1/Modules/Compiler/PGI.cmake
===================================================================
--- cmake-3.17.0-rc1.orig/Modules/Compiler/PGI.cmake
+++ cmake-3.17.0-rc1/Modules/Compiler/PGI.cmake
@@ -18,7 +18,7 @@ macro(__compiler_pgi lang)
string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g -O0")
string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -O2 -s")
- string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -fast -O3")
+ string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -fast -O2")
string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -gopt")
if(CMAKE_HOST_WIN32)
Index: cmake-3.17.0-rc1/Modules/Compiler/SunPro-ASM.cmake
===================================================================
--- cmake-3.17.0-rc1.orig/Modules/Compiler/SunPro-ASM.cmake
+++ cmake-3.17.0-rc1/Modules/Compiler/SunPro-ASM.cmake
@@ -11,7 +11,7 @@ set(CMAKE_SHARED_LIBRARY_SONAME_ASM_FLAG
string(APPEND CMAKE_ASM_FLAGS_INIT " ")
string(APPEND CMAKE_ASM_FLAGS_DEBUG_INIT " -g")
string(APPEND CMAKE_ASM_FLAGS_MINSIZEREL_INIT " -xO2 -xspace -DNDEBUG")
-string(APPEND CMAKE_ASM_FLAGS_RELEASE_INIT " -xO3 -DNDEBUG")
+string(APPEND CMAKE_ASM_FLAGS_RELEASE_INIT " -xO2 -DNDEBUG")
string(APPEND CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT " -g -xO2 -DNDEBUG")
# Initialize ASM link type selection flags. These flags are used when
Index: cmake-3.17.0-rc1/Modules/Compiler/SunPro-C.cmake
===================================================================
--- cmake-3.17.0-rc1.orig/Modules/Compiler/SunPro-C.cmake
+++ cmake-3.17.0-rc1/Modules/Compiler/SunPro-C.cmake
@@ -19,7 +19,7 @@ set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "
string(APPEND CMAKE_C_FLAGS_INIT " ")
string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " -g")
string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -xO2 -xspace -DNDEBUG")
-string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -xO3 -DNDEBUG")
+string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -xO2 -DNDEBUG")
string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO_INIT " -g -xO2 -DNDEBUG")
set(CMAKE_DEPFILE_FLAGS_C "-xMD -xMF <DEPFILE>")
Index: cmake-3.17.0-rc1/Modules/Compiler/SunPro-CXX.cmake
===================================================================
--- cmake-3.17.0-rc1.orig/Modules/Compiler/SunPro-CXX.cmake
+++ cmake-3.17.0-rc1/Modules/Compiler/SunPro-CXX.cmake
@@ -19,7 +19,7 @@ set(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG
string(APPEND CMAKE_CXX_FLAGS_INIT " ")
string(APPEND CMAKE_CXX_FLAGS_DEBUG_INIT " -g")
string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -xO2 -xspace -DNDEBUG")
-string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -xO3 -DNDEBUG")
+string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -xO2 -DNDEBUG")
string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT " -g -xO2 -DNDEBUG")
set(CMAKE_DEPFILE_FLAGS_CXX "-xMD -xMF <DEPFILE>")
Index: cmake-3.17.0-rc1/Modules/Compiler/SunPro-Fortran.cmake
===================================================================
--- cmake-3.17.0-rc1.orig/Modules/Compiler/SunPro-Fortran.cmake
+++ cmake-3.17.0-rc1/Modules/Compiler/SunPro-Fortran.cmake
@@ -17,7 +17,7 @@ set(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLA
string(APPEND CMAKE_Fortran_FLAGS_INIT " ")
string(APPEND CMAKE_Fortran_FLAGS_DEBUG_INIT " -g")
string(APPEND CMAKE_Fortran_FLAGS_MINSIZEREL_INIT " -xO2 -xspace -DNDEBUG")
-string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " -xO3 -DNDEBUG")
+string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " -xO2 -DNDEBUG")
string(APPEND CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT " -g -xO2 -DNDEBUG")
set(CMAKE_Fortran_MODDIR_FLAG "-moddir=")
set(CMAKE_Fortran_MODPATH_FLAG "-M")
Index: cmake-3.17.0-rc1/Modules/Platform/Windows-Clang.cmake
===================================================================
--- cmake-3.17.0-rc1.orig/Modules/Platform/Windows-Clang.cmake
+++ cmake-3.17.0-rc1/Modules/Platform/Windows-Clang.cmake
@@ -79,7 +79,7 @@ macro(__windows_compiler_clang_gnu lang)
string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g -Xclang -gcodeview -O0 ${__ADDED_FLAGS_DEBUG}")
string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Os -DNDEBUG ${__ADDED_FLAGS}")
- string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O3 -DNDEBUG ${__ADDED_FLAGS}")
+ string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O2 -DNDEBUG ${__ADDED_FLAGS}")
string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g -DNDEBUG -Xclang -gcodeview ${__ADDED_FLAGS}")
endif()
set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ")

22
cmake-findruby.patch Normal file
View File

@ -0,0 +1,22 @@
Index: cmake-3.18.0-rc1/Modules/FindRuby.cmake
===================================================================
--- cmake-3.18.0-rc1.orig/Modules/FindRuby.cmake
+++ cmake-3.18.0-rc1/Modules/FindRuby.cmake
@@ -289,14 +289,9 @@ if(Ruby_EXECUTABLE AND NOT Ruby_VERSION_
_RUBY_CONFIG_VAR("sitearchdir" Ruby_SITEARCH_DIR)
_RUBY_CONFIG_VAR("sitelibdir" Ruby_SITELIB_DIR)
- # vendor_ruby available ?
- execute_process(COMMAND ${Ruby_EXECUTABLE} -r vendor-specific -e "print 'true'"
- OUTPUT_VARIABLE Ruby_HAS_VENDOR_RUBY ERROR_QUIET)
-
- if(Ruby_HAS_VENDOR_RUBY)
- _RUBY_CONFIG_VAR("vendorlibdir" Ruby_VENDORLIB_DIR)
- _RUBY_CONFIG_VAR("vendorarchdir" Ruby_VENDORARCH_DIR)
- endif()
+ # vendor_ruby
+ _RUBY_CONFIG_VAR("vendorlibdir" Ruby_VENDORLIB_DIR)
+ _RUBY_CONFIG_VAR("vendorarchdir" Ruby_VENDORARCH_DIR)
# save the results in the cache so we don't have to run ruby the next time again
set(Ruby_VERSION_MAJOR ${Ruby_VERSION_MAJOR} CACHE PATH "The Ruby major version" FORCE)

9
cmake-init.el Normal file
View File

@ -0,0 +1,9 @@
;;
;; Setup cmake-mode for autoloading
;;
(autoload 'cmake-mode "cmake-mode" "Major mode for editing CMake listfiles." t)
(setq auto-mode-alist
(append
'(("CMakeLists\\.txt\\'" . cmake-mode))
'(("\\.cmake\\'" . cmake-mode))
auto-mode-alist))

21
cmake-mingw-dl.patch Normal file
View File

@ -0,0 +1,21 @@
Index: cmake-3.17.0-rc1/Modules/Platform/Windows-GNU.cmake
===================================================================
--- cmake-3.17.0-rc1.orig/Modules/Platform/Windows-GNU.cmake
+++ cmake-3.17.0-rc1/Modules/Platform/Windows-GNU.cmake
@@ -25,12 +25,14 @@ endif()
if(MINGW)
set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
- set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".a" ".lib")
+ set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll" ".dll.a" ".a" ".lib")
set(CMAKE_C_STANDARD_LIBRARIES_INIT "-lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32")
set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
+ set(CMAKE_DL_LIBS "dl")
+else()
+ set(CMAKE_DL_LIBS "")
endif()
-set(CMAKE_DL_LIBS "")
set(CMAKE_LIBRARY_PATH_FLAG "-L")
set(CMAKE_LINK_LIBRARY_FLAG "-l")
set(CMAKE_LINK_DEF_FILE_FLAG "") # Empty string: passing the file is enough

3
cmake.attr Normal file
View File

@ -0,0 +1,3 @@
%__cmake_provides %{_rpmconfigdir}/cmake.prov
%__cmake_requires %{_rpmconfigdir}/cmake.req
%__cmake_path ^(%{_libdir}|%{_datadir})/cmake/.*/.*(Config\.cmake|-config\.cmake)$

82
cmake.prov Normal file
View File

@ -0,0 +1,82 @@
#!/usr/bin/python3
# -*- coding:utf-8 -*-
#
# Copyright (C) 2015 Daniel Vrátil <dvratil@redhat.com>
# Copyright (C) 2017 Daniel Vrátil <dvratil@fedoraproject.org>
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this program; if not, write to the
# Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
import sys
import re
import glob
class CMakeParser:
def __init__(self, filelist = None):
if filelist == None:
filelist = sys.stdin
paths = map(lambda x: x.rstrip(), filelist.readlines())
for path in paths:
modulePath, cmakeModule, lowercase = self.parseCmakeModuleConfig(path)
if modulePath and cmakeModule:
version = self.resolveCMakeModuleVersion(modulePath, cmakeModule, lowercase)
if version:
string = "cmake(" + cmakeModule + ") = " + version
else:
string = "cmake(" + cmakeModule + ")"
if string == string.lower():
print(string)
else:
# Temporarily print both variants to satisfy requires
# by the old version of this generator which made mistakes
print(string)
print(string.lower())
def parseCmakeModuleConfig(self, configFile):
paths = configFile.rsplit("/", 3)
modulePath = "%s/cmake/%s" % (paths[0], paths[2])
cfgFile = paths[3]
if cfgFile.endswith("Config.cmake"):
return (modulePath, cfgFile[0:-len("Config.cmake")], False)
elif cfgFile.endswith("-config.cmake"):
return (modulePath, cfgFile[0:-len("-config.cmake")], True)
else:
return (None, None, False)
def resolveCMakeModuleVersion(self, modulePath, cmakeModule, lowercase):
versionFile = ("%s/%s-config-version.cmake" if lowercase else "%s/%sConfigVersion.cmake") % (modulePath, cmakeModule)
try:
f = open(versionFile, 'r')
except:
return None
for line in f:
line = line.strip()
# set(PACKAGE_VERSION <version>)
version = re.match(r"^set[\ ]*\([\ ]*PACKAGE_VERSION[\ ]+[\"]*([0-9\.]+)[\"]*[\ ]*[.]*\)", line)
if version:
return version.groups(1)[0]
return None
if __name__ == "__main__":
parser = CMakeParser()

70
cmake.req Normal file
View File

@ -0,0 +1,70 @@
#!/usr/bin/python3
# -*- coding:utf-8 -*-
#
# Copyright (C) 2017 Björn Esser <besser82@fedoraproject.org>
#
# based on cmake.prov, which is
# Copyright (C) 2015 Daniel Vrátil <dvratil@redhat.com>
# Copyright (C) 2017 Daniel Vrátil <dvratil@fedoraproject.org>
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this program; if not, write to the
# Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
import sys
import re
import subprocess
class CMakeParser:
def __init__(self, filelist = None):
if filelist == None:
filelist = sys.stdin
has_module = False
is_arched = False
isa_suf = subprocess.check_output(["/usr/bin/rpm", "-E %{?_isa}"]).decode().strip()
paths = map(lambda x: x.rstrip(), filelist.readlines())
for path in paths:
modulePath, cmakeModule, lowercase = self.parseCmakeModuleConfig(path)
if modulePath and cmakeModule:
has_module = True
if re.match(".*/usr/lib(64)?/cmake/.*", modulePath):
is_arched = True
if has_module:
if is_arched:
print("cmake-filesystem%s" % isa_suf)
else:
print("cmake-filesystem")
def parseCmakeModuleConfig(self, configFile):
paths = configFile.rsplit("/", 3)
modulePath = "%s/cmake/%s" % (paths[0], paths[2])
cfgFile = paths[3]
if cfgFile.endswith("Config.cmake"):
return (modulePath, cfgFile[0:-len("Config.cmake")], False)
elif cfgFile.endswith("-config.cmake"):
return (modulePath, cfgFile[0:-len("-config.cmake")], True)
else:
return (None, None, False)
if __name__ == "__main__":
parser = CMakeParser()

1655
cmake.spec Normal file

File diff suppressed because it is too large Load Diff

60
macros.cmake Normal file
View File

@ -0,0 +1,60 @@
#
# Macros for cmake
#
%_cmake_lib_suffix64 -DLIB_SUFFIX=64
%_cmake_shared_libs -DBUILD_SHARED_LIBS:BOOL=ON
%_cmake_skip_rpath -DCMAKE_SKIP_RPATH:BOOL=ON
%_cmake_version @@CMAKE_VERSION@@
%__cmake /usr/bin/cmake
%__ctest /usr/bin/ctest
%__cmake_builddir %{!?__cmake_in_source_build:%{_vpath_builddir}}%{?__cmake_in_source_build:.}
# - Set default compile flags
# - CMAKE_*_FLAGS_RELEASE are added *after* the *FLAGS environment variables
# and default to -O3 -DNDEBUG. Strip the -O3 so we can override with *FLAGS
# - Turn on verbose makefiles so we can see and verify compile flags
# - Set default install prefixes and library install directories
# - Turn on shared libraries by default
%cmake \
%if 0%{?set_build_flags:1} \
%set_build_flags \
%else \
CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
FFLAGS="${FFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}}" ; export FFLAGS ; \
FCFLAGS="${FCFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}}" ; export FCFLAGS ; \
%{?__global_ldflags:LDFLAGS="${LDFLAGS:-%__global_ldflags}" ; export LDFLAGS ;} \
%endif \
%__cmake \\\
%{!?__cmake_in_source_build:-S "%{_vpath_srcdir}"} \\\
%{!?__cmake_in_source_build:-B "%{__cmake_builddir}"} \\\
-DCMAKE_C_FLAGS_RELEASE:STRING="-DNDEBUG" \\\
-DCMAKE_CXX_FLAGS_RELEASE:STRING="-DNDEBUG" \\\
-DCMAKE_Fortran_FLAGS_RELEASE:STRING="-DNDEBUG" \\\
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \\\
-DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \\\
-DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \\\
-DLIB_INSTALL_DIR:PATH=%{_libdir} \\\
-DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \\\
-DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \\\
%if "%{?_lib}" == "lib64" \
%{?_cmake_lib_suffix64} \\\
%endif \
%{?_cmake_shared_libs}
%cmake_build \
%__cmake --build "%{__cmake_builddir}" %{?_smp_mflags} --verbose
%cmake_install \
DESTDIR="%{buildroot}" %__cmake --install "%{__cmake_builddir}"
%ctest(:-:) \
cd "%{__cmake_builddir}" \
%__ctest --output-on-failure --force-new-ctest-process %{?_smp_mflags} %{**} \
cd -
%cmake@@CMAKE_MAJOR_VERSION@@ %cmake
%cmake@@CMAKE_MAJOR_VERSION@@_build %cmake_build
%cmake@@CMAKE_MAJOR_VERSION@@_install %cmake_install
%ctest@@CMAKE_MAJOR_VERSION@@(:-:) %ctest %{**}

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (cmake-3.18.4.tar.gz) = 2f0c5647ed58bf911d0bfeafc7f22a3de09aa3be86301158fa51c8560e994534d7500869067432ecf91e82213a0b36ddb5db11c5c55d2ca5e5647ac9f75717b9