1{ stdenv, fetchurl, buildPerlPackage, DBI, sqlite }:
2
3buildPerlPackage rec {
4 name = "DBD-SQLite-${version}";
5 version = "1.55_07";
6
7 src = fetchurl {
8 url = "https://github.com/DBD-SQLite/DBD-SQLite/archive/${version}.tar.gz";
9 sha256 = "0213a31eb7b5afc2d7b3775ca2d1717d07fc7e9ed21ae73b2513a8d54ca222d8";
10 };
11
12 propagatedBuildInputs = [ DBI ];
13 buildInputs = [ sqlite ];
14
15 patches = [
16 # Support building against our own sqlite.
17 ./external-sqlite.patch
18 ];
19
20 makeMakerFlags = "SQLITE_INC=${sqlite.dev}/include SQLITE_LIB=${sqlite.out}/lib";
21
22 preBuild =
23 ''
24 substituteInPlace Makefile --replace -L/usr/lib ""
25 '';
26
27 postInstall =
28 ''
29 # Prevent warnings from `strip'.
30 chmod -R u+w $out
31
32 # Get rid of a pointless copy of the SQLite sources.
33 rm -rf $out/lib/perl5/site_perl/*/*/auto/share
34 '';
35
36 # Disabled because the tests can randomly fail due to timeouts
37 # (e.g. "database is locked(5) at dbdimp.c line 402 at t/07busy.t").
38 #doCheck = false;
39
40 meta = with stdenv.lib; {
41 description = "Self Contained SQLite RDBMS in a DBI Driver";
42 license = with licenses; [ artistic1 gpl1Plus ];
43 platforms = platforms.unix;
44 };
45}