|
| 1 | +use alienfile; |
| 2 | + |
| 3 | +# check if installed as system package on Linux |
| 4 | +#plugin 'PkgConfig' => 'libonig5'; |
| 5 | + |
| 6 | +# verify it is GNU make |
| 7 | +#plugin 'Probe::CommandLine' => ( |
| 8 | +# command => $_, |
| 9 | +# args => [ '--version' ], |
| 10 | +# match => qr/GNU Make/o, |
| 11 | +#) for qw/gmake make/; |
| 12 | + |
| 13 | +# download utility available |
| 14 | +plugin 'Probe::CommandLine' => ( |
| 15 | + command => 'curl', |
| 16 | +); |
| 17 | +plugin 'Probe::CommandLine' => ( |
| 18 | + command => 'wget', |
| 19 | + secondary => 1, |
| 20 | +); |
| 21 | + |
| 22 | +share { |
| 23 | + #start_url 'https://github.com/kkos/oniguruma/releases/'; |
| 24 | + start_url 'https://hub.fastgit.org/kkos/oniguruma/releases/'; |
| 25 | + plugin Download => ( |
| 26 | + version => qr/^onig-([0-9\.]+)\.tar\.gz$/o, |
| 27 | + ); |
| 28 | + plugin Extract => 'tar.gz'; |
| 29 | + if ($^O eq 'MSWin32') { |
| 30 | + # #meta->prop->{env_interpolate} = 1; |
| 31 | + # #meta->prop->{env}->{ONIG_DIR} = '%{.install.extract}\\src'; |
| 32 | + # #meta->prop->{env}->{BUILD_DIR} = '%{.install.extract}'; |
| 33 | + # plugin 'Build::Make' => 'nmake'; |
| 34 | + # build [ |
| 35 | + # sub { |
| 36 | + # my ( $build, ) = @_; |
| 37 | + |
| 38 | + # my $extract = $build->install_prop->{extract}; |
| 39 | + # $extract =~ s#/#\\#go; |
| 40 | + # $ENV{ONIG_DIR} = $extract. '\\src'; |
| 41 | + # $ENV{BUILD_DIR} = $extract; |
| 42 | + # $build->install_prop->{onig_dir} = $ENV{ONIG_DIR}; |
| 43 | + # $build->install_prop->{build_dir}= $ENV{BUILD_DIR}; |
| 44 | + # }, |
| 45 | + # 'copy %{.install.onig_dir}\\config.h.windows.in %{.install.build_dir}\\config.h', |
| 46 | + # '%{make} -f %{.install.onig_dir}\\Makefile.windows', |
| 47 | + # ]; |
| 48 | + plugin 'Build::CMake'; |
| 49 | + # require Strawberry perl gmake.exe |
| 50 | + plugin 'Build::Make' => 'gmake'; |
| 51 | + build [ |
| 52 | + [ '%{cmake}', -G => '%{cmake_generator}', |
| 53 | + '-DCMAKE_MAKE_PROGRAM:PATH=%{make}', |
| 54 | + '-DBUILD_SHARED_LIBS:BOOL=OFF', |
| 55 | + '-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON', |
| 56 | + '-DCMAKE_INSTALL_PREFIX:PATH=%{.install.prefix}', |
| 57 | + '.' |
| 58 | + ], |
| 59 | + '%{make}', |
| 60 | + '%{make} install', |
| 61 | + ]; |
| 62 | + } |
| 63 | + elsif ($^O eq 'MacOS') { |
| 64 | + # noop on Mac, jq compile will build this module |
| 65 | + } |
| 66 | + else { |
| 67 | + build [ |
| 68 | + '%{sh} configure --disable-shared --with-pic --prefix=%{.install.prefix}', |
| 69 | + '%{make}', |
| 70 | + '%{make} install', |
| 71 | + ]; |
| 72 | + } |
| 73 | + plugin 'Gather::IsolateDynamic'; |
| 74 | + # gather sub { |
| 75 | + # my ( $build, ) = @_; |
| 76 | + |
| 77 | + # my $prefix = $build->runtime_prop->{prefix}; |
| 78 | + # $build->runtime_prop->{cflags} = "-I$prefix/include"; |
| 79 | + # $build->runtime_prop->{cflags_static} = "-I$prefix/include"; |
| 80 | + # $build->runtime_prop->{libs} = "-L$prefix/lib -lonig5"; |
| 81 | + # $build->runtime_prop->{libs_static} = "-L$prefix/lib -lonig5"; |
| 82 | + # }; |
| 83 | +}; |
0 commit comments