diff --git a/pkgs/development/perl-modules/DBD-SQLite/default.nix b/pkgs/development/perl-modules/DBD-SQLite/default.nix index 5631ec673e59..c2da549b0ac4 100644 --- a/pkgs/development/perl-modules/DBD-SQLite/default.nix +++ b/pkgs/development/perl-modules/DBD-SQLite/default.nix @@ -1,11 +1,11 @@ {fetchurl, buildPerlPackage, DBI, sqlite}: -buildPerlPackage { - name = "DBD-SQLite-1.14"; +buildPerlPackage rec { + name = "DBD-SQLite-1.25"; src = fetchurl { - url = mirror://cpan/authors/id/M/MS/MSERGEANT/DBD-SQLite-1.14.tar.gz; - sha256 = "01qd5xfx702chg3bv2k727kfdp84zy5xh31y6njvivkp78vrs624"; + url = "mirror://cpan/authors/id/A/AD/ADAMK/${name}.tar.gz"; + sha256 = "17dd09jhf2kk33rqlsg74c1sb049qabmyh857alqc9fhffd1yb43"; }; propagatedBuildInputs = [DBI]; @@ -13,11 +13,11 @@ buildPerlPackage { makeMakerFlags = "SQLITE_LOCATION=${sqlite}"; patches = [ - # Prevent segfaults in case of timeouts. - ./reset.patch + # Support building against our own sqlite. + ./external-sqlite.patch ]; # Disabled because the tests can randomly fail due to timeouts # (e.g. "database is locked(5) at dbdimp.c line 402 at t/07busy.t"). - doCheck = false; + #doCheck = false; } diff --git a/pkgs/development/perl-modules/DBD-SQLite/external-sqlite.patch b/pkgs/development/perl-modules/DBD-SQLite/external-sqlite.patch new file mode 100644 index 000000000000..61e2e0af912c --- /dev/null +++ b/pkgs/development/perl-modules/DBD-SQLite/external-sqlite.patch @@ -0,0 +1,39 @@ +diff -rc DBD-SQLite-1.25-orig/Makefile.PL DBD-SQLite-1.25/Makefile.PL +*** DBD-SQLite-1.25-orig/Makefile.PL 2009-04-23 12:12:04.000000000 +0200 +--- DBD-SQLite-1.25/Makefile.PL 2009-07-02 14:07:25.000000000 +0200 +*************** +*** 79,85 **** + # Let's find out the full story first, so we can make an informed + # decision to whether to do this. -- ADAMK + my ($force_local, $sqlite_base, $sqlite_lib, $sqlite_inc); +! if ( 0 ) { + require File::Spec; + if ( $sqlite_base = (grep(/SQLITE_LOCATION=.*/, @ARGV))[0] ) { + $sqlite_base =~ /=(.*)/; +--- 79,85 ---- + # Let's find out the full story first, so we can make an informed + # decision to whether to do this. -- ADAMK + my ($force_local, $sqlite_base, $sqlite_lib, $sqlite_inc); +! if ( 1 ) { + require File::Spec; + if ( $sqlite_base = (grep(/SQLITE_LOCATION=.*/, @ARGV))[0] ) { + $sqlite_base =~ /=(.*)/; +*************** +*** 141,148 **** + + # Use always the bundled one. + # XXX: ... and this message should be more informative. +! $force_local = 1; +! print "We're using the bundled sqlite library.\n" if $ENV{AUTOMATED_TESTING}; + + @ARGV = grep( ! /SQLITE_LOCATION|USE_LOCAL_SQLITE/, @ARGV ); + +--- 141,148 ---- + + # Use always the bundled one. + # XXX: ... and this message should be more informative. +! #$force_local = 1; +! #print "We're using the bundled sqlite library.\n" if $ENV{AUTOMATED_TESTING}; + + @ARGV = grep( ! /SQLITE_LOCATION|USE_LOCAL_SQLITE/, @ARGV ); + diff --git a/pkgs/development/perl-modules/DBD-SQLite/reset.patch b/pkgs/development/perl-modules/DBD-SQLite/reset.patch deleted file mode 100644 index af6a0b73796e..000000000000 --- a/pkgs/development/perl-modules/DBD-SQLite/reset.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff -rc DBD-SQLite-1.14-orig/dbdimp.c DBD-SQLite-1.14/dbdimp.c -*** DBD-SQLite-1.14-orig/dbdimp.c 2007-08-24 04:51:25.000000000 +0200 ---- DBD-SQLite-1.14/dbdimp.c 2008-11-10 18:31:53.000000000 +0100 -*************** -*** 398,405 **** - if (imp_sth->retval == SQLITE_ROW) { - continue; - } -! /* There are bug reports that say this should be sqlite3_reset() */ -! sqlite3_finalize(imp_sth->stmt); - sqlite_error(sth, (imp_xxh_t*)imp_sth, imp_sth->retval, (char*)sqlite3_errmsg(imp_dbh->db)); - return -5; - } ---- 398,404 ---- - if (imp_sth->retval == SQLITE_ROW) { - continue; - } -! sqlite3_reset(imp_sth->stmt); - sqlite_error(sth, (imp_xxh_t*)imp_sth, imp_sth->retval, (char*)sqlite3_errmsg(imp_dbh->db)); - return -5; - } -*************** -*** 418,425 **** - case SQLITE_DONE: DBIc_ACTIVE_on(imp_sth); - sqlite_trace(5, "exec ok - %d rows, %d cols\n", imp_sth->nrow, DBIc_NUM_FIELDS(imp_sth)); - return 0; -! /* There are bug reports that say this should be sqlite3_reset() */ -! default: sqlite3_finalize(imp_sth->stmt); - sqlite_error(sth, (imp_xxh_t*)imp_sth, imp_sth->retval, (char*)sqlite3_errmsg(imp_dbh->db)); - return -6; - } ---- 417,423 ---- - case SQLITE_DONE: DBIc_ACTIVE_on(imp_sth); - sqlite_trace(5, "exec ok - %d rows, %d cols\n", imp_sth->nrow, DBIc_NUM_FIELDS(imp_sth)); - return 0; -! default: sqlite3_reset(imp_sth->stmt); - sqlite_error(sth, (imp_xxh_t*)imp_sth, imp_sth->retval, (char*)sqlite3_errmsg(imp_dbh->db)); - return -6; - } -Only in DBD-SQLite-1.14/: dbdimp.c~