mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 12:53:59 +03:00
perlPackages.DBI: Stub out dbd_postamble for cross-compilation.
This commit is contained in:
parent
306d5cdf03
commit
dd6c926362
@ -186,7 +186,8 @@ for a module may (indirectly) import a native module. In that case,
|
|||||||
you will need to make a stub for that module that will satisfy the
|
you will need to make a stub for that module that will satisfy the
|
||||||
Makefile.PL and install it into
|
Makefile.PL and install it into
|
||||||
<filename>lib/perl5/site_perl/cross_perl/${perl.version}</filename>.
|
<filename>lib/perl5/site_perl/cross_perl/${perl.version}</filename>.
|
||||||
</para>
|
See the <varname>postInstall</varname> for <varname>DBI</varname> for
|
||||||
|
an example.</para>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
@ -3835,11 +3835,50 @@ let self = _self // overrides; _self = with self; {
|
|||||||
};
|
};
|
||||||
|
|
||||||
DBI = buildPerlPackage rec {
|
DBI = buildPerlPackage rec {
|
||||||
name = "DBI-1.636";
|
name = "DBI-${version}";
|
||||||
|
version = "1.6.36";
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "mirror://cpan/authors/id/T/TI/TIMB/${name}.tar.gz";
|
url = "mirror://cpan/authors/id/T/TI/TIMB/${name}.tar.gz";
|
||||||
sha256 = "8f7ddce97c04b4b7a000e65e5d05f679c964d62c8b02c94c1a7d815bb2dd676c";
|
sha256 = "8f7ddce97c04b4b7a000e65e5d05f679c964d62c8b02c94c1a7d815bb2dd676c";
|
||||||
};
|
};
|
||||||
|
postInstall = stdenv.lib.optionalString (perl ? crossVersion) ''
|
||||||
|
mkdir -p $out/lib/perl5/site_perl/cross_perl/${perl.version}/DBI
|
||||||
|
cat > $out/lib/perl5/site_perl/cross_perl/${perl.version}/DBI.pm <<EOF
|
||||||
|
package DBI;
|
||||||
|
BEGIN {
|
||||||
|
our \$VERSION = "$version";
|
||||||
|
}
|
||||||
|
1;
|
||||||
|
EOF
|
||||||
|
|
||||||
|
autodir=$(echo $out/lib/perl5/site_perl/${perl.version}/*/auto/DBI)
|
||||||
|
cat > $out/lib/perl5/site_perl/cross_perl/${perl.version}/DBI/DBD.pm <<EOF
|
||||||
|
package DBI::DBD;
|
||||||
|
use Exporter ();
|
||||||
|
use vars qw (@ISA @EXPORT);
|
||||||
|
@ISA = qw(Exporter);
|
||||||
|
@EXPORT = qw(dbd_postamble);
|
||||||
|
sub dbd_postamble {
|
||||||
|
return '
|
||||||
|
# --- This section was generated by DBI::DBD::dbd_postamble()
|
||||||
|
DBI_INSTARCH_DIR=$autodir
|
||||||
|
DBI_DRIVER_XST=$autodir/Driver.xst
|
||||||
|
|
||||||
|
# The main dependency (technically correct but probably not used)
|
||||||
|
\$(BASEEXT).c: \$(BASEEXT).xsi
|
||||||
|
|
||||||
|
# This dependency is needed since MakeMaker uses the .xs.o rule
|
||||||
|
\$(BASEEXT)\$(OBJ_EXT): \$(BASEEXT).xsi
|
||||||
|
|
||||||
|
\$(BASEEXT).xsi: \$(DBI_DRIVER_XST) $autodir/Driver_xst.h
|
||||||
|
\$(PERL) -p -e "s/~DRIVER~/\$(BASEEXT)/g" \$(DBI_DRIVER_XST) > \$(BASEEXT).xsi
|
||||||
|
|
||||||
|
# ---
|
||||||
|
';
|
||||||
|
}
|
||||||
|
1;
|
||||||
|
EOF
|
||||||
|
'';
|
||||||
meta = {
|
meta = {
|
||||||
homepage = http://dbi.perl.org/;
|
homepage = http://dbi.perl.org/;
|
||||||
description = "Database independent interface for Perl";
|
description = "Database independent interface for Perl";
|
||||||
|
Loading…
Reference in New Issue
Block a user