From 90d5e87862fb1fea7e48159b6a50530a4bee9b62 Mon Sep 17 00:00:00 2001 From: Vladimír Čunát Date: Tue, 13 Oct 2015 22:30:30 +0200 Subject: sqlite: split dev and bin outputs --- .../perl-modules/DBD-SQLite/default.nix | 4 ++ .../perl-modules/DBD-SQLite/external-sqlite.patch | 72 ++++++++++------------ 2 files changed, 37 insertions(+), 39 deletions(-) (limited to 'pkgs/development/perl-modules/DBD-SQLite') diff --git a/pkgs/development/perl-modules/DBD-SQLite/default.nix b/pkgs/development/perl-modules/DBD-SQLite/default.nix index 985e7946b6b..13b633f4704 100644 --- a/pkgs/development/perl-modules/DBD-SQLite/default.nix +++ b/pkgs/development/perl-modules/DBD-SQLite/default.nix @@ -17,6 +17,10 @@ buildPerlPackage rec { ./external-sqlite.patch ]; + sqlite_dev = sqlite.dev; + sqlite_out = sqlite.out; + postPatch = "substituteAllInPlace Makefile.PL; cat Makefile.PL"; + preBuild = '' substituteInPlace Makefile --replace -L/usr/lib "" diff --git a/pkgs/development/perl-modules/DBD-SQLite/external-sqlite.patch b/pkgs/development/perl-modules/DBD-SQLite/external-sqlite.patch index 9a20fa25039..1f90546b252 100644 --- a/pkgs/development/perl-modules/DBD-SQLite/external-sqlite.patch +++ b/pkgs/development/perl-modules/DBD-SQLite/external-sqlite.patch @@ -1,39 +1,33 @@ -diff -rc DBD-SQLite-1.29/Makefile.PL DBD-SQLite-1.29-new/Makefile.PL -*** DBD-SQLite-1.29/Makefile.PL 2010-01-08 10:08:29.000000000 +0100 ---- DBD-SQLite-1.29-new/Makefile.PL 2010-08-05 11:42:53.000000000 +0200 -*************** -*** 123,129 **** - # a system sqlite is also sophisticated enough to have a patching system - # that can change the if ( 0 ) to if ( 1 ) - my ($sqlite_local, $sqlite_base, $sqlite_lib, $sqlite_inc); -! if ( 0 ) { - require File::Spec; - if ( $sqlite_base = (grep(/SQLITE_LOCATION=.*/, @ARGV))[0] ) { - $sqlite_base =~ /=(.*)/; ---- 123,129 ---- - # a system sqlite is also sophisticated enough to have a patching system - # that can change the if ( 0 ) to if ( 1 ) - my ($sqlite_local, $sqlite_base, $sqlite_lib, $sqlite_inc); -! if ( 1 ) { - require File::Spec; - if ( $sqlite_base = (grep(/SQLITE_LOCATION=.*/, @ARGV))[0] ) { - $sqlite_base =~ /=(.*)/; -*************** -*** 184,191 **** - } else { - # Always the bundled one. - # XXX: ... and this message should be more informative. -! $sqlite_local = 1; -! print "We're using the bundled sqlite library.\n" if $ENV{AUTOMATED_TESTING}; - } - - @ARGV = grep( ! /SQLITE_LOCATION|USE_LOCAL_SQLITE/, @ARGV ); ---- 184,191 ---- - } else { - # Always the bundled one. - # XXX: ... and this message should be more informative. -! # $sqlite_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/Makefile.PL b/Makefile.PL +index 606b28d..0cea060 100644 +--- a/Makefile.PL ++++ b/Makefile.PL +@@ -128,24 +128,10 @@ SCOPE: { + # the system SQLite. We expect that anyone sophisticated enough to use + # a system sqlite is also sophisticated enough to have a patching system + # that can change the if ( 0 ) to if ( 1 ) +-my ($sqlite_local, $sqlite_base, $sqlite_lib, $sqlite_inc); +-if ( 0 ) { +- require File::Spec; +- if ( $sqlite_base = (grep(/SQLITE_LOCATION=.*/, @ARGV))[0] ) { +- $sqlite_base =~ /=(.*)/; +- $sqlite_base = $1; +- $sqlite_lib = File::Spec->catdir( $sqlite_base, 'lib' ); +- $sqlite_inc = File::Spec->catdir( $sqlite_base, 'include' ); +- } +- if ( $sqlite_local = (grep(/USE_LOCAL_SQLITE=.*/, @ARGV))[0] ) { +- $sqlite_local =~ /=(.*)/; +- $sqlite_local = "$1" ? 1 : 0; +- if ( $sqlite_local ) { +- # Keep these from making into CFLAGS/LDFLAGS +- undef $sqlite_lib; +- undef $sqlite_inc; +- } +- } ++my ($sqlite_local, $sqlite_lib, $sqlite_inc); ++if ( 1 ) { ++ $sqlite_lib = '@sqlite_out@/lib'; ++ $sqlite_inc = '@sqlite_dev@/include'; + + # Now check for a compatible sqlite3 + unless ( $sqlite_local ) { -- cgit 1.4.1