Opened 15 years ago

Closed 15 years ago

#19425 closed submission (fixed)

Add libdbi port

Reported by: mtalexander (Mike Alexander) Owned by: nerdling (Jeremy Lavergne)
Priority: Normal Milestone:
Component: ports Version: 1.7.1
Keywords: Cc:
Port: libdbi-drivers

Description

I wanted to build GnuCash with the database backend which requires libdbi. I couldn't find a port for this so I created one. Actually I created two, one for libdbi and one for its drivers. The libdbi-drivers port has a variant for each of the drivers that I thought might be useful. The only one I've tested much is mysql.

Attachments (6)

Portfile (762 bytes) - added by mtalexander (Mike Alexander) 15 years ago.
libdbi Portfile
Portfile.2 (1.5 KB) - added by mtalexander (Mike Alexander) 15 years ago.
libdbi-drivers Portfile
Portfile.3 (1.6 KB) - added by mtalexander (Mike Alexander) 15 years ago.
Corrected libdbi-drivers Portfile
Portfile.4 (918 bytes) - added by mtalexander (Mike Alexander) 15 years ago.
libdbi Portfile which fixes endian bug on PPC machines
Portfile.5 (1.8 KB) - added by mtalexander (Mike Alexander) 15 years ago.
libdbi-drivers Portfile that works for mysql and postgresql
endian.patch (1.4 KB) - added by mtalexander (Mike Alexander) 15 years ago.
Corrected patch to fix endian problem in libdbi

Download all attachments as: .zip

Change History (17)

Changed 15 years ago by mtalexander (Mike Alexander)

Attachment: Portfile added

libdbi Portfile

Changed 15 years ago by mtalexander (Mike Alexander)

Attachment: Portfile.2 added

libdbi-drivers Portfile

comment:1 Changed 15 years ago by blb@…

Port: libdbi-drivers added

libdbi added in r50096, thanks; two changes made to the port:

  • removed :libdbi from master_sites since the port's name is the default
  • used obfuscated form of maintainers

libdbi-drivers needs some changes first:

  • don't hardcode /opt/local, use ${prefix} instead
  • the database variants will need to have a dependency on the proper database, and they should be named for the version to use; for example, instead of postgresql call it postgresql83 and add the following to it:
    depends_lib-append   port:postgresql83
    

then do the same for the other variants.

  • since building the port without any variants selected causes this to install nothing, which would causes issues and confusion, you should select a default if none is selected; I suggest sqlite3 since it's lightweight, so added the following:
    if {![variant_isset mysql5] && ![variant_isset postgresql83] && ![variant_isset sqlite] && ![variant_isset sqlite3]} {
       default_variants     +sqlite3
    }
    

Obviously add other variants you add if you want to also have support for other databases.

  • There is no port for msql currently, so that should be removed

Changed 15 years ago by mtalexander (Mike Alexander)

Attachment: Portfile.3 added

Corrected libdbi-drivers Portfile

comment:2 Changed 15 years ago by jmroot (Joshua Root)

Type: enhancementsubmission

comment:3 Changed 15 years ago by (none)

Milestone: Port Submissions

Milestone Port Submissions deleted

comment:4 in reply to:  1 Changed 15 years ago by mtalexander (Mike Alexander)

Replying to blb@…:

libdbi-drivers needs some changes first:

I submitted a new version of this port which I think fixed these problems, but it hasn't been committed yet. Are there further problems that I need to fix?

comment:5 Changed 15 years ago by blb@…

+sqlite3 looks good, but trying +postgresql83 appears to need to be told how to find the headers:

 /usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../../include -I/mp/include -I/mp/include -I/mp/include -O20 -D__NO_MATH_INLINES -fsigned-char -MT dbd_pgsql.lo -MD -MP -MF .deps/dbd_pgsql.Tpo -c dbd_pgsql.c  -fno-common -DPIC -o .libs/dbd_pgsql.o
dbd_pgsql.c:56:22: error: libpq-fe.h: No such file or directory
dbd_pgsql.c: In function '_dbd_real_connect':
dbd_pgsql.c:156: error: 'PGconn' undeclared (first use in this function)
dbd_pgsql.c:156: error: (Each undeclared identifier is reported only once
dbd_pgsql.c:156: error: for each function it appears in.)
dbd_pgsql.c:156: error: 'pgconn' undeclared (first use in this function)
dbd_pgsql.c:217: error: 'CONNECTION_BAD' undeclared (first use in this function)
...

Similar issue with +mysql5:

 /usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../../include -I/mp/include -I/mp/include -I/mp/include -O20 -D__NO_MATH_INLINES -fsigned-char -MT dbd_mysql.lo -MD -MP -MF .deps/dbd_mysql.Tpo -c dbd_mysql.c  -fno-common -DPIC -o .libs/dbd_mysql.o
dbd_mysql.c:54:25: error: mysql/mysql.h: No such file or directory
dbd_mysql.c:111: error: syntax error before '*' token
dbd_mysql.c: In function 'dbd_connect':
dbd_mysql.c:134: error: 'MYSQL' undeclared (first use in this function)
dbd_mysql.c:134: error: (Each undeclared identifier is reported only once
dbd_mysql.c:134: error: for each function it appears in.)
dbd_mysql.c:134: error: 'mycon' undeclared (first use in this function)
dbd_mysql.c:149: error: 'CLIENT_COMPRESS' undeclared (first use in this function)

Changed 15 years ago by mtalexander (Mike Alexander)

Attachment: Portfile.4 added

libdbi Portfile which fixes endian bug on PPC machines

Changed 15 years ago by mtalexander (Mike Alexander)

Attachment: Portfile.5 added

libdbi-drivers Portfile that works for mysql and postgresql

comment:6 in reply to:  5 Changed 15 years ago by mtalexander (Mike Alexander)

I just attached a new Portfile that I think fixes the libdbi-driver problems.

I also attached a new Portfile and associated patch file for libdbi since I discovered an endian bug in it today. I'm still running on a PPC machine and libdbi didn't return integer values correctly on that architecture.

Both of these new Portfiles have a +debug variant that builds the library with debug symbols. If you don't like that, you can remove it. I find it useful for finding problems like this one.

Changed 15 years ago by mtalexander (Mike Alexander)

Attachment: endian.patch added

Corrected patch to fix endian problem in libdbi

comment:7 Changed 15 years ago by mtalexander (Mike Alexander)

I just replaced the patch which fixes the endian problem in libdbi. The libdbi driver API supports 3 byte integers which are a rather unusual data type and my patch didn't handle them consistently with the rest of the code.

comment:8 Changed 15 years ago by blb@…

Resolution: fixed
Status: newclosed

libdbi updated in r52205, with a bump in revision since it modifies what is installed.

libdbi-drivers added in r52206, thanks.

comment:9 Changed 15 years ago by nerdling (Jeremy Lavergne)

Resolution: fixed
Status: closedreopened

Reopening to track the MySQL dependency's need to be fixed (should use path: instead of port:).

comment:10 Changed 15 years ago by nerdling (Jeremy Lavergne)

Owner: changed from macports-tickets@… to snc@…
Port: libdbi removed
Status: reopenednew

comment:11 in reply to:  9 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed

Replying to snc@…:

Reopening to track the MySQL dependency's need to be fixed (should use path: instead of port:).

Done in r52353.

Note: See TracTickets for help on using tickets.