dlang-sqlite inital
This commit is contained in:
commit
ce0a6c08e4
160 files changed
+362540
No files matched your search
BIN
Binary file not shown.
+166
@@ -0,0 +1,166 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file LICENSE.rst or https://cmake.org/licensing for details.
|
||||
|
||||
cmake_minimum_required(VERSION ${CMAKE_VERSION}) # this file comes with cmake
|
||||
|
||||
function(check_file_hash has_hash hash_is_good)
|
||||
if("${has_hash}" STREQUAL "")
|
||||
message(FATAL_ERROR "has_hash Can't be empty")
|
||||
endif()
|
||||
|
||||
if("${hash_is_good}" STREQUAL "")
|
||||
message(FATAL_ERROR "hash_is_good Can't be empty")
|
||||
endif()
|
||||
|
||||
if("SHA3_256" STREQUAL "")
|
||||
# No check
|
||||
set("${has_hash}" FALSE PARENT_SCOPE)
|
||||
set("${hash_is_good}" FALSE PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set("${has_hash}" TRUE PARENT_SCOPE)
|
||||
|
||||
message(VERBOSE "verifying file...
|
||||
file='C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-subbuild/sqlite3_ext-populate-prefix/src/sqlite-amalgamation-3490100.zip'")
|
||||
|
||||
file("SHA3_256" "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-subbuild/sqlite3_ext-populate-prefix/src/sqlite-amalgamation-3490100.zip" actual_value)
|
||||
|
||||
if(NOT "${actual_value}" STREQUAL "e7eb4cfb2d95626e782cfa748f534c74482f2c3c93f13ee828b9187ce05b2da7")
|
||||
set("${hash_is_good}" FALSE PARENT_SCOPE)
|
||||
message(VERBOSE "SHA3_256 hash of
|
||||
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-subbuild/sqlite3_ext-populate-prefix/src/sqlite-amalgamation-3490100.zip
|
||||
does not match expected value
|
||||
expected: 'e7eb4cfb2d95626e782cfa748f534c74482f2c3c93f13ee828b9187ce05b2da7'
|
||||
actual: '${actual_value}'")
|
||||
else()
|
||||
set("${hash_is_good}" TRUE PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(sleep_before_download attempt)
|
||||
if(attempt EQUAL 0)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(attempt EQUAL 1)
|
||||
message(VERBOSE "Retrying...")
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(sleep_seconds 0)
|
||||
|
||||
if(attempt EQUAL 2)
|
||||
set(sleep_seconds 5)
|
||||
elseif(attempt EQUAL 3)
|
||||
set(sleep_seconds 5)
|
||||
elseif(attempt EQUAL 4)
|
||||
set(sleep_seconds 15)
|
||||
elseif(attempt EQUAL 5)
|
||||
set(sleep_seconds 60)
|
||||
elseif(attempt EQUAL 6)
|
||||
set(sleep_seconds 90)
|
||||
elseif(attempt EQUAL 7)
|
||||
set(sleep_seconds 300)
|
||||
else()
|
||||
set(sleep_seconds 1200)
|
||||
endif()
|
||||
|
||||
message(VERBOSE "Retry after ${sleep_seconds} seconds (attempt #${attempt}) ...")
|
||||
|
||||
execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep "${sleep_seconds}")
|
||||
endfunction()
|
||||
|
||||
if(EXISTS "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-subbuild/sqlite3_ext-populate-prefix/src/sqlite-amalgamation-3490100.zip")
|
||||
check_file_hash(has_hash hash_is_good)
|
||||
if(has_hash)
|
||||
if(hash_is_good)
|
||||
message(VERBOSE "File already exists and hash match (skip download):
|
||||
file='C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-subbuild/sqlite3_ext-populate-prefix/src/sqlite-amalgamation-3490100.zip'
|
||||
SHA3_256='e7eb4cfb2d95626e782cfa748f534c74482f2c3c93f13ee828b9187ce05b2da7'"
|
||||
)
|
||||
return()
|
||||
else()
|
||||
message(VERBOSE "File already exists but hash mismatch. Removing...")
|
||||
file(REMOVE "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-subbuild/sqlite3_ext-populate-prefix/src/sqlite-amalgamation-3490100.zip")
|
||||
endif()
|
||||
else()
|
||||
message(VERBOSE "File already exists but no hash specified (use URL_HASH):
|
||||
file='C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-subbuild/sqlite3_ext-populate-prefix/src/sqlite-amalgamation-3490100.zip'
|
||||
Old file will be removed and new file downloaded from URL."
|
||||
)
|
||||
file(REMOVE "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-subbuild/sqlite3_ext-populate-prefix/src/sqlite-amalgamation-3490100.zip")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(retry_number 5)
|
||||
|
||||
message(VERBOSE "Downloading...
|
||||
dst='C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-subbuild/sqlite3_ext-populate-prefix/src/sqlite-amalgamation-3490100.zip'
|
||||
timeout='none'
|
||||
inactivity timeout='none'"
|
||||
)
|
||||
set(download_retry_codes 7 6 8 15 28 35)
|
||||
set(skip_url_list)
|
||||
set(status_code)
|
||||
foreach(i RANGE ${retry_number})
|
||||
if(status_code IN_LIST download_retry_codes)
|
||||
sleep_before_download(${i})
|
||||
endif()
|
||||
foreach(url IN ITEMS [====[https://sqlite.org/2025/sqlite-amalgamation-3490100.zip]====])
|
||||
if(NOT url IN_LIST skip_url_list)
|
||||
message(VERBOSE "Using src='${url}'")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
file(
|
||||
DOWNLOAD
|
||||
"${url}" "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-subbuild/sqlite3_ext-populate-prefix/src/sqlite-amalgamation-3490100.zip"
|
||||
SHOW_PROGRESS
|
||||
# no TIMEOUT
|
||||
# no INACTIVITY_TIMEOUT
|
||||
STATUS status
|
||||
LOG log
|
||||
|
||||
|
||||
)
|
||||
|
||||
list(GET status 0 status_code)
|
||||
list(GET status 1 status_string)
|
||||
|
||||
if(status_code EQUAL 0)
|
||||
check_file_hash(has_hash hash_is_good)
|
||||
if(has_hash AND NOT hash_is_good)
|
||||
message(VERBOSE "Hash mismatch, removing...")
|
||||
file(REMOVE "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-subbuild/sqlite3_ext-populate-prefix/src/sqlite-amalgamation-3490100.zip")
|
||||
else()
|
||||
message(VERBOSE "Downloading... done")
|
||||
return()
|
||||
endif()
|
||||
else()
|
||||
string(APPEND logFailedURLs "error: downloading '${url}' failed
|
||||
status_code: ${status_code}
|
||||
status_string: ${status_string}
|
||||
log:
|
||||
--- LOG BEGIN ---
|
||||
${log}
|
||||
--- LOG END ---
|
||||
"
|
||||
)
|
||||
if(NOT status_code IN_LIST download_retry_codes)
|
||||
list(APPEND skip_url_list "${url}")
|
||||
break()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
message(FATAL_ERROR "Each download failed!
|
||||
${logFailedURLs}
|
||||
"
|
||||
)
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file LICENSE.rst or https://cmake.org/licensing for details.
|
||||
|
||||
cmake_minimum_required(VERSION ${CMAKE_VERSION}) # this file comes with cmake
|
||||
|
||||
# Make file names absolute:
|
||||
#
|
||||
get_filename_component(filename "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-subbuild/sqlite3_ext-populate-prefix/src/sqlite-amalgamation-3490100.zip" ABSOLUTE)
|
||||
get_filename_component(directory "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-src" ABSOLUTE)
|
||||
|
||||
message(VERBOSE "extracting...
|
||||
src='${filename}'
|
||||
dst='${directory}'"
|
||||
)
|
||||
|
||||
if(NOT EXISTS "${filename}")
|
||||
message(FATAL_ERROR "File to extract does not exist: '${filename}'")
|
||||
endif()
|
||||
|
||||
# Prepare a space for extracting:
|
||||
#
|
||||
set(i 1234)
|
||||
while(EXISTS "${directory}/../ex-sqlite3_ext-populate${i}")
|
||||
math(EXPR i "${i} + 1")
|
||||
endwhile()
|
||||
set(ut_dir "${directory}/../ex-sqlite3_ext-populate${i}")
|
||||
file(MAKE_DIRECTORY "${ut_dir}")
|
||||
|
||||
# Extract it:
|
||||
#
|
||||
message(VERBOSE "extracting... [tar xf]")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf ${filename} --touch
|
||||
WORKING_DIRECTORY ${ut_dir}
|
||||
RESULT_VARIABLE rv
|
||||
)
|
||||
|
||||
if(NOT rv EQUAL 0)
|
||||
message(VERBOSE "extracting... [error clean up]")
|
||||
file(REMOVE_RECURSE "${ut_dir}")
|
||||
message(FATAL_ERROR "Extract of '${filename}' failed")
|
||||
endif()
|
||||
|
||||
# Analyze what came out of the tar file:
|
||||
#
|
||||
message(VERBOSE "extracting... [analysis]")
|
||||
file(GLOB contents "${ut_dir}/*")
|
||||
list(REMOVE_ITEM contents "${ut_dir}/.DS_Store")
|
||||
list(LENGTH contents n)
|
||||
if(NOT n EQUAL 1 OR NOT IS_DIRECTORY "${contents}")
|
||||
set(contents "${ut_dir}")
|
||||
endif()
|
||||
|
||||
# Move "the one" directory to the final directory:
|
||||
#
|
||||
message(VERBOSE "extracting... [rename]")
|
||||
file(REMOVE_RECURSE ${directory})
|
||||
get_filename_component(contents ${contents} ABSOLUTE)
|
||||
file(RENAME ${contents} ${directory})
|
||||
|
||||
# Clean up:
|
||||
#
|
||||
message(VERBOSE "extracting... [clean up]")
|
||||
file(REMOVE_RECURSE "${ut_dir}")
|
||||
|
||||
message(VERBOSE "extracting... done")
|
||||
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
+6
@@ -0,0 +1,6 @@
|
||||
# This is a generated file and its contents are an internal implementation detail.
|
||||
# The update step will be re-executed if anything in this file changes.
|
||||
# No other meaning or use of this file is supported.
|
||||
|
||||
command=
|
||||
work_dir=
|
||||
Whitespace-only changes.
Whitespace-only changes.
+7
@@ -0,0 +1,7 @@
|
||||
# This is a generated file and its contents are an internal implementation detail.
|
||||
# The patch step will be re-executed if anything in this file changes.
|
||||
# No other meaning or use of this file is supported.
|
||||
|
||||
command (connected)=
|
||||
command (disconnected)=
|
||||
work_dir=
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
# This is a generated file and its contents are an internal implementation detail.
|
||||
# The download step will be re-executed if anything in this file changes.
|
||||
# No other meaning or use of this file is supported.
|
||||
|
||||
method=url
|
||||
command=C:/Program Files/Microsoft Visual Studio/18/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe;-DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE;-P;C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-subbuild/sqlite3_ext-populate-prefix/src/sqlite3_ext-populate-stamp/download-sqlite3_ext-populate.cmake;COMMAND;C:/Program Files/Microsoft Visual Studio/18/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe;-DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE;-P;C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-subbuild/sqlite3_ext-populate-prefix/src/sqlite3_ext-populate-stamp/verify-sqlite3_ext-populate.cmake;COMMAND;C:/Program Files/Microsoft Visual Studio/18/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe;-DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE;-P;C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-subbuild/sqlite3_ext-populate-prefix/src/sqlite3_ext-populate-stamp/extract-sqlite3_ext-populate.cmake
|
||||
source_dir=C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-src
|
||||
work_dir=C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps
|
||||
url(s)=https://sqlite.org/2025/sqlite-amalgamation-3490100.zip
|
||||
hash=SHA3_256=e7eb4cfb2d95626e782cfa748f534c74482f2c3c93f13ee828b9187ce05b2da7
|
||||
no_extract=
|
||||
|
||||
Whitespace-only changes.
+1
@@ -0,0 +1 @@
|
||||
cmd=''
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file LICENSE.rst or https://cmake.org/licensing for details.
|
||||
|
||||
cmake_minimum_required(VERSION ${CMAKE_VERSION}) # this file comes with cmake
|
||||
|
||||
# If CMAKE_DISABLE_SOURCE_CHANGES is set to true and the source directory is an
|
||||
# existing directory in our source tree, calling file(MAKE_DIRECTORY) on it
|
||||
# would cause a fatal error, even though it would be a no-op.
|
||||
if(NOT EXISTS "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-src")
|
||||
file(MAKE_DIRECTORY "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-src")
|
||||
endif()
|
||||
file(MAKE_DIRECTORY
|
||||
"C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-build"
|
||||
"C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-subbuild/sqlite3_ext-populate-prefix"
|
||||
"C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-subbuild/sqlite3_ext-populate-prefix/tmp"
|
||||
"C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-subbuild/sqlite3_ext-populate-prefix/src/sqlite3_ext-populate-stamp"
|
||||
"C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-subbuild/sqlite3_ext-populate-prefix/src"
|
||||
"C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-subbuild/sqlite3_ext-populate-prefix/src/sqlite3_ext-populate-stamp"
|
||||
)
|
||||
|
||||
set(configSubDirs )
|
||||
foreach(subDir IN LISTS configSubDirs)
|
||||
file(MAKE_DIRECTORY "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-subbuild/sqlite3_ext-populate-prefix/src/sqlite3_ext-populate-stamp/${subDir}")
|
||||
endforeach()
|
||||
if(cfgdir)
|
||||
file(MAKE_DIRECTORY "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-subbuild/sqlite3_ext-populate-prefix/src/sqlite3_ext-populate-stamp${cfgdir}") # cfgdir has leading slash
|
||||
endif()
|
||||
Reference in new issue
Block a user