commit
4d4cdd48d0
@ -0,0 +1 @@
|
||||
0c0c76bd90092bbc36288ffd25d8e7f7ebc3c2e5 SOURCES/cmake-3.20.2.tar.gz
|
@ -0,0 +1 @@
|
||||
SOURCES/cmake-3.20.2.tar.gz
|
@ -0,0 +1,41 @@
|
||||
From f72734ff7712d6aae837f940a45d6e7508bb182c Mon Sep 17 00:00:00 2001
|
||||
From: Brad King <brad.king@kitware.com>
|
||||
Date: Thu, 20 Oct 2022 13:38:20 -0400
|
||||
Subject: [PATCH] Tests: Explicitly allow usage of git file-based protocol in
|
||||
test cases
|
||||
|
||||
Due to CVE-2022-39253, Git 2.30.6 sets `protocol.file.allow=user` by
|
||||
default. The change has also been backported to other Git versions by
|
||||
distros. This breaks some of our test cases that use the file-based
|
||||
protocol locally to simulate real workflows without requiring network
|
||||
access. In these cases the file protocol is safe, so explicitly enable
|
||||
it in the tests.
|
||||
|
||||
(cherry picked from commit 79ce0f434e916684d734e136b92e14f472a9d14a)
|
||||
---
|
||||
Tests/CMakeLists.txt | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
|
||||
index 8e7c04fbd0..d011020f99 100644
|
||||
--- a/Tests/CMakeLists.txt
|
||||
+++ b/Tests/CMakeLists.txt
|
||||
@@ -1540,6 +1540,7 @@ if(BUILD_TESTING)
|
||||
)
|
||||
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProject")
|
||||
set_tests_properties(ExternalProject PROPERTIES
|
||||
+ ENVIRONMENT GIT_ALLOW_PROTOCOL=file
|
||||
RUN_SERIAL 1
|
||||
TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT})
|
||||
|
||||
@@ -2653,6 +2654,7 @@ if(BUILD_TESTING)
|
||||
-P "${CMake_BINARY_DIR}/Tests/CTestUpdateGIT.cmake"
|
||||
)
|
||||
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateGIT_DIR}")
|
||||
+ set_property(TEST CTest.UpdateGIT PROPERTY ENVIRONMENT GIT_ALLOW_PROTOCOL=file)
|
||||
endif()
|
||||
|
||||
# Test CTest Update with HG
|
||||
--
|
||||
2.31.1
|
||||
|
@ -0,0 +1,11 @@
|
||||
diff -up cmake-3.20.0/Tests/RunCMake/CPack/tests/THREADED_ALL/test.cmake.CPACK_THREADS cmake-3.20.0/Tests/RunCMake/CPack/tests/THREADED_ALL/test.cmake
|
||||
--- cmake-3.20.0/Tests/RunCMake/CPack/tests/THREADED_ALL/test.cmake.CPACK_THREADS 2021-03-23 10:43:17.000000000 -0500
|
||||
+++ cmake-3.20.0/Tests/RunCMake/CPack/tests/THREADED_ALL/test.cmake 2021-03-23 13:29:14.539434722 -0500
|
||||
@@ -1,6 +1,6 @@
|
||||
install(FILES CMakeLists.txt DESTINATION foo COMPONENT test)
|
||||
|
||||
-set(CPACK_THREADS 0)
|
||||
+set(CPACK_THREADS 4)
|
||||
|
||||
if(PACKAGING_TYPE STREQUAL "COMPONENT")
|
||||
set(CPACK_COMPONENTS_ALL test)
|
@ -0,0 +1,20 @@
|
||||
diff -Naur cmake-3.18.2.orig/Modules/FindRuby.cmake cmake-3.18.2/Modules/FindRuby.cmake
|
||||
--- cmake-3.18.2.orig/Modules/FindRuby.cmake 2020-09-08 13:30:51.129086854 +0000
|
||||
+++ cmake-3.18.2/Modules/FindRuby.cmake 2020-09-10 07:10:56.679302608 +0000
|
||||
@@ -300,14 +300,8 @@
|
||||
_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()
|
||||
+ _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)
|
@ -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))
|
@ -0,0 +1,16 @@
|
||||
diff -Naur cmake-3.18.2.orig/Modules/Platform/Windows-GNU.cmake cmake-3.18.2/Modules/Platform/Windows-GNU.cmake
|
||||
--- cmake-3.18.2.orig/Modules/Platform/Windows-GNU.cmake 2020-09-08 13:30:51.186087690 +0000
|
||||
+++ cmake-3.18.2/Modules/Platform/Windows-GNU.cmake 2020-09-10 07:42:22.458698539 +0000
|
||||
@@ -28,9 +28,11 @@
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".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
|
@ -0,0 +1,3 @@
|
||||
%__cmake_provides %{_rpmconfigdir}/cmake.prov
|
||||
%__cmake_requires %{_rpmconfigdir}/cmake.req
|
||||
%__cmake_path ^(%{_libdir}|%{_datadir})/cmake/.*/.*(Config\.cmake|-config\.cmake)$
|
@ -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()
|
@ -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()
|
@ -0,0 +1,61 @@
|
||||
#
|
||||
# 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_in_source_build 1
|
||||
%__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 %{**}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue