aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/unixodbc
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/unixodbc
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/unixodbc')
-rw-r--r--vcpkg/ports/unixodbc/portfile.cmake55
-rw-r--r--vcpkg/ports/unixodbc/subdirs.diff12
-rw-r--r--vcpkg/ports/unixodbc/unixodbcConfig.cmake7
-rw-r--r--vcpkg/ports/unixodbc/unofficial-unixodbc-config.cmake44
-rw-r--r--vcpkg/ports/unixodbc/usage16
-rw-r--r--vcpkg/ports/unixodbc/vcpkg.json15
6 files changed, 149 insertions, 0 deletions
diff --git a/vcpkg/ports/unixodbc/portfile.cmake b/vcpkg/ports/unixodbc/portfile.cmake
new file mode 100644
index 0000000..094a0c9
--- /dev/null
+++ b/vcpkg/ports/unixodbc/portfile.cmake
@@ -0,0 +1,55 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO lurcher/unixODBC
+ REF v${VERSION}
+ SHA512 c70c1eff4bf2f34a968bd8007dc02260d1f583d6295deccde9a2c22b2592e6daed4ee3ef40b0b3445c09444a7d08d128a854b56502675fa3e6d2f908a9b1bcdb
+ HEAD_REF master
+ PATCHES
+ subdirs.diff
+)
+
+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_DEBUG}
+)
+vcpkg_make_install()
+vcpkg_copy_pdbs()
+vcpkg_fixup_pkgconfig()
+
+file(REMOVE_RECURSE
+ "${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"
+)
+
+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"
+)
diff --git a/vcpkg/ports/unixodbc/subdirs.diff b/vcpkg/ports/unixodbc/subdirs.diff
new file mode 100644
index 0000000..357696f
--- /dev/null
+++ b/vcpkg/ports/unixodbc/subdirs.diff
@@ -0,0 +1,12 @@
+diff --git a/Makefile.am b/Makefile.am
+index 76d0b3a..19a88d5 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -11,7 +11,6 @@ SUBDIRS = \
+ log \
+ lst \
+ ini \
+- libltdl \
+ odbcinst \
+ DriverManager \
+ exe \
diff --git a/vcpkg/ports/unixodbc/unixodbcConfig.cmake b/vcpkg/ports/unixodbc/unixodbcConfig.cmake
new file mode 100644
index 0000000..0ed62e1
--- /dev/null
+++ b/vcpkg/ports/unixodbc/unixodbcConfig.cmake
@@ -0,0 +1,7 @@
+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()
diff --git a/vcpkg/ports/unixodbc/unofficial-unixodbc-config.cmake b/vcpkg/ports/unixodbc/unofficial-unixodbc-config.cmake
new file mode 100644
index 0000000..d78764f
--- /dev/null
+++ b/vcpkg/ports/unixodbc/unofficial-unixodbc-config.cmake
@@ -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()
+
diff --git a/vcpkg/ports/unixodbc/usage b/vcpkg/ports/unixodbc/usage
new file mode 100644
index 0000000..50f8e47
--- /dev/null
+++ b/vcpkg/ports/unixodbc/usage
@@ -0,0 +1,16 @@
+unixodbc provides CMake targets:
+
+ # 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
diff --git a/vcpkg/ports/unixodbc/vcpkg.json b/vcpkg/ports/unixodbc/vcpkg.json
new file mode 100644
index 0000000..bdae268
--- /dev/null
+++ b/vcpkg/ports/unixodbc/vcpkg.json
@@ -0,0 +1,15 @@
+{
+ "name": "unixodbc",
+ "version": "2.3.14",
+ "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": null,
+ "supports": "linux | osx",
+ "dependencies": [
+ "libltdl",
+ {
+ "name": "vcpkg-make",
+ "host": true
+ }
+ ]
+}