├── .github └── workflows │ └── test.yml ├── .gitignore ├── Build.PL ├── Changes ├── LICENSE ├── MANIFEST.SKIP ├── META.json ├── README.md ├── author ├── Dockerfile ├── README.md ├── Vagrantfile ├── cpanfile.snapshot └── fatpack.pl ├── bin ├── perl-build ├── plenv-install └── plenv-uninstall ├── cpanfile ├── lib └── Perl │ ├── Build.pm │ └── Build │ └── Built.pm ├── minil.toml ├── perl-build ├── script └── perl-build ├── t ├── 00_compile.t ├── 01_perl_build_built.t ├── 02_perl_release.t └── regression │ └── 056_issue.t └── xt ├── 02_perlcritic.t └── live └── 01_available.t /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: test 2 | on: [push, pull_request] 3 | jobs: 4 | build: 5 | runs-on: ubuntu-latest 6 | strategy: 7 | matrix: 8 | perl: 9 | [ 10 | "5.36", 11 | "5.34", 12 | "5.32", 13 | "5.30", 14 | "5.28", 15 | "5.26", 16 | "5.24", 17 | "5.22", 18 | "5.20", 19 | "5.18", 20 | "5.16", 21 | "5.14", 22 | "5.12", 23 | "5.10" 24 | ] 25 | name: Perl ${{ matrix.perl }} 26 | steps: 27 | - uses: actions/checkout@v3 28 | - name: Setup perl 29 | uses: shogo82148/actions-setup-perl@v1 30 | with: 31 | perl-version: ${{ matrix.perl }} 32 | - name: Install dependencies 33 | run: cpanm -nq --installdeps --with-develop --with-recommends . 34 | - name: Run test 35 | run: prove -lr t xt 36 | 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | inc/ 3 | .c 4 | ppport.h 5 | *.sw[po] 6 | *.bak 7 | *.old 8 | Build 9 | _build/ 10 | xshelper.h 11 | tags 12 | pm_to_blib 13 | blib/ 14 | META.yml 15 | MYMETA.* 16 | META.yml 17 | README 18 | .build 19 | _build_params 20 | /Build 21 | !Build/ 22 | !META.json 23 | Perl-Build-*.tar.gz 24 | /Perl-Build-* 25 | /.build 26 | /_build_params 27 | /fatlib/ 28 | /fatpacker.trace 29 | /packlists 30 | !LICENSE 31 | /author/.vagrant 32 | *~ 33 | /author/local/ 34 | 35 | -------------------------------------------------------------------------------- /Build.PL: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # THIS FILE IS AUTOMATICALLY GENERATED BY MINILLA. 3 | # DO NOT EDIT DIRECTLY. 4 | # ========================================================================= 5 | 6 | use 5.008_001; 7 | 8 | use strict; 9 | use warnings; 10 | use utf8; 11 | 12 | use Module::Build; 13 | use File::Basename; 14 | use File::Spec; 15 | 16 | my %args = ( 17 | license => 'perl_5', 18 | dynamic_config => 0, 19 | 20 | configure_requires => { 21 | 'Module::Build' => '0.4005', 22 | }, 23 | 24 | requires => { 25 | 'CPAN::Perl::Releases' => '3.58', 26 | 'CPAN::Perl::Releases::MetaCPAN' => '0.006', 27 | 'Devel::PatchPerl' => '0.88', 28 | 'File::Temp' => '0', 29 | 'File::pushd' => '0', 30 | 'Getopt::Long' => '0', 31 | 'HTTP::Tinyish' => '0.17', 32 | 'JSON::PP' => '0', 33 | 'Pod::Usage' => '1.63', 34 | 'perl' => '5.008001', 35 | }, 36 | 37 | recommends => { 38 | }, 39 | 40 | suggests => { 41 | }, 42 | 43 | build_requires => { 44 | }, 45 | 46 | test_requires => { 47 | 'Test::More' => '0.98', 48 | }, 49 | 50 | name => 'Perl-Build', 51 | module_name => 'Perl::Build', 52 | allow_pureperl => 0, 53 | 54 | script_files => [glob('script/*'), glob('bin/*')], 55 | PL_files => {}, 56 | 57 | test_files => ((-d '.git' || $ENV{RELEASE_TESTING}) && -d 'xt') ? 't/ xt/' : 't/', 58 | recursive_test_files => 1, 59 | 60 | 61 | ); 62 | if (-d 'share') { 63 | $args{share_dir} = 'share'; 64 | } 65 | 66 | my $builder = Module::Build->subclass( 67 | class => 'MyBuilder', 68 | code => q{ 69 | sub ACTION_distmeta { 70 | die "Do not run distmeta. Install Minilla and `minil install` instead.\n"; 71 | } 72 | sub ACTION_installdeps { 73 | die "Do not run installdeps. Run `cpanm --installdeps .` instead.\n"; 74 | } 75 | } 76 | )->new(%args); 77 | $builder->create_build_script(); 78 | 79 | -------------------------------------------------------------------------------- /Changes: -------------------------------------------------------------------------------- 1 | Revision history for Perl extension Perl-Build 2 | 3 | {{$NEXT}} 4 | 5 | 1.34 2023-05-16T12:48:45Z 6 | - Fix document (bes-internal #104) 7 | 8 | 1.33 2022-05-05T01:28:16Z 9 | - Use https for github urls (AnaTofuZ #103) 10 | 11 | 1.32 2021-03-10T15:23:02Z 12 | - Show perl & Devel::PatchPerl versions in perl-build --version (#98) 13 | 14 | 1.31 2020-07-12T02:05:29Z 15 | - Bump HTTP::Tinyish https://github.com/miyagawa/HTTP-Tinyish/pull/18 16 | 17 | 1.30 2019-10-25T23:43:38Z 18 | - Use github for blead archive (haarg toddr #94, #95) 19 | - Fix grammar (scop #92) 20 | - Fix `plenv install --version` (#91) 21 | 22 | 1.29 2018-12-21T12:34:40Z 23 | - Use https explicitly for installing blead perl (Grinnz #89) 24 | 25 | 1.28 2018-11-20T23:10:18Z 26 | - Allow installing from local tar.xz (Grinnz #88) 27 | 28 | 1.27 2018-09-24T03:07:15Z 29 | - Bump HTTP::Tinyish prereq 30 | 31 | 1.26 2018-09-23T12:24:24Z 32 | - Change hardcoded plenv path in README and module pod to $(plenv root) (mikkoi #86) 33 | 34 | 1.25 2018-08-23T12:18:36Z 35 | - Dump response body if http status = 599 (#85) 36 | 37 | 1.24 2018-07-23T14:30:29Z 38 | - Support perl releases in BackPAN (#84) 39 | 40 | 1.23 2018-05-27T22:14:34Z 41 | - Support tar.xz (#81) 42 | 43 | 1.22 2018-05-27T15:26:27Z 44 | - Silence "Use of uninitialized value" warning on old perls (#80) 45 | 46 | 1.21 2018-05-27T14:14:59Z 47 | - Silence "[cpan_perl_releases] not found the tarball" warning (#76) 48 | - Remove unnecessary 'use lib "lib"' (#77) 49 | - Relax perl requirement 5.8.2 -> 5.8.1 (#79) 50 | 51 | 1.20 2018-05-26T12:28:58Z 52 | - Resolve perl release versions and URLs from MetaCPAN entirely (Grinnz, sjn #66 #67, #73, #74, #75) 53 | - Use HTTP::Tinyish for transparent https support (AnaTofuZ #72) 54 | - If error status is 599 also display content (djzort #71) 55 | - Add -L to curl in installation instructions (akarelas #68, #70) 56 | - Support PERL_BUILD_INSTALL_OPTIONS env var (defc0n #61) 57 | - blead.tar.gz is now extracted into perl-blead-(hash), not perl-(hash) (charsbar #60) 58 | 59 | 1.13 2016-04-02T05:40:07Z 60 | 61 | commit d757b7f982b8efa48d1b802b7fd91c4ff0c03040 62 | Merge: 37a22d8 db28ded 63 | Author: Tatsuhiko Miyagawa 64 | Date: Sat Jan 23 09:05:09 2016 -0800 65 | 66 | Merge pull request #54 from tokuhirom/rc-version 67 | 68 | Remove RC version 69 | 70 | commit db28ded756fe80b092a233d98cbce85a5c9ddd77 71 | Author: Syohei YOSHIDA 72 | Date: Sat Jan 23 17:23:16 2016 +0900 73 | 74 | Remove RC version 75 | 76 | Because old RC versions were removed. 77 | 78 | commit 37a22d802074be898c8dcd0c1fa49ccbf20b57a0 79 | Author: Tokuhiro Matsuno 80 | Date: Fri Jan 8 19:09:20 2016 +0900 81 | 82 | Rerun fatpacker - Close #52 83 | 84 | commit 445bb6a7cc87ab4c28ca976f0449821b9403082a 85 | Merge: 320b022 4c2c637 86 | Author: Tokuhiro Matsuno 87 | Date: Fri Sep 18 14:47:19 2015 +0900 88 | 89 | Merge pull request #51 from tokuhirom/fix-xz-fetch-issue 90 | 91 | Fix xz fetch issue 92 | 93 | commit 4c2c637578ca8c1d146c873f9494e810f64b39ab 94 | Author: Syohei YOSHIDA 95 | Date: Fri Sep 18 14:46:07 2015 +0900 96 | 97 | Update perl-build 98 | 99 | commit 8fc95b0fb9f964f6b202404bc79336080dd63e92 100 | Author: Syohei YOSHIDA 101 | Date: Fri Sep 18 14:44:04 2015 +0900 102 | 103 | Fix fetching .xz file issue 104 | 105 | 1.12 2015-09-15T02:58:10Z 106 | 107 | - support cperl. 108 | - support installing from https 109 | 110 | 1.11 2015-07-07T23:25:44Z 111 | 112 | - Support stableperl(moznion) 113 | 114 | 1.10 2014-09-29T06:54:29Z 115 | 116 | - support PERL_BUILD_COMPILE_OPTIONS env (charsbar) 117 | 118 | 1.09 2014-09-24T02:46:59Z 119 | 120 | - add support for install blead from perl5.git snapshot 121 | (charsbar, syohex) 122 | 123 | 1.08 2014-06-09T02:57:17Z 124 | 125 | - requires newer Pod::Usage for fixing a dependencies error on perl-5.8 126 | (kazeburo) 127 | - change shebang of perl-build command 128 | (kazeburo) 129 | 130 | 1.07 2014-06-05T07:02:16Z 131 | 132 | - Change default cpan mirror to www.cpan.org. 133 | (kazeburo++) 134 | - use perl-releases page instead of scraping search.cpan.org 135 | (kazeburo++) 136 | - update github raw content URI 137 | ref: https://developer.github.com/changes/2014-04-25-user-content-security/ 138 | (chiba) 139 | 140 | 1.06 2014-04-04T01:11:10Z 141 | 142 | commit e04fcb3280188992fb3ebf85bf93ca11391b08ef 143 | Author: tokuhirom 144 | Date: Tue Nov 5 09:02:09 2013 +0900 145 | 146 | Support -D,-A,-U,-j as a first argument. 147 | https://github.com/tokuhirom/plenv/issues/61 148 | 149 | commit 2c59fa4836d6dab57b1fe079f4e0ca1ff5350f01 150 | Author: Katsuhiro KONISHI 151 | Date: Thu Oct 17 17:43:07 2013 +0900 152 | 153 | change /usr/bin/perl to $^X 154 | 155 | 1.05 2013-09-04T01:46:13Z 156 | 157 | - document `--test` option. 158 | (tokuhirom) 159 | - Tweaks needed for conformance with CPAN::Changes::Spec 160 | (Neil Bowers) 161 | - plenv-install: Use 'permute' option for Getopt::Long::Parser 162 | It allows `plenv install 5.18.1 -Dusedtrace --as 5.18.1-dtrace`. 163 | This issue was reported by hanekomu. 164 | (tokuhirom) 165 | 166 | 1.04 2013-08-13T00:03:11Z 167 | 168 | - Added --as option for plenv-install command 169 | (tokuhirom) 170 | - fix case for PLENV_ROOT environment variable in plenv-uninstall 171 | (Akihiro Uchida) 172 | - Provide plenv completions. Closed #13 173 | (tokuhirom) 174 | 175 | 1.03 2013-05-31T00:35:58Z 176 | 177 | - It works well as plugin for plenv. 178 | (tokuhirom) 179 | 180 | 1.01 2013-05-29T21:27:28Z 181 | 182 | - Added --symlink-devel-executables option. 183 | (tokuhirom) 184 | - Added --version option 185 | (tokuhirom) 186 | 187 | 1.00 2013-05-29T09:01:22Z 188 | 189 | [INCOMPATIBLE CHANGES] 190 | - `--definitions` and #available_versions returns version number without 'perl-' prefix. 191 | (tokuhirom) 192 | 193 | 0.21 2013-05-28T14:35:30Z 194 | 195 | - Added `--definitions` option. This option is same as ruby-build. 196 | (tokuhirom) 197 | 198 | 0.20 2013-05-17T00:46:48Z 199 | 200 | - use 'test_harness' for parallel testing. 201 | (tokuhirom) 202 | - Added --tarball-dir option 203 | (tokuhirom) 204 | 205 | 0.19 2013-05-16T02:17:08Z 206 | 207 | - no feature changes 208 | 209 | 0.18 2013-05-16T01:51:30Z 210 | 211 | - Support --jobs for parallel building. 212 | (tokuhirom) 213 | - Install from url 214 | (tokuhirom) 215 | 216 | 0.17 2013-04-05T08:36:20Z 217 | 218 | - Perl::Build::Built::new should take HashRef 219 | Broken at 0.16. 220 | (syohex) 221 | 222 | 0.16 2013-04-04T04:08:37Z 223 | 224 | - Add a Built package and integrate it into Build.pm 225 | (Kent Fredric) 226 | 227 | 0.15 2013-04-01T01:55:25Z 228 | 229 | - Grammar fix and Typo fixes. 230 | (Mark Stosberg) 231 | 232 | 0.14 2013-03-31T07:23:51Z 233 | 234 | - Documentation enhancements suggested by markstos 235 | (tokuhirom) 236 | 237 | 0.13 2013-03-29T23:46:30Z 238 | 239 | - add to support build-dir command-line option 240 | (typester) 241 | 242 | 0.12 2013-03-28T07:52:13Z 243 | 244 | - packaging, again. 245 | Back to Module::Build from Module::Build::Tiny. 246 | 247 | 0.11 2013-03-28T02:45:03Z 248 | 249 | - re-packaging 250 | 251 | 0.10 2013-03-27T12:08:57Z 252 | 253 | - Perl5 installs public executable scripts(like `prove`) to /usr/local/share/ 254 | if it exists. 255 | This -A'eval:scriptdir=$prefix/bin' option avoid this feature. 256 | (Reported by moznion++) 257 | 258 | 0.09 2013-03-27T05:13:03Z 259 | 260 | - Remove 'patchperl' option in OO APIs. 261 | Use Devel::PatchPerl as a library. 262 | (tokuhirom) 263 | 264 | 0.08 2013-03-22T20:32:06 265 | 266 | - minil-ized 267 | (tokuhirom) 268 | 269 | 0.06 2013-03-10T10:37:42 270 | 271 | - Depend to latest Devel::PatchPerl 272 | It removes dependency for IPC::Cmd. 273 | (tokuhirom) 274 | 275 | 0.05 2013-02-01T15:00:50 276 | 277 | commit 1d9912144703e31079ac71f56e0616af4bddee77 278 | Author: Syohei YOSHIDA 279 | Date: Wed Jan 30 13:58:05 2013 +0900 280 | 281 | Fixed for parsing command line arguments 282 | 283 | - Loop for @D, @A, @U makes no sense 284 | - Remove '--' if @ARGV contains it(See also Getopt::Long document). 285 | 286 | 0.04 2013-01-24T12:19:57 287 | 288 | - switch to HTTP::Tiny 289 | (tokuhirom) 290 | 291 | 0.03 2013-01-23 292 | 293 | - support relative path to install tar ball 294 | (tokuhirom) 295 | 296 | - more documentations 297 | 298 | 0.01 2013-01-12T17:18:43 299 | - original version 300 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This software is copyright (c) 2013 by Tokuhiro Matsuno Etokuhirom AAJKLFJEF@ GMAIL COME. 2 | 3 | This is free software; you can redistribute it and/or modify it under 4 | the same terms as the Perl 5 programming language system itself. 5 | 6 | Terms of the Perl programming language system itself 7 | 8 | a) the GNU General Public License as published by the Free 9 | Software Foundation; either version 1, or (at your option) any 10 | later version, or 11 | b) the "Artistic License" 12 | 13 | --- The GNU General Public License, Version 1, February 1989 --- 14 | 15 | This software is Copyright (c) 2013 by Tokuhiro Matsuno Etokuhirom AAJKLFJEF@ GMAIL COME. 16 | 17 | This is free software, licensed under: 18 | 19 | The GNU General Public License, Version 1, February 1989 20 | 21 | GNU GENERAL PUBLIC LICENSE 22 | Version 1, February 1989 23 | 24 | Copyright (C) 1989 Free Software Foundation, Inc. 25 | 51 Franklin St, Suite 500, Boston, MA 02110-1335 USA 26 | 27 | Everyone is permitted to copy and distribute verbatim copies 28 | of this license document, but changing it is not allowed. 29 | 30 | Preamble 31 | 32 | The license agreements of most software companies try to keep users 33 | at the mercy of those companies. By contrast, our General Public 34 | License is intended to guarantee your freedom to share and change free 35 | software--to make sure the software is free for all its users. The 36 | General Public License applies to the Free Software Foundation's 37 | software and to any other program whose authors commit to using it. 38 | You can use it for your programs, too. 39 | 40 | When we speak of free software, we are referring to freedom, not 41 | price. Specifically, the General Public License is designed to make 42 | sure that you have the freedom to give away or sell copies of free 43 | software, that you receive source code or can get it if you want it, 44 | that you can change the software or use pieces of it in new free 45 | programs; and that you know you can do these things. 46 | 47 | To protect your rights, we need to make restrictions that forbid 48 | anyone to deny you these rights or to ask you to surrender the rights. 49 | These restrictions translate to certain responsibilities for you if you 50 | distribute copies of the software, or if you modify it. 51 | 52 | For example, if you distribute copies of a such a program, whether 53 | gratis or for a fee, you must give the recipients all the rights that 54 | you have. You must make sure that they, too, receive or can get the 55 | source code. And you must tell them their rights. 56 | 57 | We protect your rights with two steps: (1) copyright the software, and 58 | (2) offer you this license which gives you legal permission to copy, 59 | distribute and/or modify the software. 60 | 61 | Also, for each author's protection and ours, we want to make certain 62 | that everyone understands that there is no warranty for this free 63 | software. If the software is modified by someone else and passed on, we 64 | want its recipients to know that what they have is not the original, so 65 | that any problems introduced by others will not reflect on the original 66 | authors' reputations. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | GNU GENERAL PUBLIC LICENSE 72 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 73 | 74 | 0. This License Agreement applies to any program or other work which 75 | contains a notice placed by the copyright holder saying it may be 76 | distributed under the terms of this General Public License. The 77 | "Program", below, refers to any such program or work, and a "work based 78 | on the Program" means either the Program or any work containing the 79 | Program or a portion of it, either verbatim or with modifications. Each 80 | licensee is addressed as "you". 81 | 82 | 1. You may copy and distribute verbatim copies of the Program's source 83 | code as you receive it, in any medium, provided that you conspicuously and 84 | appropriately publish on each copy an appropriate copyright notice and 85 | disclaimer of warranty; keep intact all the notices that refer to this 86 | General Public License and to the absence of any warranty; and give any 87 | other recipients of the Program a copy of this General Public License 88 | along with the Program. You may charge a fee for the physical act of 89 | transferring a copy. 90 | 91 | 2. You may modify your copy or copies of the Program or any portion of 92 | it, and copy and distribute such modifications under the terms of Paragraph 93 | 1 above, provided that you also do the following: 94 | 95 | a) cause the modified files to carry prominent notices stating that 96 | you changed the files and the date of any change; and 97 | 98 | b) cause the whole of any work that you distribute or publish, that 99 | in whole or in part contains the Program or any part thereof, either 100 | with or without modifications, to be licensed at no charge to all 101 | third parties under the terms of this General Public License (except 102 | that you may choose to grant warranty protection to some or all 103 | third parties, at your option). 104 | 105 | c) If the modified program normally reads commands interactively when 106 | run, you must cause it, when started running for such interactive use 107 | in the simplest and most usual way, to print or display an 108 | announcement including an appropriate copyright notice and a notice 109 | that there is no warranty (or else, saying that you provide a 110 | warranty) and that users may redistribute the program under these 111 | conditions, and telling the user how to view a copy of this General 112 | Public License. 113 | 114 | d) You may charge a fee for the physical act of transferring a 115 | copy, and you may at your option offer warranty protection in 116 | exchange for a fee. 117 | 118 | Mere aggregation of another independent work with the Program (or its 119 | derivative) on a volume of a storage or distribution medium does not bring 120 | the other work under the scope of these terms. 121 | 122 | 3. You may copy and distribute the Program (or a portion or derivative of 123 | it, under Paragraph 2) in object code or executable form under the terms of 124 | Paragraphs 1 and 2 above provided that you also do one of the following: 125 | 126 | a) accompany it with the complete corresponding machine-readable 127 | source code, which must be distributed under the terms of 128 | Paragraphs 1 and 2 above; or, 129 | 130 | b) accompany it with a written offer, valid for at least three 131 | years, to give any third party free (except for a nominal charge 132 | for the cost of distribution) a complete machine-readable copy of the 133 | corresponding source code, to be distributed under the terms of 134 | Paragraphs 1 and 2 above; or, 135 | 136 | c) accompany it with the information you received as to where the 137 | corresponding source code may be obtained. (This alternative is 138 | allowed only for noncommercial distribution and only if you 139 | received the program in object code or executable form alone.) 140 | 141 | Source code for a work means the preferred form of the work for making 142 | modifications to it. For an executable file, complete source code means 143 | all the source code for all modules it contains; but, as a special 144 | exception, it need not include source code for modules which are standard 145 | libraries that accompany the operating system on which the executable 146 | file runs, or for standard header files or definitions files that 147 | accompany that operating system. 148 | 149 | 4. You may not copy, modify, sublicense, distribute or transfer the 150 | Program except as expressly provided under this General Public License. 151 | Any attempt otherwise to copy, modify, sublicense, distribute or transfer 152 | the Program is void, and will automatically terminate your rights to use 153 | the Program under this License. However, parties who have received 154 | copies, or rights to use copies, from you under this General Public 155 | License will not have their licenses terminated so long as such parties 156 | remain in full compliance. 157 | 158 | 5. By copying, distributing or modifying the Program (or any work based 159 | on the Program) you indicate your acceptance of this license to do so, 160 | and all its terms and conditions. 161 | 162 | 6. Each time you redistribute the Program (or any work based on the 163 | Program), the recipient automatically receives a license from the original 164 | licensor to copy, distribute or modify the Program subject to these 165 | terms and conditions. You may not impose any further restrictions on the 166 | recipients' exercise of the rights granted herein. 167 | 168 | 7. The Free Software Foundation may publish revised and/or new versions 169 | of the General Public License from time to time. Such new versions will 170 | be similar in spirit to the present version, but may differ in detail to 171 | address new problems or concerns. 172 | 173 | Each version is given a distinguishing version number. If the Program 174 | specifies a version number of the license which applies to it and "any 175 | later version", you have the option of following the terms and conditions 176 | either of that version or of any later version published by the Free 177 | Software Foundation. If the Program does not specify a version number of 178 | the license, you may choose any version ever published by the Free Software 179 | Foundation. 180 | 181 | 8. If you wish to incorporate parts of the Program into other free 182 | programs whose distribution conditions are different, write to the author 183 | to ask for permission. For software which is copyrighted by the Free 184 | Software Foundation, write to the Free Software Foundation; we sometimes 185 | make exceptions for this. Our decision will be guided by the two goals 186 | of preserving the free status of all derivatives of our free software and 187 | of promoting the sharing and reuse of software generally. 188 | 189 | NO WARRANTY 190 | 191 | 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 192 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 193 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 194 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 195 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 196 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 197 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 198 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 199 | REPAIR OR CORRECTION. 200 | 201 | 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 202 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 203 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 204 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 205 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 206 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 207 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 208 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 209 | POSSIBILITY OF SUCH DAMAGES. 210 | 211 | END OF TERMS AND CONDITIONS 212 | 213 | Appendix: How to Apply These Terms to Your New Programs 214 | 215 | If you develop a new program, and you want it to be of the greatest 216 | possible use to humanity, the best way to achieve this is to make it 217 | free software which everyone can redistribute and change under these 218 | terms. 219 | 220 | To do so, attach the following notices to the program. It is safest to 221 | attach them to the start of each source file to most effectively convey 222 | the exclusion of warranty; and each file should have at least the 223 | "copyright" line and a pointer to where the full notice is found. 224 | 225 | 226 | Copyright (C) 19yy 227 | 228 | This program is free software; you can redistribute it and/or modify 229 | it under the terms of the GNU General Public License as published by 230 | the Free Software Foundation; either version 1, or (at your option) 231 | any later version. 232 | 233 | This program is distributed in the hope that it will be useful, 234 | but WITHOUT ANY WARRANTY; without even the implied warranty of 235 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 236 | GNU General Public License for more details. 237 | 238 | You should have received a copy of the GNU General Public License 239 | along with this program; if not, write to the Free Software 240 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA 241 | 242 | 243 | Also add information on how to contact you by electronic and paper mail. 244 | 245 | If the program is interactive, make it output a short notice like this 246 | when it starts in an interactive mode: 247 | 248 | Gnomovision version 69, Copyright (C) 19xx name of author 249 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 250 | This is free software, and you are welcome to redistribute it 251 | under certain conditions; type `show c' for details. 252 | 253 | The hypothetical commands `show w' and `show c' should show the 254 | appropriate parts of the General Public License. Of course, the 255 | commands you use may be called something other than `show w' and `show 256 | c'; they could even be mouse-clicks or menu items--whatever suits your 257 | program. 258 | 259 | You should also get your employer (if you work as a programmer) or your 260 | school, if any, to sign a "copyright disclaimer" for the program, if 261 | necessary. Here a sample; alter the names: 262 | 263 | Yoyodyne, Inc., hereby disclaims all copyright interest in the 264 | program `Gnomovision' (a program to direct compilers to make passes 265 | at assemblers) written by James Hacker. 266 | 267 | , 1 April 1989 268 | Ty Coon, President of Vice 269 | 270 | That's all there is to it! 271 | 272 | 273 | --- The Artistic License 1.0 --- 274 | 275 | This software is Copyright (c) 2013 by Tokuhiro Matsuno Etokuhirom AAJKLFJEF@ GMAIL COME. 276 | 277 | This is free software, licensed under: 278 | 279 | The Artistic License 1.0 280 | 281 | The Artistic License 282 | 283 | Preamble 284 | 285 | The intent of this document is to state the conditions under which a Package 286 | may be copied, such that the Copyright Holder maintains some semblance of 287 | artistic control over the development of the package, while giving the users of 288 | the package the right to use and distribute the Package in a more-or-less 289 | customary fashion, plus the right to make reasonable modifications. 290 | 291 | Definitions: 292 | 293 | - "Package" refers to the collection of files distributed by the Copyright 294 | Holder, and derivatives of that collection of files created through 295 | textual modification. 296 | - "Standard Version" refers to such a Package if it has not been modified, 297 | or has been modified in accordance with the wishes of the Copyright 298 | Holder. 299 | - "Copyright Holder" is whoever is named in the copyright or copyrights for 300 | the package. 301 | - "You" is you, if you're thinking about copying or distributing this Package. 302 | - "Reasonable copying fee" is whatever you can justify on the basis of media 303 | cost, duplication charges, time of people involved, and so on. (You will 304 | not be required to justify it to the Copyright Holder, but only to the 305 | computing community at large as a market that must bear the fee.) 306 | - "Freely Available" means that no fee is charged for the item itself, though 307 | there may be fees involved in handling the item. It also means that 308 | recipients of the item may redistribute it under the same conditions they 309 | received it. 310 | 311 | 1. You may make and give away verbatim copies of the source form of the 312 | Standard Version of this Package without restriction, provided that you 313 | duplicate all of the original copyright notices and associated disclaimers. 314 | 315 | 2. You may apply bug fixes, portability fixes and other modifications derived 316 | from the Public Domain or from the Copyright Holder. A Package modified in such 317 | a way shall still be considered the Standard Version. 318 | 319 | 3. You may otherwise modify your copy of this Package in any way, provided that 320 | you insert a prominent notice in each changed file stating how and when you 321 | changed that file, and provided that you do at least ONE of the following: 322 | 323 | a) place your modifications in the Public Domain or otherwise make them 324 | Freely Available, such as by posting said modifications to Usenet or an 325 | equivalent medium, or placing the modifications on a major archive site 326 | such as ftp.uu.net, or by allowing the Copyright Holder to include your 327 | modifications in the Standard Version of the Package. 328 | 329 | b) use the modified Package only within your corporation or organization. 330 | 331 | c) rename any non-standard executables so the names do not conflict with 332 | standard executables, which must also be provided, and provide a separate 333 | manual page for each non-standard executable that clearly documents how it 334 | differs from the Standard Version. 335 | 336 | d) make other distribution arrangements with the Copyright Holder. 337 | 338 | 4. You may distribute the programs of this Package in object code or executable 339 | form, provided that you do at least ONE of the following: 340 | 341 | a) distribute a Standard Version of the executables and library files, 342 | together with instructions (in the manual page or equivalent) on where to 343 | get the Standard Version. 344 | 345 | b) accompany the distribution with the machine-readable source of the Package 346 | with your modifications. 347 | 348 | c) accompany any non-standard executables with their corresponding Standard 349 | Version executables, giving the non-standard executables non-standard 350 | names, and clearly documenting the differences in manual pages (or 351 | equivalent), together with instructions on where to get the Standard 352 | Version. 353 | 354 | d) make other distribution arrangements with the Copyright Holder. 355 | 356 | 5. You may charge a reasonable copying fee for any distribution of this 357 | Package. You may charge any fee you choose for support of this Package. You 358 | may not charge a fee for this Package itself. However, you may distribute this 359 | Package in aggregate with other (possibly commercial) programs as part of a 360 | larger (possibly commercial) software distribution provided that you do not 361 | advertise this Package as a product of your own. 362 | 363 | 6. The scripts and library files supplied as input to or produced as output 364 | from the programs of this Package do not automatically fall under the copyright 365 | of this Package, but belong to whomever generated them, and may be sold 366 | commercially, and may be aggregated with this Package. 367 | 368 | 7. C or perl subroutines supplied by you and linked into this Package shall not 369 | be considered part of this Package. 370 | 371 | 8. The name of the Copyright Holder may not be used to endorse or promote 372 | products derived from this software without specific prior written permission. 373 | 374 | 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED 375 | WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 376 | MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 377 | 378 | The End 379 | 380 | -------------------------------------------------------------------------------- /MANIFEST.SKIP: -------------------------------------------------------------------------------- 1 | ^bin/.*$ 2 | -------------------------------------------------------------------------------- /META.json: -------------------------------------------------------------------------------- 1 | { 2 | "abstract" : "perl builder", 3 | "author" : [ 4 | "Tokuhiro Matsuno " 5 | ], 6 | "dynamic_config" : 0, 7 | "generated_by" : "Minilla/v3.1.21, CPAN::Meta::Converter version 2.150010", 8 | "license" : [ 9 | "perl_5" 10 | ], 11 | "meta-spec" : { 12 | "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", 13 | "version" : 2 14 | }, 15 | "name" : "Perl-Build", 16 | "no_index" : { 17 | "directory" : [ 18 | "t", 19 | "xt", 20 | "inc", 21 | "share", 22 | "eg", 23 | "examples", 24 | "author", 25 | "builder" 26 | ] 27 | }, 28 | "prereqs" : { 29 | "configure" : { 30 | "requires" : { 31 | "Module::Build" : "0.4005" 32 | } 33 | }, 34 | "develop" : { 35 | "requires" : { 36 | "Test::CPAN::Meta" : "0", 37 | "Test::MinimumVersion::Fast" : "0.04", 38 | "Test::PAUSE::Permissions" : "0.07", 39 | "Test::Pod" : "1.41", 40 | "Test::Spellunker" : "v0.2.7" 41 | } 42 | }, 43 | "runtime" : { 44 | "requires" : { 45 | "CPAN::Perl::Releases" : "3.58", 46 | "CPAN::Perl::Releases::MetaCPAN" : "0.006", 47 | "Devel::PatchPerl" : "0.88", 48 | "File::Temp" : "0", 49 | "File::pushd" : "0", 50 | "Getopt::Long" : "0", 51 | "HTTP::Tinyish" : "0.17", 52 | "JSON::PP" : "0", 53 | "Pod::Usage" : "1.63", 54 | "perl" : "5.008001" 55 | } 56 | }, 57 | "test" : { 58 | "requires" : { 59 | "Test::More" : "0.98" 60 | } 61 | } 62 | }, 63 | "release_status" : "unstable", 64 | "resources" : { 65 | "bugtracker" : { 66 | "web" : "https://github.com/tokuhirom/Perl-Build/issues" 67 | }, 68 | "homepage" : "https://github.com/tokuhirom/Perl-Build", 69 | "repository" : { 70 | "type" : "git", 71 | "url" : "https://github.com/tokuhirom/Perl-Build.git", 72 | "web" : "https://github.com/tokuhirom/Perl-Build" 73 | } 74 | }, 75 | "version" : "1.34", 76 | "x_contributors" : [ 77 | "Akihiro Uchida ", 78 | "AnaTofuZ ", 79 | "Ashley Hindmarsh ", 80 | "Daisuke Murase ", 81 | "Dan Book ", 82 | "Dean Hamstead ", 83 | "Diab Jerius ", 84 | "Graham Knop ", 85 | "Kang-min Liu ", 86 | "Katsuhiro KONISHI ", 87 | "Kenichi Ishigaki ", 88 | "Kent Fredric ", 89 | "Mark Stosberg ", 90 | "Masahiro Chiba ", 91 | "Masahiro Nagano ", 92 | "Mikko Johannes Koivunalho ", 93 | "Mitch McCracken ", 94 | "Neil Bowers ", 95 | "Przemysław Wesołek ", 96 | "Shoichi Kaji ", 97 | "Shoichi Kaji ", 98 | "Syohei YOSHIDA ", 99 | "Tatsuhiko Miyagawa ", 100 | "Tatsuhiko Miyagawa ", 101 | "Tony ", 102 | "Ville Skyttä ", 103 | "Vladimir Varlamov ", 104 | "hagihala ", 105 | "moznion " 106 | ], 107 | "x_serialization_backend" : "JSON::PP version 4.16", 108 | "x_static_install" : 1 109 | } 110 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NAME 2 | 3 | Perl::Build - perl builder 4 | 5 | # SYNOPSIS 6 | 7 | # Install as plenv plugin (Recommended) 8 | 9 | % git clone https://github.com/tokuhirom/Perl-Build.git $(plenv root)/plugins/perl-build/ 10 | 11 | # CLI interface without dependencies 12 | 13 | # perl-build command is FatPacker ready 14 | % curl -L https://raw.githubusercontent.com/tokuhirom/Perl-Build/master/perl-build | perl - 5.16.2 /opt/perl-5.16/ 15 | 16 | # CLI interface 17 | 18 | % cpanm Perl::Build 19 | % perl-build 5.16.2 /opt/perl-5.16/ 20 | 21 | ## Programmable interface 22 | 23 | # install perl from CPAN 24 | my $result = Perl::Build->install_from_cpan( 25 | '5.16.2' => ( 26 | dst_path => '/path/to/perl-5.16.2/', 27 | configure_options => ['-des'], 28 | ) 29 | ); 30 | 31 | # install perl from tar ball 32 | my $result = Perl::Build->install_from_tarball( 33 | 'path/to/perl-5.16.2.tar.gz' => ( 34 | dst_path => '/path/to/perl-5.16.2/', 35 | configure_options => ['-des'], 36 | ) 37 | ); 38 | 39 | # DESCRIPTION 40 | 41 | This is yet another perl builder module. 42 | 43 | **THIS IS A DEVELOPMENT RELEASE. API MAY CHANGE WITHOUT NOTICE**. 44 | 45 | # METHODS 46 | 47 | - `Perl::Build->install_from_cpan($version, %args)` 48 | 49 | Install `$version` perl from CPAN. This method fetches tar ball from CPAN, build, and install it. 50 | 51 | You can pass following options in `%args`. 52 | 53 | - `dst_path` 54 | 55 | Destination directory to install perl. 56 | 57 | - `configure_options : ArrayRef(Optional)` 58 | 59 | Command line arguments for `./Configure`. 60 | 61 | (Default: `['-de']`) 62 | 63 | - `tarball_dir` (Optional) 64 | 65 | Temporary directory to put tar ball. 66 | 67 | - `build_dir` (Optional) 68 | 69 | Temporary directory to build binary. 70 | 71 | - `jobs: Int` (Optional) 72 | 73 | Parallel building and testing. 74 | 75 | (Default: `1`) 76 | 77 | - `Perl::Build->install_from_tarball($dist_tarball_path, %args)` 78 | 79 | Install perl from tar ball. This method extracts tar ball, build, and install. 80 | 81 | You can pass following options in `%args`. 82 | 83 | - `dst_path` (Required) 84 | 85 | Destination directory to install perl. 86 | 87 | - `configure_options : ArrayRef` (Optional) 88 | 89 | Command line arguments for `./Configure`. 90 | 91 | (Default: `['-de']`) 92 | 93 | - `build_dir` (Optional) 94 | 95 | Temporary directory to build binary. 96 | 97 | - `jobs: Int` (Optional) 98 | 99 | Parallel building and testing. 100 | 101 | (Default: `1`) 102 | 103 | - `Perl::Build->install(%args)` 104 | 105 | Build and install Perl5 from extracted source directory. 106 | 107 | - `src_path` (Required) 108 | 109 | Source code directory to build. That contains extracted Perl5 source code. 110 | 111 | - `dst_path` (Required) 112 | 113 | Destination directory to install perl. 114 | 115 | - `configure_options : ArrayRef` (Optional) 116 | 117 | Command line arguments for `./Configure`. 118 | 119 | (Default: `['-de']`) 120 | 121 | - `test: Bool` (Optional) 122 | 123 | If you set this value as `true`, `Perl::Build` runs `make test` after building. 124 | 125 | (Default: `0`) 126 | 127 | - `jobs: Int` (Optional) 128 | 129 | Parallel building and testing. 130 | 131 | (Default: `1`) 132 | 133 | Returns an instance of [Perl::Build::Built](https://metacpan.org/pod/Perl%3A%3ABuild%3A%3ABuilt) to facilitate using the built perl from code. 134 | 135 | - `Perl::Build->symlink_devel_executables($bin_dir:Str)` 136 | 137 | Perl5 binary generated with `-Dusedevel`, is "perl-5.12.2" form. This method symlinks "perl-5.12.2" to "perl". 138 | 139 | # FAQ 140 | 141 | - How can I use patchperl plugins? 142 | 143 | If you want to use patchperl plugins, please Google "PERL5\_PATCHPERL\_PLUGIN". 144 | 145 | - What's the difference between `perlbrew`? 146 | 147 | [perlbrew](https://metacpan.org/pod/perlbrew) is a perl5 installation manager. But perl-build is a simple perl5 compilation and installation assistant tool. 148 | It makes perl5 installation easily. That's all. perl-build doesn't care about the user's environment. 149 | 150 | So, perl-build is just an installer. 151 | 152 | # THANKS TO 153 | 154 | Most of the code was taken from [`App::perlbrew`](https://metacpan.org/pod/App%3A%3Aperlbrew). 155 | 156 | TYPESTER - suggests `--patches` option 157 | 158 | Thanks 159 | 160 | # AUTHOR 161 | 162 | Tokuhiro Matsuno 163 | 164 | # LICENSE 165 | 166 | Copyright (C) Tokuhiro Matsuno 167 | 168 | This library is free software; you can redistribute it and/or modify 169 | it under the same terms as Perl itself. 170 | 171 | This software takes lot of the code from [App::perlbrew](https://metacpan.org/pod/App%3A%3Aperlbrew). App::perlbrew's license is: 172 | 173 | The MIT License 174 | 175 | Copyright (c) 2010,2011 Kang-min Liu 176 | 177 | Permission is hereby granted, free of charge, to any person obtaining a copy 178 | of this software and associated documentation files (the "Software"), to deal 179 | in the Software without restriction, including without limitation the rights 180 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 181 | copies of the Software, and to permit persons to whom the Software is 182 | furnished to do so, subject to the following conditions: 183 | 184 | The above copyright notice and this permission notice shall be included in 185 | all copies or substantial portions of the Software. 186 | 187 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 188 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 189 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 190 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 191 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 192 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 193 | THE SOFTWARE. 194 | -------------------------------------------------------------------------------- /author/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM perl:5.26.1 2 | 3 | RUN curl --compressed -sSL https://git.io/cpm -o /tmp/cpm 4 | RUN perl /tmp/cpm install -g App::cpm App::FatPacker::Simple Carton 5 | CMD ["perl", "/perl-build/author/fatpack.pl"] 6 | -------------------------------------------------------------------------------- /author/README.md: -------------------------------------------------------------------------------- 1 | # How to fatpack perl-build 2 | 3 | There are 3 options: 4 | 5 | ### Docker 6 | 7 | ``` 8 | docker build -t perl-build . 9 | docker run -v /path/to/local/Perl-Build:/perl-build perl-build 10 | ``` 11 | 12 | ### Vagrant 13 | 14 | In fact, this uses docker internally: 15 | 16 | ``` 17 | vagrant up --provision 18 | ``` 19 | 20 | ### Your local environment 21 | 22 | Make sure you have App::cpm, App::FatPacker::Simple, Carton. If not, install them first: 23 | 24 | ``` 25 | cpanm -nq App::cpm App::FatPacker::Simple Carton 26 | ``` 27 | 28 | Then: 29 | ``` 30 | perl fatpack.pl 31 | ``` 32 | 33 | ## Hint 34 | 35 | ### How do we update dependencies? 36 | 37 | Execute `fatpack.pl` with `--update` option, so that `cpanfile.snapshot` will be updated. 38 | -------------------------------------------------------------------------------- /author/Vagrantfile: -------------------------------------------------------------------------------- 1 | # How to fatpack with Vagrant 2 | # vagrant >= 1.6.3 is required 3 | # 4 | # * fatpack build-perl 5 | # $ cd author 6 | # $ vagrant up --provision 7 | # 8 | # * halt vm 9 | # $ vagrant halt 10 | # 11 | # * retry fatpack 12 | # $ vagrant up --provision 13 | # or 14 | # $ vagrant reload --provision 15 | # 16 | 17 | VAGRANTFILE_API_VERSION = "2" 18 | 19 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 20 | config.vm.box = "ubuntu/xenial64" 21 | config.vm.synced_folder "../", "/perl-build" 22 | config.vm.provision "docker" do |d| 23 | d.build_image "/perl-build/author", 24 | args: "-t perl-build" 25 | end 26 | # docker provisoner does not block until docker run is finished, so I use shell provisioner for docker run 27 | config.vm.provision "shell", 28 | inline: "docker run -v /perl-build:/perl-build perl-build" 29 | end 30 | 31 | -------------------------------------------------------------------------------- /author/cpanfile.snapshot: -------------------------------------------------------------------------------- 1 | # carton snapshot format: version 1.0 2 | DISTRIBUTIONS 3 | CPAN-Perl-Releases-5.20230423 4 | pathname: B/BI/BINGOS/CPAN-Perl-Releases-5.20230423.tar.gz 5 | provides: 6 | CPAN::Perl::Releases 5.20230423 7 | requirements: 8 | ExtUtils::MakeMaker 0 9 | perl 5.006000 10 | CPAN-Perl-Releases-MetaCPAN-0.006 11 | pathname: S/SK/SKAJI/CPAN-Perl-Releases-MetaCPAN-0.006.tar.gz 12 | provides: 13 | CPAN::Perl::Releases::MetaCPAN 0.006 14 | requirements: 15 | HTTP::Tiny 0.055 16 | HTTP::Tinyish 0 17 | JSON::PP 0 18 | Module::Build::Tiny 0.034 19 | perl 5.008001 20 | Carp-1.50 21 | pathname: X/XS/XSAWYERX/Carp-1.50.tar.gz 22 | provides: 23 | Carp 1.50 24 | Carp::Heavy 1.50 25 | requirements: 26 | Config 0 27 | Exporter 0 28 | ExtUtils::MakeMaker 0 29 | IPC::Open3 1.0103 30 | Test::More 0.47 31 | overload 0 32 | strict 0 33 | warnings 0 34 | Devel-PatchPerl-2.08 35 | pathname: B/BI/BINGOS/Devel-PatchPerl-2.08.tar.gz 36 | provides: 37 | Devel::PatchPerl 2.08 38 | Devel::PatchPerl::Hints 2.08 39 | Devel::PatchPerl::Plugin 2.08 40 | requirements: 41 | ExtUtils::MakeMaker 0 42 | File::pushd 1.00 43 | Getopt::Long 0 44 | IO::File 0 45 | MIME::Base64 0 46 | Module::Pluggable 0 47 | perl 5.006000 48 | Exporter-5.77 49 | pathname: T/TO/TODDR/Exporter-5.77.tar.gz 50 | provides: 51 | Exporter 5.77 52 | Exporter::Heavy 5.77 53 | requirements: 54 | Carp 1.05 55 | ExtUtils::MakeMaker 0 56 | ExtUtils-MakeMaker-7.70 57 | pathname: B/BI/BINGOS/ExtUtils-MakeMaker-7.70.tar.gz 58 | provides: 59 | ExtUtils::Command 7.70 60 | ExtUtils::Command::MM 7.70 61 | ExtUtils::Liblist 7.70 62 | ExtUtils::Liblist::Kid 7.70 63 | ExtUtils::MM 7.70 64 | ExtUtils::MM_AIX 7.70 65 | ExtUtils::MM_Any 7.70 66 | ExtUtils::MM_BeOS 7.70 67 | ExtUtils::MM_Cygwin 7.70 68 | ExtUtils::MM_DOS 7.70 69 | ExtUtils::MM_Darwin 7.70 70 | ExtUtils::MM_MacOS 7.70 71 | ExtUtils::MM_NW5 7.70 72 | ExtUtils::MM_OS2 7.70 73 | ExtUtils::MM_OS390 7.70 74 | ExtUtils::MM_QNX 7.70 75 | ExtUtils::MM_UWIN 7.70 76 | ExtUtils::MM_Unix 7.70 77 | ExtUtils::MM_VMS 7.70 78 | ExtUtils::MM_VOS 7.70 79 | ExtUtils::MM_Win32 7.70 80 | ExtUtils::MM_Win95 7.70 81 | ExtUtils::MY 7.70 82 | ExtUtils::MakeMaker 7.70 83 | ExtUtils::MakeMaker::Config 7.70 84 | ExtUtils::MakeMaker::Locale 7.70 85 | ExtUtils::MakeMaker::_version 7.70 86 | ExtUtils::MakeMaker::charstar 7.70 87 | ExtUtils::MakeMaker::version 7.70 88 | ExtUtils::MakeMaker::version::regex 7.70 89 | ExtUtils::MakeMaker::version::vpp 7.70 90 | ExtUtils::Mkbootstrap 7.70 91 | ExtUtils::Mksymlists 7.70 92 | ExtUtils::testlib 7.70 93 | MM 7.70 94 | MY 7.70 95 | requirements: 96 | Data::Dumper 0 97 | Encode 0 98 | File::Basename 0 99 | File::Spec 0.8 100 | Pod::Man 0 101 | perl 5.006 102 | File-Path-2.18 103 | pathname: J/JK/JKEENAN/File-Path-2.18.tar.gz 104 | provides: 105 | File::Path 2.18 106 | requirements: 107 | Cwd 0 108 | Exporter 0 109 | ExtUtils::MakeMaker 0 110 | File::Basename 0 111 | File::Spec 0 112 | File-Temp-0.2311 113 | pathname: E/ET/ETHER/File-Temp-0.2311.tar.gz 114 | provides: 115 | File::Temp 0.2311 116 | requirements: 117 | Carp 0 118 | Carp::Heavy 0 119 | Cwd 0 120 | Exporter 5.57 121 | ExtUtils::MakeMaker 0 122 | Fcntl 1.03 123 | File::Path 2.06 124 | File::Spec 0.8 125 | IO::Handle 0 126 | IO::Seekable 0 127 | POSIX 0 128 | Scalar::Util 0 129 | Symbol 0 130 | constant 0 131 | overload 0 132 | parent 0.221 133 | perl 5.006 134 | strict 0 135 | File-Which-1.27 136 | pathname: P/PL/PLICEASE/File-Which-1.27.tar.gz 137 | provides: 138 | File::Which 1.27 139 | requirements: 140 | ExtUtils::MakeMaker 0 141 | base 0 142 | perl 5.006 143 | File-pushd-1.016 144 | pathname: D/DA/DAGOLDEN/File-pushd-1.016.tar.gz 145 | provides: 146 | File::pushd 1.016 147 | requirements: 148 | Carp 0 149 | Cwd 0 150 | Exporter 0 151 | ExtUtils::MakeMaker 6.17 152 | File::Path 0 153 | File::Spec 0 154 | File::Temp 0 155 | overload 0 156 | perl 5.006 157 | strict 0 158 | warnings 0 159 | HTTP-Tiny-0.082 160 | pathname: D/DA/DAGOLDEN/HTTP-Tiny-0.082.tar.gz 161 | provides: 162 | HTTP::Tiny 0.082 163 | requirements: 164 | Carp 0 165 | ExtUtils::MakeMaker 6.17 166 | Fcntl 0 167 | IO::Socket 0 168 | MIME::Base64 0 169 | Socket 0 170 | Time::Local 0 171 | bytes 0 172 | perl 5.006 173 | strict 0 174 | warnings 0 175 | HTTP-Tinyish-0.18 176 | pathname: M/MI/MIYAGAWA/HTTP-Tinyish-0.18.tar.gz 177 | provides: 178 | HTTP::Tinyish 0.18 179 | HTTP::Tinyish::Base undef 180 | HTTP::Tinyish::Curl undef 181 | HTTP::Tinyish::HTTPTiny undef 182 | HTTP::Tinyish::LWP undef 183 | HTTP::Tinyish::Wget undef 184 | requirements: 185 | ExtUtils::MakeMaker 0 186 | File::Which 0 187 | HTTP::Tiny 0.055 188 | IPC::Run3 0 189 | parent 0 190 | perl 5.008001 191 | IPC-Run3-0.048 192 | pathname: R/RJ/RJBS/IPC-Run3-0.048.tar.gz 193 | provides: 194 | IPC::Run3 0.048 195 | requirements: 196 | ExtUtils::MakeMaker 0 197 | Test::More 0.31 198 | Time::HiRes 0 199 | JSON-PP-4.16 200 | pathname: I/IS/ISHIGAKI/JSON-PP-4.16.tar.gz 201 | provides: 202 | JSON::PP 4.16 203 | JSON::PP::Boolean 4.16 204 | JSON::PP::IncrParser 4.16 205 | requirements: 206 | ExtUtils::MakeMaker 0 207 | Scalar::Util 1.08 208 | Test::More 0 209 | Module-Pluggable-5.2 210 | pathname: S/SI/SIMONW/Module-Pluggable-5.2.tar.gz 211 | provides: 212 | Devel::InnerPackage 0.4 213 | Module::Pluggable 5.2 214 | Module::Pluggable::Object 5.2 215 | requirements: 216 | Exporter 5.57 217 | ExtUtils::MakeMaker 0 218 | File::Basename 0 219 | File::Find 0 220 | File::Spec 3.00 221 | File::Spec::Functions 0 222 | if 0 223 | perl 5.005030 224 | strict 0 225 | PathTools-3.75 226 | pathname: X/XS/XSAWYERX/PathTools-3.75.tar.gz 227 | provides: 228 | Cwd 3.75 229 | File::Spec 3.75 230 | File::Spec::AmigaOS 3.75 231 | File::Spec::Cygwin 3.75 232 | File::Spec::Epoc 3.75 233 | File::Spec::Functions 3.75 234 | File::Spec::Mac 3.75 235 | File::Spec::OS2 3.75 236 | File::Spec::Unix 3.75 237 | File::Spec::VMS 3.75 238 | File::Spec::Win32 3.75 239 | requirements: 240 | Carp 0 241 | ExtUtils::MakeMaker 0 242 | File::Basename 0 243 | Scalar::Util 0 244 | Test::More 0.88 245 | Pod-Escapes-1.07 246 | pathname: N/NE/NEILB/Pod-Escapes-1.07.tar.gz 247 | provides: 248 | Pod::Escapes 1.07 249 | requirements: 250 | Exporter 0 251 | ExtUtils::MakeMaker 0 252 | perl 5.006 253 | strict 0 254 | vars 0 255 | warnings 0 256 | Pod-Perldoc-3.28 257 | pathname: M/MA/MALLEN/Pod-Perldoc-3.28.tar.gz 258 | provides: 259 | Pod::Perldoc 3.28 260 | Pod::Perldoc::BaseTo 3.28 261 | Pod::Perldoc::GetOptsOO 3.28 262 | Pod::Perldoc::ToANSI 3.28 263 | Pod::Perldoc::ToChecker 3.28 264 | Pod::Perldoc::ToMan 3.28 265 | Pod::Perldoc::ToNroff 3.28 266 | Pod::Perldoc::ToPod 3.28 267 | Pod::Perldoc::ToRtf 3.28 268 | Pod::Perldoc::ToTerm 3.28 269 | Pod::Perldoc::ToText 3.28 270 | Pod::Perldoc::ToTk 3.28 271 | Pod::Perldoc::ToXml 3.28 272 | requirements: 273 | Config 0 274 | Encode 0 275 | ExtUtils::MakeMaker 0 276 | Fcntl 0 277 | File::Spec::Functions 0 278 | File::Temp 0.22 279 | IO::Select 0 280 | Pod::Man 2.18 281 | Pod::Simple::RTF 3.16 282 | Pod::Simple::XMLOutStream 3.16 283 | Pod::Text 0 284 | Symbol 0 285 | Test::More 0 286 | Text::ParseWords 0 287 | parent 0 288 | strict 0 289 | warnings 0 290 | Pod-Simple-3.45 291 | pathname: K/KH/KHW/Pod-Simple-3.45.tar.gz 292 | provides: 293 | Pod::Simple 3.45 294 | Pod::Simple::BlackBox 3.45 295 | Pod::Simple::Checker 3.45 296 | Pod::Simple::Debug 3.45 297 | Pod::Simple::DumpAsText 3.45 298 | Pod::Simple::DumpAsXML 3.45 299 | Pod::Simple::HTML 3.45 300 | Pod::Simple::HTMLBatch 3.45 301 | Pod::Simple::HTMLLegacy 5.01 302 | Pod::Simple::JustPod undef 303 | Pod::Simple::LinkSection 3.45 304 | Pod::Simple::Methody 3.45 305 | Pod::Simple::Progress 3.45 306 | Pod::Simple::PullParser 3.45 307 | Pod::Simple::PullParserEndToken 3.45 308 | Pod::Simple::PullParserStartToken 3.45 309 | Pod::Simple::PullParserTextToken 3.45 310 | Pod::Simple::PullParserToken 3.45 311 | Pod::Simple::RTF 3.45 312 | Pod::Simple::Search 3.45 313 | Pod::Simple::SimpleTree 3.45 314 | Pod::Simple::Text 3.45 315 | Pod::Simple::TextContent 3.45 316 | Pod::Simple::TiedOutFH 3.45 317 | Pod::Simple::Transcode 3.45 318 | Pod::Simple::TranscodeDumb 3.45 319 | Pod::Simple::TranscodeSmart 3.45 320 | Pod::Simple::XHTML 3.45 321 | Pod::Simple::XMLOutStream 3.45 322 | requirements: 323 | Carp 0 324 | Config 0 325 | Cwd 0 326 | ExtUtils::MakeMaker 0 327 | File::Basename 0 328 | File::Find 0 329 | File::Spec 0 330 | Pod::Escapes 1.04 331 | Symbol 0 332 | Text::Wrap 98.112902 333 | if 0 334 | integer 0 335 | overload 0 336 | strict 0 337 | Pod-Usage-2.03 338 | pathname: M/MA/MAREKR/Pod-Usage-2.03.tar.gz 339 | provides: 340 | Pod::Usage 2.03 341 | requirements: 342 | Cwd 0 343 | ExtUtils::MakeMaker 0 344 | File::Basename 0 345 | File::Spec 0.82 346 | Pod::Perldoc 3.28 347 | Pod::Simple 3.40 348 | Pod::Text 4.00 349 | Test-Simple-1.302195 350 | pathname: E/EX/EXODIST/Test-Simple-1.302195.tar.gz 351 | provides: 352 | Test2 1.302195 353 | Test2::API 1.302195 354 | Test2::API::Breakage 1.302195 355 | Test2::API::Context 1.302195 356 | Test2::API::Instance 1.302195 357 | Test2::API::InterceptResult 1.302195 358 | Test2::API::InterceptResult::Event 1.302195 359 | Test2::API::InterceptResult::Facet 1.302195 360 | Test2::API::InterceptResult::Hub 1.302195 361 | Test2::API::InterceptResult::Squasher 1.302195 362 | Test2::API::Stack 1.302195 363 | Test2::Event 1.302195 364 | Test2::Event::Bail 1.302195 365 | Test2::Event::Diag 1.302195 366 | Test2::Event::Encoding 1.302195 367 | Test2::Event::Exception 1.302195 368 | Test2::Event::Fail 1.302195 369 | Test2::Event::Generic 1.302195 370 | Test2::Event::Note 1.302195 371 | Test2::Event::Ok 1.302195 372 | Test2::Event::Pass 1.302195 373 | Test2::Event::Plan 1.302195 374 | Test2::Event::Skip 1.302195 375 | Test2::Event::Subtest 1.302195 376 | Test2::Event::TAP::Version 1.302195 377 | Test2::Event::V2 1.302195 378 | Test2::Event::Waiting 1.302195 379 | Test2::EventFacet 1.302195 380 | Test2::EventFacet::About 1.302195 381 | Test2::EventFacet::Amnesty 1.302195 382 | Test2::EventFacet::Assert 1.302195 383 | Test2::EventFacet::Control 1.302195 384 | Test2::EventFacet::Error 1.302195 385 | Test2::EventFacet::Hub 1.302195 386 | Test2::EventFacet::Info 1.302195 387 | Test2::EventFacet::Info::Table 1.302195 388 | Test2::EventFacet::Meta 1.302195 389 | Test2::EventFacet::Parent 1.302195 390 | Test2::EventFacet::Plan 1.302195 391 | Test2::EventFacet::Render 1.302195 392 | Test2::EventFacet::Trace 1.302195 393 | Test2::Formatter 1.302195 394 | Test2::Formatter::TAP 1.302195 395 | Test2::Hub 1.302195 396 | Test2::Hub::Interceptor 1.302195 397 | Test2::Hub::Interceptor::Terminator 1.302195 398 | Test2::Hub::Subtest 1.302195 399 | Test2::IPC 1.302195 400 | Test2::IPC::Driver 1.302195 401 | Test2::IPC::Driver::Files 1.302195 402 | Test2::Tools::Tiny 1.302195 403 | Test2::Util 1.302195 404 | Test2::Util::ExternalMeta 1.302195 405 | Test2::Util::Facets2Legacy 1.302195 406 | Test2::Util::HashBase 1.302195 407 | Test2::Util::Trace 1.302195 408 | Test::Builder 1.302195 409 | Test::Builder::Formatter 1.302195 410 | Test::Builder::IO::Scalar 2.114 411 | Test::Builder::Module 1.302195 412 | Test::Builder::Tester 1.302195 413 | Test::Builder::Tester::Color 1.302195 414 | Test::Builder::Tester::Tie 1.302195 415 | Test::Builder::TodoDiag 1.302195 416 | Test::More 1.302195 417 | Test::Simple 1.302195 418 | Test::Tester 1.302195 419 | Test::Tester::Capture 1.302195 420 | Test::Tester::CaptureRunner 1.302195 421 | Test::Tester::Delegate 1.302195 422 | Test::use::ok 1.302195 423 | ok 1.302195 424 | requirements: 425 | ExtUtils::MakeMaker 0 426 | File::Spec 0 427 | File::Temp 0 428 | Scalar::Util 1.13 429 | Storable 0 430 | perl 5.006002 431 | utf8 0 432 | parent-0.241 433 | pathname: C/CO/CORION/parent-0.241.tar.gz 434 | provides: 435 | parent 0.241 436 | requirements: 437 | ExtUtils::MakeMaker 0 438 | perl 5.006 439 | podlators-4.14 440 | pathname: R/RR/RRA/podlators-4.14.tar.gz 441 | provides: 442 | Pod undef 443 | Pod::Man 4.14 444 | Pod::ParseLink 4.14 445 | Pod::Text 4.14 446 | Pod::Text::Color 4.14 447 | Pod::Text::Overstrike 4.14 448 | Pod::Text::Termcap 4.14 449 | requirements: 450 | ExtUtils::MakeMaker 0 451 | Pod::Simple 3.06 452 | perl 5.008 453 | -------------------------------------------------------------------------------- /author/fatpack.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | use strict; 3 | use warnings; 4 | use FindBin; 5 | use App::FatPacker::Simple; 6 | use App::cpm::CLI; 7 | use Carton::Snapshot; 8 | use CPAN::Meta::Requirements; 9 | use Getopt::Long (); 10 | 11 | sub cpm { 12 | App::cpm::CLI->new->run(@_) == 0 or die 13 | } 14 | 15 | sub fatpack { 16 | App::FatPacker::Simple->new->parse_options(@_)->run 17 | } 18 | 19 | sub gen_snapshot { 20 | my $snapshot = Carton::Snapshot->new(path => "cpanfile.snapshot"); 21 | my $no_exclude = CPAN::Meta::Requirements->new; 22 | $snapshot->find_installs("local", $no_exclude); 23 | $snapshot->save; 24 | } 25 | 26 | Getopt::Long::GetOptions 27 | "u|update" => \my $update, 28 | "h|help" => sub { exec "perldoc", $0 }, 29 | or exit 1; 30 | 31 | chdir $FindBin::Bin; 32 | 33 | my $target = '5.8.1'; 34 | 35 | my $resolver = -f "cpanfile.snapshot" && !$update ? "snapshot" : "metadb"; 36 | 37 | warn "Resolver $resolver\n"; 38 | cpm "install", "--cpanfile", "../cpanfile", "--target-perl", $target, "--resolver", $resolver; 39 | cpm "install", "--resolver", $resolver, "--reinstall", "ExtUtils::MakeMaker"; 40 | gen_snapshot if $update; 41 | print STDERR "FatPacking..."; 42 | fatpack 43 | "-q", 44 | "-o", "../perl-build", 45 | "-d", "local,../lib", 46 | "-e", "Test::Simple,Test,File::Spec,Carp", 47 | "--shebang", '#!/usr/bin/env perl', 48 | "../script/perl-build"; 49 | print STDERR " DONE\n"; 50 | 51 | __END__ 52 | 53 | =head1 NAME 54 | 55 | fatpack.pl - fatpack perl-build 56 | 57 | =head1 SYNOPSIS 58 | 59 | perl fatpack.pl 60 | perl fatpack.pl --update 61 | 62 | =head1 DESCRIPTION 63 | 64 | This script does: 65 | 66 | =over 4 67 | 68 | =item * 69 | 70 | install CPAN module dependencies of perl-build into ./local with cpanfile.snapshot 71 | 72 | =item * 73 | 74 | fatpack ../script/perl-build with modules in ./local and ../lib 75 | 76 | =back 77 | 78 | If you want to update CPAN module dependencies and re-generate cpanfile.snapshot, 79 | then execute this script with C<--update> option. 80 | 81 | =head1 REQUIREMENT 82 | 83 | App::cpm, App::FatPacker::Simple, Carton 84 | 85 | You can install them by 86 | 87 | cpanm -nq App::cpm App::FatPacker::Simple Carton 88 | 89 | =cut 90 | 91 | -------------------------------------------------------------------------------- /bin/perl-build: -------------------------------------------------------------------------------- 1 | ../perl-build -------------------------------------------------------------------------------- /bin/plenv-install: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # 3 | # Summary: Install a Perl version using the perl-build plugin 4 | # 5 | # Usage: plenv install [-v|--verbose] 6 | # plenv install [-v|--verbose] /path/to/definition 7 | # plenv install -l|--list 8 | # 9 | # -l/--list List all available versions 10 | # -v/--verbose Verbose mode: print compilation status to stdout 11 | # --as= Install the definition as 12 | # --test Run test cases 13 | # --noman Skip installation of manpages 14 | # -D, -A, -U, -j perl configure options via perl-build 15 | # --version show perl-build plugin version 16 | # 17 | # Example: 18 | # plenv install 5.20.2 -j 8 -Dcc=gcc -UDEBUGGING -Accflags=... 19 | # 20 | # For more options that are passed through perl-build, run `perl-build --help` 21 | # or see: https://metacpan.org/pod/distribution/Perl-Build/script/perl-build#OPTIONS 22 | use strict; 23 | use warnings; 24 | use 5.008001; 25 | use FindBin; 26 | 27 | use Getopt::Long (); 28 | use File::Path qw(mkpath); 29 | 30 | my $PERL_BUILD = "$FindBin::Bin/perl-build"; 31 | 32 | &main;exit 0; 33 | 34 | # Provide plenv completions 35 | sub main { 36 | if (!defined $ENV{PLENV_ROOT}) { 37 | $ENV{PLENV_ROOT} = "$ENV{HOME}/.plenv"; 38 | } 39 | 40 | 41 | if (@ARGV > 0 && $ARGV[0] eq '--complete') { 42 | print `$^X $PERL_BUILD --definitions`; 43 | exit 0; 44 | } 45 | 46 | my (@D, @A, @U); 47 | my $p = Getopt::Long::Parser->new( 48 | config => [qw(posix_default no_ignore_case pass_through permute bundling)] 49 | ); 50 | $p->getoptions( 51 | 'version!' => \my $version, 52 | 'h|help' => \my $help, 53 | 'l|list' => \my $list, 54 | 'as=s' => \my $as, 55 | 56 | # perl-build args 57 | 'j|jobs=i' => \my $jobs, 58 | 'D=s@' => \@D, 59 | 'A=s@' => \@A, 60 | 'U=s@' => \@U, 61 | 'noman' => \my $noman, 62 | ); 63 | if ($version) { 64 | exec $^X, $PERL_BUILD, "--version"; 65 | exit 255; 66 | } elsif ($help) { 67 | usage(); 68 | } elsif ($list) { 69 | print "Available versions:\n"; 70 | print `$^X $PERL_BUILD --definitions | sed 's/^/ /g'`; 71 | exit 0; 72 | } 73 | 74 | my $definition = shift @ARGV or usage(); 75 | if (not defined $as) { 76 | $as = $definition; 77 | } 78 | if ($definition =~ /\A-/) { 79 | die "You should put `${definition}` as a last argument.\n"; 80 | } 81 | my $prefix = "$ENV{PLENV_ROOT}/versions/$as"; 82 | if (-d $prefix) { 83 | die "$prefix is already installed\n"; 84 | } 85 | 86 | my $cache_dir = "$ENV{PLENV_ROOT}/cache/"; 87 | mkpath($cache_dir); 88 | my $build_dir = "$ENV{PLENV_ROOT}/build/" . time . ".$$/"; 89 | mkpath($build_dir); 90 | 91 | print "Installing $definition as $as\n"; 92 | 93 | my @cmd = ( 94 | $^X, 95 | '--', 96 | $PERL_BUILD, 97 | '--symlink-devel-executables', 98 | '--build-dir' => $build_dir, 99 | '--tarball-dir' => $cache_dir, 100 | '-Dversiononly', 101 | (map { "-D$_" } @D), 102 | (map { "-A$_" } @A), 103 | (map { "-U$_" } @U), 104 | ($jobs ? "--jobs=${jobs}" : ()), 105 | ($noman ? "--noman" : ()), 106 | @ARGV, 107 | $definition, 108 | $prefix 109 | ); 110 | print join(' ', @cmd), "\n"; 111 | 112 | system(@cmd) == 0 or die "ABORT\n"; 113 | 114 | system("plenv rehash"); 115 | } 116 | 117 | sub usage { 118 | open my $fh, '<', $0 or die "$0: $!\n"; 119 | my $buf = ''; 120 | <$fh>; # shebang 121 | while (<$fh>) { 122 | s/^#// or last; 123 | s/^ //; 124 | $buf .= $_; 125 | } 126 | print $buf; 127 | exit 0; 128 | } 129 | 130 | 131 | -------------------------------------------------------------------------------- /bin/plenv-uninstall: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Summary: Uninstall a specific Perl version 4 | # 5 | # Usage: plenv uninstall [-f] 6 | # 7 | # -f Attempt to remove the specified version without prompting 8 | # for confirmation. If the version does not exist, do not 9 | # display an error message. 10 | # 11 | # See `plenv versions` for a complete list of installed versions. 12 | # 13 | set -e 14 | 15 | # Provide plenv completions 16 | if [ "$1" = "--complete" ]; then 17 | exec plenv versions --bare 18 | fi 19 | 20 | if [ -z "$PLENV_ROOT" ]; then 21 | PLENV_ROOT="${HOME}/.plenv" 22 | fi 23 | 24 | unset FORCE 25 | if [ "$1" = "-f" ]; then 26 | FORCE=true 27 | shift 28 | fi 29 | 30 | DEFINITION="$1" 31 | case "$DEFINITION" in 32 | "" | -* ) 33 | # We can remove the sed fallback once plenv 0.4.0 is widely available. 34 | { plenv-help uninstall 2>/dev/null || 35 | sed -ne '/^#/!q;s/.\{1,2\}//;1,4d;p' < "$0" 36 | } >&2 37 | exit 1 38 | ;; 39 | esac 40 | 41 | VERSION_NAME="${DEFINITION##*/}" 42 | PREFIX="${PLENV_ROOT}/versions/${VERSION_NAME}" 43 | 44 | if [ -z "$FORCE" ]; then 45 | if [ ! -d "$PREFIX" ]; then 46 | echo "plenv: version \`$VERSION_NAME' not installed" >&2 47 | exit 1 48 | fi 49 | 50 | read -p "plenv: remove $PREFIX? " 51 | case "$REPLY" in 52 | y* | Y* ) ;; 53 | * ) exit 1 ;; 54 | esac 55 | fi 56 | 57 | if [ -d "$PREFIX" ]; then 58 | rm -rf "$PREFIX" 59 | plenv rehash 60 | fi 61 | -------------------------------------------------------------------------------- /cpanfile: -------------------------------------------------------------------------------- 1 | requires 'perl' => '5.008001'; 2 | requires 'CPAN::Perl::Releases' => '3.58'; 3 | requires 'CPAN::Perl::Releases::MetaCPAN' => '0.006'; 4 | requires 'File::pushd' => '0'; 5 | requires 'HTTP::Tinyish' => '0.17'; 6 | requires 'JSON::PP' => '0'; 7 | requires 'Devel::PatchPerl' => '0.88'; 8 | requires 'File::Temp'; 9 | requires 'Getopt::Long'; 10 | requires 'Pod::Usage', '1.63'; 11 | 12 | on test => sub { 13 | requires 'Test::More' => '0.98'; 14 | }; 15 | 16 | -------------------------------------------------------------------------------- /lib/Perl/Build.pm: -------------------------------------------------------------------------------- 1 | package Perl::Build; 2 | use strict; 3 | use warnings; 4 | use utf8; 5 | 6 | use 5.008001; 7 | our $VERSION = '1.34'; 8 | 9 | use Carp (); 10 | use File::Basename; 11 | use File::Spec::Functions qw(catfile catdir rel2abs); 12 | use CPAN::Perl::Releases; 13 | use CPAN::Perl::Releases::MetaCPAN; 14 | use File::pushd qw(pushd); 15 | use File::Temp; 16 | use HTTP::Tinyish; 17 | use JSON::PP qw(decode_json); 18 | use Devel::PatchPerl 0.88; 19 | use Perl::Build::Built; 20 | use Time::Local; 21 | 22 | our $CPAN_MIRROR = $ENV{PERL_BUILD_CPAN_MIRROR} || 'https://cpan.metacpan.org'; 23 | 24 | sub available_perls { 25 | my $class = shift; 26 | 27 | my $releases = CPAN::Perl::Releases::MetaCPAN->new->get; 28 | my @available_versions; 29 | for my $release (@$releases) { 30 | if ($release->{name} =~ /^perl-(5.(\d+).(\d+)(-\w+)?)$/) { 31 | my ($version, $major, $minor, $rc) = ($1, $2, $3, $4); 32 | my $sort_by = sprintf "%03d%03d%s", $major, $minor, $rc || "ZZZ"; 33 | push @available_versions, { version => $version, sort_by => $sort_by }; 34 | } 35 | } 36 | map { $_->{version} } sort { $b->{sort_by} cmp $a->{sort_by} } @available_versions; 37 | } 38 | 39 | # @return extracted source directory 40 | sub extract_tarball { 41 | my ($class, $dist_tarball, $destdir) = @_; 42 | 43 | # Was broken on Solaris, where GNU tar is probably 44 | # installed as 'gtar' - RT #61042 45 | my $tar = $^O eq 'solaris' ? 'gtar' : 'tar'; 46 | 47 | my $type 48 | = $dist_tarball =~ m/bz2$/ ? 'j' 49 | : $dist_tarball =~ m/xz$/ ? 'J' 50 | : 'z'; 51 | 52 | my $abs_tarball = File::Spec->rel2abs($dist_tarball); 53 | 54 | my @tar_files = `$tar t${type}f "$abs_tarball"`; 55 | $? == 0 56 | or die "Failed to extract $dist_tarball"; 57 | 58 | chomp @tar_files; 59 | my %seen; 60 | my @prefixes = grep !$seen{$_}++, map m{\A(?:\./)?([^/]+)}, @tar_files; 61 | 62 | die "$dist_tarball does not contain single directory : @prefixes" 63 | if @prefixes != 1; 64 | 65 | system(qq{cd "$destdir"; $tar x${type}f "$abs_tarball"}) == 0 66 | or die "Failed to extract $dist_tarball"; 67 | 68 | return catfile($destdir, $prefixes[0]); 69 | } 70 | 71 | sub perl_release { 72 | my ($class, $version) = @_; 73 | 74 | my ($dist_tarball, $dist_tarball_url); 75 | my @err; 76 | for my $func (qw/cpan_perl_releases metacpan/) { 77 | eval { 78 | ($dist_tarball, $dist_tarball_url) = $class->can("perl_release_by_$func")->($class,$version); 79 | }; 80 | push @err, "[$func] $@" if $@; 81 | last if $dist_tarball && $dist_tarball_url; 82 | } 83 | if (!$dist_tarball and !$dist_tarball_url) { 84 | push @err, "ERROR: Cannot find the tarball for perl-$version\n"; 85 | die join "", @err; 86 | } 87 | 88 | return ($dist_tarball, $dist_tarball_url); 89 | } 90 | 91 | sub perl_release_by_cpan_perl_releases { 92 | my ($class, $version) = @_; 93 | my $tarballs = CPAN::Perl::Releases::perl_tarballs($version); 94 | my $x = $tarballs->{'tar.gz'} || $tarballs->{'tar.bz2'} || $tarballs->{'tar.xz'}; 95 | die "not found the tarball for perl-$version\n" unless $x; 96 | my $dist_tarball = (split("/", $x))[-1]; 97 | my $dist_tarball_url = $CPAN_MIRROR . "/authors/id/$x"; 98 | return ($dist_tarball, $dist_tarball_url); 99 | } 100 | 101 | sub perl_release_by_metacpan { 102 | my ($class, $version) = @_; 103 | my $releases = CPAN::Perl::Releases::MetaCPAN->new->get; 104 | for my $release (@$releases) { 105 | if ($release->{name} eq "perl-$version") { 106 | my ($path) = $release->{download_url} =~ m{(/authors/id/.*)}; 107 | my $dist_tarball = (split("/", $path))[-1]; 108 | my $dist_tarball_url = $CPAN_MIRROR . $path; 109 | return ($dist_tarball, $dist_tarball_url); 110 | } 111 | } 112 | die "not found the tarball for perl-$version\n"; 113 | } 114 | 115 | sub http_get { 116 | my ($url) = @_; 117 | 118 | my $http = HTTP::Tinyish->new(verify_SSL => 1); 119 | my $response = $http->get($url); 120 | if ($response->{success}) { 121 | return $response->{content}; 122 | } else { 123 | my $msg = $response->{status} == 599 ? ", $response->{content}" : ""; 124 | chomp $msg; 125 | die "Cannot get content from $url: $response->{status} $response->{reason}$msg\n"; 126 | } 127 | } 128 | 129 | sub http_mirror { 130 | my ($url, $path) = @_; 131 | 132 | my $http = HTTP::Tinyish->new(verify_SSL => 1); 133 | my $response = $http->mirror($url, $path); 134 | if ($response->{success}) { 135 | print "Downloaded $url to $path.\n"; 136 | } else { 137 | my $msg = $response->{status} == 599 ? ", $response->{content}" : ""; 138 | chomp $msg; 139 | die "Cannot get file from $url: $response->{status} $response->{reason}$msg"; 140 | } 141 | } 142 | 143 | sub install_from_cpan { 144 | my ($class, $version, %args) = @_; 145 | 146 | $args{patchperl} && Carp::croak "The patchperl argument was deprected."; 147 | 148 | my $tarball_dir = $args{tarball_dir} 149 | || File::Temp::tempdir( CLEANUP => 1 ); 150 | my $build_dir = $args{build_dir} 151 | || File::Temp::tempdir( CLEANUP => 1 ); 152 | my $dst_path = $args{dst_path} 153 | or die "Missing mandatory parameter: dst_path"; 154 | my $configure_options = $args{configure_options} 155 | || ['-de']; 156 | 157 | # download tar ball 158 | my ($dist_tarball, $dist_tarball_url) = Perl::Build->perl_release($version); 159 | my $dist_tarball_path = catfile($tarball_dir, $dist_tarball); 160 | if (-f $dist_tarball_path) { 161 | print "Use the previously fetched ${dist_tarball}\n"; 162 | } 163 | else { 164 | print "Fetching $version as $dist_tarball_path ($dist_tarball_url)\n"; 165 | http_mirror( $dist_tarball_url, $dist_tarball_path ); 166 | } 167 | 168 | # and extract tar ball. 169 | my $dist_extracted_path = Perl::Build->extract_tarball($dist_tarball_path, $build_dir); 170 | Perl::Build->install( 171 | src_path => $dist_extracted_path, 172 | dst_path => $dst_path, 173 | configure_options => $configure_options, 174 | test => $args{test}, 175 | jobs => $args{jobs}, 176 | ); 177 | } 178 | 179 | sub install_from_url { 180 | my ($class, $dist_tarball_url, %args) = @_; 181 | $args{patchperl} && Carp::croak "The patchperl argument was deprected."; 182 | 183 | my $build_dir = $args{build_dir} 184 | || File::Temp::tempdir( CLEANUP => 1 ); 185 | my $tarball_dir = $args{tarball_dir} 186 | || File::Temp::tempdir( CLEANUP => 1 ); 187 | my $dst_path = $args{dst_path} 188 | or die "Missing mandatory parameter: dst_path"; 189 | my $configure_options = $args{configure_options} 190 | || ['-de']; 191 | 192 | my $dist_tarball = basename($dist_tarball_url); 193 | my $dist_tarball_path = catfile($tarball_dir, $dist_tarball); 194 | if (-f $dist_tarball_path) { 195 | print "Use the previously fetched ${dist_tarball}\n"; 196 | } 197 | else { 198 | print "Fetching $dist_tarball_path ($dist_tarball_url)\n"; 199 | http_mirror( $dist_tarball_url, $dist_tarball_path ); 200 | } 201 | 202 | my $dist_extracted_path = Perl::Build->extract_tarball($dist_tarball_path, $build_dir); 203 | Perl::Build->install( 204 | src_path => $dist_extracted_path, 205 | dst_path => $dst_path, 206 | configure_options => $configure_options, 207 | test => $args{test}, 208 | jobs => $args{jobs}, 209 | ); 210 | } 211 | 212 | sub install_from_tarball { 213 | my ($class, $dist_tarball_path, %args) = @_; 214 | $args{patchperl} && Carp::croak "The patchperl argument was deprected."; 215 | 216 | my $build_dir = $args{build_dir} 217 | || File::Temp::tempdir( CLEANUP => 1 ); 218 | my $dst_path = $args{dst_path} 219 | or die "Missing mandatory parameter: dst_path"; 220 | my $configure_options = $args{configure_options} 221 | || ['-de']; 222 | 223 | my $dist_extracted_path = Perl::Build->extract_tarball($dist_tarball_path, $build_dir); 224 | Perl::Build->install( 225 | src_path => $dist_extracted_path, 226 | dst_path => $dst_path, 227 | configure_options => $configure_options, 228 | test => $args{test}, 229 | jobs => $args{jobs}, 230 | ); 231 | } 232 | 233 | sub install { 234 | my ($class, %args) = @_; 235 | $args{patchperl} && Carp::croak "The patchperl argument was deprected."; 236 | 237 | my $src_path = $args{src_path} 238 | or die "Missing mandatory parameter: src_path"; 239 | my $dst_path = $args{dst_path} 240 | or die "Missing mandatory parameter: dst_path"; 241 | my $configure_options = $args{configure_options} 242 | or die "Missing mandatory parameter: configure_options"; 243 | my $jobs = $args{jobs}; # optional 244 | my $test = $args{test}; # optional 245 | 246 | unshift @$configure_options, qq(-Dprefix=$dst_path); 247 | 248 | # Perl5 installs public executable scripts(like `prove`) to /usr/local/share/ 249 | # if it exists. 250 | # 251 | # This -A'eval:scriptdir=$prefix/bin' option avoid this feature. 252 | unless (grep { /eval:scriptdir=/} @$configure_options) { 253 | push @$configure_options, "-A'eval:scriptdir=${dst_path}/bin'"; 254 | } 255 | 256 | # clean up environment 257 | delete $ENV{$_} for qw(PERL5LIB PERL5OPT); 258 | 259 | { 260 | my $dir = pushd($src_path); 261 | 262 | # determine_version is a public API. 263 | my $dist_version = Devel::PatchPerl->determine_version(); 264 | print "Configuring perl '$dist_version'\n"; 265 | 266 | # clean up 267 | $class->do_system("rm -f config.sh Policy.sh"); 268 | 269 | # apply patches 270 | Devel::PatchPerl->patch_source(); 271 | 272 | # configure 273 | $class->do_system(['sh', 'Configure', @$configure_options]); 274 | # patch for older perls 275 | # XXX is this needed? patchperl do this? 276 | # if (Perl::Build->perl_version_to_integer($dist_version) < Perl::Build->perl_version_to_integer( '5.8.9' )) { 277 | # $class->do_system("$^X -i -nle 'print unless /command-line/' makefile x2p/makefile"); 278 | # } 279 | 280 | # build 281 | my @make = qw(make); 282 | if ($ENV{PERL_BUILD_COMPILE_OPTIONS}) { 283 | push @make, $ENV{PERL_BUILD_COMPILE_OPTIONS}; 284 | } 285 | if ($jobs) { 286 | push @make, '-j', $jobs; 287 | } 288 | $class->do_system(\@make); 289 | if ($test) { 290 | local $ENV{TEST_JOBS} = $jobs if $jobs; 291 | # Test via "make test_harness" if available so we'll get 292 | # automatic parallel testing via $HARNESS_OPTIONS. The 293 | # "test_harness" target was added in 5.7.3, which was the last 294 | # development release before 5.8.0. 295 | my $test_target = 'test'; 296 | if ($dist_version && $dist_version =~ /^5\.([0-9]+)\.([0-9]+)/ 297 | && ($1 >= 8 || $1 == 7 && $2 == 3)) { 298 | $test_target = "test_harness"; 299 | } 300 | $class->do_system([@make, $test_target]); 301 | } 302 | @make = qw(make install); 303 | if ($ENV{PERL_BUILD_INSTALL_OPTIONS}) { 304 | push @make, $ENV{PERL_BUILD_INSTALL_OPTIONS}; 305 | } 306 | $class->do_system(\@make); 307 | } 308 | return Perl::Build::Built->new({ 309 | installed_path => $dst_path, 310 | }); 311 | } 312 | 313 | sub do_system { 314 | my ($class, $cmd) = @_; 315 | 316 | if (ref $cmd eq 'ARRAY') { 317 | $class->info(join(' ', @$cmd)); 318 | system(@$cmd) == 0 319 | or die "Installation failure: @$cmd"; 320 | } else { 321 | $class->info($cmd); 322 | system($cmd) == 0 323 | or die "Installation failure: $cmd"; 324 | } 325 | } 326 | 327 | sub symlink_devel_executables { 328 | my ($class, $bin_dir) = @_; 329 | 330 | for my $executable (glob("$bin_dir/*")) { 331 | my ($name, $version) = basename( $executable ) =~ m/(.+?)(5\.\d.*)?$/; 332 | if ($version) { 333 | my $cmd = "ln -fs $executable $bin_dir/$name"; 334 | $class->info($cmd); 335 | system($cmd); 336 | } 337 | } 338 | } 339 | 340 | sub info { 341 | my ($class, @msg) = @_; 342 | print @msg, "\n"; 343 | } 344 | 345 | 1; 346 | __END__ 347 | 348 | =encoding utf8 349 | 350 | =for stopwords tarball Optional symlinks patchperl 351 | 352 | =head1 NAME 353 | 354 | Perl::Build - perl builder 355 | 356 | =head1 SYNOPSIS 357 | 358 | =head1 Install as plenv plugin (Recommended) 359 | 360 | % git clone https://github.com/tokuhirom/Perl-Build.git $(plenv root)/plugins/perl-build/ 361 | 362 | =head1 CLI interface without dependencies 363 | 364 | # perl-build command is FatPacker ready 365 | % curl -L https://raw.githubusercontent.com/tokuhirom/Perl-Build/master/perl-build | perl - 5.16.2 /opt/perl-5.16/ 366 | 367 | =head1 CLI interface 368 | 369 | % cpanm Perl::Build 370 | % perl-build 5.16.2 /opt/perl-5.16/ 371 | 372 | =head2 Programmable interface 373 | 374 | # install perl from CPAN 375 | my $result = Perl::Build->install_from_cpan( 376 | '5.16.2' => ( 377 | dst_path => '/path/to/perl-5.16.2/', 378 | configure_options => ['-des'], 379 | ) 380 | ); 381 | 382 | # install perl from tar ball 383 | my $result = Perl::Build->install_from_tarball( 384 | 'path/to/perl-5.16.2.tar.gz' => ( 385 | dst_path => '/path/to/perl-5.16.2/', 386 | configure_options => ['-des'], 387 | ) 388 | ); 389 | 390 | =head1 DESCRIPTION 391 | 392 | This is yet another perl builder module. 393 | 394 | B. 395 | 396 | =head1 METHODS 397 | 398 | =over 4 399 | 400 | =item C<< Perl::Build->install_from_cpan($version, %args) >> 401 | 402 | Install C<< $version >> perl from CPAN. This method fetches tar ball from CPAN, build, and install it. 403 | 404 | You can pass following options in C<< %args >>. 405 | 406 | =over 4 407 | 408 | =item C<< dst_path >> 409 | 410 | Destination directory to install perl. 411 | 412 | =item C<< configure_options : ArrayRef(Optional) >> 413 | 414 | Command line arguments for C<< ./Configure >>. 415 | 416 | (Default: C<< ['-de'] >>) 417 | 418 | =item C<< tarball_dir >> (Optional) 419 | 420 | Temporary directory to put tar ball. 421 | 422 | =item C<< build_dir >> (Optional) 423 | 424 | Temporary directory to build binary. 425 | 426 | =item C<< jobs: Int >> (Optional) 427 | 428 | Parallel building and testing. 429 | 430 | (Default: C<1>) 431 | 432 | =back 433 | 434 | =item C<< Perl::Build->install_from_tarball($dist_tarball_path, %args) >> 435 | 436 | Install perl from tar ball. This method extracts tar ball, build, and install. 437 | 438 | You can pass following options in C<< %args >>. 439 | 440 | =over 4 441 | 442 | =item C<< dst_path >> (Required) 443 | 444 | Destination directory to install perl. 445 | 446 | =item C<< configure_options : ArrayRef >> (Optional) 447 | 448 | Command line arguments for C<< ./Configure >>. 449 | 450 | (Default: C<< ['-de'] >>) 451 | 452 | =item C<< build_dir >> (Optional) 453 | 454 | Temporary directory to build binary. 455 | 456 | =item C<< jobs: Int >> (Optional) 457 | 458 | Parallel building and testing. 459 | 460 | (Default: C<1>) 461 | 462 | =back 463 | 464 | =item C<< Perl::Build->install(%args) >> 465 | 466 | Build and install Perl5 from extracted source directory. 467 | 468 | =over 4 469 | 470 | =item C<< src_path >> (Required) 471 | 472 | Source code directory to build. That contains extracted Perl5 source code. 473 | 474 | =item C<< dst_path >> (Required) 475 | 476 | Destination directory to install perl. 477 | 478 | =item C<< configure_options : ArrayRef >> (Optional) 479 | 480 | Command line arguments for C<< ./Configure >>. 481 | 482 | (Default: C<< ['-de'] >>) 483 | 484 | =item C<< test: Bool >> (Optional) 485 | 486 | If you set this value as C<< true >>, C<< Perl::Build >> runs C<< make test >> after building. 487 | 488 | (Default: C<0>) 489 | 490 | =item C<< jobs: Int >> (Optional) 491 | 492 | Parallel building and testing. 493 | 494 | (Default: C<1>) 495 | 496 | =back 497 | 498 | Returns an instance of L to facilitate using the built perl from code. 499 | 500 | =item C<< Perl::Build->symlink_devel_executables($bin_dir:Str) >> 501 | 502 | Perl5 binary generated with C<< -Dusedevel >>, is "perl-5.12.2" form. This method symlinks "perl-5.12.2" to "perl". 503 | 504 | =back 505 | 506 | =head1 FAQ 507 | 508 | =over 4 509 | 510 | =item How can I use patchperl plugins? 511 | 512 | If you want to use patchperl plugins, please Google "PERL5_PATCHPERL_PLUGIN". 513 | 514 | =item What's the difference between C<< perlbrew >>? 515 | 516 | L is a perl5 installation manager. But perl-build is a simple perl5 compilation and installation assistant tool. 517 | It makes perl5 installation easily. That's all. perl-build doesn't care about the user's environment. 518 | 519 | So, perl-build is just an installer. 520 | 521 | =back 522 | 523 | =head1 THANKS TO 524 | 525 | Most of the code was taken from L<< C >>. 526 | 527 | TYPESTER - suggests C<< --patches >> option 528 | 529 | Thanks 530 | 531 | =head1 AUTHOR 532 | 533 | Tokuhiro Matsuno Etokuhirom@gmail.comE 534 | 535 | 536 | =head1 LICENSE 537 | 538 | Copyright (C) Tokuhiro Matsuno 539 | 540 | This library is free software; you can redistribute it and/or modify 541 | it under the same terms as Perl itself. 542 | 543 | This software takes lot of the code from L. App::perlbrew's license is: 544 | 545 | The MIT License 546 | 547 | Copyright (c) 2010,2011 Kang-min Liu 548 | 549 | Permission is hereby granted, free of charge, to any person obtaining a copy 550 | of this software and associated documentation files (the "Software"), to deal 551 | in the Software without restriction, including without limitation the rights 552 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 553 | copies of the Software, and to permit persons to whom the Software is 554 | furnished to do so, subject to the following conditions: 555 | 556 | The above copyright notice and this permission notice shall be included in 557 | all copies or substantial portions of the Software. 558 | 559 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 560 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 561 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 562 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 563 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 564 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 565 | THE SOFTWARE. 566 | 567 | 568 | -------------------------------------------------------------------------------- /lib/Perl/Build/Built.pm: -------------------------------------------------------------------------------- 1 | package Perl::Build::Built; 2 | 3 | use strict; 4 | use warnings; 5 | use utf8; 6 | 7 | use 5.008001; 8 | our $VERSION = '1.34'; 9 | 10 | use Carp (); 11 | use File::Spec::Functions qw( catdir catfile ); 12 | 13 | sub run_env { 14 | my ( $self, @args ) = @_; 15 | my $config = {}; 16 | if ( ref $args[0] eq 'HASH' ) { 17 | $config = %{ shift @args }; 18 | } 19 | if ( $args[0] and ref $args[0] eq 'CODE' ) { 20 | $config->{code} = shift @args; 21 | } 22 | if (@args) { 23 | Carp::croak( '->run_env(\%config,\&code)' 24 | . ' or ->run_env(\&code)' 25 | . ' or ->run_env(\%config)' ); 26 | } 27 | local $ENV{PATH} = $self->combined_bin_path; 28 | my $combined_man_path = $self->combined_man_path; 29 | local $ENV{MANPATH} = $combined_man_path if $combined_man_path; 30 | delete local $ENV{PERL5LIB}; 31 | return $config->{code}->(); 32 | } 33 | 34 | sub new { 35 | my ( $self, $args ) = @_; 36 | $args = {} unless defined $args; 37 | Carp::croak '->new(\%config) required' if not ref $args eq 'HASH'; 38 | Carp::croak 'installed_path is a mandatory parameter' 39 | unless exists $args->{installed_path}; 40 | return bless $args, $self; 41 | } 42 | 43 | sub installed_path { 44 | return $_[0]->{installed_path}; 45 | } 46 | 47 | sub bin_path { 48 | return catdir( $_[0]->{installed_path}, 'bin' ); 49 | } 50 | 51 | sub man_path { 52 | return catdir( $_[0]->{installed_path}, 'man' ); 53 | } 54 | 55 | sub combined_bin_path { 56 | return $_[0]->bin_path . ':' . $ENV{PATH}; 57 | } 58 | 59 | sub combined_man_path { 60 | if ( -d $_[0]->man_path ) { 61 | return $_[0]->man_path . ':' . $ENV{MANPATH}; 62 | } 63 | return $ENV{MANPATH}; 64 | } 65 | 66 | 1; 67 | 68 | __END__ 69 | 70 | =pod 71 | 72 | =encoding utf8 73 | 74 | =for stopwords dir 75 | 76 | =head1 NAME 77 | 78 | Perl::Build::Built - A utility class to work with recently built perl installs. 79 | 80 | =head1 SYNOPSIS 81 | 82 | my $result = Perl::Build->install( ... ); 83 | $result->run_env(sub{ 84 | # Run code on the installed perl 85 | system('perl', .... ); 86 | }); 87 | 88 | =head1 METHODS 89 | 90 | =over 4 91 | 92 | =item $instance->run_env(\&code) 93 | 94 | Run C<&code> inside an environment configured to use the built perl. 95 | 96 | $instance->run_env(sub{ 97 | my $cpanm_path = catfile( $instance->bin_path , 'cpanm' ); 98 | system('wget','-O', $cpanm_path, 'http://path/to/cpanm'); 99 | system('chmod', 'u+x', $cpanm_path ); 100 | system('cpanm', "App::cpanoutdated"); 101 | system('perl',.... ); 102 | }); 103 | 104 | =item Perl::Build::Built->new( \%params ) 105 | 106 | You probably don't need to call this, ever. 107 | 108 | =item $instance->installed_path 109 | 110 | Returns the path the Perl was installed to ( Just whatever was passed to C ) 111 | 112 | =item $instance->bin_path 113 | 114 | Returns the path to the 'bin' dir inside the installed Perl target directory. 115 | 116 | =item $instance->man_path 117 | 118 | Returns the path to the 'man' dir inside the installed Perl target directory. 119 | 120 | =item $instance->combined_bin_path 121 | 122 | C prefixed onto C<$ENV{PATH}> 123 | 124 | =item $instance->combined_man_path 125 | 126 | C prefixed onto C<$ENV{MANPATH}> 127 | 128 | =back 129 | 130 | =head1 AUTHOR 131 | 132 | =over 4 133 | 134 | =item Kent Fredric Ekentnl@cpan.orgE 135 | 136 | =item Tokuhiro Matsuno Etokuhirom@gmail.comE 137 | 138 | =back 139 | 140 | =head1 LICENSE 141 | 142 | Copyright (C) Tokuhiro Matsuno 143 | 144 | This library is free software; you can redistribute it and/or modify 145 | it under the same terms as Perl itself. 146 | 147 | -------------------------------------------------------------------------------- /minil.toml: -------------------------------------------------------------------------------- 1 | module_maker="ModuleBuild" 2 | 3 | [FileGatherer] 4 | exclude_match = [ 5 | '^perl-build$', 6 | '^xt', 7 | '^author', 8 | ] 9 | -------------------------------------------------------------------------------- /script/perl-build: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | use strict; 3 | use warnings; 4 | use Perl::Build; 5 | use Devel::PatchPerl; 6 | use Getopt::Long; 7 | use Pod::Usage; 8 | use File::Spec; 9 | 10 | my $test = undef; 11 | my $patches; 12 | my $build_dir; 13 | my $symlink_devel_executables; 14 | my (@D, @A, @U); 15 | Getopt::Long::Configure( 16 | 'pass_through', 17 | 'no_ignore_case', 18 | 'bundling', 19 | ); 20 | GetOptions( 21 | 'h|help' => \my $help, 22 | 'test!' => \$test, 23 | 'D=s@' => \@D, 24 | 'A=s@' => \@A, 25 | 'U=s@' => \@U, 26 | 'definitions' => \my $definitions, 27 | 'patches=s' => \$patches, 28 | 'build-dir=s' => \$build_dir, 29 | 'j|jobs=i' => \my $jobs, 30 | 'tarball-dir=s' => \my $tarball_dir, 31 | 'version' => \my $show_version, 32 | 'symlink-devel-executables!' => \$symlink_devel_executables, 33 | 'noman' => \my $noman, 34 | ); 35 | for (@D, @A, @U) { 36 | s/^=//; 37 | } 38 | 39 | if ($show_version) { 40 | print "perl-build $Perl::Build::VERSION ($0)\n"; 41 | print "perl $] ($^X)\n"; 42 | print "Devel::PatchPerl $Devel::PatchPerl::VERSION\n"; 43 | exit 0; 44 | } 45 | 46 | pod2usage(1) if $help; 47 | 48 | if ($definitions) { 49 | for (Perl::Build->available_perls()) { 50 | print "$_\n"; 51 | } 52 | exit 0; 53 | } 54 | 55 | shift @ARGV if @ARGV >= 1 && $ARGV[0] eq '--'; 56 | 57 | my $stuff = shift @ARGV or pod2usage(); 58 | my $dest = shift @ARGV or pod2usage(); 59 | $dest = File::Spec->rel2abs($dest); 60 | 61 | my @configure_options = @ARGV ? @ARGV : ('-de'); 62 | push @configure_options, map { "-D$_" } @D; 63 | push @configure_options, map { "-A$_" } @A; 64 | push @configure_options, map { "-U$_" } @U; 65 | push @configure_options, "-Dman1dir=none", "-Dman3dir=none" if $noman; 66 | 67 | $ENV{PERL5_PATCHPERL_PLUGIN} = $patches if defined $patches; 68 | 69 | if ($stuff eq 'blead') { 70 | my $url = "https://github.com/Perl/perl5/archive/blead.tar.gz"; 71 | Perl::Build->install_from_url( 72 | $url => ( 73 | dst_path => $dest, 74 | configure_options => ['-Dusedevel', @configure_options], 75 | test => $test, 76 | build_dir => $build_dir, 77 | jobs => $jobs, 78 | tarball_dir => $tarball_dir, 79 | ) 80 | ); 81 | } elsif ($stuff =~ m{^https?://}) { 82 | Perl::Build->install_from_url( 83 | $stuff => ( 84 | dst_path => $dest, 85 | configure_options => \@configure_options, 86 | test => $test, 87 | build_dir => $build_dir, 88 | jobs => $jobs, 89 | tarball_dir => $tarball_dir, 90 | ) 91 | ); 92 | } elsif ($stuff =~ /\.(gz|bz2|xz)$/) { 93 | Perl::Build->install_from_tarball( 94 | $stuff => ( 95 | dst_path => $dest, 96 | configure_options => \@configure_options, 97 | test => $test, 98 | build_dir => $build_dir, 99 | jobs => $jobs, 100 | ) 101 | ); 102 | } else { 103 | my $version = $stuff; 104 | Perl::Build->install_from_cpan( 105 | $version => ( 106 | dst_path => $dest, 107 | configure_options => \@configure_options, 108 | test => $test, 109 | build_dir => $build_dir, 110 | jobs => $jobs, 111 | tarball_dir => $tarball_dir, 112 | ) 113 | ); 114 | } 115 | 116 | if ($symlink_devel_executables) { 117 | Perl::Build->symlink_devel_executables( 118 | File::Spec->catdir($dest, 'bin') 119 | ); 120 | } 121 | 122 | __END__ 123 | 124 | =head1 NAME 125 | 126 | perl-build - perl binary builder 127 | 128 | =head1 SYNOPSIS 129 | 130 | # perl-build command is FatPacker ready 131 | % curl -L https://raw.github.com/tokuhirom/Perl-Build/master/perl-build | perl - 5.16.2 /opt/perl-5.16/ 132 | 133 | # Or, just install from CPAN 134 | % cpanm Perl::Build 135 | 136 | # And run it. 137 | % perl-build 5.16.2 /usr/local/perl-5.16.2 138 | % perl-build path/to/perl-5.16.2.tar.gz /usr/local/perl-5.16.2 139 | 140 | =head1 DESCRIPTION 141 | 142 | This script fetch/build/install perl5 from CPAN or tar ball. 143 | 144 | =head1 OPTIONS 145 | 146 | =over 4 147 | 148 | =item -D, -A, -U 149 | 150 | -Dxxx, -Axxx, -Uxxx options are pass through to ./Configure script. 151 | 152 | =item --test 153 | 154 | This option enables C<< make test >> after building. 155 | 156 | (Default: disabled) 157 | 158 | =item --patches=Asan 159 | 160 | You can set I environment variable by this option. 161 | 162 | =item --build-dir=path 163 | 164 | Specify perl build path. optional. (Default: temporary directory) 165 | 166 | =item -j n 167 | 168 | =item --jobs n 169 | 170 | Parallel building and testing. 171 | 172 | =item --tarball-dir 173 | 174 | Specify the tar ball saving directory. 175 | 176 | (Default: temporary directory, will remove after building) 177 | 178 | =item --definitions 179 | 180 | % perl-build --definitions 181 | 182 | Display the available perl versions and exit. 183 | 184 | =item --version 185 | 186 | Show version number and exit. 187 | 188 | =item --symlink-devel-executables 189 | 190 | Create symlinks for development version perl commands. 191 | 192 | =item --noman 193 | 194 | Skip installation of manpages. 195 | This is equivalent to specifying C<-Dman1dir=none> and C<-Dman3dir=none>. 196 | 197 | =back 198 | 199 | =head1 FAQ 200 | 201 | =over 4 202 | 203 | =item How can I apply security fixes like CVE-2013-1667? 204 | 205 | RURBAN provides L. Install it and run C<< perl-build --patches=Asan 5.16.1 /opt/perl/5.16/ >>. 206 | 207 | =back 208 | 209 | =head1 SEE ALSO 210 | 211 | L, L 212 | 213 | -------------------------------------------------------------------------------- /t/00_compile.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use Test::More; 3 | 4 | use_ok $_ for qw( 5 | Perl::Build 6 | ); 7 | 8 | done_testing; 9 | -------------------------------------------------------------------------------- /t/01_perl_build_built.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use Test::More; 5 | use Perl::Build::Built; 6 | 7 | sub exception(&) { 8 | my $code = shift; 9 | my $prev_error = $@; 10 | my ( @ret, $error, $failed ); 11 | { 12 | local $@; 13 | $failed = not eval { 14 | $@ = $prev_error; 15 | $code->(); 16 | return 1; 17 | }; 18 | $error = $@; 19 | } 20 | if ( !$failed ) { 21 | return undef; 22 | } 23 | return $error; 24 | } 25 | 26 | sub lives($$) { 27 | my ( $result, @reason ) = @_; 28 | @_ = ( $result, undef, @reason ); 29 | goto \&is; 30 | } 31 | 32 | sub throws($$) { 33 | my ( $result, @reason ) = @_; 34 | @_ = ( $result, undef, @reason ); 35 | goto \&isnt; 36 | } 37 | 38 | my $sample; 39 | 40 | throws exception { die "can catch" }, 'minimal exception test works'; 41 | 42 | lives exception { 43 | $sample = 44 | Perl::Build::Built->new( { installed_path => 'wizzardry_example' } ); 45 | }, 46 | 'new does not bail'; 47 | 48 | throws exception { 49 | $sample->run_env( [] ); 50 | }, 'array ref is invalid'; 51 | 52 | lives exception { 53 | $sample->run_env( 54 | sub { 55 | like( $ENV{PATH}, qr/wizzardry_example/, 56 | 'installed_path propagates to ENV{PATH}' ); 57 | } 58 | ); 59 | }, 'run_env runs'; 60 | 61 | lives exception { 62 | unlike( $sample->combined_man_path || '', 63 | qr/wizzardry_example/, 64 | "combined_man_path not inclusive due to no real man path existing" ); 65 | }, 'combined_man_path lives'; 66 | 67 | done_testing; 68 | -------------------------------------------------------------------------------- /t/02_perl_release.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use Test::More; 3 | use Perl::Build; 4 | use CPAN::Perl::Releases; 5 | 6 | my %test = ( 7 | '5.22.1' => q!S/SH/SHAY/perl-5.22.1.tar.!, 8 | '5.18.2' => q!R/RJ/RJBS/perl-5.18.2.tar.!, 9 | '5.16.1' => q!R/RJ/RJBS/perl-5.16.1.tar.!, 10 | '5.12.5' => q!D/DO/DOM/perl-5.12.5.tar.!, 11 | '5.8.5' => q!N/NW/NWCLARK/perl-5.8.5.tar.!, 12 | ); 13 | 14 | subtest 'CPAN::Perl::Releases' => sub { 15 | local $Perl::Build::CPAN_MIRROR = ''; 16 | for my $ver (keys %test ) { 17 | my ($tarball,$url) = Perl::Build->perl_release($ver); 18 | like ($url, qr!^/authors/id/\Q$test{$ver}\E!); 19 | } 20 | }; 21 | 22 | subtest 'perl-releases-page' => sub { 23 | plan skip_all => 'author test only' unless $ENV{AUTHOR_TESTING}; 24 | local $Perl::Build::CPAN_MIRROR = ''; 25 | no warnings 'redefine'; 26 | *{CPAN::Perl::Releases::perl_tarballs} = sub {}; 27 | for my $ver (keys %test ) { 28 | my ($tarball,$url) = Perl::Build->perl_release($ver); 29 | like ($url, qr!^/authors/id/\Q$test{$ver}\E!); 30 | } 31 | }; 32 | 33 | subtest 'metacpan.org' => sub { 34 | plan skip_all => 'author test only' unless $ENV{AUTHOR_TESTING}; 35 | my $tiny = HTTP::Tinyish->new(timeout=>5); 36 | my $res = $tiny->get("https://fastapi.metacpan.org/"); 37 | plan skip_all => 'fastapi.metacpan.org seems to be down' unless $res->{success}; 38 | local $Perl::Build::CPAN_MIRROR = ''; 39 | no warnings 'redefine'; 40 | *{CPAN::Perl::Releases::perl_tarballs} = sub {}; 41 | my $orig = HTTP::Tinyish->can('get'); 42 | *{HTTP::Tinyish::get} = sub { 43 | return {success=>0,status=>599,reason=>"test error"} if $_[1] =~ m!perl-releases\.!; 44 | $orig->(@_); 45 | }; 46 | for my $ver (keys %test ) { 47 | my ($tarball,$url) = Perl::Build->perl_release($ver); 48 | like ($url, qr!^/authors/id/\Q$test{$ver}\E!); 49 | } 50 | }; 51 | 52 | 53 | done_testing; 54 | -------------------------------------------------------------------------------- /t/regression/056_issue.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | BEGIN { 5 | use Test::More; 6 | 7 | *CORE::GLOBAL::glob = sub { 8 | return ("/home/axafbin/.plenv/versions/5.22.2/bin/perl5.22.2"); 9 | }; 10 | 11 | *CORE::GLOBAL::system = sub { 12 | is $_[0], "ln -fs /home/axafbin/.plenv/versions/5.22.2/bin/perl5.22.2 /home/axafbin/.plenv/versions/5.22.2/bin/perl"; 13 | }; 14 | } 15 | 16 | use Perl::Build; 17 | 18 | Perl::Build->symlink_devel_executables("/home/axafbin/.plenv/versions/5.22.2/bin"); 19 | done_testing; 20 | -------------------------------------------------------------------------------- /xt/02_perlcritic.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | use Test::More; 4 | 5 | eval { 6 | require Perl::Critic; 7 | Perl::Critic->VERSION(1.105); 8 | 9 | require Test::Perl::Critic; 10 | Test::Perl::Critic->VERSION(1.02); 11 | Test::Perl::Critic->import( 12 | -profile => \(join q{}, ) 13 | ); 14 | }; 15 | note $@ if $@; 16 | plan skip_all => "Perl::Critic 1.105+ or Test::Perl::Critic 1.02+ is not installed." if $@; 17 | 18 | all_critic_ok('lib', 'script'); 19 | 20 | __END__ 21 | 22 | only=1 23 | 24 | # ------------------------------------------------------------------------- 25 | # Not important. 26 | 27 | [BuiltinFunctions::ProhibitSleepViaSelect] 28 | [BuiltinFunctions::RequireGlobFunction] 29 | [ClassHierarchies::ProhibitOneArgBless] 30 | 31 | # ------------------------------------------------------------------------- 32 | # Bug detection 33 | [InputOutput::ProhibitBarewordFileHandles] 34 | [Modules::RequireFilenameMatchesPackage] 35 | [Subroutines::ProhibitNestedSubs] 36 | [Subroutines::ProhibitReturnSort] 37 | [TestingAndDebugging::RequireUseStrict] 38 | [Variables::ProhibitConditionalDeclarations] 39 | [Variables::RequireLexicalLoopIterators] 40 | 41 | [TestingAndDebugging::ProhibitNoStrict] 42 | allow=refs 43 | 44 | # ------------------------------------------------------------------------- 45 | # Security issue detection 46 | [InputOutput::RequireEncodingWithUTF8Layer] 47 | [Modules::ProhibitEvilModules] 48 | [InputOutput::ProhibitTwoArgOpen] 49 | 50 | -------------------------------------------------------------------------------- /xt/live/01_available.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | use utf8; 4 | use Test::More; 5 | use Perl::Build; 6 | 7 | my @perls = Perl::Build->available_perls(); 8 | ok @perls; 9 | 10 | note $_ for @perls; 11 | 12 | done_testing; 13 | 14 | --------------------------------------------------------------------------------