Skip to content
This repository has been archived by the owner on Sep 29, 2022. It is now read-only.

Commit

Permalink
freetds: Added (1.00.9)
Browse files Browse the repository at this point in the history
  • Loading branch information
mingwandroid committed Sep 6, 2016
1 parent 9727d1a commit 8d14c40
Show file tree
Hide file tree
Showing 5 changed files with 181 additions and 0 deletions.
78 changes: 78 additions & 0 deletions freetds/0001-CMake-install-targets.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
diff -urN freetds-1.00.9.orig/src/apps/CMakeLists.txt freetds-1.00.9/src/apps/CMakeLists.txt
--- freetds-1.00.9.orig/src/apps/CMakeLists.txt 2016-09-03 12:28:52.287102400 +0100
+++ freetds-1.00.9/src/apps/CMakeLists.txt 2016-09-03 12:29:12.049890000 +0100
@@ -15,3 +15,4 @@

add_executable(bsqlodbc bsqlodbc.c)
target_link_libraries(bsqlodbc tdsodbc replacements ${libs})
+install(TARGETS freebcp bsqldb defncopy datacopy bsqlodbc tsql RUNTIME DESTINATION bin)
diff -urN freetds-1.00.9.orig/src/ctlib/CMakeLists.txt freetds-1.00.9/src/ctlib/CMakeLists.txt
--- freetds-1.00.9.orig/src/ctlib/CMakeLists.txt 2016-09-03 12:28:52.177727100 +0100
+++ freetds-1.00.9/src/ctlib/CMakeLists.txt 2016-09-03 12:29:12.049890000 +0100
@@ -31,3 +31,4 @@
if(MINGW OR CYGWIN)
set_target_properties(ct PROPERTIES LINK_FLAGS "--static")
endif(MINGW OR CYGWIN)
+install(TARGETS ct-static ct ARCHIVE DESTINATION lib RUNTIME DESTINATION bin LIBRARY DESTINATION lib)
diff -urN freetds-1.00.9.orig/src/dblib/CMakeLists.txt freetds-1.00.9/src/dblib/CMakeLists.txt
--- freetds-1.00.9.orig/src/dblib/CMakeLists.txt 2016-09-03 12:28:52.208977500 +0100
+++ freetds-1.00.9/src/dblib/CMakeLists.txt 2016-09-03 12:40:16.285967900 +0100
@@ -1,8 +1,10 @@
add_subdirectory(unittests)

+set(static_lib_name sybdb)
if(WIN32)
add_definitions(-DDLL_EXPORT)
set(win_SRCS winmain.c dblib.def dbopen.c)
+ set(static_lib_name libsybdb)
endif()

# TODO add dbopen.c if necessary
@@ -12,10 +14,16 @@
)
target_link_libraries(sybdb tds replacements ${lib_NETWORK} ${lib_BASE})

