diff --git a/ports/freetds/CONTROL b/ports/freetds/CONTROL deleted file mode 100644 index bfd1e44d47..0000000000 --- a/ports/freetds/CONTROL +++ /dev/null @@ -1,9 +0,0 @@ -Source: freetds -Version: 1.1.17 -Homepage: https://www.freetds.org -Description: Implementation of the Tabular Data Stream protocol -Default-Features: openssl - -Feature: openssl -Build-Depends: openssl -Description: OpenSSL support diff --git a/ports/freetds/crypt32.patch b/ports/freetds/crypt32.patch deleted file mode 100644 index a3af75693b..0000000000 --- a/ports/freetds/crypt32.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 796625e17..fc9076f54 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -149,6 +149,9 @@ if(OPENSSL_FOUND) - config_write("#define HAVE_OPENSSL 1\n\n") - include_directories(${OPENSSL_INCLUDE_DIR}) - set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) -+ if(WIN32) -+ list(APPEND CMAKE_REQUIRED_LIBRARIES crypt32 ws2_32) -+ endif() - check_function_exists_define(BIO_get_data) - check_function_exists_define(RSA_get0_key) - check_function_exists_define(ASN1_STRING_get0_data) -@@ -441,7 +444,10 @@ else(WIN32) - endif(WIN32) - - if(OPENSSL_FOUND) - set(lib_NETWORK ${lib_NETWORK} ${OPENSSL_LIBRARIES}) -+ if(WIN32) -+ list(APPEND lib_NETWORK crypt32) -+ endif() - elseif(GNUTLS_FOUND) - set(lib_NETWORK ${lib_NETWORK} ${lib_GNUTLS}) - endif(OPENSSL_FOUND) diff --git a/ports/freetds/fix-encoding-h-dependency.patch b/ports/freetds/fix-encoding-h-dependency.patch new file mode 100644 index 0000000000..7b2909fec4 --- /dev/null +++ b/ports/freetds/fix-encoding-h-dependency.patch @@ -0,0 +1,45 @@ +diff --git a/src/odbc/CMakeLists.txt b/src/odbc/CMakeLists.txt +index 5d036a1..031b9a2 100644 +--- a/src/odbc/CMakeLists.txt ++++ b/src/odbc/CMakeLists.txt +@@ -30,7 +30,7 @@ add_library(tdsodbc SHARED + target_compile_definitions(tdsodbc PUBLIC DLL_EXPORT=1) + # TODO libiconv, odbcinstlib and other dynamics + target_link_libraries(tdsodbc tds replacements tdsutils ${libs} ${lib_NETWORK} ${lib_BASE}) +- ++add_dependencies(tdsodbc generate_encodings_h) + if(MINGW OR CYGWIN) + set_target_properties(tdsodbc PROPERTIES LINK_FLAGS "--static -Wl,--kill-at -Wl,--enable-stdcall-fixup") + endif(MINGW OR CYGWIN) +@@ -41,6 +41,7 @@ add_library(tdsodbc_static STATIC + native.c sql2tds.c error.c odbc_checks.c sqlwchar.c sqlwparams.h + odbc_export.h error_export.h odbc_data.c ${win_SRCS} + ) ++add_dependencies(tdsodbc_static generate_encodings_h) + if (NOT WIN32) + set_target_properties(tdsodbc_static PROPERTIES POSITION_INDEPENDENT_CODE ON) + endif() +diff --git a/src/tds/CMakeLists.txt b/src/tds/CMakeLists.txt +index d8be1a0..42b6a4d 100644 +--- a/src/tds/CMakeLists.txt ++++ b/src/tds/CMakeLists.txt +@@ -29,6 +29,8 @@ if(PERL_FOUND AND NOT EXISTS "${CMAKE_SOURCE_DIR}/configure") + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) + endif(PERL_FOUND AND NOT EXISTS "${CMAKE_SOURCE_DIR}/configure") + ++add_custom_target(generate_encodings_h DEPENDS "${CMAKE_BINARY_DIR}/include/freetds/encodings.h") ++ + if(WIN32) + set(add_SRCS sspi.c) + else(WIN32) +@@ -44,9 +46,9 @@ add_library(tds STATIC + bulk.c packet.c stream.c random.c + sec_negotiate_gnutls.h sec_negotiate_openssl.h sec_negotiate.c gssapi.c + tds_willconvert.h num_limits.h tds_types.h +- "${CMAKE_BINARY_DIR}/include/freetds/encodings.h" + ${add_SRCS} + ) ++add_dependencies(tds generate_encodings_h) + if (NOT WIN32) + set_target_properties(tds PROPERTIES POSITION_INDEPENDENT_CODE ON) + endif() diff --git a/ports/freetds/portfile.cmake b/ports/freetds/portfile.cmake index eb833b30ae..b534c43f9c 100644 --- a/ports/freetds/portfile.cmake +++ b/ports/freetds/portfile.cmake @@ -1,28 +1,37 @@ -include(vcpkg_common_functions) - -vcpkg_download_distfile(ARCHIVE - URLS "https://www.freetds.org/files/stable/freetds-1.1.17.tar.bz2" - FILENAME "freetds-1.1.17.tar.bz2" - SHA512 3746ea009403960950fd619ffaf6433cfc92c34a8261b15e61009f01a1446e5a5a59413cd48e5511bbf3a0224f54b40daa713187bd20ca43105c5f8c68f4b88e -) - -vcpkg_extract_source_archive_ex( +vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} + REPO freetds/freetds + REF fbf3bbbbc27283b35a5a6aec9992521e684c9abf # 1.2.5 + HEAD_REF master + SHA512 e18dba16705db951ea52055476fac342c1bb62e90629ef82064ad9d3d4a7f2078e8f7674b1602bc21798240e005052dcbc67cdd0912b47163bd95956128c4677 PATCHES - crypt32.patch + skip-unit-tests.patch + fix-encoding-h-dependency.patch ) -set(BUILD_freetds_openssl OFF) -if("openssl" IN_LIST FEATURES) - set(BUILD_freetds_openssl ON) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + openssl WITH_OPENSSL +) + +vcpkg_find_acquire_program(PERL) +get_filename_component(PERL_PATH ${PERL} DIRECTORY) +vcpkg_add_to_path(${PERL_PATH}) + +if (VCPKG_TARGET_IS_WINDOWS) + vcpkg_find_acquire_program(GPERF) + get_filename_component(GPERF_PATH ${GPERF} DIRECTORY) + vcpkg_add_to_path(${GPERF_PATH}) +else() + if (NOT EXISTS /usr/bin/gperf) + message(FATAL_ERROR "freetds requires gperf, these can be installed on Ubuntu systems via apt-get install gperf.") + endif() endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS - -DWITH_OPENSSL=${BUILD_freetds_openssl} + OPTIONS ${FEATURE_OPTIONS} ) vcpkg_install_cmake() @@ -62,4 +71,4 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) endif() -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${SOURCE_PATH}/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/freetds/skip-unit-tests.patch b/ports/freetds/skip-unit-tests.patch new file mode 100644 index 0000000000..0ec6d8ee43 --- /dev/null +++ b/ports/freetds/skip-unit-tests.patch @@ -0,0 +1,89 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e3840ae..19a22bb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -64,9 +64,9 @@ math(EXPR BUILD_NUMBER "${BUILD_NUMBER}") + + set(FREETDS_TOPDIR ${CMAKE_CURRENT_LIST_DIR}) + +-enable_testing() +-set(CMAKE_CTEST_COMMAND ctest) +-add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) ++#enable_testing() ++#set(CMAKE_CTEST_COMMAND ctest) ++#add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) + + # TODO depends on configure + add_definitions(-D_REENTRANT -D_THREAD_SAFE) +@@ -464,7 +464,7 @@ add_subdirectory(src/dblib) + add_subdirectory(src/odbc) + add_subdirectory(src/apps) + add_subdirectory(src/server) +-add_subdirectory(src/pool) ++#add_subdirectory(src/pool) + + configure_file(${CMAKE_BINARY_DIR}/include/config.h.in ${CMAKE_BINARY_DIR}/include/config.h) + configure_file(${CMAKE_SOURCE_DIR}/include/tds_sysdep_public.h.in ${CMAKE_BINARY_DIR}/include/tds_sysdep_public.h) +diff --git a/src/ctlib/CMakeLists.txt b/src/ctlib/CMakeLists.txt +index e83b0b1..017d571 100644 +--- a/src/ctlib/CMakeLists.txt ++++ b/src/ctlib/CMakeLists.txt +@@ -1,4 +1,4 @@ +-add_subdirectory(unittests) ++#add_subdirectory(unittests) + + set(static_lib_name ct) + if(WIN32) +diff --git a/src/dblib/CMakeLists.txt b/src/dblib/CMakeLists.txt +index aa8a179..b626000 100644 +--- a/src/dblib/CMakeLists.txt ++++ b/src/dblib/CMakeLists.txt +@@ -1,4 +1,4 @@ +-add_subdirectory(unittests) ++#add_subdirectory(unittests) + + if(WIN32) + set(win_SRCS winmain.c dblib.def dbopen.c) +diff --git a/src/odbc/CMakeLists.txt b/src/odbc/CMakeLists.txt +index 7fad8db..3d90456 100644 +--- a/src/odbc/CMakeLists.txt ++++ b/src/odbc/CMakeLists.txt +@@ -1,4 +1,4 @@ +-add_subdirectory(unittests) ++#add_subdirectory(unittests) + + # TODO checks + add_definitions(-DUNIXODBC -DHAVE_SQLGETPRIVATEPROFILESTRING) +diff --git a/src/replacements/CMakeLists.txt b/src/replacements/CMakeLists.txt +index 37b47e3..ba17bed 100644 +--- a/src/replacements/CMakeLists.txt ++++ b/src/replacements/CMakeLists.txt +@@ -35,7 +35,7 @@ if (NOT WIN32) + set_target_properties(replacements PROPERTIES POSITION_INDEPENDENT_CODE ON) + endif() + +-add_subdirectory(unittests) ++#add_subdirectory(unittests) + + + INSTALL(TARGETS replacements +diff --git a/src/tds/CMakeLists.txt b/src/tds/CMakeLists.txt +index fee56b3..e7a71f0 100644 +--- a/src/tds/CMakeLists.txt ++++ b/src/tds/CMakeLists.txt +@@ -1,4 +1,4 @@ +-add_subdirectory(unittests) ++#add_subdirectory(unittests) + + if(PERL_FOUND AND NOT EXISTS "${CMAKE_SOURCE_DIR}/configure") + # get name of null device +diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt +index 2a1935c..a46483e 100644 +--- a/src/utils/CMakeLists.txt ++++ b/src/utils/CMakeLists.txt +@@ -1,4 +1,4 @@ +-add_subdirectory(unittests) ++#add_subdirectory(unittests) + + if(WIN32) + set(add_SRCS md5.c) diff --git a/ports/freetds/vcpkg.json b/ports/freetds/vcpkg.json new file mode 100644 index 0000000000..0c01013ad6 --- /dev/null +++ b/ports/freetds/vcpkg.json @@ -0,0 +1,18 @@ +{ + "name": "freetds", + "version-string": "1.2.5", + "description": "Implementation of the Tabular Data Stream protocol", + "homepage": "https://www.freetds.org", + "supports": "windows & !uwp", + "default-features": [ + "openssl" + ], + "features": { + "openssl": { + "description": "OpenSSL support", + "dependencies": [ + "openssl" + ] + } + } +} diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 942288e26b..80950fa9d6 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -423,10 +423,6 @@ freeglut:x64-uwp=fail freeglut:x64-osx=fail # Needs /bigobj freeopcua:arm64-windows=fail -freetds:arm-uwp=fail -freetds:x64-linux=fail -freetds:x64-osx=fail -freetds:x64-uwp=fail freetype-gl:x64-uwp=fail freexl:arm-uwp=fail freexl:x64-uwp=fail @@ -1835,9 +1831,3 @@ clapack:x86-windows=skip clapack:x64-uwp=skip lapack-reference:arm64-windows=skip lapack-reference:arm-uwp=skip - -# freetds upstream is gone -freetds:x86-windows=fail -freetds:x64-windows=fail -freetds:x64-windows-static=fail -freetds:arm64-windows=fail