diff --git a/packages/libiodbc/build.sh b/packages/libiodbc/build.sh new file mode 100644 index 000000000..909e6b47e --- /dev/null +++ b/packages/libiodbc/build.sh @@ -0,0 +1,12 @@ +TERMUX_PKG_HOMEPAGE=http://www.iodbc.org/ +TERMUX_PKG_DESCRIPTION="Independent Open DataBase Connectivity for Linux, MacOS X and Unix systems" +TERMUX_PKG_LICENSE="LGPL-2.0, BSD 3-Clause" +TERMUX_PKG_LICENSE_FILE="LICENSE, LICENSE.BSD, LICENSE.LGPL" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION=3.52.15 +TERMUX_PKG_SRCURL=https://github.com/openlink/iODBC/releases/download/v${TERMUX_PKG_VERSION}/libiodbc-${TERMUX_PKG_VERSION}.tar.gz +TERMUX_PKG_SHA256=c74541e3327fc9a1c7ccf103645471c67bc014542d70f572476eb07c0b2dd43c +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +--disable-libodbc +--with-layout=gnu +" diff --git a/packages/libiodbc/include-sqlext.h.patch b/packages/libiodbc/include-sqlext.h.patch new file mode 100644 index 000000000..6f7538094 --- /dev/null +++ b/packages/libiodbc/include-sqlext.h.patch @@ -0,0 +1,13 @@ +--- a/include/sqlext.h ++++ b/include/sqlext.h +@@ -476,8 +476,8 @@ + #define SQL_OPT_TRACE_FILE_DEFAULT "\\SQL.LOG" + #define SQL_OPT_TRACE_FILE_DEFAULTW L"\\SQL.LOG" + #else +-#define SQL_OPT_TRACE_FILE_DEFAULT "/tmp/odbc.log" +-#define SQL_OPT_TRACE_FILE_DEFAULTW L"/tmp/odbc.log" ++#define SQL_OPT_TRACE_FILE_DEFAULT "@TERMUX_PREFIX@/tmp/odbc.log" ++#define SQL_OPT_TRACE_FILE_DEFAULTW L"@TERMUX_PREFIX@/tmp/odbc.log" + #endif + + diff --git a/packages/libiodbc/iodbcinst-SQLInstallDriver.c.patch b/packages/libiodbc/iodbcinst-SQLInstallDriver.c.patch new file mode 100644 index 000000000..c821cee68 --- /dev/null +++ b/packages/libiodbc/iodbcinst-SQLInstallDriver.c.patch @@ -0,0 +1,24 @@ +--- a/iodbcinst/SQLInstallDriver.c ++++ b/iodbcinst/SQLInstallDriver.c +@@ -168,8 +168,8 @@ + STRNCPY (lpszPath, "/boot/beos/system/lib", cbPathMax - 1); + if (STRLEN (lpszPath) != STRLEN ("/boot/beos/system/lib")) + #else +- STRNCPY (lpszPath, "/usr/local/lib", cbPathMax - 1); +- if (STRLEN (lpszPath) != STRLEN ("/usr/local/lib")) ++ STRNCPY (lpszPath, "@TERMUX_PREFIX@/local/lib", cbPathMax - 1); ++ if (STRLEN (lpszPath) != STRLEN ("@TERMUX_PREFIX@/local/lib")) + #endif + { + PUSH_ERROR (ODBC_ERROR_INVALID_BUFF_LEN); +@@ -182,8 +182,8 @@ + STRNCPY (lpszPath, "/boot/home/config/lib", cbPathMax - 1); + if (STRLEN (lpszPath) != STRLEN ("/boot/home/config/lib")) + #else +- STRNCPY (lpszPath, "/usr/lib", cbPathMax - 1); +- if (STRLEN (lpszPath) != STRLEN ("/usr/lib")) ++ STRNCPY (lpszPath, "@TERMUX_PREFIX@/lib", cbPathMax - 1); ++ if (STRLEN (lpszPath) != STRLEN ("@TERMUX_PREFIX@/lib")) + #endif + { + PUSH_ERROR (ODBC_ERROR_INVALID_BUFF_LEN); diff --git a/packages/libiodbc/iodbcinst-SQLInstallDriverEx.c.patch b/packages/libiodbc/iodbcinst-SQLInstallDriverEx.c.patch new file mode 100644 index 000000000..c6305e6d7 --- /dev/null +++ b/packages/libiodbc/iodbcinst-SQLInstallDriverEx.c.patch @@ -0,0 +1,26 @@ +--- a/iodbcinst/SQLInstallDriverEx.c ++++ b/iodbcinst/SQLInstallDriverEx.c +@@ -155,9 +155,9 @@ + goto done; + } + #else +- if (access ("/usr/local/lib", R_OK | W_OK | X_OK) == 0) ++ if (access ("@TERMUX_PREFIX@/local/lib", R_OK | W_OK | X_OK) == 0) + { +- len = STRLEN ("/usr/local/lib"); ++ len = STRLEN ("@TERMUX_PREFIX@/local/lib"); + goto done; + } + #endif +@@ -169,9 +169,9 @@ + goto done; + } + #else +- if (access ("/usr/lib", R_OK | W_OK | X_OK) == 0) ++ if (access ("@TERMUX_PREFIX@/lib", R_OK | W_OK | X_OK) == 0) + { +- len = STRLEN ("/usr/lib"); ++ len = STRLEN ("@TERMUX_PREFIX@/lib"); + goto done; + } + #endif