diff --git a/CMakeLists.txt b/CMakeLists.txt index 93e53b9f..b4ec065e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,22 @@ if(NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "") set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type" FORCE) endif() +if(WIN32) + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(CMAKE_INSTALL_PREFIX "C:/Program Files/TA-Lib" CACHE PATH "Installation Directory" FORCE) + else() + set(CMAKE_INSTALL_PREFIX "C:/Program Files (x86)/TA-Lib" CACHE PATH "Installation Directory" FORCE) + endif() + + if(DEFINED ENV{Platform}) + set(PLATFORM_ENV $ENV{Platform}) + message(STATUS "Platform environment variable: ${PLATFORM_ENV}") + else() + message(FATAL_ERROR "Platform env variable not set. Did you forget to do vcvarsall.bat?") + endif() +endif() +message(STATUS "Installation Directory: ${CMAKE_INSTALL_PREFIX}") + # Attempt to set SOURCE_DATE_EPOCH to the last commit timestamp of include/ta_common.h # If not possible, use a fallback. Controlling the SOURCE_DATE_EPOCH "might" help producing # consistent binaries when there is no source code change. @@ -389,21 +405,21 @@ target_include_directories(ta-lib-static PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/inc # Install the libraries and headers. if(WIN32) install(TARGETS ta-lib ta-lib-static - LIBRARY DESTINATION bin # For shared libraries (DLLs on Windows) + RUNTIME DESTINATION bin # For shared libraries (DLLs on Windows) + LIBRARY DESTINATION lib # For import library ARCHIVE DESTINATION lib # For static libraries ) - install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/" + + install(FILES ${LIB_HEADERS} DESTINATION include - FILES_MATCHING PATTERN "*.h" ) else() install(TARGETS ta-lib ta-lib-static LIBRARY DESTINATION lib # For shared libraries (.so on Linux) ARCHIVE DESTINATION lib # For static libraries ) - install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/" - DESTINATION include/ta-lib - FILES_MATCHING PATTERN "*.h" + install(FILES ${LIB_HEADERS} + DESTINATION include/ta-lib ) endif() @@ -558,23 +574,31 @@ endif() set(CPACK_BUILD_CONFIG "${CMAKE_BUILD_TYPE}") # Set common package metadata -set(CPACK_PACKAGE_NAME "ta-lib") set(CPACK_PACKAGE_VERSION_MAJOR ${TA_LIB_VERSION_MAJOR}) set(CPACK_PACKAGE_VERSION_MINOR ${TA_LIB_VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_PATCH ${TA_LIB_VERSION_BUILD}) set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) -set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}") set(CPACK_PACKAGE_VENDOR "ta-lib.org") set(CPACK_PACKAGE_CONTACT "mfortier@yahoo.com") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "TA-Lib Technical Analysis Library") + if(WIN32) # Use mix case for Windows "best practice" in "C:\Program Files" - set(CPACK_PACKAGE_INSTALL_DIRECTORY "TA-Lib") + set(CPACK_PACKAGE_INSTALL_DIRECTORY "TA-Lib") + # Set a constant UPGRADE_GUID for each variant (never change these) + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(CPACK_WIX_UPGRADE_GUID "37b08339-521a-422f-a964-e616bd3e06b9") + set(CPACK_PACKAGE_NAME "TA-Lib (64 bits)") + else() + set(CPACK_WIX_UPGRADE_GUID "773316fa-8a9d-433c-b639-8f71a71641c5") + set(CPACK_PACKAGE_NAME "TA-Lib (32 bits)") + endif() else() # Keep everything lowercase for Unix-like systems set(CPACK_PACKAGE_INSTALL_DIRECTORY "ta-lib") + set(CPACK_PACKAGE_NAME "ta-lib") endif() set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md") @@ -582,21 +606,42 @@ set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md") # Detect host architecture and set DEB and RPM specific architecture variables message(STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}") if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64") - set(DEB_HOST_ARCH "amd64") - set(RPM_HOST_ARCH "x86_64") - set(MSI_HOST_ARCH "x86_64") -elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i386|i686") + if(WIN32) + # Handle cross-compilation configured with, say, using "vcvarsall.bat amd64_arm" settings. + # For windows, assume CMAKE_SYSTEM_PROCESSOR is always "AMD64", and the target architecture + # is in PLATFORM_ENV. + # + # There is no plan to cross-compile from anything else than AMD64. + if(PLATFORM_ENV STREQUAL "x86") + set(MSI_HOST_ARCH "x86_32") + message(STATUS "Cross-compilation to ${MSI_HOST_ARCH}") + elseif(PLATFORM_ENV STREQUAL "arm") + set(MSI_HOST_ARCH "arm_32") + message(STATUS "Cross-compilation to ${MSI_HOST_ARCH}") + elseif(PLATFORM_ENV STREQUAL "arm64") + set(MSI_HOST_ARCH "arm_64") + message(STATUS "Cross-compilation to ${MSI_HOST_ARCH}") + elseif(PLATFORM_ENV STREQUAL "x64") + set(MSI_HOST_ARCH "x86_64") + else() + status(FATAL_ERROR "Unsupported vcvarsall target: ${PLATFORM_ENV}") + endif() + else() + set(DEB_HOST_ARCH "amd64") + set(RPM_HOST_ARCH "x86_64") + endif() +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86|i386|i686") set(DEB_HOST_ARCH "i386") set(RPM_HOST_ARCH "i386") - set(MSI_HOST_ARCH "i386") + set(MSI_HOST_ARCH "x86_32") elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "armv7l") set(DEB_HOST_ARCH "armhf") set(RPM_HOST_ARCH "armv7hl") - set(MSI_HOST_ARCH "arm") + set(MSI_HOST_ARCH "arm_32") elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") set(DEB_HOST_ARCH "arm64") set(RPM_HOST_ARCH "aarch64") - set(MSI_HOST_ARCH "arm64") + set(MSI_HOST_ARCH "arm_64") elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le") set(DEB_HOST_ARCH "ppc64el") set(RPM_HOST_ARCH "ppc64le") @@ -638,9 +683,6 @@ set(CPACK_WIX_LICENSE_RTF "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.rtf") #set(CPACK_WIX_UI_BANNER "${CMAKE_CURRENT_SOURCE_DIR}/banner.bmp") #set(CPACK_WIX_UI_DIALOG "${CMAKE_CURRENT_SOURCE_DIR}/dialog.bmp") -# Set a constant UPGRADE_GUID (never change this) -set(CPACK_WIX_UPGRADE_GUID "37b08339-521a-422f-a964-e616bd3e06b9") - # Set the PRODUCT_GUID to change on every version change. # # This should guarantee a single version of the library installed @@ -655,14 +697,15 @@ set(CPACK_WIX_PRODUCT_GUID "${PRODUCT_GUID_PART1}-${PRODUCT_GUID_PART2}-${PRODUC # Set common variables that changes depending of the generator. if(CPACK_GENERATOR STREQUAL "DEB") - set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${DEB_HOST_ARCH}") + set(CPACK_PACKAGE_FILE_NAME "ta-lib_${CPACK_PACKAGE_VERSION}_${DEB_HOST_ARCH}") elseif(CPACK_GENERATOR STREQUAL "RPM") - set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.${RPM_HOST_ARCH}") + set(CPACK_PACKAGE_FILE_NAME "ta-lib-${CPACK_PACKAGE_VERSION}.${RPM_HOST_ARCH}") elseif(CPACK_GENERATOR STREQUAL "WIX") - set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-windows-${MSI_HOST_ARCH}") + set(CPACK_PACKAGE_FILE_NAME "ta-lib-${CPACK_PACKAGE_VERSION}-windows-${MSI_HOST_ARCH}") +else() + set(CPACK_PACKAGE_FILE_NAME "ta-lib-${CPACK_PACKAGE_VERSION}") endif() -# Allow the caller at the "cmake" configuration phase to see the filename. message(STATUS "CPACK_PACKAGE_FILE_NAME: ${CPACK_PACKAGE_FILE_NAME}") include(CPack) diff --git a/dist/ta-lib-0.6.0-windows-x86_64.msi b/dist/ta-lib-0.6.0-windows-x86_64.msi deleted file mode 100644 index 009d77ad..00000000 Binary files a/dist/ta-lib-0.6.0-windows-x86_64.msi and /dev/null differ diff --git a/include/ta_common.h b/include/ta_common.h index 3ad5b3d0..18347db0 100644 --- a/include/ta_common.h +++ b/include/ta_common.h @@ -151,7 +151,11 @@ TA_RetCode TA_Shutdown( void ); * This value is updated whenever a make, cmake or any source files * modification should trig a repackaging of TA-Lib. */ +<<<<<<< Updated upstream #define TA_LIB_SOURCES_DIGEST e2ca9dad960906da62435a4687425284 +======= +#define TA_LIB_SOURCES_DIGEST 9cb9d8be369d2b4d95b9c19a8361736b +>>>>>>> Stashed changes #ifdef __cplusplus } diff --git a/scripts/package.py b/scripts/package.py index 55d68e3f..0430b8aa 100755 --- a/scripts/package.py +++ b/scripts/package.py @@ -7,9 +7,9 @@ # For linux/ubuntu: ta-lib--src.tar.gz # with contents for doing "./configure; make; sudo make install" # -# For windows: ta-lib--windows-x86_64.zip +# For windows: ta-lib--windows-.zip # with contents: -# lib/ta-lib.dll (dynamic library) +# bin/ta-lib.dll (dynamic library) # lib/ta-lib.lib (import library) # lib/ta-lib-static.lib (static library) # include/*.h (API headers) @@ -20,15 +20,15 @@ # # Windows Specific: # - You must have Visual Studio installed (free community version works). -# - Host machine must be x64 -# - Scripts must be run in a "VS Development Command Shell" (for having -# CMake and Ninja be on the Path). +# - Host machine *must* be x64. # # (FYI, all this can optionally be done in a Windows VM) # # How to change the version? -# Edit MAJOR, MINOR, BUILD in src/ta_common/ta_version.c +# Edit MAJOR, MINOR, PATCH in src/ta_common/ta_version.c # There is no need to modify other files (they will be updated by this script). +# +# See README-DEVS.md for all the release steps. import argparse import filecmp @@ -44,8 +44,9 @@ import zipfile import zlib +from utilities.windows import call_vcvarsall from utilities.versions import sync_sources_digest, sync_versions -from utilities.common import are_generated_files_git_changed, compare_dir, copy_file_list, create_temp_dir, get_src_generated_files, is_arm64_toolchain_installed, is_cmake_installed, is_debian_based, is_dotnet_installed, is_i386_toolchain_installed, is_redhat_based, is_rpmbuild_installed, is_ubuntu, is_dotnet_installed, is_wix_installed, is_x86_64_toolchain_installed, run_command, verify_git_repo, run_command_sudo +from utilities.common import are_generated_files_git_changed, compare_dir, copy_file_list, create_temp_dir, get_src_generated_files, is_arm64_toolchain_installed, is_cmake_installed, is_debian_based, is_dotnet_installed, is_i386_toolchain_installed, is_redhat_based, is_rpmbuild_installed, is_ubuntu, is_dotnet_installed, is_wix_installed, is_x86_64_toolchain_installed, run_command, run_command_term, verify_git_repo, run_command_sudo from utilities.files import compare_msi_files, compare_tar_gz_files, compare_zip_files, create_rtf_from_txt, create_zip_file, compare_deb_files, force_delete, force_delete_glob, path_join def delete_other_versions(target_dir: str, file_pattern: str, new_version: str ): @@ -78,6 +79,10 @@ def do_cmake_reconfigure(root_dir: str, options: str, sudo_pwd: str = "") ->str: print(f"Error: {cmake_lists} not found. Your working directory must be within a cloned TA-Lib repos") sys.exit(1) + # Delete ta_config.h to force regeneration. + ta_config_h = path_join(root_dir, 'include', 'ta_config.h') + force_delete(ta_config_h, sudo_pwd) + # Run CMake configuration. original_dir = os.getcwd() try: @@ -85,8 +90,8 @@ def do_cmake_reconfigure(root_dir: str, options: str, sudo_pwd: str = "") ->str: os.chdir(build_dir) cmake_command = ['cmake'] + shlex.split(options) + ['..'] formatted_command = ' '.join([f'[{elem}]' for elem in cmake_command]) - print("CMake command:", formatted_command) # Display the cmake_command list with brackets - run_command(cmake_command) + print("CMake configure command:", formatted_command) # to help debugging, display each arg in brackets + run_command_term(cmake_command) # Run the command in foreground (output displayed). finally: # Restore the original working directory os.chdir(original_dir) @@ -98,7 +103,10 @@ def do_cmake_build(build_dir: str): original_dir = os.getcwd() try: os.chdir(build_dir) - run_command(['cmake', '--build', '.']) + cmake_command = ['cmake', '--build', '.'] + formatted_command = ' '.join([f'[{elem}]' for elem in cmake_command]) + print("CMake build command:", formatted_command) # to help debugging, display each arg in brackets + run_command(cmake_command) # Output piped and displayed only on error. finally: # Restore the original working directory os.chdir(original_dir) @@ -108,7 +116,10 @@ def do_cpack_build(build_dir: str): original_dir = os.getcwd() try: os.chdir(build_dir) - run_command(['cpack', '.']) + cpack_command = ['cpack', '.'] + formatted_command = ' '.join([f'[{elem}]' for elem in cpack_command]) + print("CPack command:", formatted_command) # to help debugging, display each arg in brackets + run_command_term(cpack_command) finally: # Restore the original working directory os.chdir(original_dir) @@ -130,10 +141,10 @@ def find_asset_with_ext(target_dir, version: str, extension: str) -> str: return os.path.basename(filepath) -def package_windows_zip(root_dir: str, version: str) -> dict: +def package_windows_zip(root_dir: str, version: str, platform: str) -> dict: result: dict = {"success": False} - file_name_prefix = f'ta-lib-{version}-windows-x86_64' + file_name_prefix = f'ta-lib-{version}-windows-{platform}' asset_file_name = f'{file_name_prefix}.zip' result["asset_file_name"] = asset_file_name @@ -147,17 +158,19 @@ def package_windows_zip(root_dir: str, version: str) -> dict: force_delete_glob(temp_dir, "ta-lib-*") # Build the libraries - build_dir = do_cmake_reconfigure(root_dir, '-G Ninja -DBUILD_DEV_TOOLS=OFF') + build_dir = do_cmake_reconfigure(root_dir, '-G Ninja -DBUILD_DEV_TOOLS=OFF -DCMAKE_BUILD_TYPE=Release') do_cmake_build(build_dir) # Create a temporary zip package to test before copying to dist. package_temp_dir = path_join(temp_dir, file_name_prefix) temp_lib_dir = path_join(package_temp_dir, 'lib') + temp_bin_dir = path_join(package_temp_dir, 'bin') temp_include_dir = path_join(package_temp_dir, 'include') os.makedirs(temp_dir, exist_ok=True) os.makedirs(package_temp_dir, exist_ok=True) os.makedirs(temp_lib_dir, exist_ok=True) + os.makedirs(temp_bin_dir, exist_ok=True) os.makedirs(temp_include_dir, exist_ok=True) # Copy the built files to the temporary package locations. @@ -165,11 +178,16 @@ def package_windows_zip(root_dir: str, version: str) -> dict: include_rootdir = path_join(root_dir, 'include') try: os.chdir(build_dir) - shutil.copy('ta-lib.dll', temp_lib_dir) + shutil.copy('ta-lib.dll', temp_bin_dir) shutil.copy('ta-lib.lib', temp_lib_dir) shutil.copy('ta-lib-static.lib', temp_lib_dir) - for header in glob.glob(path_join(include_rootdir, '*.h')): - shutil.copy(header, temp_include_dir) + for header_filepath in glob.glob(path_join(include_rootdir, '*.h')): + if "ta_config.h" in header_filepath: + # At this point, this build artifact header is no longuer needed. + force_delete(header_filepath) + continue + shutil.copy(header_filepath, temp_include_dir) + # Create the VERSION.txt file with open(path_join(package_temp_dir, 'VERSION.txt'), 'w') as f: f.write(version) @@ -205,12 +223,21 @@ def package_windows_zip(root_dir: str, version: str) -> dict: result["copied"] = package_copied return result -def package_windows_msi(root_dir: str, version: str, force: bool) -> dict: +def package_windows_msi(root_dir: str, version: str, platform: str, force: bool) -> dict: result: dict = {"success": False} + # Clean-up + dist_dir = path_join(root_dir, 'dist') + delete_other_versions(dist_dir,"ta-lib-*.msi",version) + + temp_dir = path_join(root_dir, 'temp') + force_delete(path_join(temp_dir, "PFiles")) + + force_delete_glob(temp_dir, "ta-lib-*") + # MSI supports only .rtf for license, so generate it into root_dir. - license_rtf = path_join(root_dir,"LICENSE.rtf") license_txt = path_join(root_dir,"LICENSE") + license_rtf = path_join(root_dir,"LICENSE.rtf") create_rtf_from_txt(license_txt,license_rtf) if not is_dotnet_installed(): @@ -604,50 +631,79 @@ def package_all_linux(root_dir: str, version: str, sudo_pwd: str): print(f"\nPackaging completed successfully.") -def package_all_windows(root_dir: str, version: str): - - zip_results = { - "success": False, - "built": False, - "asset_file_name": ".zip", # Default, will change. - } - results = package_windows_zip(root_dir, version) - zip_results.update(results) - zip_results["built"] = True - if not zip_results["success"]: - print(f'Error: Packaging dist/{zip_results["asset_file_name"]} failed') +def package_windows_platform(root_dir: str, version: str, platform: str) -> dict: + + vcvarsall_args = [] + if platform == "x86_64": + vcvarsall_args = ["amd64"] + elif platform == "x86_32": + vcvarsall_args = ["amd64_x86"] + elif platform == "arm_64": + vcvarsall_args = ["amd64_arm64"] + elif platform == "arm_32": + vcvarsall_args = ["amd64_arm"] + + call_vcvarsall(vcvarsall_args) + results = { + "zip_results": { + "success": False, + "built": False, + "asset_file_name": f"{platform}.zip", # Default, will change. + }, + "msi_results": { + "success": False, + "built": False, + "asset_file_name": f"{platform}.msi", # Default, will change. + } + } + zip_results = package_windows_zip(root_dir, version, platform) + results["zip_results"].update(zip_results) + results["zip_results"]["built"] = True + if not results["zip_results"]["success"]: + print(f'Error: Packaging dist/{results["zip_results"]["asset_file_name"]} failed') sys.exit(1) # The zip file is better at detecting if the *content* is different. # If any changes are detected, it will force the creation and overwrite # of the .msi file in dist. force_msi_overwrite = False - if zip_results["built"] and zip_results["copied"]: + if results["zip_results"]["built"] and results["zip_results"]["copied"]: force_msi_overwrite = True # For now, skip the .msi file creation if wix is not installed. # Process the .msi file. - msi_results = { - "success": False, - "built": False, - "asset_file_name": ".msi", # Default, will change. - } if not is_wix_installed(): print("Warning: WiX Toolset not found. MSI packaging skipped.") else: - results = package_windows_msi(root_dir, version, force_msi_overwrite) - msi_results.update(results) - msi_results["built"] = True - if not msi_results["success"]: - print(f'Error: Packaging dist/{msi_results["asset_file_name"]} failed') + msi_results = package_windows_msi(root_dir, version, platform, force_msi_overwrite) + results["msi_results"].update(msi_results) + results["msi_results"]["built"] = True + if not results["msi_results"]["success"]: + print(f'Error: Packaging dist/{results["msi_results"]["asset_file_name"]} failed') sys.exit(1) + return results + +def package_all_windows(root_dir: str, version: str): + results_x86_64 = package_windows_platform(root_dir, version, "x86_64") + results_x86_32 = package_windows_platform(root_dir, version, "x86_32") + + # TODO: More testing needed for ARM platforms. + #results_arm_64 = package_windows_platform(root_dir, version, "arm_64") + #results_arm_32 = package_windows_platform(root_dir, version, "arm_32") + print(f"\n***********") print(f"* Summary *") print(f"***********") - display_package_results(zip_results) - display_package_results(msi_results) + display_package_results(results_x86_64["zip_results"]) + display_package_results(results_x86_64["msi_results"]) + display_package_results(results_x86_32["zip_results"]) + display_package_results(results_x86_32["msi_results"]) + #display_package_results(results_arm_64["zip_results"]) + #display_package_results(results_arm_64["msi_results"]) + #display_package_results(results_arm_32["zip_results"]) + #display_package_results(results_arm_32["msi_results"]) print(f"Packaging completed successfully.") @@ -668,7 +724,7 @@ def package_all_windows(root_dir: str, version: str): if arch == '64bit': package_all_windows(root_dir, version) else: - print( f"Unsupported architecture [{arch}]. Contact TA-Lib maintainers.") + print( f"Unsupported [{arch}]. Only 64-bits windows supported for TA-Lib development.") else: print(f"Unsupported platform [{host_platform}]. Contact TA-Lib maintainers.") sys.exit(1) diff --git a/scripts/utilities/common.py b/scripts/utilities/common.py index 3153be2d..2260611f 100644 --- a/scripts/utilities/common.py +++ b/scripts/utilities/common.py @@ -153,6 +153,8 @@ def get_release_assets(version:str) -> list: f'ta-lib-{version}-src.tar.gz', f'ta-lib-{version}-windows-x86_64.msi', f'ta-lib-{version}-windows-x86_64.zip', + f'ta-lib-{version}-windows-x86_32.msi', + f'ta-lib-{version}-windows-x86_32.zip', f'ta-lib_{version}_amd64.deb', f'ta-lib_{version}_arm64.deb', f'ta-lib_{version}_x86.deb', @@ -239,6 +241,17 @@ def run_command(command: list) -> str: return result.stdout.strip() +def run_command_term(command: list): + """ + Similar to run_command, but let it print its output to the terminal instead of capturing. + Also, exit if the command fails. + """ + try: + subprocess.run(command, check=True) + except subprocess.CalledProcessError as e: + print(f"Error during '{' '.join(command)}': {e}") + sys.exit(1) + def run_command_sudo(command: list, sudo_pwd: str=''): """ Run a command with sudo, optionally using a password if provided. diff --git a/scripts/utilities/files.py b/scripts/utilities/files.py index aa3f76db..cb902a53 100644 --- a/scripts/utilities/files.py +++ b/scripts/utilities/files.py @@ -51,18 +51,24 @@ def remove_lib_files_recursive(target_path: str): # That source digest is necessary because some package includes only the # headers... not all the files that were used to build the package (but # all are reflected in the digest) + # + # Always remove the ta_config.h... it is a build artifact. if is_windows(): for root, dirs, files in os.walk(target_path): for file in files: - if file.endswith('.msi') or file.endswith('.lib') or file.endswith('.dll'): + if "ta_config.h" in file or file.endswith('.msi') or file.endswith('.lib') or file.endswith('.dll'): os.remove(path_join(root, file)) elif is_linux(): pattern = r'\.so\.\d+' for root, dirs, files in os.walk(target_path): for file in files: - if file.endswith('.a') or file.endswith('.so') or re.search(pattern, file) is not None: + if "ta_config.h" in file or file.endswith('.a') or file.endswith('.so') or re.search(pattern, file) is not None: os.remove(path_join(root, file)) + + + + def compare_zip_files(zip_file1, zip_file2): # Does a comparison of the contents of the two zip files. # Ignores file creation time and binaries. diff --git a/scripts/utilities/versions.py b/scripts/utilities/versions.py index 30b3856c..f64d93f0 100644 --- a/scripts/utilities/versions.py +++ b/scripts/utilities/versions.py @@ -380,6 +380,10 @@ def calculate_sources_digest(root_dir: str, silent: bool = False) -> str: "configure.ac", "ta-lib.*.in", "cmake/*", + "include/ta_abstract.h", + "include/ta_def.h", + "include/ta_func.h", + "include/ta_libc.h", "src/**/*.c", "src/**/*.h", "src/**/*.am",