Re: ActivePerl on OS X: ppm not working, no DBD::mysql PPM available

Mark Dootson <[email protected]> Tue, 16 Oct 2012 23:00:39 +0100
Newsgroups gmane.comp.lang.perl.active-perl
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------000409070707000906080708
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

I uploaded PPM's for DBD::mysql 4.022 to the repository at 
http://www.wxperl.co.uk/repository

I already had the builds setup for Citrus Perl so it was not so big a 
task to build for ActivePerl.

PPM's available for Perl 5.12, 5.14, 5.16


The trick if you wish to build yourself in future is, for example, for 
an x86_64 / i386 fat binary:

Download and extract the mysql c connector for MacOSX 10.5 x86_64

in the lib directory, delete all the files and links except libmysqlclient.a

Rename libmysqlclient.a to libmysqlclient64.a

Download and extract the mysql C connector for MacOSX 10.5 i386

copy the libmysqlclient.a file from here to the lib folder of your 
x86_64 extract.

Rename this file libmysqlclient32.a

Change to the x86_64 lib directory in a terminal and lipo the two files 
together:

lipo -create libmysqlclient32.a libmysqlclient64.a -output libmysqlclient.a

You can then build with

perl Makefile.PL  --cflags=-I/path/to/mysqlconnector/include \
   --testdb='sometestdb' \
   --testhost='mysql.test.server' \
   --testport='3306' \
   --testuser='yourname' \
   --testpassword='yourpassword' \
   --mysql_config='/path/to/mysqlconnector/bin/mysql_config' \
   --libs='-L/path/to/mysqlconnector/lib -lmysqlclient'


For a ppc + i386 binary ( ActviePerl 5.12 and below ) download the mysql 
connector packages for 10.4 ppc and 10.4 i386 and repeat the procedure 
above.

I also used the attached patch in my build that I think I originally 
sourced from this list ( or a post here lead me to it)?


Hope it helps.


Mark



On 04/10/2012 08:53, Michiel Beijen wrote:
> Hi, I just installed ActivePerl on OS X. When I set the PATH correctly
> and I started PPM; I saw a screen flash briefly and then crash. PPM on
> the command line works though.
>
> Also, there seems to be no PPM package for DBD-mysql on OS X
> available; even though DBD-mysql is, according to the PPM site, the
> most popular PPM package.
>
> http://code.activestate.com/ppm/DBD-mysql/
>
> I think I'll uninstall and use CitrusPerl instead, for now.
> --
> Mike
> _______________________________________________
> ActivePerl mailing list
> [email protected]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>


--------------000409070707000906080708
Content-Type: text/plain;
 name="mysql4022.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="mysql4022.patch"

diff -ruNw DBD-mysql-4.022/dbdimp.c DBD-mysql-4.022-wcopy/dbdimp.c
--- DBD-mysql-4.022/dbdimp.c	2012-08-28 18:51:00.000000000 +0100
+++ DBD-mysql-4.022-wcopy/dbdimp.c	2012-10-12 06:05:02.628779500 +0100
@@ -3253,6 +3253,7 @@
       }
 #if MYSQL_ASYNC
   }
+#endif
   Safefree(salloc);
 
   if(rows == -2) {
@@ -3260,9 +3261,9 @@
              mysql_sqlstate(svsock));
     if (DBIc_TRACE_LEVEL(imp_xxh) >= 2)
       PerlIO_printf(DBIc_LOGPIO(imp_xxh), "IGNORING ERROR errno %d\n", errno);
-    rows = -2;
+ 
   }
-#endif
+
   return(rows);
 }
 
@@ -3840,6 +3841,7 @@
         default:
           if (DBIc_TRACE_LEVEL(imp_xxh) >= 2)
             PerlIO_printf(DBIc_LOGPIO(imp_xxh), "\t\tERROR IN st_fetch_string");
+          {
           STRLEN len= fbh->length;
 	/* ChopBlanks */
           if (ChopBlanks)
@@ -3856,6 +3858,7 @@
 	/* END OF ChopBlanks */
 
           sv_setpvn(sv, fbh->data, len);
+          }
 
 	/* UTF8 */
         /*HELMUT*/
@@ -3892,8 +3895,7 @@
     {
       PerlIO_printf(DBIc_LOGPIO(imp_xxh), "\tdbd_st_fetch result set details\n");
       PerlIO_printf(DBIc_LOGPIO(imp_xxh), "\timp_sth->result=%08lx\n",(long unsigned int) imp_sth->result);
-      PerlIO_printf(DBIc_LOGPIO(imp_xxh), "\tmysql_num_fields=%llu\n",
-                    (long long unsigned int) mysql_num_fields(imp_sth->result));
+      PerlIO_printf(DBIc_LOGPIO(imp_xxh), "\tmysql_num_fields=%u\n", mysql_num_fields(imp_sth->result));
       PerlIO_printf(DBIc_LOGPIO(imp_xxh), "\tmysql_num_rows=%llu\n",
                     mysql_num_rows(imp_sth->result));
       PerlIO_printf(DBIc_LOGPIO(imp_xxh), "\tmysql_affected_rows=%llu\n",

--------------000409070707000906080708
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--------------000409070707000906080708--