Bug 192448 - databases/mysql-connector-odbc and DEFAULT_MYSQL_VER
Summary: databases/mysql-connector-odbc and DEFAULT_MYSQL_VER
Status: Closed Works As Intended
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Many People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-06 17:26 UTC by Pavel Timofeev
Modified: 2014-11-05 10:15 UTC (History)
1 user (show)

See Also:


Attachments
dont' use it (2.89 KB, text/plain)
2014-08-07 10:19 UTC, Pavel Timofeev
no flags Details
don't use it (3.37 KB, application/gzip)
2014-08-07 10:23 UTC, Pavel Timofeev
no flags Details
final diff to update port to 5.2.7 (3.21 KB, patch)
2014-08-09 06:25 UTC, Pavel Timofeev
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Timofeev 2014-08-06 17:26:45 UTC
databases/mysql-connector-odbc overwrites DEFAULT_MYSQL_VER, which is 55 at the momemt, to 51.
Should it do that? What for? It builds and works with 55.

Look:

# Created by: sergey@migsoft.com.ua
# $FreeBSD: head/databases/mysql-connector-odbc/Makefile 353029 2014-05-05 16:24:00Z bapt $

PORTNAME=       mysql-connector-odbc
PORTVERSION=    5.1.9
CATEGORIES=     databases
MASTER_SITES=   ${MASTER_SITE_MYSQL}
MASTER_SITE_SUBDIR=     Connector-ODBC/5.1
PKGNAMESUFFIX=  -${DRIVER_MANAGER}-mysql${MYSQL_VER}

MAINTAINER=     sergey@network-asp.biz
COMMENT=        ODBC driver for MySQL${MYSQL_VER} / ${DRIVER_MANAGER}

USE_LDCONFIG=   yes
USE_MYSQL=      yes
DEFAULT_MYSQL_VER=      51
USES=           cmake

PLIST_SUB=      VER=${PORTVERSION}

PORTDOCS=       ChangeLog INSTALL \
                README README.debug COPYING Licenses_for_Third-Party_Components.txt
......
Comment 1 John Marino freebsd_committer freebsd_triage 2014-08-06 21:03:23 UTC
Notify maintainer (in CC)
Comment 2 Pavel Timofeev 2014-08-07 07:10:20 UTC
And it would be extremely great if maintained updated this port to lastest 5.2.7 version.
Comment 3 Pavel Timofeev 2014-08-07 10:18:54 UTC
I have poor skills, but I've made a patch. I attached diff and whole ports dir, just in case.
Only files/patch-CMakeLists.txt and pkg-descr haven't been changed.

It passes stage and other stuff.



But it has one problem that I don't know how to fix. Please, help.
During build ld tries to find odbc libs in wrong place (in /usr/lib/, for example, which is supposed to be in /usr/local/lib). 
Here is output of make:
...
/usr/include/sys/timeb.h:42:2: warning: #warning "this file includes <sys/timeb.h> which is deprecated"
Linking C shared library ../lib/libmyodbc5w.so
/usr/bin/ld: cannot find -lodbcinst
*** [lib/libmyodbc5w.so] Error code 1
1 error
*** [driver/CMakeFiles/myodbc5w.dir/all] Error code 2
Linking C shared library ../lib/libmyodbc5a.so
/usr/bin/ld: cannot find -lodbcinst
*** [lib/libmyodbc5a.so] Error code 1
....


So as workaround I made sym links
# ln -s /usr/local/lib/libodbcinst.a /usr/lib/libodbcinst.a
# ln -s /usr/local/lib/libodbcinst.so.2 /usr/lib/libodbcinst.so
After that it passes make install and works!

Please, help to fix that.

P.S. I didn't try it with mariadb, but I think it works.
Comment 4 Pavel Timofeev 2014-08-07 10:19:38 UTC
Created attachment 145441 [details]
dont' use it
Comment 5 Pavel Timofeev 2014-08-07 10:23:59 UTC
Created attachment 145442 [details]
don't use it
Comment 6 Pavel Timofeev 2014-08-08 20:08:15 UTC
> But it has one problem that I don't know how to fix. Please, help.
> During build ld tries to find odbc libs in wrong place (in /usr/lib/, for  example, which is supposed to be in /usr/local/lib). 

Yea, I found how to fix that.
Download provided patch file, patch and after that add this line to patched Makefile:

LDFLAGS+=      -L${LOCALBASE}/lib


That's all!
Comment 7 Pavel Timofeev 2014-08-09 06:25:08 UTC
Created attachment 145547 [details]
final diff to update port to 5.2.7

That's final version of patch. There is no force mysql version settting and it update port to lastest version.
Builds from ports and in poudriere without any problems.

P.S. it still needs to be checked with mariadb.
Comment 8 Pavel Timofeev 2014-08-25 12:23:48 UTC
Please, commit it
Comment 9 Pavel Timofeev 2014-09-04 06:30:36 UTC
Comment on attachment 145547 [details]
final diff to update port to 5.2.7

It turned out that it compiles normally, but then it's unusable. Sorry for the noise!
I return this PR to first request: should it use DEFAULT_MYSQL_VER in existing port.
Comment 10 Pavel Timofeev 2014-09-04 06:47:34 UTC
Returning to the need of "DEFAULT_MYSQL_VER=51" in Makefile.
I made some checks with existing port (5.1.9) under FreeBSD 10.0-p7 amd64.
Tried to comment "DEFAULT_MYSQL_VER=51" in Makefile, then compiled it with various mysql clients from ports. Made some queries to DBs for tests.
databases/mysql51-client - no problems.
databases/mysql55-client - no problems.
databases/mysql56-client - no problems.
databases/mariadb-client - this version of mariadb doesn't compile under FreeBSD 10, so I couldn't check it.
databases/mariadb55-client - almost no problems. Compiles only if files/patch-driver__execute.c is removed from mysql-connector-odbc port folder. Works.
Comment 11 Pavel Timofeev 2014-11-05 10:15:24 UTC
I'll create new PR for this a bit later. So close it for now.