diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-02-02 19:02:58 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-02-02 19:02:58 +0000 |
commit | b255fa570d8b041e4c81e3454d51e06100c2fa4f (patch) | |
tree | d3b246b467500ca48067ed4a45d2fa53966cd9f1 /cmake.deps | |
parent | eeccad2ff1ae8892fe9e06d733a7b07a166eecb0 (diff) | |
parent | 0bd07bea095a8000cffa4f379c1fa53e009c1143 (diff) | |
download | rneovim-20230125_mix.tar.gz rneovim-20230125_mix.tar.bz2 rneovim-20230125_mix.zip |
Merge branch 'aucmd_textputpost' into 20230125_mix20230125_mix
Diffstat (limited to 'cmake.deps')
-rw-r--r-- | cmake.deps/CMakeLists.txt | 8 | ||||
-rw-r--r-- | cmake.deps/cmake/BuildLibvterm.cmake | 31 | ||||
-rw-r--r-- | cmake.deps/cmake/BuildLuarocks.cmake | 2 | ||||
-rw-r--r-- | cmake.deps/cmake/Libvterm-tbl2inc_c.cmake | 163 | ||||
-rw-r--r-- | cmake.deps/cmake/LibvtermCMakeLists.txt | 58 |
5 files changed, 10 insertions, 252 deletions
diff --git a/cmake.deps/CMakeLists.txt b/cmake.deps/CMakeLists.txt index a7e71ffc92..90ae91463d 100644 --- a/cmake.deps/CMakeLists.txt +++ b/cmake.deps/CMakeLists.txt @@ -153,8 +153,8 @@ set(LUA_SHA256 2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333) set(LUAROCKS_URL https://github.com/luarocks/luarocks/archive/v3.8.0.tar.gz) set(LUAROCKS_SHA256 ab6612ca9ab87c6984871d2712d05525775e8b50172701a0a1cabddf76de2be7) -set(UNIBILIUM_URL https://github.com/neovim/unibilium/archive/92d929f.tar.gz) -set(UNIBILIUM_SHA256 29815283c654277ef77a3adcc8840db79ddbb20a0f0b0c8f648bd8cd49a02e4b) +set(UNIBILIUM_URL https://github.com/neovim/unibilium/archive/d72c3598e7ac5d1ebf86ee268b8b4ed95c0fa628.tar.gz) +set(UNIBILIUM_SHA256 9c4747c862ab5e3076dcf8fa8f0ea7a6b50f20ec5905618b9536655596797487) set(LIBTERMKEY_URL https://www.leonerd.org.uk/code/libtermkey/libtermkey-0.22.tar.gz) set(LIBTERMKEY_SHA256 6945bd3c4aaa83da83d80a045c5563da4edd7d0374c62c0d35aec09eb3014600) @@ -194,8 +194,8 @@ set(TREESITTER_LUA_SHA256 930d0370dc15b66389869355c8e14305b9ba7aafd36edbfdb468c8 set(TREESITTER_VIM_URL https://github.com/vigoux/tree-sitter-viml/archive/55ff1b080c09edeced9b748cf4c16d0b49d17fb9.tar.gz) set(TREESITTER_VIM_SHA256 1b1cd39e33c8fb02fa7fe3977e844883c2a8508a7edd621f2d21e39a9aeefa92) -set(TREESITTER_HELP_URL https://github.com/neovim/tree-sitter-vimdoc/archive/ce20f13c3f12506185754888feaae3f2ad54c287.tar.gz) -set(TREESITTER_HELP_SHA256 2b8b166438cce66064aab56a744430b1f44871f43e47f70b51246d14bb826609) +set(TREESITTER_HELP_URL https://github.com/neovim/tree-sitter-vimdoc/archive/v1.3.0.tar.gz) +set(TREESITTER_HELP_SHA256 f33f6d49c7d71feb2fd68ef2b2684da150f9f8e486ad9726213631d673942331) set(TREESITTER_URL https://github.com/tree-sitter/tree-sitter/archive/eb970a83a107cbaba52e31588355c0b09b3a308a.tar.gz) set(TREESITTER_SHA256 58063721182f182fb9ec5481794f2ba594e52d6c2497e0214570535054dfc78d) diff --git a/cmake.deps/cmake/BuildLibvterm.cmake b/cmake.deps/cmake/BuildLibvterm.cmake index 1578d56fba..b75987eb24 100644 --- a/cmake.deps/cmake/BuildLibvterm.cmake +++ b/cmake.deps/cmake/BuildLibvterm.cmake @@ -1,27 +1,3 @@ -if(WIN32) - set(LIBVTERM_CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy - ${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibvtermCMakeLists.txt - ${DEPS_BUILD_DIR}/src/libvterm/CMakeLists.txt - COMMAND ${CMAKE_COMMAND} -E copy - ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Libvterm-tbl2inc_c.cmake - ${DEPS_BUILD_DIR}/src/libvterm/tbl2inc_c.cmake - COMMAND ${CMAKE_COMMAND} ${DEPS_BUILD_DIR}/src/libvterm - -DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR} - -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} - -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM} - -DCMAKE_GENERATOR=${CMAKE_GENERATOR} - -DCMAKE_POSITION_INDEPENDENT_CODE=ON) - set(LIBVTERM_BUILD_COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>) - set(LIBVTERM_INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config $<CONFIG>) -else() - set(LIBVTERM_INSTALL_COMMAND ${MAKE_PRG} CC=${DEPS_C_COMPILER} - PREFIX=${DEPS_INSTALL_DIR} - CFLAGS=-fPIC - LDFLAGS+=-static - ${DEFAULT_MAKE_CFLAGS} - install) -endif() - if(USE_EXISTING_SRC_DIR) unset(LIBVTERM_URL) endif() @@ -30,10 +6,9 @@ ExternalProject_Add(libvterm URL_HASH SHA256=${LIBVTERM_SHA256} DOWNLOAD_NO_PROGRESS TRUE DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libvterm - BUILD_IN_SOURCE 1 - CONFIGURE_COMMAND "${LIBVTERM_CONFIGURE_COMMAND}" - BUILD_COMMAND "${LIBVTERM_BUILD_COMMAND}" - INSTALL_COMMAND "${LIBVTERM_INSTALL_COMMAND}" + PATCH_COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibvtermCMakeLists.txt + ${DEPS_BUILD_DIR}/src/libvterm/CMakeLists.txt CMAKE_ARGS ${DEPS_CMAKE_ARGS} CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS}) diff --git a/cmake.deps/cmake/BuildLuarocks.cmake b/cmake.deps/cmake/BuildLuarocks.cmake index d0b4a8e7d1..b84ce34d45 100644 --- a/cmake.deps/cmake/BuildLuarocks.cmake +++ b/cmake.deps/cmake/BuildLuarocks.cmake @@ -148,7 +148,7 @@ if(USE_BUNDLED_BUSTED) set(LUACHECK_EXE "${DEPS_BIN_DIR}/luacheck") endif() add_custom_command(OUTPUT ${BUSTED_EXE} - COMMAND ${LUAROCKS_BINARY} build busted 2.0.0 ${LUAROCKS_BUILDARGS} + COMMAND ${LUAROCKS_BINARY} build busted 2.1.1 ${LUAROCKS_BUILDARGS} DEPENDS penlight) add_custom_target(busted DEPENDS ${BUSTED_EXE}) diff --git a/cmake.deps/cmake/Libvterm-tbl2inc_c.cmake b/cmake.deps/cmake/Libvterm-tbl2inc_c.cmake deleted file mode 100644 index 32d973680f..0000000000 --- a/cmake.deps/cmake/Libvterm-tbl2inc_c.cmake +++ /dev/null @@ -1,163 +0,0 @@ -cmake_minimum_required(VERSION 3.10) - -set(HEX_ALPHABET "0123456789abcdef") - -function(ConvertToHex dec hex) - while(dec GREATER 0) - math(EXPR _val "${dec} % 16") - math(EXPR dec "${dec} / 16") - string(SUBSTRING ${HEX_ALPHABET} ${_val} 1 _val) - set(_res "${_val}${_res}") - endwhile() - # Pad the result with the number of zeros - # specified by the optional third argument - if(${ARGC} EQUAL 3) - set(padding ${ARGV2}) - string(LENGTH ${_res} _resLen) - if(_resLen LESS ${padding}) - math(EXPR _neededPadding "${padding} - ${_resLen}") - foreach(i RANGE 1 ${_neededPadding}) - set(_res "0${_res}") - endforeach() - endif() - endif() - set(${hex} "0x${_res}" PARENT_SCOPE) -endfunction() - -function(ConvertFromHex hex dec) - string(TOLOWER ${hex} hex) - string(LENGTH "${hex}" _strlen) - set(_res 0) - while(_strlen GREATER 0) - math(EXPR _res "${_res} * 16") - string(SUBSTRING "${hex}" 0 1 NIBBLE) - string(SUBSTRING "${hex}" 1 -1 hex) - string(FIND ${HEX_ALPHABET} ${NIBBLE} value) - if(value EQUAL -1) - message(FATAL_ERROR "Invalid hex character '${NIBBLE}'") - endif() - math(EXPR _res "${_res} + ${value}") - string(LENGTH "${hex}" _strlen) - endwhile() - set(${dec} ${_res} PARENT_SCOPE) -endfunction() - -# Based on http://www.json.org/JSON_checker/utf8_decode.c -function(DecodeUtf8 hexBytes codePoint) - string(SUBSTRING ${hexBytes} 0 2 hexByte1) - ConvertFromHex(${hexByte1} byte1) - # Zero continuations (0 to 127) - math(EXPR out "${byte1} & 128") - if(out EQUAL 0) - set(${codePoint} ${byte1} PARENT_SCOPE) - return() - endif() - # One continuation (128 to 2047) - math(EXPR out "${byte1} & 224") - if(out EQUAL 192) - string(SUBSTRING ${hexBytes} 2 2 hexByte2) - ConvertFromHex(${hexByte2} byte2) - math(EXPR result "((${byte1} & 31) << 6) | ${byte2}") - if(result GREATER 127) - set(${codePoint} ${result} PARENT_SCOPE) - return() - endif() - else() - # Two continuations (2048 to 55295 and 57344 to 65535) - math(EXPR result "${byte1} & 240") - if(result EQUAL 224) - string(SUBSTRING ${hexBytes} 2 2 hexByte2) - string(SUBSTRING ${hexBytes} 4 2 hexByte3) - ConvertFromHex(${hexByte2} byte2) - ConvertFromHex(${hexByte3} byte3) - math(EXPR result "${byte2} | ${byte3}") - if(result GREATER -1) - math(EXPR result "((${byte1} & 15) << 12) | (${byte2} << 6) | ${byte3}") - if((result GREATER 2047) AND (result LESS 55296 OR result GREATER 57343)) - set(${codePoint} ${result} PARENT_SCOPE) - return() - endif() - endif() - else() - # Three continuations (65536 to 1114111) - math(EXPR result "${byte1} & 248") - if(result EQUAL 224) - string(SUBSTRING ${hexBytes} 2 2 hexByte2) - string(SUBSTRING ${hexBytes} 4 2 hexByte3) - string(SUBSTRING ${hexBytes} 6 2 hexByte4) - ConvertFromHex(${hexByte2} byte2) - ConvertFromHex(${hexByte3} byte3) - ConvertFromHex(${hexByte4} byte4) - math(EXPR result "${byte2} | ${byte3} | ${byte4}") - if(result GREATER -1) - math(EXPR result "((c & 7) << 18) | (c1 << 12) | (c2 << 6) | c3") - if((result GREATER 65535) AND (result LESS 1114112)) - set(${codePoint} ${result} PARENT_SCOPE) - return() - endif() - endif() - endif() - endif() - endif() - message(FATAL_ERROR "Invalid UTF-8 encoding") -endfunction() - -set(inputFile ${CMAKE_ARGV3}) -set(outputFile ${CMAKE_ARGV4}) -# Get the file contents in text and hex-encoded format because -# CMake doesn't provide functions for converting between the two -file(READ "${inputFile}" contents) -file(READ "${inputFile}" hexContents HEX) - -# Convert the text contents into a list of lines by escaping -# the list separator ';' and then replacing new line characters -# with the list separator -string(REGEX REPLACE ";" "\\\\;" contents ${contents}) -string(REGEX REPLACE "\n" ";" contents ${contents}) - -get_filename_component(encname ${inputFile} NAME_WE) -set(output - "static const struct StaticTableEncoding encoding_${encname} = {\n" - " { .decode = &decode_table },\n" - " {") -set(hexIndex 0) -foreach(line ${contents}) - string(LENGTH ${line} lineLength) - # Convert "A" to 0x41 - string(FIND ${line} "\"" beginQuote) - if(NOT ${beginQuote} EQUAL -1) - string(FIND ${line} "\"" endQuote REVERSE) - if(${beginQuote} EQUAL ${endQuote}) - message(FATAL_ERROR "Line contains only one quote") - endif() - math(EXPR beginHexQuote "${hexIndex} + (${beginQuote} + 1)*2") - math(EXPR endHexQuote "${hexIndex} + (${endQuote} + 1)*2") - math(EXPR quoteLen "${endHexQuote} - ${beginHexQuote} - 1") - string(SUBSTRING ${hexContents} ${beginHexQuote} ${quoteLen} hexQuote) - DecodeUtf8(${hexQuote} codePoint) - ConvertToHex(${codePoint} hexCodePoint 4) - STRING(REGEX REPLACE "\"(.+)\"" ${hexCodePoint} line ${line}) - endif() - # Strip comment - string(REGEX REPLACE "[ \t\n]*#.*" "" line ${line}) - # Convert 3/1 to [0x31] - string(REGEX REPLACE "^([0-9]+)/([0-9]+).*" "\\1;\\2" numbers ${line}) - list(GET numbers 0 upperBits) - list(GET numbers 1 lowerBits) - math(EXPR res "${upperBits}*16 + ${lowerBits}") - ConvertToHex(${res} hex 2) - string(REGEX REPLACE "^([0-9]+)/([0-9]+)" "[${hex}]" line ${line}) - # Convert U+0041 to 0x0041 - string(REPLACE "U+" "0x" line ${line}) - # Indent and append a comma - set(line " ${line},") - set(output "${output}\n${line}") - # Increment the index by the number of characters in the line, - # plus one for the new line character then multiple by two for the hex digit index - math(EXPR hexIndex "${hexIndex} + 2*(${lineLength} + 1)") -endforeach() -set(output "${output}\n" - " }\n" - "}\;\n") - -file(WRITE ${outputFile} ${output}) diff --git a/cmake.deps/cmake/LibvtermCMakeLists.txt b/cmake.deps/cmake/LibvtermCMakeLists.txt index 079ad28ba0..777ce6c54c 100644 --- a/cmake.deps/cmake/LibvtermCMakeLists.txt +++ b/cmake.deps/cmake/LibvtermCMakeLists.txt @@ -2,43 +2,18 @@ cmake_minimum_required(VERSION 3.10) project(libvterm LANGUAGES C) include(GNUInstallDirs) -find_package(Perl) if(MSVC) - add_compile_options(/W3) add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE) else() - add_compile_options(-Wall -std=c99) + add_compile_options(-std=c99) endif() -# Generate includes from tables -file(GLOB TBL_FILES ${CMAKE_SOURCE_DIR}/src/encoding/*.tbl) -set(TBL_FILES_HEADERS) -foreach(file ${TBL_FILES}) - get_filename_component(basename ${file} NAME_WE) - set(tname encoding/${basename}.inc) - add_custom_command(OUTPUT - COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/encoding/ - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/tbl2inc_c.cmake ${file} ${CMAKE_BINARY_DIR}/${tname} - COMMENT "Generating ${tname}" - OUTPUT ${CMAKE_BINARY_DIR}/${tname} - ) - list(APPEND TBL_FILES_HEADERS ${tname}) - # Only used for verifying that the output of tbl2inc_c.cmake is correct - set(tname encoding-test/${basename}.inc) - add_custom_command(OUTPUT - COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/encoding-test/ - COMMAND ${PERL_EXECUTABLE} -CSD ${CMAKE_SOURCE_DIR}/tbl2inc_c.pl ${file} > ${CMAKE_BINARY_DIR}/${tname} - COMMENT "Generating ${tname}" - OUTPUT ${CMAKE_BINARY_DIR}/${tname} - ) -endforeach() - include_directories(${CMAKE_SOURCE_DIR}/include) include_directories(${CMAKE_BINARY_DIR}) file(GLOB VTERM_SOURCES ${CMAKE_SOURCE_DIR}/src/*.c) -add_library(vterm ${VTERM_SOURCES} ${TBL_FILES_HEADERS}) +add_library(vterm ${VTERM_SOURCES}) install(TARGETS vterm ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(FILES include/vterm.h include/vterm_keycodes.h @@ -54,33 +29,4 @@ if(NOT WIN32) endforeach() endif() -# Tests -add_executable(harness EXCLUDE_FROM_ALL t/harness.c) -target_link_libraries(harness vterm) -set_target_properties(harness PROPERTIES - # run-test.pl expects to find the harness in t/.libs/ - RUNTIME_OUTPUT_DIRECTORY t/.libs) - -if(Perl_FOUND) - file(GLOB TESTFILES ${CMAKE_SOURCE_DIR}/t/*.test) - add_custom_target(check) - foreach(testfile ${TESTFILES}) - get_filename_component(target_name ${testfile} NAME_WE) - add_custom_target(${target_name} - COMMAND ${PERL_EXECUTABLE} ${CMAKE_SOURCE_DIR}/t/run-test.pl ${testfile} - COMMENT "**${target_name} **" - DEPENDS harness) - add_dependencies(check ${target_name}) - endforeach() - - foreach(header_path ${TBL_FILES_HEADERS}) - get_filename_component(header_name ${header_path} NAME) - set(perl_header_path ${CMAKE_BINARY_DIR}/encoding-test/${header_name}) - add_custom_target(test-${header_name} - COMMAND ${CMAKE_COMMAND} -E compare_files - ${header_path} ${perl_header_path} - DEPENDS ${header_path} ${perl_header_path}) - endforeach() -endif() - # vim: set ft=cmake: |