mirror of
https://github.com/microsoft/vcpkg.git
synced 2026-01-18 01:11:23 +01:00
[unixodbc] Update to 2.3.12, use new port [libltdl] (#47342)
This commit is contained in:
19
ports/libltdl/libtoolize-ltdl-no-la
Executable file
19
ports/libltdl/libtoolize-ltdl-no-la
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
me=libtoolize-ltdl-no-la
|
||||
if test -n "$VCPKG_LIBLTDL_LIBTOOLIZE"; then
|
||||
libtoolize="${VCPKG_LIBLTDL_LIBTOOLIZE}"
|
||||
elif hash glibtoolize 2>/dev/null; then
|
||||
libtoolize=glibtoolize
|
||||
else
|
||||
libtoolize=libtoolize
|
||||
fi
|
||||
echo "$me: running: ${libtoolize} $*" 1>&2
|
||||
"${libtoolize}" "$@" &&
|
||||
echo "$me: disabling libltdl.la check in m4/ltdl.m4" # most distros removes the la file
|
||||
if test -f m4/ltdl.m4 ; then
|
||||
sed -e 's,test -f "\$with_ltdl_lib/libltdl.la",test -d "\$with_ltdl_lib",' m4/ltdl.m4 > m4/_ltdl.m4.tmp &&
|
||||
cp m4/_ltdl.m4.tmp m4/ltdl.m4 &&
|
||||
rm m4/_ltdl.m4.tmp
|
||||
else
|
||||
echo "$me: Cannot find m4/libltdl.m4" 1>&2
|
||||
fi
|
||||
38
ports/libltdl/portfile.cmake
Normal file
38
ports/libltdl/portfile.cmake
Normal file
@@ -0,0 +1,38 @@
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
URLS "https://ftpmirror.gnu.org/libtool/libtool-${VERSION}.tar.xz"
|
||||
"https://ftp.gnu.org/pub/gnu/libtool/libtool-${VERSION}.tar.xz"
|
||||
FILENAME "gnu-libtool-${VERSION}.tar.xz"
|
||||
SHA512 eed207094bcc444f4bfbb13710e395e062e3f1d312ca8b186ab0cbd22dc92ddef176a0b3ecd43e02676e37bd9e328791c59a38ef15846d4eae15da4f20315724
|
||||
)
|
||||
|
||||
vcpkg_extract_source_archive(SOURCE_PATH
|
||||
ARCHIVE "${ARCHIVE}"
|
||||
)
|
||||
|
||||
vcpkg_list(SET OPTIONS "")
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
string(APPEND VCPKG_C_FLAGS " -D_CRT_SECURE_NO_WARNINGS")
|
||||
string(APPEND VCPKG_CXX_FLAGS " -D_CRT_SECURE_NO_WARNINGS")
|
||||
if(NOT VCPKG_TARGET_IS_MINGW)
|
||||
vcpkg_list(APPEND OPTIONS ac_cv_header_dirent_h=no) # Ignore vcpkg port dirent
|
||||
endif()
|
||||
endif()
|
||||
|
||||
vcpkg_make_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}/libltdl"
|
||||
AUTORECONF
|
||||
OPTIONS
|
||||
--enable-ltdl-install
|
||||
${OPTIONS}
|
||||
)
|
||||
vcpkg_make_install()
|
||||
|
||||
file(COPY "${CURRENT_PORT_DIR}/libtoolize-ltdl-no-la" DESTINATION "${CURRENT_PACKAGES_DIR}/manual-tools/${PORT}")
|
||||
file(CHMOD "${CURRENT_PACKAGES_DIR}/manual-tools/${PORT}/libtoolize-ltdl-no-la" FILE_PERMISSIONS
|
||||
OWNER_READ OWNER_WRITE OWNER_EXECUTE
|
||||
GROUP_READ GROUP_EXECUTE
|
||||
WORLD_READ WORLD_EXECUTE
|
||||
)
|
||||
file(COPY "${CURRENT_PORT_DIR}/vcpkg-port-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/libltdl/COPYING.LIB")
|
||||
43
ports/libltdl/vcpkg-port-config.cmake
Normal file
43
ports/libltdl/vcpkg-port-config.cmake
Normal file
@@ -0,0 +1,43 @@
|
||||
# Provide variables to use lib ltldl with autoconf.
|
||||
#
|
||||
# - <PREFIX>_LIBTOOLIZE
|
||||
# A libtoolize (wrapper) which disables the check for libltdl.la.
|
||||
# la files are removed from packages in vcpkg (and in most distros).
|
||||
# They add little value in modern environments, and they use absolute paths.
|
||||
# - <PREFIX>_OPTIONS_RELEASE,
|
||||
# <PREFIX>_OPTIONS_DEBUG:
|
||||
# Options to pass to vcpkg_make_configure.
|
||||
#
|
||||
# Usage:
|
||||
# vcpkg_libltdl_get_vars(LIBLTDL)
|
||||
# set(ENV{LIBTOOLIZE} "${LIBLTDL_LIBTOOLIZE}")
|
||||
#
|
||||
# vcpkg_make_configure(
|
||||
# SOURCE_PATH "${SOURCE_PATH}"
|
||||
# AUTORECONF
|
||||
# OPTIONS_RELEASE
|
||||
# ${LIBLTDL_OPTIONS_RELEASE}
|
||||
# OPTIONS_DEBUG
|
||||
# ${LIBLTDL_OPTIONS_RELEASE}
|
||||
# )
|
||||
|
||||
function(vcpkg_libltdl_get_vars prefix)
|
||||
# Forward libtoolize from environment to libtoolize-ltdl-no-la.
|
||||
if(NOT "$ENV{LIBTOOLIZE}" STREQUAL "")
|
||||
set(ENV{VCPKG_LIBLTDL_LIBTOOLIZE} "$ENV{LIBTOOLIZE}")
|
||||
endif()
|
||||
|
||||
vcpkg_list(SET options_release
|
||||
"--with-included-ltdl=no"
|
||||
"--with-ltdl-include=${CURRENT_INSTALLED_DIR}/include"
|
||||
"--with-ltdl-lib=${CURRENT_INSTALLED_DIR}/lib"
|
||||
)
|
||||
vcpkg_list(SET options_debug
|
||||
"--with-included-ltdl=no"
|
||||
"--with-ltdl-include=${CURRENT_INSTALLED_DIR}/include"
|
||||
"--with-ltdl-lib=${CURRENT_INSTALLED_DIR}/debug/lib"
|
||||
)
|
||||
set("${prefix}_OPTIONS_RELEASE" "${options_release}" PARENT_SCOPE)
|
||||
set("${prefix}_OPTIONS_DEBUG" "${options_debug}" PARENT_SCOPE)
|
||||
set("${prefix}_LIBTOOLIZE" "${CURRENT_INSTALLED_DIR}/manual-tools/libltdl/libtoolize-ltdl-no-la" PARENT_SCOPE)
|
||||
endfunction()
|
||||
14
ports/libltdl/vcpkg.json
Normal file
14
ports/libltdl/vcpkg.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "libltdl",
|
||||
"version": "2.5.4",
|
||||
"description": "A system independent dlopen wrapper for GNU libtool",
|
||||
"homepage": "https://www.gnu.org/software/libtool/",
|
||||
"license": "LGPL-2.1-or-later",
|
||||
"supports": "!uwp",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-make",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
||||
10
ports/unixodbc/pkgconfig-libiconv.diff
Normal file
10
ports/unixodbc/pkgconfig-libiconv.diff
Normal file
@@ -0,0 +1,10 @@
|
||||
diff --git a/DriverManager/odbc.pc.in b/DriverManager/odbc.pc.in
|
||||
index defa7cd..db4dfe7 100644
|
||||
--- a/DriverManager/odbc.pc.in
|
||||
+++ b/DriverManager/odbc.pc.in
|
||||
@@ -17,4 +17,4 @@ URL: http://unixodbc.org
|
||||
Version: @PACKAGE_VERSION@
|
||||
Cflags: -I${includedir}
|
||||
Libs: -L${libdir} -lodbc
|
||||
-Libs.private: @LIBLTDL@ @LIBS@
|
||||
+Libs.private: @LIBLTDL@ @LIBICONV@ @LIBS@
|
||||
@@ -1,56 +1,55 @@
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO lurcher/unixODBC
|
||||
REF 6c8071b1bef4e4991e7b3023a1c1c712168a818e # v2.3.11
|
||||
SHA512 5c5b189e3b62935fdee5e25f5cf9b41fb2bc68fc9bd1652cab1b109032ab586978ba14d19e83328838b55e773f099046344bb4c84ec99edac309650ed863543e
|
||||
REF ${VERSION}
|
||||
SHA512 f0c0a995c90ff3abd00a031430e2f2034d45ca96c7fba34adc826a668c4eeb77ee2e1be27b7b1817c706f43df4fa434746362e746a39e779256e006deeb790c7
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
pkgconfig-libiconv.diff
|
||||
)
|
||||
|
||||
set(ENV{CFLAGS} "$ENV{CFLAGS} -Wno-error=implicit-function-declaration")
|
||||
vcpkg_libltdl_get_vars(LIBLTDL)
|
||||
set(ENV{LIBTOOLIZE} "${LIBLTDL_LIBTOOLIZE}")
|
||||
|
||||
if(VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_LINUX)
|
||||
list(APPEND OPTIONS --with-included-ltdl)
|
||||
endif()
|
||||
|
||||
vcpkg_configure_make(
|
||||
vcpkg_make_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
AUTOCONFIG
|
||||
COPY_SOURCE
|
||||
OPTIONS ${OPTIONS}
|
||||
AUTORECONF
|
||||
OPTIONS_RELEASE
|
||||
${LIBLTDL_OPTIONS_RELEASE}
|
||||
OPTIONS_DEBUG
|
||||
${LIBLTDL_OPTIONS_DEBUG}
|
||||
)
|
||||
|
||||
vcpkg_install_make()
|
||||
|
||||
vcpkg_make_install()
|
||||
vcpkg_copy_pdbs()
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
if (VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
|
||||
endif ()
|
||||
|
||||
file(REMOVE_RECURSE
|
||||
"${CURRENT_PACKAGES_DIR}/debug/include"
|
||||
"${CURRENT_PACKAGES_DIR}/debug/share"
|
||||
"${CURRENT_PACKAGES_DIR}/debug/etc"
|
||||
"${CURRENT_PACKAGES_DIR}/etc"
|
||||
"${CURRENT_PACKAGES_DIR}/share/man"
|
||||
"${CURRENT_PACKAGES_DIR}/share/${PORT}/man1"
|
||||
"${CURRENT_PACKAGES_DIR}/share/${PORT}/man5"
|
||||
"${CURRENT_PACKAGES_DIR}/share/${PORT}/man7"
|
||||
"${CURRENT_PACKAGES_DIR}/debug/etc"
|
||||
"${CURRENT_PACKAGES_DIR}/debug/include"
|
||||
"${CURRENT_PACKAGES_DIR}/debug/share"
|
||||
"${CURRENT_PACKAGES_DIR}/etc"
|
||||
"${CURRENT_PACKAGES_DIR}/share/${PORT}/man1"
|
||||
"${CURRENT_PACKAGES_DIR}/share/${PORT}/man5"
|
||||
"${CURRENT_PACKAGES_DIR}/share/${PORT}/man7"
|
||||
)
|
||||
|
||||
foreach(FILE config.h unixodbc_conf.h)
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/unixODBC/${FILE}" "#define BIN_PREFIX \"${CURRENT_INSTALLED_DIR}/tools/unixodbc/bin\"" "")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/unixODBC/${FILE}" "#define DEFLIB_PATH \"${CURRENT_INSTALLED_DIR}/lib\"" "")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/unixODBC/${FILE}" "#define EXEC_PREFIX \"${CURRENT_INSTALLED_DIR}\"" "")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/unixODBC/${FILE}" "#define INCLUDE_PREFIX \"${CURRENT_INSTALLED_DIR}/include\"" "")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/unixODBC/${FILE}" "#define LIB_PREFIX \"${CURRENT_INSTALLED_DIR}/lib\"" "")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/unixODBC/${FILE}" "#define PREFIX \"${CURRENT_INSTALLED_DIR}\"" "")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/unixODBC/${FILE}" "#define SYSTEM_FILE_PATH \"${CURRENT_INSTALLED_DIR}/etc\"" "")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/unixODBC/${FILE}" "#define SYSTEM_LIB_PATH \"${CURRENT_INSTALLED_DIR}/lib\"" "")
|
||||
endforeach()
|
||||
|
||||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/unixodbcConfig.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/unixODBC/unixodbc_conf.h" "#define BIN_PREFIX \"${CURRENT_INSTALLED_DIR}/tools/unixodbc/bin\"" "/* redacted */")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/unixODBC/unixodbc_conf.h" "#define DEFLIB_PATH \"${CURRENT_INSTALLED_DIR}/lib\"" "/* redacted */")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/unixODBC/unixodbc_conf.h" "#define EXEC_PREFIX \"${CURRENT_INSTALLED_DIR}\"" "/* redacted */")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/unixODBC/unixodbc_conf.h" "#define INCLUDE_PREFIX \"${CURRENT_INSTALLED_DIR}/include\"" "/* redacted */")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/unixODBC/unixodbc_conf.h" "#define LIB_PREFIX \"${CURRENT_INSTALLED_DIR}/lib\"" "/* redacted */")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/unixODBC/unixodbc_conf.h" "#define PREFIX \"${CURRENT_INSTALLED_DIR}\"" "/* redacted */")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/unixODBC/unixodbc_conf.h" "#define SYSTEM_FILE_PATH \"${CURRENT_INSTALLED_DIR}/etc\"" "/* redacted */")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/unixODBC/unixodbc_conf.h" "#define SYSTEM_LIB_PATH \"${CURRENT_INSTALLED_DIR}/lib\"" "/* redacted */")
|
||||
|
||||
configure_file("${CMAKE_CURRENT_LIST_DIR}/unofficial-unixodbc-config.cmake" "${CURRENT_PACKAGES_DIR}/share/unofficial-unixodbc/unofficial-unixodbc-config.cmake" @ONLY)
|
||||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/unixodbcConfig.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") # legacy
|
||||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
|
||||
vcpkg_install_copyright(
|
||||
COMMENT
|
||||
"All libraries are LGPL Version 2.1. All programs are GPL Version 2.0."
|
||||
FILE_LIST
|
||||
"${SOURCE_PATH}/COPYING"
|
||||
"${SOURCE_PATH}/exe/COPYING"
|
||||
)
|
||||
|
||||
@@ -1,31 +1,7 @@
|
||||
function(set_library_target NAMESPACE LIB_NAME DEBUG_DIR RELEASE_DIR INCLUDE_DIR)
|
||||
add_library(${NAMESPACE}::${LIB_NAME} STATIC IMPORTED)
|
||||
|
||||
find_library (RELEASE_LIB_FILE_NAME NAMES "lib${LIB_NAME}.a" PATHS ${RELEASE_DIR} NO_DEFAULT_PATH)
|
||||
if (RELEASE_LIB_FILE_NAME)
|
||||
set(LIBODBC_USE_STATIC_LIB true)
|
||||
endif()
|
||||
find_library (RELEASE_LIB_FILE_NAME NAMES ${LIB_NAME} PATHS ${RELEASE_DIR} NO_DEFAULT_PATH)
|
||||
find_library (DEBUG_LIB_FILE_NAME NAMES "lib${LIB_NAME}.a" PATHS ${DEBUG_DIR} NO_DEFAULT_PATH)
|
||||
if (DEBUG_LIB_FILE_NAME)
|
||||
set(LIBODBC_USE_STATIC_LIB true)
|
||||
endif()
|
||||
find_library (DEBUG_LIB_FILE_NAME NAMES ${LIB_NAME} PATHS ${DEBUG_DIR} NO_DEFAULT_PATH)
|
||||
set_target_properties(${NAMESPACE}::${LIB_NAME} PROPERTIES
|
||||
IMPORTED_CONFIGURATIONS "RELEASE;DEBUG"
|
||||
IMPORTED_LOCATION_RELEASE "${RELEASE_LIB_FILE_NAME}"
|
||||
IMPORTED_LOCATION_DEBUG "${DEBUG_LIB_FILE_NAME}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${INCLUDE_DIR}"
|
||||
)
|
||||
if(LIBODBC_USE_STATIC_LIB)
|
||||
find_package(Iconv MODULE)
|
||||
set_property(TARGET ${NAMESPACE}::${LIB_NAME} PROPERTY INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS} Iconv::Iconv)
|
||||
endif()
|
||||
set(${NAMESPACE}_${LIB_NAME}_FOUND 1)
|
||||
endfunction()
|
||||
|
||||
get_filename_component(ROOT "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
get_filename_component(ROOT "${ROOT}" PATH)
|
||||
get_filename_component(ROOT "${ROOT}" PATH)
|
||||
|
||||
set_library_target("UNIX" "odbc" "${ROOT}/debug/lib/" "${ROOT}/lib/" "${ROOT}/include/")
|
||||
file(READ "${CMAKE_CURRENT_LIST_DIR}/usage" usage)
|
||||
message(WARNING "find_package(unixodbc) is deprecated.\n${usage}")
|
||||
include(CMakeFindDependencyMacro)
|
||||
find_dependency(unofficial-unixodbc CONFIG REQUIRED)
|
||||
if(NOT TARGET UNIX::odbc)
|
||||
add_library(#[[skip-usage-heuristics]] UNIX::odbc ALIAS unofficial::unixodbc::unixodbc)
|
||||
endif()
|
||||
|
||||
44
ports/unixodbc/unofficial-unixodbc-config.cmake
Normal file
44
ports/unixodbc/unofficial-unixodbc-config.cmake
Normal file
@@ -0,0 +1,44 @@
|
||||
if(NOT TARGET unofficial::unixodbc::unixodbc)
|
||||
if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static")
|
||||
include(CMakeFindDependencyMacro)
|
||||
find_dependency(Iconv)
|
||||
endif()
|
||||
|
||||
get_filename_component(z_unixodbc_root "${CMAKE_CURRENT_LIST_DIR}" PATH)
|
||||
get_filename_component(z_unixodbc_root "${z_unixodbc_root}" PATH)
|
||||
|
||||
find_library(UNIXODBC_LIBRARY_RELEASE NAMES "odbc" PATHS "${z_unixodbc_root}/lib" NO_DEFAULT_PATH REQUIRED)
|
||||
add_library(unofficial::unixodbc::unixodbc UNKNOWN IMPORTED)
|
||||
set_target_properties(unofficial::unixodbc::unixodbc PROPERTIES
|
||||
IMPORTED_CONFIGURATIONS RELEASE
|
||||
IMPORTED_LOCATION_RELEASE "${UNIXODBC_LIBRARY_RELEASE}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${z_unixodbc_root}/include"
|
||||
)
|
||||
find_library(UNIXODBC_LIBRARY_DEBUG NAMES "odbc" PATHS "${z_unixodbc_root}/debug/lib" NO_DEFAULT_PATH)
|
||||
if(UNIXODBC_LIBRARY_DEBUG)
|
||||
set_property(TARGET unofficial::unixodbc::unixodbc APPEND PROPERTY
|
||||
IMPORTED_CONFIGURATIONS DEBUG
|
||||
)
|
||||
set_target_properties(unofficial::unixodbc::unixodbc PROPERTIES
|
||||
IMPORTED_LOCATION_DEBUG "${UNIXODBC_LIBRARY_DEBUG}"
|
||||
)
|
||||
endif()
|
||||
mark_as_advanced(UNIXODBC_LIBRARY_RELEASE UNIXODBC_LIBRARY_DEBUG)
|
||||
|
||||
if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static")
|
||||
find_library(UNIXODBC_LTDL_LIBRARY_RELEASE NAMES "ltdl" PATHS "${z_unixodbc_root}/lib" NO_DEFAULT_PATH REQUIRED)
|
||||
find_library(UNIXODBC_LTDL_LIBRARY_DEBUG NAMES "ltdl" PATHS "${z_unixodbc_root}/debug/lib" NO_DEFAULT_PATH REQUIRED)
|
||||
mark_as_advanced(UNIXODBC_LTDL_LIBRARY_RELEASE UNIXODBC_LTDL_LIBRARY_DEBUG)
|
||||
if(UNIXODBC_LTDL_LIBRARY_DEBUG)
|
||||
set(z_unixodbc_ltdl "$<$<CONFIG:DEBUG>:${UNIXODBC_LTDL_LIBRARY_DEBUG}>;$<$<NOT:$<CONFIG:DEBUG>>:${UNIXODBC_LTDL_LIBRARY_RELEASE}>")
|
||||
else()
|
||||
set(z_unixodbc_ltdl "${UNIXODBC_LTDL_LIBRARY_RELEASE}")
|
||||
endif()
|
||||
set_target_properties(unofficial::unixodbc::unixodbc PROPERTIES
|
||||
INTERFACE_LINK_LIBRARIES "$<LINK_ONLY:Iconv::Iconv>;${z_unixodbc_ltdl};${CMAKE_DL_LIBS}"
|
||||
)
|
||||
unset(z_unixodbc_ltdl)
|
||||
endif()
|
||||
unset(z_unixodbc_root)
|
||||
endif()
|
||||
|
||||
@@ -1,4 +1,16 @@
|
||||
The package unixodbc is compatible with built-in CMake targets:
|
||||
unixodbc provides CMake targets:
|
||||
|
||||
find_package(unixodbc REQUIRED)
|
||||
target_link_libraries(main PRIVATE UNIX::odbc)
|
||||
# unixODBC Driver Manager library
|
||||
find_package(unofficial-unixodbc CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE (unofficial::unixodbc::odbc)
|
||||
|
||||
unixodbc provides pkg-config modules:
|
||||
|
||||
# unixODBC Driver Manager library
|
||||
odbc
|
||||
|
||||
# unixODBC Cursor Library
|
||||
odbccr
|
||||
|
||||
# unixODBC Configuration Library
|
||||
odbcinst
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
{
|
||||
"name": "unixodbc",
|
||||
"version": "2.3.11",
|
||||
"port-version": 2,
|
||||
"version": "2.3.12",
|
||||
"description": "unixODBC is an Open Source ODBC sub-system and an ODBC SDK for Linux, Mac OSX, and UNIX",
|
||||
"homepage": "https://github.com/lurcher/unixODBC",
|
||||
"license": "LGPL-2.1-only",
|
||||
"supports": "osx | linux"
|
||||
"license": null,
|
||||
"supports": "linux | osx",
|
||||
"dependencies": [
|
||||
"libltdl",
|
||||
{
|
||||
"name": "vcpkg-make",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
9
scripts/test_ports/vcpkg-ci-unixodbc/portfile.cmake
Normal file
9
scripts/test_ports/vcpkg-ci-unixodbc/portfile.cmake
Normal file
@@ -0,0 +1,9 @@
|
||||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
||||
|
||||
vcpkg_find_acquire_program(PKGCONFIG)
|
||||
set(ENV{PKG_CONFIG} "${PKGCONFIG}")
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${CURRENT_PORT_DIR}/project"
|
||||
)
|
||||
vcpkg_cmake_build()
|
||||
14
scripts/test_ports/vcpkg-ci-unixodbc/project/CMakeLists.txt
Normal file
14
scripts/test_ports/vcpkg-ci-unixodbc/project/CMakeLists.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
cmake_minimum_required(VERSION 3.30)
|
||||
project(unixodbc-test C)
|
||||
|
||||
# legacy vcpkg-only name, now forwarding to "unofficial" names
|
||||
find_package(unixodbc CONFIG REQUIRED)
|
||||
|
||||
add_executable(main main.c)
|
||||
target_link_libraries(main PRIVATE UNIX::odbc)
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(unixodbc_pc odbc REQUIRED IMPORTED_TARGET)
|
||||
|
||||
add_executable(main-pkconfig main.c)
|
||||
target_link_libraries(main-pkconfig PRIVATE PkgConfig::unixodbc_pc)
|
||||
27
scripts/test_ports/vcpkg-ci-unixodbc/project/main.c
Normal file
27
scripts/test_ports/vcpkg-ci-unixodbc/project/main.c
Normal file
@@ -0,0 +1,27 @@
|
||||
/* https://www.unixodbc.org/doc/ProgrammerManual/Tutorial/ has
|
||||
* #include <odbc/sql.h>
|
||||
* but actual pkgconfig files and MS ODBC documentation suggest
|
||||
* #include <sql.h>
|
||||
*/
|
||||
#include <sql.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
SQLHENV odbc_handle;
|
||||
long result = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &odbc_handle);
|
||||
if ((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO))
|
||||
return 1;
|
||||
|
||||
SQLCHAR l_dsn[100], l_desc[100];
|
||||
SQLUSMALLINT l_len1, l_len2, l_next;
|
||||
for (short int l_next = SQL_FETCH_FIRST;
|
||||
SQLDataSources(odbc_handle, l_next, l_dsn, sizeof(l_dsn), &l_len1, l_desc, sizeof(l_desc), &l_len2) == SQL_SUCCESS;
|
||||
l_next = SQL_FETCH_NEXT)
|
||||
{
|
||||
printf("Server '%s' (%s)\n", l_dsn, l_desc);
|
||||
}
|
||||
|
||||
SQLFreeHandle(SQL_HANDLE_ENV, odbc_handle);
|
||||
return 0;
|
||||
}
|
||||
14
scripts/test_ports/vcpkg-ci-unixodbc/vcpkg.json
Normal file
14
scripts/test_ports/vcpkg-ci-unixodbc/vcpkg.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "vcpkg-ci-unixodbc",
|
||||
"version-string": "ci",
|
||||
"description": "Test port for unixodbc usage",
|
||||
"homepage": "https://github.com/microsoft/vcpkg",
|
||||
"license": "MIT",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
"unixodbc"
|
||||
]
|
||||
}
|
||||
@@ -5028,6 +5028,10 @@
|
||||
"baseline": "3.3.2",
|
||||
"port-version": 1
|
||||
},
|
||||
"libltdl": {
|
||||
"baseline": "2.5.4",
|
||||
"port-version": 0
|
||||
},
|
||||
"liblttng-ust": {
|
||||
"baseline": "2.14.0-rc1",
|
||||
"port-version": 0
|
||||
@@ -9881,8 +9885,8 @@
|
||||
"port-version": 6
|
||||
},
|
||||
"unixodbc": {
|
||||
"baseline": "2.3.11",
|
||||
"port-version": 2
|
||||
"baseline": "2.3.12",
|
||||
"port-version": 0
|
||||
},
|
||||
"unleash-client-cpp": {
|
||||
"baseline": "1.3.0",
|
||||
|
||||
9
versions/l-/libltdl.json
Normal file
9
versions/l-/libltdl.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "2c97575fd1ac927693c5f780cdb4b3da22c25c2d",
|
||||
"version": "2.5.4",
|
||||
"port-version": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "9e0f6a67aa215869cbbf29cb2dbb409c713764da",
|
||||
"version": "2.3.12",
|
||||
"port-version": 0
|
||||
},
|
||||
{
|
||||
"git-tree": "29dd7a9c7a6649ace85fd2e695dc4613ba6cb13a",
|
||||
"version": "2.3.11",
|
||||
|
||||
Reference in New Issue
Block a user