diff options
Diffstat (limited to 'Utilities/Scripts')
-rw-r--r-- | Utilities/Scripts/BoostScanDeps.cmake | 41 | ||||
-rwxr-xr-x | Utilities/Scripts/clang-format.bash | 17 | ||||
-rwxr-xr-x | Utilities/Scripts/regenerate-lexers.bash | 53 | ||||
-rwxr-xr-x | Utilities/Scripts/regenerate-parsers.bash | 37 | ||||
-rwxr-xr-x | Utilities/Scripts/update-curl.bash | 12 | ||||
-rwxr-xr-x | Utilities/Scripts/update-expat.bash | 3 | ||||
-rwxr-xr-x | Utilities/Scripts/update-gitsetup.bash | 7 | ||||
-rwxr-xr-x | Utilities/Scripts/update-jsoncpp.bash | 33 | ||||
-rwxr-xr-x | Utilities/Scripts/update-libarchive.bash | 2 | ||||
-rwxr-xr-x | Utilities/Scripts/update-liblzma.bash | 8 | ||||
-rwxr-xr-x | Utilities/Scripts/update-libuv.bash | 2 | ||||
-rw-r--r-- | Utilities/Scripts/update-third-party.bash | 24 | ||||
-rwxr-xr-x | Utilities/Scripts/update-zstd.bash | 36 |
13 files changed, 251 insertions, 24 deletions
diff --git a/Utilities/Scripts/BoostScanDeps.cmake b/Utilities/Scripts/BoostScanDeps.cmake index 2fd8f8633..28a94ce89 100644 --- a/Utilities/Scripts/BoostScanDeps.cmake +++ b/Utilities/Scripts/BoostScanDeps.cmake @@ -39,29 +39,40 @@ function(_Boost_FIND_COMPONENT_DEPENDENCIES component includedir _ret_libs) # Start by finding all headers for the component; header # dependencies via #include will be solved by future passes + file(GLOB_RECURSE _boost_mpi_python_headers + RELATIVE "${includedir}" + "${includedir}/boost/mpi/python/*") + list(INSERT _boost_mpi_python_headers 0 "boost/mpi/python.hpp") + + file(GLOB_RECURSE _boost_python_numpy_headers + RELATIVE "${includedir}" + "${includedir}/boost/python/numpy/*") + list(INSERT _boost_python_numpy_headers 0 "boost/python/numpy.hpp") # Special-case since it is part of mpi; look only in boost/mpi/python* if(component STREQUAL "mpi_python") - set(_boost_DEPS "python") + set(_boost_DEPS "python\${component_python_version}") set(library_component TRUE) - file(GLOB_RECURSE _boost_unprocessed_headers - RELATIVE "${includedir}" - "${includedir}/boost/mpi/python/*") - list(INSERT _boost_unprocessed_headers 0 "${includedir}/boost/mpi/python.hpp") + set(_boost_unprocessed_headers ${_boost_mpi_python_headers}) + # Special-case since it is part of python; look only in boost/python/numpy* + elseif(component STREQUAL "numpy") + set(_boost_DEPS "python\${component_python_version}") + set(library_component TRUE) + set(_boost_unprocessed_headers ${_boost_python_numpy_headers}) # Special-case since it is a serialization variant; look in boost/serialization elseif(component STREQUAL "wserialization") set(library_component TRUE) file(GLOB_RECURSE _boost_unprocessed_headers RELATIVE "${includedir}" "${includedir}/boost/serialization/*") - list(INSERT _boost_unprocessed_headers 0 "${includedir}/boost/serialization.hpp") + list(INSERT _boost_unprocessed_headers 0 "boost/serialization.hpp") # Not really a library in its own right, but treat it as one elseif(component STREQUAL "math") set(library_component TRUE) file(GLOB_RECURSE _boost_unprocessed_headers RELATIVE "${includedir}" "${includedir}/boost/math/*") - list(INSERT _boost_unprocessed_headers 0 "${includedir}/boost/math.hpp") + list(INSERT _boost_unprocessed_headers 0 "boost/math.hpp") # Single test header elseif(component STREQUAL "unit_test_framework") set(library_component TRUE) @@ -79,7 +90,8 @@ function(_Boost_FIND_COMPONENT_DEPENDENCIES component includedir _ret_libs) file(GLOB_RECURSE _boost_unprocessed_headers RELATIVE "${includedir}" "${includedir}/boost/${component}/*") - list(INSERT _boost_unprocessed_headers 0 "${includedir}/boost/${component}.hpp") + list(INSERT _boost_unprocessed_headers 0 "boost/${component}.hpp") + list(REMOVE_ITEM _boost_unprocessed_headers ${_boost_mpi_python_headers} ${_boost_python_numpy_headers}) endif() while(_boost_unprocessed_headers) @@ -102,6 +114,8 @@ function(_Boost_FIND_COMPONENT_DEPENDENCIES component includedir _ret_libs) foreach(line ${_boost_header_deps}) string(REGEX REPLACE "^[ \t]*#[ \t]*define[ \t][ \t]*BOOST_LIB_NAME[ \t][ \t]*boost_([^ \t][^ \t]*).*" "\\1" _boost_component_match "${line}") + string(REPLACE "python3" "python" _boost_component_match "${_boost_component_match}") + string(REPLACE "numpy3" "numpy" _boost_component_match "${_boost_component_match}") list(FIND _boost_DEPS "${_boost_component_match}" _boost_dep_found) if(_boost_component_match STREQUAL "bzip2" OR _boost_component_match STREQUAL "zlib") @@ -119,6 +133,12 @@ function(_Boost_FIND_COMPONENT_DEPENDENCIES component includedir _ret_libs) # hard dependency (handle as special-case for mpi_python). continue() endif() + if(component STREQUAL "python" AND + boost_component_match STREQUAL "numpy") + # Optional python dependency; skip to avoid making it a + # hard dependency (handle as special-case for numpy). + continue() + endif() if (_boost_dep_found EQUAL -1 AND NOT "${_boost_component_match}" STREQUAL "${component}") list(APPEND _boost_DEPS "${_boost_component_match}") @@ -168,6 +188,11 @@ if(IS_DIRECTORY "${BOOST_DIR}/boost/mpi" AND IS_DIRECTORY "${BOOST_DIR}/boost/python") list(APPEND boost_components "mpi_python") endif() +# Special-case numpy, since it's a part of python +if(IS_DIRECTORY "${BOOST_DIR}/boost/python" AND + IS_DIRECTORY "${BOOST_DIR}/boost/python/numpy") + list(APPEND boost_components "numpy") +endif() # Special-case wserialization, which is a variant of serialization if(IS_DIRECTORY "${BOOST_DIR}/boost/serialization") list(APPEND boost_components "wserialization") diff --git a/Utilities/Scripts/clang-format.bash b/Utilities/Scripts/clang-format.bash index edcda77b9..7ca4433a8 100755 --- a/Utilities/Scripts/clang-format.bash +++ b/Utilities/Scripts/clang-format.bash @@ -78,8 +78,8 @@ test "$#" = 0 || die "$usage" # Find a default tool. tools=' + clang-format-6.0 clang-format - clang-format-3.8 ' if test "x$clang_format" = "x"; then for tool in $tools; do @@ -92,7 +92,12 @@ fi # Verify that we have a tool. if ! type -p "$clang_format" >/dev/null; then - echo "Unable to locate '$clang_format'" + echo "Unable to locate a 'clang-format' tool." + exit 1 +fi + +if ! "$clang_format" --version | grep 'clang-format version 6\.0' >/dev/null 2>/dev/null; then + echo "clang-format version 6.0 is required (exactly)" exit 1 fi @@ -110,8 +115,10 @@ esac $git_ls | # Select sources with our attribute. - git check-attr --stdin format.clang-format | - sed -n '/: format\.clang-format: set$/ {s/:[^:]*:[^:]*$//p}' | + git check-attr --stdin format.clang-format-6.0 | + grep -e ': format\.clang-format-6\.0: set$' | + sed -n 's/:[^:]*:[^:]*$//p' | # Update sources in-place. - xargs -d '\n' "$clang_format" -i + tr '\n' '\0' | + xargs -0 "$clang_format" -i diff --git a/Utilities/Scripts/regenerate-lexers.bash b/Utilities/Scripts/regenerate-lexers.bash new file mode 100755 index 000000000..1b61b705e --- /dev/null +++ b/Utilities/Scripts/regenerate-lexers.bash @@ -0,0 +1,53 @@ +#!/usr/bin/env bash + +set -e + +forced=1 +if [[ "${1}" = "make" ]]; then + forced=0 +fi + +pushd "${BASH_SOURCE%/*}/../../Source/LexerParser" > /dev/null + +for lexer in \ + CommandArgument \ + CTestResourceGroups \ + DependsJava \ + Expr \ + Fortran +do + cxx_file=cm${lexer}Lexer.cxx + h_file=cm${lexer}Lexer.h + in_file=cm${lexer}Lexer.in.l + + if [[ (${in_file} -nt ${cxx_file}) || (${in_file} -nt ${h_file}) || (${forced} -gt 0) ]]; then + echo "Generating Lexer ${lexer}" + flex --nounistd -DFLEXINT_H --noline --header-file=${h_file} -o${cxx_file} ${in_file} + sed -i 's/\s*$//' ${h_file} ${cxx_file} # remove trailing whitespaces + sed -i '${/^$/d;}' ${h_file} ${cxx_file} # remove blank line at the end + sed -i '1i#include "cmStandardLexer.h"' ${cxx_file} # add cmStandardLexer.h include + else + echo "Skipped generating Lexer ${lexer}" + fi +done + + +# these lexers (at the moment only the ListFileLexer) are compiled as C and do not generate a header +for lexer in ListFile +do + c_file=cm${lexer}Lexer.c + in_file=cm${lexer}Lexer.in.l + + if [[ (${in_file} -nt ${c_file}) || (${forced} -gt 0) ]]; then + echo "Generating Lexer ${lexer}" + flex --nounistd -DFLEXINT_H --noline -o${c_file} ${in_file} + sed -i 's/\s*$//' ${c_file} # remove trailing whitespaces + sed -i '${/^$/d;}' ${c_file} # remove blank line at the end + sed -i '1i#include "cmStandardLexer.h"' ${c_file} # add cmStandardLexer.h include + else + echo "Skipped generating Lexer ${lexer}" + fi + +done + +popd > /dev/null diff --git a/Utilities/Scripts/regenerate-parsers.bash b/Utilities/Scripts/regenerate-parsers.bash new file mode 100755 index 000000000..6fb35c028 --- /dev/null +++ b/Utilities/Scripts/regenerate-parsers.bash @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +set -e + +forced=1 +if [[ "${1}" = "make" ]]; then + forced=0 +fi + +pushd "${BASH_SOURCE%/*}/../../Source/LexerParser" > /dev/null + +for parser in \ + CommandArgument \ + DependsJava \ + Expr \ + Fortran +do + in_file=cm${parser}Parser.y + cxx_file=cm${parser}Parser.cxx + h_file=cm${parser}ParserTokens.h + prefix=cm${parser}_yy + + if [[ (${in_file} -nt ${cxx_file}) || (${in_file} -nt ${h_file}) || (${forced} -gt 0) ]]; then + echo "Generating Parser ${parser}" + bison --yacc --name-prefix=${prefix} --defines=${h_file} -o${cxx_file} ${in_file} + sed -i '/\/\* Else will try to reuse/ i\ +#if 0 +/^yyerrlab1:/ a\ +#endif +' ${cxx_file} + else + echo "Skipped generating Parser ${parser}" + fi +done + + +popd > /dev/null diff --git a/Utilities/Scripts/update-curl.bash b/Utilities/Scripts/update-curl.bash index 465841a02..5c2a331c0 100755 --- a/Utilities/Scripts/update-curl.bash +++ b/Utilities/Scripts/update-curl.bash @@ -8,14 +8,13 @@ readonly name="curl" readonly ownership="Curl Upstream <curl-library@cool.haxx.se>" readonly subtree="Utilities/cmcurl" readonly repo="https://github.com/curl/curl.git" -readonly tag="curl-7_54_1" +readonly tag="curl-7_65_0" readonly shortlog=false readonly paths=" CMake/* CMakeLists.txt COPYING include/curl/*.h - include/curl/curlbuild.h.cmake lib/*.c lib/*.h lib/CMakeLists.txt @@ -32,6 +31,15 @@ extract_source () { git_archive pushd "${extractdir}/${name}-reduced" rm lib/config-*.h + chmod a-x lib/connect.c + for f in \ + lib/cookie.c \ + lib/krb5.c \ + lib/security.c \ + ; do + iconv -f LATIN1 -t UTF8 $f -o $f.utf-8 + mv $f.utf-8 $f + done echo "* -whitespace" > .gitattributes popd } diff --git a/Utilities/Scripts/update-expat.bash b/Utilities/Scripts/update-expat.bash index 4ac5ef32c..95c5a0f6e 100755 --- a/Utilities/Scripts/update-expat.bash +++ b/Utilities/Scripts/update-expat.bash @@ -8,7 +8,7 @@ readonly name="expat" readonly ownership="Expat Upstream <kwrobot@kitware.com>" readonly subtree="Utilities/cmexpat" readonly repo="https://github.com/libexpat/libexpat.git" -readonly tag="R_2_2_3" +readonly tag="R_2_2_9" readonly shortlog=false readonly paths=" expat/lib/asciitab.h @@ -18,7 +18,6 @@ readonly paths=" expat/lib/xmlrole.h expat/lib/iasciitab.h expat/lib/latin1tab.h - expat/lib/loadlibrary.c expat/lib/xmlrole.c expat/lib/utf8tab.h expat/lib/nametab.h diff --git a/Utilities/Scripts/update-gitsetup.bash b/Utilities/Scripts/update-gitsetup.bash index 8f0da7682..70fb16511 100755 --- a/Utilities/Scripts/update-gitsetup.bash +++ b/Utilities/Scripts/update-gitsetup.bash @@ -11,6 +11,13 @@ readonly repo="https://gitlab.kitware.com/utils/gitsetup.git" readonly tag="setup" readonly shortlog=false readonly paths=" + .gitattributes + LICENSE + NOTICE + README + setup-hooks + setup-user + tips " extract_source () { diff --git a/Utilities/Scripts/update-jsoncpp.bash b/Utilities/Scripts/update-jsoncpp.bash new file mode 100755 index 000000000..f8fe54462 --- /dev/null +++ b/Utilities/Scripts/update-jsoncpp.bash @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +set -e +set -x +shopt -s dotglob + +readonly name="jsoncpp" +readonly ownership="JsonCpp Upstream <kwrobot@kitware.com>" +readonly subtree="Utilities/cmjsoncpp" +readonly repo="https://github.com/open-source-parsers/jsoncpp.git" +readonly tag="1.8.2" +readonly shortlog=false +readonly paths=" + LICENSE + include/json + src/lib_json +" +readonly remove=" + include/json/autolink.h + src/lib_json/CMakeLists.txt + src/lib_json/sconscript + src/lib_json/version.h.in +" + +extract_source () { + git_archive + pushd "${extractdir}/${name}-reduced" + rm $remove + echo "* -whitespace" > .gitattributes + popd +} + +. "${BASH_SOURCE%/*}/update-third-party.bash" diff --git a/Utilities/Scripts/update-libarchive.bash b/Utilities/Scripts/update-libarchive.bash index 41c6a66d6..31886584f 100755 --- a/Utilities/Scripts/update-libarchive.bash +++ b/Utilities/Scripts/update-libarchive.bash @@ -8,7 +8,7 @@ readonly name="LibArchive" readonly ownership="LibArchive Upstream <libarchive-discuss@googlegroups.com>" readonly subtree="Utilities/cmlibarchive" readonly repo="https://github.com/libarchive/libarchive.git" -readonly tag="v3.3.1" +readonly tag="v3.3.3" readonly shortlog=false readonly paths=" CMakeLists.txt diff --git a/Utilities/Scripts/update-liblzma.bash b/Utilities/Scripts/update-liblzma.bash index 088eb91e0..fdf66b3ec 100755 --- a/Utilities/Scripts/update-liblzma.bash +++ b/Utilities/Scripts/update-liblzma.bash @@ -7,8 +7,8 @@ shopt -s dotglob readonly name="liblzma" readonly ownership="liblzma upstream <xz-devel@tukaani.org>" readonly subtree="Utilities/cmliblzma" -readonly repo="http://git.tukaani.org/xz.git" -readonly tag="v5.0.8" +readonly repo="https://git.tukaani.org/xz.git" +readonly tag="v5.2.4" readonly shortlog=false readonly paths=" COPYING @@ -24,6 +24,10 @@ extract_source () { mv src/common . mv src/liblzma . rmdir src + rm liblzma/Makefile.* + rm liblzma/*/Makefile.* + rm liblzma/liblzma.map + rm liblzma/validate_map.sh popd } diff --git a/Utilities/Scripts/update-libuv.bash b/Utilities/Scripts/update-libuv.bash index d7a7d1f28..6d423a764 100755 --- a/Utilities/Scripts/update-libuv.bash +++ b/Utilities/Scripts/update-libuv.bash @@ -20,6 +20,8 @@ extract_source () { git_archive pushd "${extractdir}/${name}-reduced" echo "* -whitespace" > .gitattributes + echo >> src/unix/aix-common.c + echo >> src/unix/ibmi.c popd } diff --git a/Utilities/Scripts/update-third-party.bash b/Utilities/Scripts/update-third-party.bash index 670946ef4..fcab871bd 100644 --- a/Utilities/Scripts/update-third-party.bash +++ b/Utilities/Scripts/update-third-party.bash @@ -71,8 +71,6 @@ warn () { readonly regex_date='20[0-9][0-9]-[0-9][0-9]-[0-9][0-9]' readonly basehash_regex="$name $regex_date ([0-9a-f]*)" -readonly basehash="$( git rev-list --author="$ownership" --grep="$basehash_regex" -n 1 HEAD )" -readonly upstream_old_short="$( git cat-file commit "$basehash" | sed -n '/'"$basehash_regex"'/ {s/.*(//;s/)//;p}' | egrep '^[0-9a-f]+$' )" ######################################################################## # Sanity checking @@ -87,6 +85,18 @@ readonly upstream_old_short="$( git cat-file commit "$basehash" | sed -n '/'"$ba die "'repo' is empty" [ -n "$tag" ] || \ die "'tag' is empty" + +# Check for an empty destination directory on disk. By checking on disk and +# not in the repo it allows a library to be freshly re-inialized in a single +# commit rather than first deleting the old copy in one commit and adding the +# new copy in a seperate commit. +if [ ! -d "$(git rev-parse --show-toplevel)/$subtree" ]; then + readonly basehash="" +else + readonly basehash="$( git rev-list --author="$ownership" --grep="$basehash_regex" -n 1 HEAD )" +fi +readonly upstream_old_short="$( git cat-file commit "$basehash" | sed -n '/'"$basehash_regex"'/ {s/.*(//;s/)//;p}' | egrep '^[0-9a-f]+$' )" + [ -n "$basehash" ] || \ warn "'basehash' is empty; performing initial import" readonly do_shortlog="${shortlog-false}" @@ -104,6 +114,8 @@ trap "rm -rf '$workdir'" EXIT git clone "$repo" "$upstreamdir" if [ -n "$basehash" ]; then + # Remove old worktrees + git worktree prune # Use the existing package's history git worktree add "$extractdir" "$basehash" # Clear out the working tree @@ -163,13 +175,17 @@ popd if [ -n "$basehash" ]; then git merge --log -s recursive "-Xsubtree=$subtree/" --no-commit "upstream-$name" else + # Note: on Windows 'git merge --help' will open a browser, and the check + # will fail, so use the flag by default. unrelated_histories_flag="" - if git merge --help | grep -q -e allow-unrelated-histories; then + if git --version | grep -q windows; then + unrelated_histories_flag="--allow-unrelated-histories " + elif git merge --help | grep -q -e allow-unrelated-histories; then unrelated_histories_flag="--allow-unrelated-histories " fi readonly unrelated_histories_flag - git fetch "$extractdir" "upstream-$name:upstream-$name" + git fetch "$extractdir" "+upstream-$name:upstream-$name" git merge --log -s ours --no-commit $unrelated_histories_flag "upstream-$name" git read-tree -u --prefix="$subtree/" "upstream-$name" fi diff --git a/Utilities/Scripts/update-zstd.bash b/Utilities/Scripts/update-zstd.bash new file mode 100755 index 000000000..ce2c66b64 --- /dev/null +++ b/Utilities/Scripts/update-zstd.bash @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +set -e +set -x +shopt -s dotglob + +readonly name="zstd" +readonly ownership="zstd upstream <kwrobot@kitware.com>" +readonly subtree="Utilities/cmzstd" +readonly repo="https://github.com/facebook/zstd.git" +readonly tag="v1.3.8" +readonly shortlog=false +readonly paths=" + LICENSE + README.md + lib/common/*.c + lib/common/*.h + lib/compress/*.c + lib/compress/*.h + lib/decompress/*.c + lib/decompress/*.h + lib/deprecated/*.c + lib/deprecated/*.h + lib/dictBuilder/*.c + lib/dictBuilder/*.h + lib/zstd.h +" + +extract_source () { + git_archive + pushd "${extractdir}/${name}-reduced" + echo "* -whitespace" > .gitattributes + popd +} + +. "${BASH_SOURCE%/*}/update-third-party.bash" |