fix_enc2xs_path.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. diff -Nut Encode-JIS2K-0.03.orig/Makefile.PL Encode-JIS2K-0.03/Makefile.PL
  2. --- Encode-JIS2K-0.03.orig/Makefile.PL 2015-06-05 00:58:02.000000000 -0300
  3. +++ Encode-JIS2K-0.03/Makefile.PL 2016-01-03 18:58:25.861672309 -0300
  4. @@ -17,21 +17,14 @@
  5. );
  6. -# from perlvar
  7. -use Config; # first appeared in 5.00307
  8. -my $secure_perl_path = $Config{perlpath};
  9. -if ($^O ne 'VMS') {
  10. - my $secure_perl_path .= $Config{_exe}
  11. - unless $secure_perl_path =~ m/$Config{_exe}$/i;
  12. -}
  13. -die "can't determine path to the perl I'm running under"
  14. - unless ($secure_perl_path);
  15. -use File::Basename qw(dirname);
  16. -my $dpath = dirname $secure_perl_path;
  17. my ($enc2xs, $encode_h) = ();
  18. -my $enc2xs_fpath = File::Spec->catfile($dpath, 'enc2xs');
  19. -$enc2xs = $enc2xs_fpath
  20. - if (-x $enc2xs_fpath);
  21. +PATHLOOP:
  22. +for my $d (split /:/, $ENV{PATH}){
  23. + for my $f (qw/enc2xs enc2xs5.7.3/){
  24. + my $path = File::Spec->catfile($d, $f);
  25. + -x $path and $enc2xs = $path and last PATHLOOP;
  26. + }
  27. +}
  28. $enc2xs or die "enc2xs not found!";
  29. print "enc2xs is $enc2xs\n";
  30. my %encode_h = ();
  31. Common subdirectories: Encode-JIS2K-0.03.orig/lib and Encode-JIS2K-0.03/lib
  32. Common subdirectories: Encode-JIS2K-0.03.orig/t and Encode-JIS2K-0.03/t
  33. Common subdirectories: Encode-JIS2K-0.03.orig/ucm and Encode-JIS2K-0.03/ucm