From a80c81b4052b5c797c36067ffa7216ffe3fdbdc0 Mon Sep 17 00:00:00 2001 From: autoantwort <41973254+autoantwort@users.noreply.github.com> Date: Thu, 23 Jun 2022 23:51:01 +0200 Subject: [PATCH] [tre] fix macos build (#25343) --- ports/tre/CMakeLists.txt | 3 +++ ports/tre/fix-config.patch | 17 +++++++++++++++++ ports/tre/portfile.cmake | 6 ++---- ports/tre/vcpkg.json | 4 ++-- scripts/ci.baseline.txt | 1 - versions/baseline.json | 2 +- versions/t-/tre.json | 5 +++++ 7 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 ports/tre/fix-config.patch diff --git a/ports/tre/CMakeLists.txt b/ports/tre/CMakeLists.txt index 09113fca10..b31aa8c72d 100644 --- a/ports/tre/CMakeLists.txt +++ b/ports/tre/CMakeLists.txt @@ -25,6 +25,9 @@ set (SRCS include_directories(win32 include/tre) add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -DHAVE_CONFIG_H) +if (WIN32) + add_definitions(-DHAVE_MALLOC_H) +endif() add_library(tre ${SRCS}) install( diff --git a/ports/tre/fix-config.patch b/ports/tre/fix-config.patch new file mode 100644 index 0000000000..89303ae8d3 --- /dev/null +++ b/ports/tre/fix-config.patch @@ -0,0 +1,17 @@ +diff --git a/win32/config.h b/win32/config.h +index 93b8210..db7a9e1 100644 +--- a/win32/config.h ++++ b/win32/config.h +@@ -20,7 +20,6 @@ + /* #undef HAVE_ALLOCA_H */ + + /* Define to 1 if you have and it should be used. */ +-#define HAVE_MALLOC_H 1 + + /* Define if the GNU dcgettext() function is already present or preinstalled. + */ +@@ -180,4 +179,3 @@ + /* Avoid silly warnings about "insecure" functions. */ + #define _CRT_SECURE_NO_DEPRECATE 1 + +-#define snprintf sprintf_s diff --git a/ports/tre/portfile.cmake b/ports/tre/portfile.cmake index cbc904e6e3..d92265c7d7 100644 --- a/ports/tre/portfile.cmake +++ b/ports/tre/portfile.cmake @@ -4,12 +4,10 @@ vcpkg_from_github( REF 6fb7206b935b35814c5078c20046dbe065435363 SHA512 f1d664719eab23b665d71e34ca3d11f8ba49da23ff20dc28f46d4ce30fe155c12208ba7fd212dbeb20a7037e069909f0c2120ce1fc01074656399805e3289a90 HEAD_REF master + PATCHES + fix-config.patch ) -file(READ ${SOURCE_PATH}/win32/config.h CONFIG_H) -string(REPLACE "#define snprintf sprintf_s" "" CONFIG_H ${CONFIG_H}) -file(WRITE ${SOURCE_PATH}/win32/config.h "${CONFIG_H}") - if(VCPKG_TARGET_IS_MINGW) vcpkg_replace_string(${SOURCE_PATH}/win32/tre.def "tre.dll" "libtre.dll") endif() diff --git a/ports/tre/vcpkg.json b/ports/tre/vcpkg.json index cada62daea..7d072060ff 100644 --- a/ports/tre/vcpkg.json +++ b/ports/tre/vcpkg.json @@ -1,7 +1,7 @@ { "name": "tre", - "version-string": "0.8.0", - "port-version": 3, + "version": "0.8.0", + "port-version": 4, "description": "TRE is a lightweight, robust, and efficient POSIX compliant regexp matching library with some exciting features such as approximate (fuzzy) matching.", "homepage": "https://github.com/laurikari/tre" } diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index d28b4dfde1..6a8f2f6ef0 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -1126,7 +1126,6 @@ torch-th:arm64-windows=fail torch-th:arm-uwp=fail torch-th:x64-uwp=fail torch-th:x64-windows-static=fail -tre:x64-osx=fail treehopper:x64-windows-static=fail treehopper:x64-linux=fail unicorn-lib:arm-uwp=fail diff --git a/versions/baseline.json b/versions/baseline.json index 8eff2acde0..0baa6775ac 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7186,7 +7186,7 @@ }, "tre": { "baseline": "0.8.0", - "port-version": 3 + "port-version": 4 }, "treehh": { "baseline": "3.16", diff --git a/versions/t-/tre.json b/versions/t-/tre.json index fcf4bef792..ee9ab2b0cd 100644 --- a/versions/t-/tre.json +++ b/versions/t-/tre.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "576df391c1e53ba1d3e8895ce7965d71b78d8236", + "version": "0.8.0", + "port-version": 4 + }, { "git-tree": "9a43049be2abc5f27fa5b1f77eaeda7a3a63d4a0", "version-string": "0.8.0",