lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] svn commit: r1311230 - in /lucy/trunk: clownfish/perl/lib/Clownfish/CFC/Perl/Build.pm perl/buildlib/Lucy/Build.pm
Date Mon, 09 Apr 2012 13:41:48 GMT
Author: nwellnhof
Date: Mon Apr  9 13:41:48 2012
New Revision: 1311230

URL: http://svn.apache.org/viewvc?rev=1311230&view=rev
Log:
LUCY-215 Rework installation of Clownfish includes

Install Clownfish includes using a new Module::Build action. Also install
XSBind.h and Lucy/Util/ToolSet.h with Lucy.

Modified:
    lucy/trunk/clownfish/perl/lib/Clownfish/CFC/Perl/Build.pm
    lucy/trunk/perl/buildlib/Lucy/Build.pm

Modified: lucy/trunk/clownfish/perl/lib/Clownfish/CFC/Perl/Build.pm
URL: http://svn.apache.org/viewvc/lucy/trunk/clownfish/perl/lib/Clownfish/CFC/Perl/Build.pm?rev=1311230&r1=1311229&r2=1311230&view=diff
==============================================================================
--- lucy/trunk/clownfish/perl/lib/Clownfish/CFC/Perl/Build.pm (original)
+++ lucy/trunk/clownfish/perl/lib/Clownfish/CFC/Perl/Build.pm Mon Apr  9 13:41:48 2012
@@ -102,6 +102,18 @@ END_AUTOGEN
     return $self;
 }
 
+sub ACTION_copy_clownfish_includes {
+    my $self = shift;
+    # Copy .cfh files to blib/arch/Clownfish/_include
+    my $cfh_filepaths = $self->rscan_dir( $CORE_SOURCE_DIR, qr/\.cfh$/ );
+    my $inc_dir = catdir( $self->blib, 'arch', 'Clownfish', '_include' );
+    for my $file (@$cfh_filepaths) {
+        my $rel  = abs2rel( $file, $CORE_SOURCE_DIR );
+        my $dest = catfile( $inc_dir, $rel );
+        $self->copy_if_modified( from => $file, to => $dest );
+    }
+}
+
 sub _compile_clownfish {
     my $self = shift;
 
@@ -208,14 +220,6 @@ sub ACTION_clownfish {
         $perl_binding->write_boot;
         $perl_binding->write_bindings;
         $self->_write_pod($perl_binding);
-
-        # Copy .cfh files to blib/arch/Clownfish/_include
-        my $inc_dir = catdir( $self->blib, 'arch', 'Clownfish', '_include' );
-        for my $file (@$cfh_filepaths) {
-            my $rel  = abs2rel( $file, $CORE_SOURCE_DIR );
-            my $dest = catfile( $inc_dir, $rel );
-            $self->copy_if_modified( from => $file, to => $dest, );
-        }
     }
 
     # Touch autogenerated files in case the modifications were inconsequential
@@ -383,6 +387,7 @@ sub ACTION_code {
 
     $self->dispatch('clownfish');
     $self->dispatch('compile_custom_xs');
+    $self->dispatch('copy_clownfish_includes');
 
     $self->SUPER::ACTION_code;
 }

Modified: lucy/trunk/perl/buildlib/Lucy/Build.pm
URL: http://svn.apache.org/viewvc/lucy/trunk/perl/buildlib/Lucy/Build.pm?rev=1311230&r1=1311229&r2=1311230&view=diff
==============================================================================
--- lucy/trunk/perl/buildlib/Lucy/Build.pm (original)
+++ lucy/trunk/perl/buildlib/Lucy/Build.pm Mon Apr  9 13:41:48 2012
@@ -180,10 +180,6 @@ sub ACTION_charmony {
     print join( " ", @command ), $/;
 
     system(@command) and die "Failed to write $CHARMONY_PATH: $!";
-
-    # Copy charmony.h to Clownfish include dir
-    my $inc_dir = catdir( $self->blib, 'arch', 'Clownfish', '_include' );
-    $self->copy_if_modified( from => $CHARMONY_PATH, to_dir => $inc_dir, );
 }
 
 # Build the charmonizer tests.
@@ -226,6 +222,35 @@ sub ACTION_cfc {
     chdir($old_dir);
 }
 
+sub ACTION_copy_clownfish_includes {
+    my $self = shift;
+
+    $self->dispatch('charmony');
+
+    $self->SUPER::ACTION_copy_clownfish_includes;
+
+    my $inc_dir = catdir( $self->blib, 'arch', 'Clownfish', '_include' );
+
+    # Install charmony.h
+    $self->copy_if_modified(
+        from => $CHARMONY_PATH,
+        to   => catfile( $inc_dir, 'charmony.h' ),
+    );
+
+    # Install Lucy/Util/ToolSet.h
+    my @toolset_h = qw( Lucy Util ToolSet.h );
+    $self->copy_if_modified(
+        from => catfile( $CORE_SOURCE_DIR, @toolset_h ),
+        to   => catfile( $inc_dir,         @toolset_h ),
+    );
+
+    # Install XSBind.h
+    $self->copy_if_modified(
+        from => catfile( $XS_SOURCE_DIR, 'XSBind.h' ),
+        to   => catfile( $inc_dir,       'XSBind.h' ),
+    );
+}
+
 sub ACTION_clownfish {
     my $self = shift;
 



Mime
View raw message