-add_library(db-lib STATIC
+add_library(sybdb-static STATIC
dblib.c dbutil.c rpc.c bcp.c xact.c dbpivot.c buffering.h
)
-target_link_libraries(db-lib tds replacements ${lib_NETWORK} ${lib_BASE})
+
+# See http://www.cmake.org/Wiki/CMake_FAQ#How_do_I_make_my_shared_and_static_libraries_have_the_same_root_name.2C_but_different_suffixes.3F
+SET_TARGET_PROPERTIES(sybdb-static PROPERTIES OUTPUT_NAME ${static_lib_name})
+SET_TARGET_PROPERTIES(sybdb PROPERTIES CLEAN_DIRECT_OUTPUT 1)
+SET_TARGET_PROPERTIES(sybdb-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
+
+target_link_libraries(sybdb-static tds replacements ${lib_NETWORK} ${lib_BASE})

if(NOT WIN32)
set_target_properties(sybdb PROPERTIES SOVERSION "5.0.0")
@@ -24,3 +32,4 @@
if(MINGW OR CYGWIN)
set_target_properties(sybdb PROPERTIES LINK_FLAGS "--static")
endif(MINGW OR CYGWIN)
+install(TARGETS sybdb-static sybdb ARCHIVE DESTINATION lib RUNTIME DESTINATION bin LIBRARY DESTINATION lib)
diff -urN freetds-1.00.9.orig/src/odbc/CMakeLists.txt freetds-1.00.9/src/odbc/CMakeLists.txt
--- freetds-1.00.9.orig/src/odbc/CMakeLists.txt 2016-09-03 12:28:52.302726800 +0100
+++ freetds-1.00.9/src/odbc/CMakeLists.txt 2016-09-03 12:29:12.065516500 +0100
@@ -33,3 +33,4 @@
if(MINGW OR CYGWIN)
set_target_properties(tdsodbc PROPERTIES LINK_FLAGS "--static -Wl,--kill-at -Wl,--enable-stdcall-fixup")
endif(MINGW OR CYGWIN)
+install(TARGETS tdsodbc RUNTIME DESTINATION bin)
diff -urN freetds-1.00.9.orig/src/replacements/CMakeLists.txt freetds-1.00.9/src/replacements/CMakeLists.txt
--- freetds-1.00.9.orig/src/replacements/CMakeLists.txt 2016-05-18 21:02:15.000000000 +0100
+++ freetds-1.00.9/src/replacements/CMakeLists.txt 2016-09-04 18:26:46.790959400 +0100
@@ -26,3 +26,4 @@
endif()

add_subdirectory(unittests)
+install(TARGETS replacements ARCHIVE DESTINATION lib)
diff -urN freetds-1.00.9.orig/src/tds/CMakeLists.txt freetds-1.00.9/src/tds/CMakeLists.txt
--- freetds-1.00.9.orig/src/tds/CMakeLists.txt 2016-05-18 21:02:15.000000000 +0100
+++ freetds-1.00.9/src/tds/CMakeLists.txt 2016-09-04 18:26:12.322089000 +0100
@@ -47,3 +47,4 @@
if (NOT WIN32)
set_target_properties(tds PROPERTIES COMPILE_FLAGS -fPIC)
endif()
+install(TARGETS tds ARCHIVE DESTINATION lib)
36 changes: 36 additions & 0 deletions freetds/0002-CMake-install-headers.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
diff -urN freetds-1.00.9.orig/src/ctlib/CMakeLists.txt freetds-1.00.9/src/ctlib/CMakeLists.txt
--- freetds-1.00.9.orig/src/ctlib/CMakeLists.txt 2016-09-03 12:53:36.127162000 +0100
+++ freetds-1.00.9/src/ctlib/CMakeLists.txt 2016-09-03 13:12:32.584615800 +0100
@@ -22,6 +22,8 @@
SET_TARGET_PROPERTIES(ct PROPERTIES CLEAN_DIRECT_OUTPUT 1)
SET_TARGET_PROPERTIES(ct-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)

+set_target_properties(ct PROPERTIES PUBLIC_HEADER "../../include/bkpublic.h;../../include/cspublic.h;../../include/cstypes.h;../../include/ctpublic.h;${CMAKE_BINARY_DIR}/include/tds_sysdep_public.h")
+
target_link_libraries(ct-static tds replacements ${lib_NETWORK} ${lib_BASE})

if(NOT WIN32)
@@ -31,4 +33,4 @@
if(MINGW OR CYGWIN)
set_target_properties(ct PROPERTIES LINK_FLAGS "--static")
endif(MINGW OR CYGWIN)
-install(TARGETS ct-static ct ARCHIVE DESTINATION lib RUNTIME DESTINATION bin LIBRARY DESTINATION lib)
+install(TARGETS ct-static ct ARCHIVE DESTINATION lib RUNTIME DESTINATION bin LIBRARY DESTINATION lib PUBLIC_HEADER DESTINATION include)
diff -urN freetds-1.00.9.orig/src/dblib/CMakeLists.txt freetds-1.00.9/src/dblib/CMakeLists.txt
--- freetds-1.00.9.orig/src/dblib/CMakeLists.txt 2016-09-03 12:53:36.194162100 +0100
+++ freetds-1.00.9/src/dblib/CMakeLists.txt 2016-09-03 13:11:42.228405700 +0100
@@ -23,6 +23,8 @@
SET_TARGET_PROPERTIES(sybdb PROPERTIES CLEAN_DIRECT_OUTPUT 1)
SET_TARGET_PROPERTIES(sybdb-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)

+set_target_properties(sybdb PROPERTIES PUBLIC_HEADER "../../include/sqldb.h;../../include/sqlfront.h;../../include/sybdb.h;../../include/sybfront.h;../../include/syberror.h;../../include/odbcss.h")
+
target_link_libraries(sybdb-static tds replacements ${lib_NETWORK} ${lib_BASE})

if(NOT WIN32)
@@ -32,4 +34,4 @@
if(MINGW OR CYGWIN)
set_target_properties(sybdb PROPERTIES LINK_FLAGS "--static")
endif(MINGW OR CYGWIN)
-install(TARGETS sybdb-static sybdb ARCHIVE DESTINATION lib RUNTIME DESTINATION bin LIBRARY DESTINATION lib)
+install(TARGETS sybdb-static sybdb ARCHIVE DESTINATION lib RUNTIME DESTINATION bin LIBRARY DESTINATION lib PUBLIC_HEADER DESTINATION include)
14 changes: 14 additions & 0 deletions freetds/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
set CMAKE_GENERATOR=NMake Makefiles JOM
mkdir build
cd build

cmake -G "%CMAKE_GENERATOR%" ^
-DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
-DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
-DCMAKE_BUILD_TYPE=Release ^
-DBUILD_SHARED_LIBS=True ..
if errorlevel 1 exit 1

cmake --build . --config Release --target all
cmake --build . --config Release --target install
if errorlevel 1 exit 1
7 changes: 7 additions & 0 deletions freetds/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

set -e

./configure --prefix=${PREFIX}
make
make install -k || true
46 changes: 46 additions & 0 deletions freetds/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package:
name: freetds
version: 1.00.9

source:
url: ftp://ftp.freetds.org/pub/freetds/stable/freetds-1.00.9.tar.bz2
md5: 51e8941fbb537092e29c944e39c92f68
patches:
- 0001-CMake-install-targets.patch
- 0002-CMake-install-headers.patch

build:
features:
- vc9 [win and py27]
- vc10 [win and py34]
- vc14 [win and py35]

requirements:
build:
- openssl 1.0.*
- readline [not win]
- cmake [win]
- jom [win]
- vc 9 [win and py27]
- vc 10 [win and py34]
- vc 14 [win and py>34]
run:
- openssl 1.0.*
- readline [not win]
- vc 9 [win and py27]
- vc 10 [win and py34]
- vc 14 [win and py>34]

about:
home: http://www.freetds.org/index.html
license: GNU Library or Lesser General Public License (LGPL)
license_family: LGPL
summary: 'Natively talk to Microsoft SQL Server and Sybase databases'
description: |
FreeTDS is an open source implementation of the TDS (Tabular Data Stream)
protocol used by these databases for their own clients. It supports many
different flavors of the protocol and three APIs to access it.
Additionally FreeTDS works with other software such as Perl and PHP,
providing access from those languages as well.
doc_url: http://www.freetds.org/docs.html
dev_url: https://github.com/FreeTDS/freetds/

0 comments on commit 8d14c40

Please sign in to comment.