New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Changeset 81609


Ignore:
Timestamp:
08/02/11 17:21:12 (4 years ago)
Author:
dports@…
Message:

cpan2port: add build_requires dependencies as depends_build, and set
perl5.use_module_build the module has a Build.PL instead of Makefile.PL

File:
1 edited

Legend:

Unmodified
Added
Removed
  • contrib/cpan2port/cpan2port

    r81457 r81609  
    119119    my $dist = find_dist( $info->{dist_dir}, $info->{module}->get ) 
    120120        or die "can't find dist"; 
     121    $$info{has_makefile_pl} = (-e "$dist/Makefile.PL"); 
     122    $$info{has_build_pl} = (-e "$dist/Build.PL"); 
    121123    $$info{depends} = ( 
    122124        -e "$dist/META.yml" 
     
    219221    my $depends = ''; 
    220222    my $build_depends = ''; 
     223    my $use_module_build = ''; 
     224     
    221225    if ( exists $$info{depends} ) { 
    222226         if ( my $check =  $$info{checksums} ) { 
    223227             my @hashes; 
    224228             foreach my $key (keys %{ $check }) { push @hashes, "$key ".$$check{$key}; } 
    225              $checksums = 'checksums   '.join(" \\\n".(' 'x12),@hashes); 
     229             $checksums = 'checksums           '.join(" \\\n".(' 'x20),@hashes); 
    226230         } 
    227231 
     
    234238                 $depends = 'depends_lib-append  '.join(" \\\n".(' 'x20),@depends); 
    235239             } 
    236  
    237240         } 
     241         if ( my $dep_ref = Huggy::depends_on($info, during=>"build_requires") ) { 
     242             my @depends = map { 
     243                 MSG::warn "$$info{name} build_requires $_"; 
     244                 'port:'.Huggy::from_port $_ 
     245             } keys %{ $dep_ref }; 
     246             if (@depends) { 
     247                 $build_depends = 'depends_build-append '.join(" \\\n".(' 'x21),@depends); 
     248             } 
     249 
     250         } 
     251    } 
     252 
     253    # If no Makefile.PL is present, maybe we need use_module_build? 
     254    if (!($$info{has_makefile_pl})) { 
     255        if ($$info{has_build_pl}) { 
     256            $use_module_build = "perl5.use_module_build"; 
     257        } else { 
     258            MSG::warn "Didn't find either Makefile.PL or Build.PL"; 
     259        } 
    238260    } 
    239261 
     
    274296$depends 
    275297$build_depends 
     298$use_module_build 
    276299STOP 
    277300 
Note: See TracChangeset for help on using the changeset viewer.