├── .gitattributes ├── .github └── workflows │ ├── linux.yml │ ├── macos.yml │ ├── msys2-mingw.yml │ ├── static.yml │ └── windows.yml ├── .gitignore ├── .yath.rc ├── Changes ├── Changes.Alien-Base ├── Changes.Alien-Base-Wrapper ├── Changes.Alien-Build-Decode-Mojo ├── Changes.Test-Alien ├── README.md ├── SUPPORT ├── author.yml ├── corpus ├── ab_pkgconfig │ ├── gsl.pc │ └── test.pc ├── alien_build_plugin_digest_shapp │ ├── foo.txt │ └── foo.txt.gz ├── alien_build_plugin_fetch_curlcommand │ ├── dir │ │ ├── foo-1.00.tar │ │ ├── foo-1.01.tar │ │ ├── foo-1.02.tar │ │ └── html_test.html │ └── record │ │ ├── old.json │ │ └── old.yml ├── alien_build_plugin_fetch_wget │ ├── dir │ │ ├── foo-1.00.tar │ │ ├── foo-1.01.tar │ │ ├── foo-1.02.tar │ │ └── html_test.html │ └── record │ │ ├── old.json │ │ └── old.yml ├── basic │ └── alienfile ├── blank │ └── alienfile ├── cmake-libpalindrome │ ├── CMakeLists.txt │ ├── LICENSE │ ├── libpalindrome │ │ ├── CMakeLists.txt │ │ ├── libpalindrome.h │ │ └── palindrome.c │ └── palx │ │ ├── CMakeLists.txt │ │ └── main.c ├── dir │ ├── file.html │ ├── ftp.list │ ├── ftp_abs.list │ ├── http.html │ └── http_rel.html ├── dist │ ├── foo-1.00.tar │ ├── foo-1.00.tar.Z │ ├── foo-1.00.tar.bz2 │ ├── foo-1.00.tar.gz │ ├── foo-1.00.tar.xz │ ├── foo-1.00.zip │ └── foo-1.00 │ │ ├── configure │ │ └── foo.c ├── dist2 │ └── foo.tar ├── lib │ ├── Alien │ │ ├── Build │ │ │ └── Plugin │ │ │ │ ├── Download │ │ │ │ └── Foo.pm │ │ │ │ ├── Fetch │ │ │ │ ├── Corpus.pm │ │ │ │ └── Foo.pm │ │ │ │ ├── NesAdvantage │ │ │ │ ├── Controller.pm │ │ │ │ ├── HelperTest.pm │ │ │ │ └── Negotiate.pm │ │ │ │ └── RogerRamjet.pm │ │ ├── Foo.pm │ │ ├── Foo1.pm │ │ ├── Foo1 │ │ │ └── ConfigData.pm │ │ ├── Foo2.pm │ │ ├── Foo2 │ │ │ └── ConfigData.pm │ │ ├── SansShare.pm │ │ ├── foomake.pm │ │ ├── libfoo1.pm │ │ ├── libfoo2.pm │ │ ├── libfoo3.pm │ │ └── perlhelp.pm │ ├── Foo │ │ └── Bar │ │ │ ├── Baz.pm │ │ │ └── Baz1.pm │ ├── auto │ │ └── share │ │ │ └── dist │ │ │ ├── Alien-Foo2 │ │ │ ├── README │ │ │ └── lib │ │ │ │ ├── libfoo2-3.2.1 │ │ │ │ └── include │ │ │ │ │ └── foo2.h │ │ │ │ └── libfoo2.a │ │ │ ├── Alien-libfoo1 │ │ │ └── _alien │ │ │ │ ├── alien.json │ │ │ │ └── for_libfoo1 │ │ │ ├── Alien-libfoo2 │ │ │ ├── _alien │ │ │ │ ├── alien.json │ │ │ │ └── for_libfoo2 │ │ │ ├── bin │ │ │ │ └── foo-config │ │ │ ├── dynamic │ │ │ │ ├── libfoo.so │ │ │ │ └── libfoo.so.2 │ │ │ ├── include │ │ │ │ └── foo.h │ │ │ ├── lib │ │ │ │ ├── libfoo.a │ │ │ │ └── pkgconfig │ │ │ │ │ └── x1.pc │ │ │ └── share │ │ │ │ └── pkgconfig │ │ │ │ └── x2.pc │ │ │ ├── Alien-libfoo3 │ │ │ └── _alien │ │ │ │ └── alien.json │ │ │ └── Alien-perlhelp │ │ │ └── _alien │ │ │ └── alien.json │ └── pkgconfig │ │ ├── foo.pc │ │ ├── xor-chillout.pc │ │ └── xor.pc ├── pkgconfig │ ├── libbar1.pc │ └── libfoo1.pc └── vcpkg │ ├── r1 │ ├── .vcpkg-root │ └── installed │ │ └── x64-windows │ │ ├── debug │ │ └── lib │ │ │ └── foo.lib │ │ ├── include │ │ └── foo.h │ │ └── lib │ │ └── foo.lib │ └── r2 │ ├── .vcpkg-root │ └── installed │ ├── vcpkg │ ├── info │ │ ├── bzip2_1.0.6-5_x64-windows.list │ │ ├── curl_7.68.0-1_x64-windows.list │ │ ├── libarchive_3.4.1_x64-windows.list │ │ ├── libffi_3.3_x64-windows.list │ │ ├── libffi_3.3_x86-windows.list │ │ ├── libiconv_1.16-1_x64-windows.list │ │ ├── liblzma_5.2.4-4_x64-windows.list │ │ ├── libressl_2.9.1-2_x64-windows.list │ │ ├── libxml2_2.9.9-5_x64-windows.list │ │ ├── lz4_1.9.2_x64-windows.list │ │ ├── lzo_2.10-4_x64-windows.list │ │ ├── openssl-windows_1.1.1d-1_x64-windows.list │ │ ├── openssl_1.1.1d_x64-windows.list │ │ ├── xxhash_0.7.0_x64-windows.list │ │ └── zlib_1.2.11-6_x64-windows.list │ └── status │ ├── x64-windows │ ├── bin │ │ ├── libffi.dll │ │ └── libffi.pdb │ ├── debug │ │ ├── bin │ │ │ ├── libffi.dll │ │ │ └── libffi.pdb │ │ └── lib │ │ │ └── libffi.lib │ ├── include │ │ ├── ffi.h │ │ └── ffitarget.h │ ├── lib │ │ └── libffi.lib │ └── share │ │ └── libffi │ │ ├── copyright │ │ ├── libffiConfig.cmake │ │ ├── libffiConfigVersion.cmake │ │ ├── libffiTargets-debug.cmake │ │ ├── libffiTargets-release.cmake │ │ ├── libffiTargets.cmake │ │ └── vcpkg_abi_info.txt │ └── x86-windows │ ├── bin │ ├── libffi.dll │ └── libffi.pdb │ ├── debug │ ├── bin │ │ ├── libffi.dll │ │ └── libffi.pdb │ └── lib │ │ └── libffi.lib │ ├── include │ ├── ffi.h │ └── ffitarget.h │ ├── lib │ └── libffi.lib │ └── share │ └── libffi │ ├── copyright │ ├── libffiConfig.cmake │ ├── libffiConfigVersion.cmake │ ├── libffiTargets-debug.cmake │ ├── libffiTargets-release.cmake │ ├── libffiTargets.cmake │ └── vcpkg_abi_info.txt ├── dist.ini ├── example ├── README ├── bzip2.alienfile ├── curl.alienfile ├── dontpanic.alienfile ├── gmake.alienfile ├── openssl.alienfile ├── user │ ├── README │ ├── ffi-platypus │ │ ├── lib │ │ │ └── LZMA │ │ │ │ └── Example.pm │ │ └── t │ │ │ └── lzma_example.t │ ├── inline-c │ │ ├── lib │ │ │ └── LZMA │ │ │ │ └── Example.pm │ │ └── t │ │ │ └── lzma_example.t │ ├── tool │ │ ├── lib │ │ │ └── LZMA │ │ │ │ └── Example.pm │ │ └── t │ │ │ └── lzma_example.t │ ├── xs-dzil │ │ ├── Example.xs │ │ ├── dist.ini │ │ ├── lib │ │ │ └── LZMA │ │ │ │ └── Example.pm │ │ └── t │ │ │ └── lzma_example.t │ ├── xs-mb │ │ ├── Build.PL │ │ ├── lib │ │ │ └── LZMA │ │ │ │ ├── Example.pm │ │ │ │ └── Example.xs │ │ └── t │ │ │ └── lzma_example.t │ └── xs-mm │ │ ├── Example.xs │ │ ├── Makefile.PL │ │ ├── lib │ │ └── LZMA │ │ │ └── Example.pm │ │ └── t │ │ └── lzma_example.t ├── wrapper.pl ├── xz-manual.alienfile └── xz.alienfile ├── inc ├── probebad.pl └── trivial.xs ├── lib ├── Alien │ ├── Base.pm │ ├── Base │ │ ├── Authoring.pod │ │ ├── FAQ.pod │ │ ├── PkgConfig.pm │ │ └── Wrapper.pm │ ├── Build.pm │ ├── Build │ │ ├── CommandSequence.pm │ │ ├── Interpolate.pm │ │ ├── Interpolate │ │ │ └── Default.pm │ │ ├── Log.pm │ │ ├── Log │ │ │ ├── Abbreviate.pm │ │ │ └── Default.pm │ │ ├── MM.pm │ │ ├── Manual.pod │ │ ├── Manual │ │ │ ├── Alien.pod │ │ │ ├── AlienAuthor.pod │ │ │ ├── AlienUser.pod │ │ │ ├── Contributing.pod │ │ │ ├── FAQ.pod │ │ │ ├── PluginAuthor.pod │ │ │ ├── Security.pod │ │ │ └── image │ │ │ │ ├── PluginAuthor-flowchart.png │ │ │ │ └── PluginAuthor-flowchart.svg │ │ ├── Plugin.pm │ │ ├── Plugin │ │ │ ├── Build.pod │ │ │ ├── Build │ │ │ │ ├── Autoconf.pm │ │ │ │ ├── CMake.pm │ │ │ │ ├── Copy.pm │ │ │ │ ├── MSYS.pm │ │ │ │ ├── Make.pm │ │ │ │ └── SearchDep.pm │ │ │ ├── Core.pod │ │ │ ├── Core │ │ │ │ ├── CleanInstall.pm │ │ │ │ ├── Download.pm │ │ │ │ ├── FFI.pm │ │ │ │ ├── Gather.pm │ │ │ │ ├── Legacy.pm │ │ │ │ ├── Override.pm │ │ │ │ ├── Setup.pm │ │ │ │ └── Tail.pm │ │ │ ├── Decode.pod │ │ │ ├── Decode │ │ │ │ ├── DirListing.pm │ │ │ │ ├── DirListingFtpcopy.pm │ │ │ │ ├── HTML.pm │ │ │ │ └── Mojo.pm │ │ │ ├── Digest.pod │ │ │ ├── Digest │ │ │ │ ├── Negotiate.pm │ │ │ │ ├── SHA.pm │ │ │ │ └── SHAPP.pm │ │ │ ├── Download.pod │ │ │ ├── Download │ │ │ │ └── Negotiate.pm │ │ │ ├── Extract.pod │ │ │ ├── Extract │ │ │ │ ├── ArchiveTar.pm │ │ │ │ ├── ArchiveZip.pm │ │ │ │ ├── CommandLine.pm │ │ │ │ ├── Directory.pm │ │ │ │ ├── File.pm │ │ │ │ └── Negotiate.pm │ │ │ ├── Fetch.pod │ │ │ ├── Fetch │ │ │ │ ├── CurlCommand.pm │ │ │ │ ├── HTTPTiny.pm │ │ │ │ ├── LWP.pm │ │ │ │ ├── Local.pm │ │ │ │ ├── LocalDir.pm │ │ │ │ ├── NetFTP.pm │ │ │ │ └── Wget.pm │ │ │ ├── Gather.pod │ │ │ ├── Gather │ │ │ │ └── IsolateDynamic.pm │ │ │ ├── PkgConfig.pod │ │ │ ├── PkgConfig │ │ │ │ ├── CommandLine.pm │ │ │ │ ├── LibPkgConf.pm │ │ │ │ ├── MakeStatic.pm │ │ │ │ ├── Negotiate.pm │ │ │ │ └── PP.pm │ │ │ ├── Prefer.pod │ │ │ ├── Prefer │ │ │ │ ├── BadVersion.pm │ │ │ │ ├── GoodVersion.pm │ │ │ │ └── SortVersions.pm │ │ │ ├── Probe.pod │ │ │ ├── Probe │ │ │ │ ├── CBuilder.pm │ │ │ │ ├── CommandLine.pm │ │ │ │ └── Vcpkg.pm │ │ │ ├── Test.pod │ │ │ └── Test │ │ │ │ └── Mock.pm │ │ ├── Temp.pm │ │ ├── Util.pm │ │ ├── Version │ │ │ └── Basic.pm │ │ └── rc.pm │ ├── Role.pm │ └── Util.pm ├── Test │ ├── Alien.pm │ └── Alien │ │ ├── Build.pm │ │ ├── CanCompile.pm │ │ ├── CanPlatypus.pm │ │ ├── Diag.pm │ │ ├── Run.pm │ │ └── Synthetic.pm └── alienfile.pm ├── maint ├── Alien-Base-PkgConfig │ └── Makefile.PL ├── ci-test-plugins.pl ├── cip-after-install ├── cip-before-install ├── cip-test-plugins ├── gen-test-archives.pl ├── gen.pl └── update-cmake-libpalindrome ├── perlcriticrc ├── spellcheck.ini ├── t ├── 00_diag.t ├── 01_use.t ├── alien_base.t ├── alien_base__system_installed.t ├── alien_base_pkgconfig.t ├── alien_base_wrapper.t ├── alien_build.t ├── alien_build__download_rule.t ├── alien_build_commandsequence.t ├── alien_build_commandsequence__cd.t ├── alien_build_interpolate.t ├── alien_build_interpolate_default.t ├── alien_build_log.t ├── alien_build_log_abbreviate.t ├── alien_build_log_default.t ├── alien_build_meta.t ├── alien_build_mm.t ├── alien_build_plugin.t ├── alien_build_plugin_build_autoconf.t ├── alien_build_plugin_build_cmake.t ├── alien_build_plugin_build_copy.t ├── alien_build_plugin_build_make.t ├── alien_build_plugin_build_msys.t ├── alien_build_plugin_build_searchdep.t ├── alien_build_plugin_core_cleaninstall.t ├── alien_build_plugin_core_download.t ├── alien_build_plugin_core_ffi.t ├── alien_build_plugin_core_gather.t ├── alien_build_plugin_core_legacy.t ├── alien_build_plugin_core_override.t ├── alien_build_plugin_core_setup.t ├── alien_build_plugin_core_tail.t ├── alien_build_plugin_decode_dirlisting.t ├── alien_build_plugin_decode_dirlistingftpcopy.t ├── alien_build_plugin_decode_html.t ├── alien_build_plugin_decode_mojo.t ├── alien_build_plugin_digest_negotiate.t ├── alien_build_plugin_digest_sha.t ├── alien_build_plugin_digest_shapp.t ├── alien_build_plugin_download_negotiate.t ├── alien_build_plugin_extract_archivetar.t ├── alien_build_plugin_extract_archivezip.t ├── alien_build_plugin_extract_commandline.t ├── alien_build_plugin_extract_commandline__tar_can.t ├── alien_build_plugin_extract_directory.t ├── alien_build_plugin_extract_file.t ├── alien_build_plugin_extract_negotiate.t ├── alien_build_plugin_fetch_curlcommand.t ├── alien_build_plugin_fetch_httptiny.t ├── alien_build_plugin_fetch_local.t ├── alien_build_plugin_fetch_localdir.t ├── alien_build_plugin_fetch_lwp.t ├── alien_build_plugin_fetch_netftp.t ├── alien_build_plugin_fetch_wget.t ├── alien_build_plugin_gather_isolatedynamic.t ├── alien_build_plugin_meta.t ├── alien_build_plugin_pkgconfig_commandline.t ├── alien_build_plugin_pkgconfig_libpkgconf.t ├── alien_build_plugin_pkgconfig_makestatic.t ├── alien_build_plugin_pkgconfig_negotiate.t ├── alien_build_plugin_pkgconfig_negotiate__pick.t ├── alien_build_plugin_pkgconfig_pp.t ├── alien_build_plugin_prefer_badversion.t ├── alien_build_plugin_prefer_goodversion.t ├── alien_build_plugin_prefer_sortversions.t ├── alien_build_plugin_probe_cbuilder.t ├── alien_build_plugin_probe_cbuilder__live.t ├── alien_build_plugin_probe_commandline.t ├── alien_build_plugin_probe_vcpkg.t ├── alien_build_plugin_test_mock.t ├── alien_build_rc.t ├── alien_build_rc__prepostload.t ├── alien_build_rc__prepostload_plugin.t ├── alien_build_temp.t ├── alien_build_tempdir.t ├── alien_build_util.t ├── alien_build_version_basic.t ├── alien_role.t ├── alien_util.t ├── alienfile.t ├── bin │ ├── ftpd │ └── httpd ├── cip │ └── needs-alien-unzip │ │ ├── Dockerfile │ │ ├── alienfile │ │ ├── cpanfile │ │ ├── src │ │ ├── Makefile │ │ ├── configure │ │ └── src.zip │ │ └── t │ │ └── needs_alien_unzip.t ├── lib │ └── MyTest │ │ ├── CaptureNote.pm │ │ ├── FTP.pm │ │ ├── FauxFetchCommand.pm │ │ ├── File.pm │ │ ├── HTTP.pm │ │ ├── HaveCompiler.pm │ │ └── System.pm ├── test_alien.t ├── test_alien_build.t ├── test_alien_cancompile.t ├── test_alien_canplatypus.t ├── test_alien_diag.t ├── test_alien_run.t └── test_alien_synthetic.t ├── weaver.ini └── xt └── author ├── critic.t ├── filename.t └── pod_link.t /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pm linguist-language=Perl 2 | *.t linguist-language=Perl 3 | *.alienfile linguist-language=Perl 4 | *.h linguist-language=C 5 | -------------------------------------------------------------------------------- /.github/workflows/macos.yml: -------------------------------------------------------------------------------- 1 | name: macos 2 | 3 | on: 4 | push: 5 | branches: 6 | - '*' 7 | tags-ignore: 8 | - '*' 9 | pull_request: 10 | 11 | env: 12 | PERL5LIB: /Users/runner/perl5/lib/perl5 13 | PERL_LOCAL_LIB_ROOT: /Users/runner/perl5 14 | PERL_MB_OPT: --install_base /Users/runner/perl5 15 | PERL_MM_OPT: INSTALL_BASE=/Users/runner/perl5 16 | 17 | jobs: 18 | perl: 19 | 20 | runs-on: macOS-latest 21 | 22 | strategy: 23 | fail-fast: false 24 | 25 | steps: 26 | - uses: actions/checkout@v2 27 | 28 | - name: Set up Perl 29 | run: | 30 | brew install perl libffi libarchive 31 | curl https://cpanmin.us | perl - App::cpanminus -n 32 | echo "/Users/runner/perl5/bin" >> $GITHUB_PATH 33 | 34 | - name: perl -V 35 | run: perl -V 36 | 37 | - name: Prepare for cache 38 | run: | 39 | perl -V > perlversion.txt 40 | ls -l perlversion.txt 41 | 42 | - name: Cache CPAN modules 43 | uses: actions/cache@v4 44 | with: 45 | path: ~/perl5 46 | key: ${{ runner.os }}-build-${{ hashFiles('perlversion.txt') }} 47 | restore-keys: | 48 | ${{ runner.os }}-build-${{ hashFiles('perlversion.txt') }} 49 | 50 | - name: Install Static Dependencies 51 | run: | 52 | cpanm -n Dist::Zilla 53 | dzil authordeps --missing | cpanm -n 54 | dzil listdeps --missing | cpanm -n 55 | 56 | - name: Install Dynamic Dependencies 57 | run: dzil run --no-build 'cpanm --installdeps .' 58 | 59 | - name: Run Tests 60 | run: dzil test -v 61 | 62 | - name: CPAN log 63 | if: ${{ failure() }} 64 | run: | 65 | cat ~/.cpanm/latest-build/build.log 66 | -------------------------------------------------------------------------------- /.github/workflows/msys2-mingw.yml: -------------------------------------------------------------------------------- 1 | name: msys2-mingw 2 | 3 | on: 4 | push: 5 | branches: 6 | - '*' 7 | tags-ignore: 8 | - '*' 9 | pull_request: 10 | 11 | env: 12 | PERL5LIB: /c/cx/lib/perl5:/c/cx/lib/perl5/MSWin32-x64-multi-thread 13 | PERL_LOCAL_LIB_ROOT: c:/cx 14 | PERL_MB_OPT: --install_base C:/cx 15 | PERL_MM_OPT: INSTALL_BASE=C:/cx 16 | ALIEN_BUILD_PLUGIN_PKGCONFIG_COMMANDLINE_TEST: 1 # Test Alien::Build::Plugin::PkgConfig::CommandLine 17 | LC_ALL: C 18 | 19 | jobs: 20 | perl: 21 | 22 | runs-on: windows-latest 23 | 24 | strategy: 25 | fail-fast: false 26 | 27 | defaults: 28 | run: 29 | shell: msys2 {0} 30 | 31 | steps: 32 | - name: Set git to use LF 33 | run: | 34 | git config --global core.autocrlf false 35 | git config --global core.eol lf 36 | shell: powershell 37 | 38 | - uses: actions/checkout@v2 39 | 40 | - name: Set up Perl 41 | uses: msys2/setup-msys2@v2 42 | with: 43 | update: true 44 | install: >- 45 | base-devel 46 | mingw-w64-x86_64-toolchain 47 | mingw-w64-x86_64-perl 48 | mingw-w64-x86_64-libffi 49 | mingw-w64-x86_64-libarchive 50 | 51 | - name: perl -V 52 | run: | 53 | perl -V 54 | 55 | - name: Prepare for cache 56 | run: | 57 | perl -V > perlversion.txt 58 | ls perlversion.txt 59 | 60 | - name: Cache CPAN modules 61 | uses: actions/cache@v4 62 | with: 63 | path: c:\cx 64 | key: ${{ runner.os }}-build-msys2-${{ hashFiles('perlversion.txt') }} 65 | restore-keys: | 66 | ${{ runner.os }}-build-msys2-${{ hashFiles('perlversion.txt') }} 67 | 68 | - name: Install Static Dependencies 69 | run: | 70 | export PATH="/c/cx/bin:$PATH" 71 | yes | cpan App::cpanminus || true 72 | cpanm -n Dist::Zilla 73 | perl -S dzil authordeps --missing | perl -S cpanm -n 74 | perl -S dzil listdeps --missing | perl -S cpanm -n 75 | 76 | - name: Install Dynamic Dependencies 77 | run: | 78 | export PATH="/c/cx/bin:$PATH" 79 | perl -S dzil run --no-build 'perl -S cpanm -n --installdeps .' 80 | 81 | - name: Run Tests 82 | run: | 83 | export PATH="/c/cx/bin:$PATH" 84 | perl -S dzil test -v 85 | -------------------------------------------------------------------------------- /.github/workflows/static.yml: -------------------------------------------------------------------------------- 1 | name: static 2 | 3 | on: 4 | push: 5 | branches: 6 | - '*' 7 | tags-ignore: 8 | - '*' 9 | pull_request: 10 | 11 | jobs: 12 | perl: 13 | 14 | runs-on: ubuntu-latest 15 | 16 | env: 17 | CIP_TAG: static 18 | 19 | steps: 20 | - uses: actions/checkout@v2 21 | 22 | - name: Bootstrap CIP 23 | run: | 24 | curl -L https://raw.githubusercontent.com/uperl/cip/main/bin/github-bootstrap | bash 25 | 26 | - name: Build + Test 27 | run: | 28 | cip script 29 | -------------------------------------------------------------------------------- /.github/workflows/windows.yml: -------------------------------------------------------------------------------- 1 | name: windows 2 | 3 | on: 4 | push: 5 | branches: 6 | - '*' 7 | tags-ignore: 8 | - '*' 9 | pull_request: 10 | 11 | env: 12 | PERL5LIB: c:\cx\lib\perl5 13 | PERL_LOCAL_LIB_ROOT: c:/cx 14 | PERL_MB_OPT: --install_base C:/cx 15 | PERL_MM_OPT: INSTALL_BASE=C:/cx 16 | 17 | jobs: 18 | perl: 19 | 20 | runs-on: windows-latest 21 | 22 | strategy: 23 | fail-fast: false 24 | 25 | steps: 26 | - name: Set git to use LF 27 | run: | 28 | git config --global core.autocrlf false 29 | git config --global core.eol lf 30 | 31 | - uses: actions/checkout@v2 32 | 33 | - name: Set up Perl 34 | run: | 35 | choco install strawberryperl 36 | echo "C:\cx\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append 37 | echo "C:\strawberry\c\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append 38 | echo "C:\strawberry\perl\site\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append 39 | echo "C:\strawberry\perl\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append 40 | 41 | - name: Prepare for cache 42 | run: | 43 | perl -V > perlversion.txt 44 | 45 | - name: Cache CPAN modules 46 | uses: actions/cache@v4 47 | env: 48 | cache-name: cache-cpan-modules 49 | with: 50 | path: c:\cx 51 | key: ${{ runner.os }}-build-${{ hashFiles('perlversion.txt') }} 52 | restore-keys: | 53 | ${{ runner.os }}-build-${{ hashFiles('perlversion.txt') }} 54 | 55 | - name: perl -V 56 | run: perl -V 57 | 58 | - name: Install Static Dependencies 59 | run: | 60 | cpanm -n Dist::Zilla 61 | dzil authordeps --missing | cpanm -n 62 | dzil listdeps --missing | cpanm -n 63 | 64 | - name: Install Dynamic Dependencies 65 | run: dzil run --no-build 'cpanm --installdeps .' 66 | 67 | - name: Run Tests 68 | run: dzil test -v 69 | 70 | 71 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /Alien-Build-* 2 | /.build 3 | *.swp 4 | /t/bin/*.json 5 | /t/bin/*.log 6 | /example/Alien-*/*.bak 7 | /example/Alien-*/Makefile 8 | /example/Alien-*/_alien 9 | /example/Alien-*/blib 10 | /example/Alien-*/pm_to_blib 11 | /example/Alien-*/MYMETA.* 12 | /testalien* 13 | /corpus/alien_build_plugin_fetch_curlcommand/record/new.* 14 | /corpus/alien_build_plugin_fetch_wget/record/new.* 15 | /test-logs/ 16 | /.tmp/ 17 | *.old 18 | -------------------------------------------------------------------------------- /.yath.rc: -------------------------------------------------------------------------------- 1 | [test] 2 | -B 3 | -j 5 4 | --no-unsafe-inc 5 | --qvf 6 | -------------------------------------------------------------------------------- /Changes.Alien-Base-Wrapper: -------------------------------------------------------------------------------- 1 | Revision history for Alien-Base-Wrapper 2 | 3 | After 0.05 Alien-Base-Wrapper was merged with Alien-Build 4 | 5 | 0.05 2017-05-23 13:30:44 -0400 6 | - Handle $Config{cc} and $Config{ld} with spaces. 7 | - Bug in test where test was incorrectly expecting 8 | $Config{cc} instead of $Config{ld} in one test. 9 | 10 | 0.04 2017-04-04 15:40:13 -0400 11 | - Fix bug related to multiple aliens 12 | - Add mm_args method 13 | - Add mb_args method 14 | 15 | 0.03 2017-03-21 15:26:28 -0400 16 | - Sorry, more documentation changes only. 17 | The previous version was still pretty terrible! 18 | 19 | 0.02 2017-03-21 15:11:32 -0400 20 | - Documentation only changes 21 | 22 | 0.01 2017-03-21 15:10:19 -0400 23 | - initial version 24 | -------------------------------------------------------------------------------- /Changes.Alien-Build-Decode-Mojo: -------------------------------------------------------------------------------- 1 | Revision history for Alien-Build-Decode-Mojo 2 | 3 | After 0.04_01 Alien-Build-Decode-Mojo was merged with Alien-Build 4 | 5 | 0.04_01 2019-04-25 17:55:57 -0400 6 | - Diagnostic release. 7 | 8 | 0.03_01 2019-04-24 21:17:08 -0400 9 | - Diagnostic release. 10 | 11 | 0.02 2019-04-23 19:23:31 -0400 12 | - Fix prereqs (gh#1) 13 | 14 | 0.01 2019-04-23 03:59:09 -0400 15 | - initial version 16 | -------------------------------------------------------------------------------- /Changes.Test-Alien: -------------------------------------------------------------------------------- 1 | Revision history for Test-Alien 2 | 3 | After 0.15 Test-Alien was merged with Alien-Build 4 | 5 | 0.15 2017-05-23 13:14:32 -0400 6 | - Documentation fixes 7 | - Require more recent Text::ParseWords to avoid bugs in 8 | Text::ParseWords 9 | - Handle situation where temp directory is mounted 10 | noexec 11 | 12 | 0.14 2017-03-23 22:10:24 -0400 13 | - Documentation fixes. 14 | 15 | 0.12 2017-02-01 10:56:29 -0500 16 | - workaround for Capture::Tiny on MSWin32 17 | 18 | 0.11 2017-01-30 18:45:05 -0500 19 | - Only use static methods (see last entry) on share installs 20 | Typically you want to use the dynamic libraries on a system 21 | install 22 | 23 | 0.10 2017-01-30 18:37:41 -0500 24 | - Use static methods for cflags and libs if they are provided 25 | by the Alien module. 26 | 27 | 0.09 2017-01-13 07:13:38 -0500 28 | - Test::Alien::Run#note and #diag can be chained like the other 29 | methods 30 | 31 | 0.08 2016-12-29 18:03:35 -0500 32 | - Fixes to silence warnings coming from recent versions of Test2::Suite 33 | 34 | 0.07 2016-05-10 11:31:59 -0400 35 | - Require non-experimental Test2/Test-Simple and Test2::Suite 36 | 37 | 0.06 2016-04-27 14:52:12 -0400 38 | - Better diagnostic when there is a link exception. 39 | 40 | 0.05 2016-04-25 06:59:01 -0400 41 | - Migrated to Test2 API - This will likely break your 42 | test if you are using Test::Stream. Sorry! 43 | 44 | 0.04 2015-12-29 13:52:08 -0500 45 | - Tweaked test skips based on cpantesters feedback 46 | 47 | 0.03 2015-12-26 17:28:45 -0700 48 | - Fixed (hopefully) test failure in 49 | test_alien_synthetic_libarchive.t 50 | when FFI::Platypus was installed 51 | 52 | 0.02 2015-12-25 22:18:53 -0700 53 | - Fixes for Windows. 54 | - First CPAN release. 55 | 56 | 0.01 2015-12-25 20:20:16 -0700 57 | - initial version 58 | -------------------------------------------------------------------------------- /SUPPORT: -------------------------------------------------------------------------------- 1 | SUPPORT 2 | The intent of the "Alien-Build" team is to support as best as possible 3 | all Perls from 5.8.4 to the latest production version. So long as they 4 | are also supported by the Perl toolchain. 5 | 6 | Please feel encouraged to report issues that you encounter to the 7 | project GitHub Issue tracker: 8 | 9 | 10 | 11 | Better if you can fix the issue yourself, please feel encouraged to open 12 | pull-request on the project GitHub: 13 | 14 | 15 | 16 | If you are confounded and have questions, join us on the "#native" 17 | channel on irc.perl.org. The "Alien-Build" developers frequent this 18 | channel and can probably help point you in the right direction. If you 19 | don't have an IRC client handy, you can use this web interface: 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /corpus/ab_pkgconfig/gsl.pc: -------------------------------------------------------------------------------- 1 | prefix=/home/joel/Programs/Dist/Alien-Base/examples/Alien-GSL/_install 2 | exec_prefix=/home/joel/Programs/Dist/Alien-Base/examples/Alien-GSL/_install 3 | libdir=/home/joel/Programs/Dist/Alien-Base/examples/Alien-GSL/_install/lib 4 | includedir=/home/joel/Programs/Dist/Alien-Base/examples/Alien-GSL/_install/include 5 | GSL_CBLAS_LIB=-lgslcblas 6 | 7 | Name: GSL 8 | Description: GNU Scientific Library 9 | Version: 1.15 10 | Libs: -L/home/joel/Programs/Dist/Alien-Base/examples/Alien-GSL/_install/lib -lgsl ${GSL_CBLAS_LIB} -lm -lm 11 | Cflags: -I/home/joel/Programs/Dist/Alien-Base/examples/Alien-GSL/_install/include 12 | -------------------------------------------------------------------------------- /corpus/ab_pkgconfig/test.pc: -------------------------------------------------------------------------------- 1 | prefix=/home/test/path 2 | INTERNAL_VARIABLE=-lotherlib 3 | 4 | Name: TEST 5 | Description: My TEST Library 6 | Version: 1.01 7 | Libs: -L/home/test/path/lib -lsomelib ${INTERNAL_VARIABLE} -lm -lm 8 | Cflags: -Dfoo=bar -I/home/test/path/deeper/include 9 | Requires: lib1 >= 1.0.0 lib2 >= 1.2.3 10 | -------------------------------------------------------------------------------- /corpus/alien_build_plugin_digest_shapp/foo.txt: -------------------------------------------------------------------------------- 1 | this is some text 2 | -------------------------------------------------------------------------------- /corpus/alien_build_plugin_digest_shapp/foo.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/alien_build_plugin_digest_shapp/foo.txt.gz -------------------------------------------------------------------------------- /corpus/alien_build_plugin_fetch_curlcommand/dir/foo-1.00.tar: -------------------------------------------------------------------------------- 1 | content:foo-1.00 2 | -------------------------------------------------------------------------------- /corpus/alien_build_plugin_fetch_curlcommand/dir/foo-1.01.tar: -------------------------------------------------------------------------------- 1 | content:foo-1.01 2 | -------------------------------------------------------------------------------- /corpus/alien_build_plugin_fetch_curlcommand/dir/foo-1.02.tar: -------------------------------------------------------------------------------- 1 | content:foo-1.02 2 | -------------------------------------------------------------------------------- /corpus/alien_build_plugin_fetch_curlcommand/dir/html_test.html: -------------------------------------------------------------------------------- 1 | Hello World

Hello World

2 | -------------------------------------------------------------------------------- /corpus/alien_build_plugin_fetch_wget/dir/foo-1.00.tar: -------------------------------------------------------------------------------- 1 | content:foo-1.00 2 | -------------------------------------------------------------------------------- /corpus/alien_build_plugin_fetch_wget/dir/foo-1.01.tar: -------------------------------------------------------------------------------- 1 | content:foo-1.01 2 | -------------------------------------------------------------------------------- /corpus/alien_build_plugin_fetch_wget/dir/foo-1.02.tar: -------------------------------------------------------------------------------- 1 | content:foo-1.02 2 | -------------------------------------------------------------------------------- /corpus/alien_build_plugin_fetch_wget/dir/html_test.html: -------------------------------------------------------------------------------- 1 | Hello World

Hello World

2 | -------------------------------------------------------------------------------- /corpus/basic/alienfile: -------------------------------------------------------------------------------- 1 | use alienfile; 2 | 3 | requires 'Foo', '1.00'; 4 | 5 | configure { 6 | requires 'Early::Module', '1.234'; 7 | }; 8 | 9 | share { 10 | requires 'Bar', '2.00'; 11 | }; 12 | 13 | sys { 14 | requires 'Baz', '3.00'; 15 | }; 16 | -------------------------------------------------------------------------------- /corpus/blank/alienfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/blank/alienfile -------------------------------------------------------------------------------- /corpus/cmake-libpalindrome/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.0.0) 2 | project (libpalindrome C) 3 | add_subdirectory (libpalindrome) 4 | add_subdirectory (palx) 5 | -------------------------------------------------------------------------------- /corpus/cmake-libpalindrome/libpalindrome/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library (palindrome SHARED palindrome.c) 2 | add_library (palindromeStatic palindrome.c) 3 | target_include_directories (palindrome PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 4 | target_include_directories (palindromeStatic PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 5 | 6 | IF (WIN32 OR CYGWIN OR MINGW) 7 | ELSE() 8 | set_target_properties(palindromeStatic PROPERTIES OUTPUT_NAME palindrome) 9 | ENDIF() 10 | 11 | IF (WIN32 OR CYGWIN OR MINGW) 12 | install(TARGETS palindrome RUNTIME DESTINATION bin) 13 | ELSE() 14 | install(TARGETS palindrome LIBRARY DESTINATION lib) 15 | ENDIF() 16 | 17 | install(TARGETS palindromeStatic ARCHIVE DESTINATION lib) 18 | install(FILES libpalindrome.h DESTINATION include) 19 | -------------------------------------------------------------------------------- /corpus/cmake-libpalindrome/libpalindrome/libpalindrome.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2017 Graham Ollis */ 2 | #ifndef LIBPALINDROME_H 3 | #define LIBPALINDROME_H 1 4 | 5 | int is_palindrome(const char *); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /corpus/cmake-libpalindrome/libpalindrome/palindrome.c: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2017 Graham Ollis */ 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | static void 8 | copy_letters(char *buffer, const char *original) 9 | { 10 | while(*original != 0) 11 | { 12 | if(isalpha(*original)) 13 | *(buffer++) = tolower(*original); 14 | original++; 15 | } 16 | *buffer = 0; 17 | } 18 | 19 | static void 20 | copy_reverse(char *buffer, const char *original) 21 | { 22 | int i; 23 | for(i=strlen(original)-1; i >= 0; i--) 24 | *(buffer++) = original[i]; 25 | *buffer = 0; 26 | } 27 | 28 | int 29 | is_palindrome(const char *something) 30 | { 31 | char *copy1; 32 | char *copy2; 33 | int ret; 34 | size_t len; 35 | 36 | len = strlen(something); 37 | 38 | copy1 = malloc(len+1); 39 | copy2 = malloc(len+1); 40 | 41 | copy_letters(copy1, something); 42 | copy_reverse(copy2, copy1); 43 | 44 | ret = strncmp(copy1, copy2, len) == 0; 45 | 46 | free(copy1); 47 | free(copy2); 48 | 49 | return ret; 50 | } 51 | -------------------------------------------------------------------------------- /corpus/cmake-libpalindrome/palx/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable (palx main.c) 2 | target_link_libraries (palx LINK_PUBLIC palindromeStatic) 3 | install(TARGETS palx RUNTIME DESTINATION bin) 4 | -------------------------------------------------------------------------------- /corpus/cmake-libpalindrome/palx/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int 4 | main(int argc, char *argv[]) 5 | { 6 | /* 7 | * If we do not have EXACTLY one argument, 8 | * return a usage error. 9 | */ 10 | if(argc != 2) 11 | return 1; 12 | 13 | if(is_palindrome(argv[1])) 14 | return 0; 15 | else 16 | return 2; 17 | } 18 | -------------------------------------------------------------------------------- /corpus/dir/file.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Directory /home/ollisg/dev/Alien-Build/corpus/dist/ 4 | 5 | 6 | 7 |

Directory listing of /home/ollisg/dev/Alien-Build/corpus/dist/

8 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /corpus/dir/ftp.list: -------------------------------------------------------------------------------- 1 | total 28 2 | drwxr-xr-x 2 ollisg ollisg 4096 Jan 19 19:43 foo-1.00 3 | -rw-r--r-- 1 ollisg ollisg 3584 Jan 20 06:22 foo-1.00.tar 4 | -rw-r--r-- 1 ollisg ollisg 385 Jan 19 19:43 foo-1.00.tar.Z 5 | -rw-r--r-- 1 ollisg ollisg 301 Jan 19 19:43 foo-1.00.tar.bz2 6 | -rw-r--r-- 1 ollisg ollisg 261 Jan 20 06:22 foo-1.00.tar.gz 7 | -rw-r--r-- 1 ollisg ollisg 296 Jan 19 19:43 foo-1.00.tar.xz 8 | -rw-r--r-- 1 ollisg ollisg 584 Jan 20 06:23 foo-1.00.zip 9 | -------------------------------------------------------------------------------- /corpus/dir/ftp_abs.list: -------------------------------------------------------------------------------- 1 | total 28 2 | drwxr-xr-x 2 ollisg ollisg 4096 Jan 19 19:43 /xyz/abc/foo-1.00 3 | -rw-r--r-- 1 ollisg ollisg 3584 Jan 20 06:22 /xyz/abc/foo-1.00.tar 4 | -rw-r--r-- 1 ollisg ollisg 385 Jan 19 19:43 /xyz/abc/foo-1.00.tar.Z 5 | -rw-r--r-- 1 ollisg ollisg 301 Jan 19 19:43 /xyz/abc/foo-1.00.tar.bz2 6 | -rw-r--r-- 1 ollisg ollisg 261 Jan 20 06:22 /xyz/abc/foo-1.00.tar.gz 7 | -rw-r--r-- 1 ollisg ollisg 296 Jan 19 19:43 /xyz/abc/foo-1.00.tar.xz 8 | -rw-r--r-- 1 ollisg ollisg 584 Jan 20 06:23 /xyz/abc/foo-1.00.zip 9 | -------------------------------------------------------------------------------- /corpus/dir/http.html: -------------------------------------------------------------------------------- 1 | 2 | Index of /corpus/dist/ 3 | 4 | 11 | 12 |

Index of /corpus/dist/

13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
NameSizeTypeLast Modified
Parent Directory
foo-1.00/4096directoryFri, 20 Jan 2017 00:43:29 GMT
foo-1.00.tar3584text/plainFri, 20 Jan 2017 11:22:09 GMT
foo-1.00.tar.Z385text/plainFri, 20 Jan 2017 00:43:29 GMT
foo-1.00.tar.bz2301text/plainFri, 20 Jan 2017 00:43:29 GMT
foo-1.00.tar.gz261application/x-gzipFri, 20 Jan 2017 11:22:51 GMT
foo-1.00.tar.xz296text/plainFri, 20 Jan 2017 00:43:29 GMT
foo%2D1%2E00%2Etgz584application/x-gzipFri, 20 Jan 2017 11:23:15 GMT
foo-1.00.zip584application/zipFri, 20 Jan 2017 11:23:15 GMT
31 |
32 | 33 | -------------------------------------------------------------------------------- /corpus/dir/http_rel.html: -------------------------------------------------------------------------------- 1 | 2 | Index of /foo/bar/ 3 | 4 | 11 | 12 |

Index of /foo/bar/

13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
NameSizeTypeLast Modified
Parent Directory
foo-1.00/4096directoryFri, 20 Jan 2017 00:43:29 GMT
foo-1.00.tar3584text/plainFri, 20 Jan 2017 11:22:09 GMT
foo-1.00.tar.Z385text/plainFri, 20 Jan 2017 00:43:29 GMT
foo-1.00.tar.bz2301text/plainFri, 20 Jan 2017 00:43:29 GMT
foo-1.00.tar.gz261application/x-gzipFri, 20 Jan 2017 11:22:51 GMT
foo-1.00.tar.xz296text/plainFri, 20 Jan 2017 00:43:29 GMT
foo-1.00.tgz584application/x-gzipFri, 20 Jan 2017 11:23:15 GMT
foo-1.00.zip584application/zipFri, 20 Jan 2017 11:23:15 GMT
31 |
32 | 33 | -------------------------------------------------------------------------------- /corpus/dist/foo-1.00.tar.Z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/dist/foo-1.00.tar.Z -------------------------------------------------------------------------------- /corpus/dist/foo-1.00.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/dist/foo-1.00.tar.bz2 -------------------------------------------------------------------------------- /corpus/dist/foo-1.00.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/dist/foo-1.00.tar.gz -------------------------------------------------------------------------------- /corpus/dist/foo-1.00.tar.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/dist/foo-1.00.tar.xz -------------------------------------------------------------------------------- /corpus/dist/foo-1.00.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/dist/foo-1.00.zip -------------------------------------------------------------------------------- /corpus/dist/foo-1.00/configure: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "hi there"; 4 | -------------------------------------------------------------------------------- /corpus/dist/foo-1.00/foo.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int 4 | main(int argc, char *argv[]) 5 | { 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /corpus/lib/Alien/Build/Plugin/Download/Foo.pm: -------------------------------------------------------------------------------- 1 | package Alien::Build::Plugin::Download::Foo; 2 | 3 | use strict; 4 | use warnings; 5 | use Alien::Build::Plugin; 6 | 7 | sub init 8 | { 9 | my($self,$meta) = @_; 10 | 11 | $meta->prop->{check_digest} = 1; 12 | $meta->prop->{digest} = { '*' => [ FAKE => 'deadbeaf' ] }; 13 | 14 | $meta->apply_plugin('Download::Negotiate', url => 'corpus/dist/foo-1.00.tar'); 15 | $meta->apply_plugin('Extract::ArchiveTar'); 16 | $meta->apply_plugin('Test::Mock', check_digest => 1); 17 | $meta->register_hook(probe => sub { 'share' }); 18 | } 19 | 20 | 1; 21 | -------------------------------------------------------------------------------- /corpus/lib/Alien/Build/Plugin/Fetch/Foo.pm: -------------------------------------------------------------------------------- 1 | package Alien::Build::Plugin::Fetch::Foo; 2 | 3 | use strict; 4 | use warnings; 5 | use Alien::Build::Plugin; 6 | 7 | has '+versions' => undef; 8 | 9 | sub init 10 | { 11 | my($self, $meta) = @_; 12 | $meta->register_hook( 13 | probe => sub { 'share' }, 14 | ); 15 | $meta->prop->{start_url} = 'file://localhost/'; 16 | $meta->register_hook( 17 | fetch => sub { 18 | my($build, $url) = @_; 19 | $build->log("url = @{[ $url || 'undef' ]}"); 20 | if(defined $url) 21 | { 22 | my($filename) = $url =~ m{([^/]*)$}; 23 | return { 24 | type => 'file', 25 | filename => $filename, 26 | content => "data:$filename", 27 | protocol => 'file', 28 | }; 29 | } 30 | else 31 | { 32 | return { 33 | type => 'list', 34 | list => [ 35 | map { { filename => "foo-$_.tar.gz", url => "file://localhost/foo-$_.tar.gz" } } @{ $self->versions }, 36 | ], 37 | protocol => 'file', 38 | } 39 | } 40 | }, 41 | ); 42 | } 43 | 44 | 1; 45 | -------------------------------------------------------------------------------- /corpus/lib/Alien/Build/Plugin/NesAdvantage/Controller.pm: -------------------------------------------------------------------------------- 1 | package Alien::Build::Plugin::NesAdvantage::Controller; 2 | 3 | use strict; 4 | use warnings; 5 | use Alien::Build::Plugin; 6 | 7 | sub init 8 | { 9 | my($self, $meta) = @_; 10 | $meta->prop->{nesadvantage} = 'controller'; 11 | } 12 | 13 | 1; 14 | -------------------------------------------------------------------------------- /corpus/lib/Alien/Build/Plugin/NesAdvantage/HelperTest.pm: -------------------------------------------------------------------------------- 1 | package Alien::Build::Plugin::NesAdvantage::HelperTest; 2 | 3 | use strict; 4 | use warnings; 5 | use Alien::Build::Plugin; 6 | 7 | sub init 8 | { 9 | my($self, $meta) = @_; 10 | my $intr = $meta->interpolator; 11 | $intr->replace_helper('nes' => sub { 'advantage' }); 12 | } 13 | 14 | 1; 15 | -------------------------------------------------------------------------------- /corpus/lib/Alien/Build/Plugin/NesAdvantage/Negotiate.pm: -------------------------------------------------------------------------------- 1 | package Alien::Build::Plugin::NesAdvantage::Negotiate; 2 | 3 | use strict; 4 | use warnings; 5 | use Alien::Build::Plugin; 6 | 7 | sub init 8 | { 9 | my($self, $meta) = @_; 10 | $meta->prop->{nesadvantage} = 'negotiate'; 11 | } 12 | 13 | 1; 14 | -------------------------------------------------------------------------------- /corpus/lib/Alien/Build/Plugin/RogerRamjet.pm: -------------------------------------------------------------------------------- 1 | package Alien::Build::Plugin::RogerRamjet; 2 | 3 | use strict; 4 | use warnings; 5 | use Alien::Build::Plugin; 6 | 7 | has 'foo' => 22; 8 | has '+bar' => sub { 'something generated' }; 9 | has 'baz' => undef; 10 | 11 | sub init 12 | { 13 | my($self, $meta) = @_; 14 | 15 | $meta->prop->{ramjet} = 'roger'; 16 | $meta->prop->{foo} = $self->foo; 17 | $meta->prop->{bar} = $self->bar; 18 | $meta->prop->{baz} = $self->baz; 19 | 20 | } 21 | 22 | 1; 23 | -------------------------------------------------------------------------------- /corpus/lib/Alien/Foo.pm: -------------------------------------------------------------------------------- 1 | package Alien::Foo; 2 | 3 | sub new { bless {}, __PACKAGE__ } 4 | sub cflags {} 5 | sub libs {} 6 | sub dynamic_libs {} 7 | sub bin_dir { '/foo/bar/baz' } 8 | 9 | 1; 10 | -------------------------------------------------------------------------------- /corpus/lib/Alien/Foo1.pm: -------------------------------------------------------------------------------- 1 | package Alien::Foo1; 2 | 3 | use strict; 4 | use warnings; 5 | use parent qw( Alien::Base ); 6 | 7 | 1; 8 | -------------------------------------------------------------------------------- /corpus/lib/Alien/Foo2.pm: -------------------------------------------------------------------------------- 1 | package Alien::Foo2; 2 | 3 | use strict; 4 | use warnings; 5 | use parent qw( Alien::Base ); 6 | 7 | 1; 8 | -------------------------------------------------------------------------------- /corpus/lib/Alien/SansShare.pm: -------------------------------------------------------------------------------- 1 | package Alien::SansShare; 2 | 3 | use strict; 4 | use warnings; 5 | use parent qw( Alien::Base ); 6 | 7 | 1; 8 | -------------------------------------------------------------------------------- /corpus/lib/Alien/foomake.pm: -------------------------------------------------------------------------------- 1 | package Alien::foomake; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | our $VERSION = '0.25'; 7 | 8 | sub exe { 'foomake.exe' } 9 | 10 | sub alien_helper 11 | { 12 | return { 13 | foomake1 => sub { Alien::foomake->exe }, 14 | foomake2 => 'Alien::foomake->exe', 15 | }; 16 | } 17 | 18 | 1; 19 | -------------------------------------------------------------------------------- /corpus/lib/Alien/libfoo1.pm: -------------------------------------------------------------------------------- 1 | package Alien::libfoo1; 2 | 3 | use strict; 4 | use warnings; 5 | use parent qw( Alien::Base ); 6 | 7 | sub alien_helper 8 | { 9 | return { 10 | foo1 => sub { 'bar' . (1+2) }, 11 | foo2 => '"baz" . (3+4)', 12 | }; 13 | } 14 | 15 | 1; 16 | -------------------------------------------------------------------------------- /corpus/lib/Alien/libfoo2.pm: -------------------------------------------------------------------------------- 1 | package Alien::libfoo2; 2 | 3 | use strict; 4 | use warnings; 5 | use parent qw( Alien::Base ); 6 | 7 | sub alien_helper 8 | { 9 | return { 10 | foo1 => sub { 'bar' . (1+2) }, 11 | foo2 => '"baz" . (3+4)', 12 | }; 13 | } 14 | 15 | 1; 16 | -------------------------------------------------------------------------------- /corpus/lib/Alien/libfoo3.pm: -------------------------------------------------------------------------------- 1 | package Alien::libfoo3; 2 | 3 | use strict; 4 | use warnings; 5 | use parent qw( Alien::Base ); 6 | 7 | 1; 8 | -------------------------------------------------------------------------------- /corpus/lib/Alien/perlhelp.pm: -------------------------------------------------------------------------------- 1 | package Alien::perlhelp; 2 | 3 | use strict; 4 | use warnings; 5 | use parent qw( Alien::Base ); 6 | 7 | our $VERSION = '0.25'; 8 | 9 | sub exe { $^X } 10 | 11 | sub alien_helper 12 | { 13 | return { 14 | perlhelp => sub { __PACKAGE__->exe }, 15 | }; 16 | } 17 | 18 | 1; 19 | -------------------------------------------------------------------------------- /corpus/lib/Foo/Bar/Baz.pm: -------------------------------------------------------------------------------- 1 | package Foo::Bar::Baz; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | our $VERSION = '1.23'; 7 | 8 | 1; 9 | -------------------------------------------------------------------------------- /corpus/lib/Foo/Bar/Baz1.pm: -------------------------------------------------------------------------------- 1 | package Foo::Bar::Baz1; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | our $VERSION = '1.23'; 7 | 8 | 1; 9 | -------------------------------------------------------------------------------- /corpus/lib/auto/share/dist/Alien-Foo2/README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/lib/auto/share/dist/Alien-Foo2/README -------------------------------------------------------------------------------- /corpus/lib/auto/share/dist/Alien-Foo2/lib/libfoo2-3.2.1/include/foo2.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/lib/auto/share/dist/Alien-Foo2/lib/libfoo2-3.2.1/include/foo2.h -------------------------------------------------------------------------------- /corpus/lib/auto/share/dist/Alien-Foo2/lib/libfoo2.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/lib/auto/share/dist/Alien-Foo2/lib/libfoo2.a -------------------------------------------------------------------------------- /corpus/lib/auto/share/dist/Alien-libfoo1/_alien/alien.json: -------------------------------------------------------------------------------- 1 | { 2 | "libs" : "-lfoo ", 3 | "install_type" : "system", 4 | "version" : "1.2.3", 5 | "legacy" : { 6 | "finished_installing" : 1, 7 | "name" : "foo", 8 | "version" : "1.2.3", 9 | "original_prefix" : "/foo/bar/baz/auto/share/dist/Alien-libfoo1", 10 | "install_type" : "system" 11 | }, 12 | "cflags_static" : "-DFOO=1 -DFOO_STATIC=1 ", 13 | "cflags" : "-DFOO=1 ", 14 | "libs_static" : "-lfoo -lbar -lbaz ", 15 | "prefix" : "/foo/bar/baz/auto/share/dist/Alien-libfoo1", 16 | "arbitrary" : "one" 17 | } 18 | -------------------------------------------------------------------------------- /corpus/lib/auto/share/dist/Alien-libfoo1/_alien/for_libfoo1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/lib/auto/share/dist/Alien-libfoo1/_alien/for_libfoo1 -------------------------------------------------------------------------------- /corpus/lib/auto/share/dist/Alien-libfoo2/_alien/alien.json: -------------------------------------------------------------------------------- 1 | { 2 | "libs" : "-L/foo/bar/baz/auto/share/dist/Alien-libfoo1/lib -lfoo ", 3 | "install_type" : "share", 4 | "version" : "2.3.4", 5 | "legacy" : { 6 | "finished_installing" : 1, 7 | "name" : "foo", 8 | "version" : "2.3.4", 9 | "original_prefix" : "/foo/bar/baz/auto/share/dist/Alien-libfoo1", 10 | "install_type" : "share" 11 | }, 12 | "cflags_static" : "-I/foo/bar/baz/auto/share/dist/Alien-libfoo1/include -DFOO=1 -DFOO_STATIC=1 ", 13 | "cflags" : "-I/foo/bar/baz/auto/share/dist/Alien-libfoo1/include -DFOO=1 ", 14 | "libs_static" : "-L/foo/bar/baz/auto/share/dist/Alien-libfoo1/lib -lfoo -lbar -lbaz ", 15 | "prefix" : "/foo/bar/baz/auto/share/dist/Alien-libfoo1", 16 | "arbitrary" : "two" 17 | } 18 | -------------------------------------------------------------------------------- /corpus/lib/auto/share/dist/Alien-libfoo2/_alien/for_libfoo2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/lib/auto/share/dist/Alien-libfoo2/_alien/for_libfoo2 -------------------------------------------------------------------------------- /corpus/lib/auto/share/dist/Alien-libfoo2/bin/foo-config: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | print "hi there ho there\n"; 4 | -------------------------------------------------------------------------------- /corpus/lib/auto/share/dist/Alien-libfoo2/dynamic/libfoo.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/lib/auto/share/dist/Alien-libfoo2/dynamic/libfoo.so -------------------------------------------------------------------------------- /corpus/lib/auto/share/dist/Alien-libfoo2/dynamic/libfoo.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/lib/auto/share/dist/Alien-libfoo2/dynamic/libfoo.so.2 -------------------------------------------------------------------------------- /corpus/lib/auto/share/dist/Alien-libfoo2/include/foo.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/lib/auto/share/dist/Alien-libfoo2/include/foo.h -------------------------------------------------------------------------------- /corpus/lib/auto/share/dist/Alien-libfoo2/lib/libfoo.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/lib/auto/share/dist/Alien-libfoo2/lib/libfoo.a -------------------------------------------------------------------------------- /corpus/lib/auto/share/dist/Alien-libfoo2/lib/pkgconfig/x1.pc: -------------------------------------------------------------------------------- 1 | Name: x1 2 | -------------------------------------------------------------------------------- /corpus/lib/auto/share/dist/Alien-libfoo2/share/pkgconfig/x2.pc: -------------------------------------------------------------------------------- 1 | Name: x2 2 | -------------------------------------------------------------------------------- /corpus/lib/auto/share/dist/Alien-libfoo3/_alien/alien.json: -------------------------------------------------------------------------------- 1 | { 2 | "libs" : "-L/foo/bar/baz/auto/share/dist/Alien-libfoo1/lib -lfoo ", 3 | "install_type" : "share", 4 | "version" : "2.3.4", 5 | "legacy" : { 6 | "finished_installing" : 1, 7 | "name" : "foo", 8 | "version" : "2.3.4", 9 | "original_prefix" : "/foo/bar/baz/auto/share/dist/Alien-libfoo1", 10 | "install_type" : "share" 11 | }, 12 | "cflags_static" : "-I/foo/bar/baz/auto/share/dist/Alien-libfoo1/include -DFOO=1 -DFOO_STATIC=1 ", 13 | "cflags" : "-I/foo/bar/baz/auto/share/dist/Alien-libfoo1/include -DFOO=1 ", 14 | "libs_static" : "-L/foo/bar/baz/auto/share/dist/Alien-libfoo1/lib -lfoo -lbar -lbaz ", 15 | "prefix" : "/foo/bar/baz/auto/share/dist/Alien-libfoo1", 16 | "arbitrary" : "two", 17 | "alt" : { 18 | "foo1" : { 19 | "libs" : "-L/foo/bar/baz/auto/share/dist/Alien-libfoo1/lib -lfoo ", 20 | "version" : "2.3.4", 21 | "cflags_static" : "-I/foo/bar/baz/auto/share/dist/Alien-libfoo1/include -DFOO=1 -DFOO_STATIC=1 ", 22 | "cflags" : "-I/foo/bar/baz/auto/share/dist/Alien-libfoo1/include -DFOO=1 ", 23 | "libs_static" : "-L/foo/bar/baz/auto/share/dist/Alien-libfoo1/lib -lfoo -lbar -lbaz " 24 | }, 25 | "foo2" : { 26 | "libs" : "-L/foo/bar/baz/auto/share/dist/Alien-libfoo1/lib -lfoo1 ", 27 | "version" : "2.3.5", 28 | "cflags_static" : "-I/foo/bar/baz/auto/share/dist/Alien-libfoo1/include -DFOO=2 -DFOO_STATIC=2 ", 29 | "cflags" : "-I/foo/bar/baz/auto/share/dist/Alien-libfoo1/include -DFOO=2 ", 30 | "libs_static" : "-L/foo/bar/baz/auto/share/dist/Alien-libfoo1/lib -lfoo1 -lbar -lbaz ", 31 | "arbitrary" : "four" 32 | }, 33 | "foo3" : { 34 | "arbitrary" : "five" 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /corpus/lib/auto/share/dist/Alien-perlhelp/_alien/alien.json: -------------------------------------------------------------------------------- 1 | { 2 | "libs" : "", 3 | "install_type" : "system", 4 | "version" : "1.2.3", 5 | "legacy" : { 6 | "finished_installing" : 1, 7 | "name" : "perlhelp", 8 | "version" : "1.2.3", 9 | "original_prefix" : "/foo/bar/baz/auto/share/dist/Alien-perlhelp", 10 | "install_type" : "system" 11 | }, 12 | "cflags_static" : "", 13 | "cflags" : "", 14 | "libs_static" : "", 15 | "prefix" : "/foo/bar/baz/auto/share/dist/Alien-perlhelp" 16 | } 17 | -------------------------------------------------------------------------------- /corpus/lib/pkgconfig/foo.pc: -------------------------------------------------------------------------------- 1 | prefix=/test 2 | exec_prefix=${prefix} 3 | libdir=${prefix}/lib 4 | includedir=${prefix}/include 5 | 6 | Name: foo 7 | Description: A testing pkg-config file 8 | Version: 1.2.3 9 | Libs: -L${libdir} -lfoo 10 | Libs.private: -lbar -lbaz 11 | Cflags: -fPIC -I${includedir}/foo 12 | Cflags.private: -DFOO_STATIC 13 | -------------------------------------------------------------------------------- /corpus/lib/pkgconfig/xor-chillout.pc: -------------------------------------------------------------------------------- 1 | prefix=/test 2 | exec_prefix=${prefix} 3 | libdir=${prefix}/lib 4 | includedir=${prefix}/include 5 | 6 | Name: xor 7 | Description: A testing pkg-config file 8 | Version: 4.2.2 9 | Libs: -L${libdir} -lxor-chillout 10 | Cflags: -I${includedir}/xor 11 | Cflags.private: -DXOR_STATIC 12 | -------------------------------------------------------------------------------- /corpus/lib/pkgconfig/xor.pc: -------------------------------------------------------------------------------- 1 | prefix=/test 2 | exec_prefix=${prefix} 3 | libdir=${prefix}/lib 4 | includedir=${prefix}/include 5 | 6 | Name: xor 7 | Description: A testing pkg-config file 8 | Version: 4.2.1 9 | Libs: -L${libdir} -lxor 10 | Libs.private: -lxor1 11 | Cflags: -I${includedir}/xor 12 | Cflags.private: -DXOR_STATIC 13 | -------------------------------------------------------------------------------- /corpus/pkgconfig/libbar1.pc: -------------------------------------------------------------------------------- 1 | prefix=/home/user/opt/libfoo1/git-06747d318761884e70dfa433a9548219fd779d7d 2 | exec_prefix=${prefix} 3 | libdir=${exec_prefix}/lib 4 | toolexeclibdir=${exec_prefix}/lib/../lib 5 | includedir=${libdir}/libfoo1-3.99999/include 6 | 7 | Name: libfoo1 8 | Description: Library supporting Foreign Function Interfaces 9 | Version: 3.99999 10 | Libs: -lbar1 11 | Cflags: -DFOO=stuff 12 | -------------------------------------------------------------------------------- /corpus/pkgconfig/libfoo1.pc: -------------------------------------------------------------------------------- 1 | prefix=/home/user/opt/libfoo1/git-06747d318761884e70dfa433a9548219fd779d7d 2 | exec_prefix=${prefix} 3 | libdir=${exec_prefix}/lib 4 | toolexeclibdir=${exec_prefix}/lib/../lib 5 | includedir=${libdir}/libfoo1-3.99999/include 6 | 7 | Name: libfoo1 8 | Description: Library supporting Foreign Function Interfaces 9 | Version: 3.99999 10 | Libs: -lfoo1 11 | Cflags: -DFOO=stuff 12 | -------------------------------------------------------------------------------- /corpus/vcpkg/r1/.vcpkg-root: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r1/.vcpkg-root -------------------------------------------------------------------------------- /corpus/vcpkg/r1/installed/x64-windows/debug/lib/foo.lib: -------------------------------------------------------------------------------- 1 | faux dbg foo -------------------------------------------------------------------------------- /corpus/vcpkg/r1/installed/x64-windows/include/foo.h: -------------------------------------------------------------------------------- 1 | #define FOO 1 -------------------------------------------------------------------------------- /corpus/vcpkg/r1/installed/x64-windows/lib/foo.lib: -------------------------------------------------------------------------------- 1 | faux opt foo -------------------------------------------------------------------------------- /corpus/vcpkg/r2/.vcpkg-root: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/.vcpkg-root -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/vcpkg/info/bzip2_1.0.6-5_x64-windows.list: -------------------------------------------------------------------------------- 1 | x64-windows/ 2 | x64-windows/bin/ 3 | x64-windows/bin/bz2.dll 4 | x64-windows/bin/bz2.pdb 5 | x64-windows/debug/ 6 | x64-windows/debug/bin/ 7 | x64-windows/debug/bin/bz2d.dll 8 | x64-windows/debug/bin/bz2d.pdb 9 | x64-windows/debug/lib/ 10 | x64-windows/debug/lib/bz2d.lib 11 | x64-windows/include/ 12 | x64-windows/include/bzlib.h 13 | x64-windows/lib/ 14 | x64-windows/lib/bz2.lib 15 | x64-windows/share/ 16 | x64-windows/share/bzip2/ 17 | x64-windows/share/bzip2/copyright 18 | x64-windows/share/bzip2/usage 19 | x64-windows/share/bzip2/vcpkg_abi_info.txt 20 | x64-windows/tools/ 21 | x64-windows/tools/bzip2/ 22 | x64-windows/tools/bzip2/bzip2.exe 23 | x64-windows/tools/bzip2/bzip2recover.exe 24 | -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/vcpkg/info/curl_7.68.0-1_x64-windows.list: -------------------------------------------------------------------------------- 1 | x64-windows/ 2 | x64-windows/bin/ 3 | x64-windows/bin/libcurl.dll 4 | x64-windows/bin/libcurl.pdb 5 | x64-windows/debug/ 6 | x64-windows/debug/bin/ 7 | x64-windows/debug/bin/libcurl-d.dll 8 | x64-windows/debug/bin/libcurl-d.pdb 9 | x64-windows/debug/lib/ 10 | x64-windows/debug/lib/libcurl-d.lib 11 | x64-windows/debug/lib/pkgconfig/ 12 | x64-windows/debug/lib/pkgconfig/libcurl.pc 13 | x64-windows/include/ 14 | x64-windows/include/curl/ 15 | x64-windows/include/curl/curl.h 16 | x64-windows/include/curl/curlver.h 17 | x64-windows/include/curl/easy.h 18 | x64-windows/include/curl/mprintf.h 19 | x64-windows/include/curl/multi.h 20 | x64-windows/include/curl/stdcheaders.h 21 | x64-windows/include/curl/system.h 22 | x64-windows/include/curl/typecheck-gcc.h 23 | x64-windows/include/curl/urlapi.h 24 | x64-windows/lib/ 25 | x64-windows/lib/libcurl.lib 26 | x64-windows/lib/pkgconfig/ 27 | x64-windows/lib/pkgconfig/libcurl.pc 28 | x64-windows/share/ 29 | x64-windows/share/curl/ 30 | x64-windows/share/curl/CURLConfig.cmake 31 | x64-windows/share/curl/CURLConfigVersion.cmake 32 | x64-windows/share/curl/CURLTargets-debug.cmake 33 | x64-windows/share/curl/CURLTargets-release.cmake 34 | x64-windows/share/curl/CURLTargets.cmake 35 | x64-windows/share/curl/copyright 36 | x64-windows/share/curl/curl-config 37 | x64-windows/share/curl/vcpkg-cmake-wrapper.cmake 38 | x64-windows/share/curl/vcpkg_abi_info.txt 39 | -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/vcpkg/info/libarchive_3.4.1_x64-windows.list: -------------------------------------------------------------------------------- 1 | x64-windows/ 2 | x64-windows/bin/ 3 | x64-windows/bin/archive.dll 4 | x64-windows/bin/archive.pdb 5 | x64-windows/debug/ 6 | x64-windows/debug/bin/ 7 | x64-windows/debug/bin/archive.dll 8 | x64-windows/debug/bin/archive.pdb 9 | x64-windows/debug/lib/ 10 | x64-windows/debug/lib/archive.lib 11 | x64-windows/include/ 12 | x64-windows/include/archive.h 13 | x64-windows/include/archive_entry.h 14 | x64-windows/lib/ 15 | x64-windows/lib/archive.lib 16 | x64-windows/share/ 17 | x64-windows/share/libarchive/ 18 | x64-windows/share/libarchive/copyright 19 | x64-windows/share/libarchive/vcpkg_abi_info.txt 20 | -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/vcpkg/info/libffi_3.3_x64-windows.list: -------------------------------------------------------------------------------- 1 | x64-windows/ 2 | x64-windows/bin/ 3 | x64-windows/bin/libffi.dll 4 | x64-windows/bin/libffi.pdb 5 | x64-windows/debug/ 6 | x64-windows/debug/bin/ 7 | x64-windows/debug/bin/libffi.dll 8 | x64-windows/debug/bin/libffi.pdb 9 | x64-windows/debug/lib/ 10 | x64-windows/debug/lib/libffi.lib 11 | x64-windows/include/ 12 | x64-windows/include/ffi.h 13 | x64-windows/include/ffitarget.h 14 | x64-windows/lib/ 15 | x64-windows/lib/libffi.lib 16 | x64-windows/share/ 17 | x64-windows/share/libffi/ 18 | x64-windows/share/libffi/copyright 19 | x64-windows/share/libffi/libffiConfig.cmake 20 | x64-windows/share/libffi/libffiConfigVersion.cmake 21 | x64-windows/share/libffi/libffiTargets-debug.cmake 22 | x64-windows/share/libffi/libffiTargets-release.cmake 23 | x64-windows/share/libffi/libffiTargets.cmake 24 | x64-windows/share/libffi/vcpkg_abi_info.txt 25 | -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/vcpkg/info/libffi_3.3_x86-windows.list: -------------------------------------------------------------------------------- 1 | x86-windows/ 2 | x86-windows/bin/ 3 | x86-windows/bin/libffi.dll 4 | x86-windows/bin/libffi.pdb 5 | x86-windows/debug/ 6 | x86-windows/debug/bin/ 7 | x86-windows/debug/bin/libffi.dll 8 | x86-windows/debug/bin/libffi.pdb 9 | x86-windows/debug/lib/ 10 | x86-windows/debug/lib/libffi.lib 11 | x86-windows/include/ 12 | x86-windows/include/ffi.h 13 | x86-windows/include/ffitarget.h 14 | x86-windows/lib/ 15 | x86-windows/lib/libffi.lib 16 | x86-windows/share/ 17 | x86-windows/share/libffi/ 18 | x86-windows/share/libffi/copyright 19 | x86-windows/share/libffi/libffiConfig.cmake 20 | x86-windows/share/libffi/libffiConfigVersion.cmake 21 | x86-windows/share/libffi/libffiTargets-debug.cmake 22 | x86-windows/share/libffi/libffiTargets-release.cmake 23 | x86-windows/share/libffi/libffiTargets.cmake 24 | x86-windows/share/libffi/vcpkg_abi_info.txt 25 | -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/vcpkg/info/libiconv_1.16-1_x64-windows.list: -------------------------------------------------------------------------------- 1 | x64-windows/ 2 | x64-windows/bin/ 3 | x64-windows/bin/libcharset.dll 4 | x64-windows/bin/libcharset.pdb 5 | x64-windows/bin/libiconv.dll 6 | x64-windows/bin/libiconv.pdb 7 | x64-windows/debug/ 8 | x64-windows/debug/bin/ 9 | x64-windows/debug/bin/libcharset.dll 10 | x64-windows/debug/bin/libcharset.pdb 11 | x64-windows/debug/bin/libiconv.dll 12 | x64-windows/debug/bin/libiconv.pdb 13 | x64-windows/debug/lib/ 14 | x64-windows/debug/lib/libcharset.lib 15 | x64-windows/debug/lib/libiconv.lib 16 | x64-windows/include/ 17 | x64-windows/include/iconv.h 18 | x64-windows/include/localcharset.h 19 | x64-windows/lib/ 20 | x64-windows/lib/libcharset.lib 21 | x64-windows/lib/libiconv.lib 22 | x64-windows/share/ 23 | x64-windows/share/libiconv/ 24 | x64-windows/share/libiconv/copyright 25 | x64-windows/share/libiconv/vcpkg_abi_info.txt 26 | x64-windows/share/unofficial-iconv/ 27 | x64-windows/share/unofficial-iconv/unofficial-iconv-config-debug.cmake 28 | x64-windows/share/unofficial-iconv/unofficial-iconv-config-release.cmake 29 | x64-windows/share/unofficial-iconv/unofficial-iconv-config.cmake 30 | -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/vcpkg/info/liblzma_5.2.4-4_x64-windows.list: -------------------------------------------------------------------------------- 1 | x64-windows/ 2 | x64-windows/bin/ 3 | x64-windows/bin/lzma.dll 4 | x64-windows/bin/lzma.pdb 5 | x64-windows/debug/ 6 | x64-windows/debug/bin/ 7 | x64-windows/debug/bin/lzmad.dll 8 | x64-windows/debug/bin/lzmad.pdb 9 | x64-windows/debug/lib/ 10 | x64-windows/debug/lib/lzmad.lib 11 | x64-windows/include/ 12 | x64-windows/include/lzma.h 13 | x64-windows/include/lzma/ 14 | x64-windows/include/lzma/base.h 15 | x64-windows/include/lzma/bcj.h 16 | x64-windows/include/lzma/block.h 17 | x64-windows/include/lzma/check.h 18 | x64-windows/include/lzma/container.h 19 | x64-windows/include/lzma/delta.h 20 | x64-windows/include/lzma/filter.h 21 | x64-windows/include/lzma/hardware.h 22 | x64-windows/include/lzma/index.h 23 | x64-windows/include/lzma/index_hash.h 24 | x64-windows/include/lzma/lzma12.h 25 | x64-windows/include/lzma/stream_flags.h 26 | x64-windows/include/lzma/version.h 27 | x64-windows/include/lzma/vli.h 28 | x64-windows/lib/ 29 | x64-windows/lib/lzma.lib 30 | x64-windows/share/ 31 | x64-windows/share/liblzma/ 32 | x64-windows/share/liblzma/LibLZMAConfig-debug.cmake 33 | x64-windows/share/liblzma/LibLZMAConfig-release.cmake 34 | x64-windows/share/liblzma/LibLZMAConfig.cmake 35 | x64-windows/share/liblzma/copyright 36 | x64-windows/share/liblzma/vcpkg-cmake-wrapper.cmake 37 | x64-windows/share/liblzma/vcpkg_abi_info.txt 38 | -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/vcpkg/info/libressl_2.9.1-2_x64-windows.list: -------------------------------------------------------------------------------- 1 | x64-windows/ 2 | x64-windows/share/ 3 | x64-windows/share/libressl/ 4 | x64-windows/share/libressl/vcpkg_abi_info.txt 5 | -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/vcpkg/info/lz4_1.9.2_x64-windows.list: -------------------------------------------------------------------------------- 1 | x64-windows/ 2 | x64-windows/bin/ 3 | x64-windows/bin/lz4.dll 4 | x64-windows/bin/lz4.pdb 5 | x64-windows/debug/ 6 | x64-windows/debug/bin/ 7 | x64-windows/debug/bin/lz4d.dll 8 | x64-windows/debug/bin/lz4d.pdb 9 | x64-windows/debug/lib/ 10 | x64-windows/debug/lib/lz4d.lib 11 | x64-windows/include/ 12 | x64-windows/include/lz4.h 13 | x64-windows/include/lz4frame.h 14 | x64-windows/include/lz4frame_static.h 15 | x64-windows/include/lz4hc.h 16 | x64-windows/lib/ 17 | x64-windows/lib/lz4.lib 18 | x64-windows/share/ 19 | x64-windows/share/lz4/ 20 | x64-windows/share/lz4/copyright 21 | x64-windows/share/lz4/lz4Config-debug.cmake 22 | x64-windows/share/lz4/lz4Config-release.cmake 23 | x64-windows/share/lz4/lz4Config.cmake 24 | x64-windows/share/lz4/vcpkg_abi_info.txt 25 | -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/vcpkg/info/lzo_2.10-4_x64-windows.list: -------------------------------------------------------------------------------- 1 | x64-windows/ 2 | x64-windows/bin/ 3 | x64-windows/bin/lzo2.dll 4 | x64-windows/bin/lzo2.pdb 5 | x64-windows/debug/ 6 | x64-windows/debug/bin/ 7 | x64-windows/debug/bin/lzo2.dll 8 | x64-windows/debug/bin/lzo2.pdb 9 | x64-windows/debug/lib/ 10 | x64-windows/debug/lib/lzo2.lib 11 | x64-windows/include/ 12 | x64-windows/include/lzo/ 13 | x64-windows/include/lzo/lzo1.h 14 | x64-windows/include/lzo/lzo1a.h 15 | x64-windows/include/lzo/lzo1b.h 16 | x64-windows/include/lzo/lzo1c.h 17 | x64-windows/include/lzo/lzo1f.h 18 | x64-windows/include/lzo/lzo1x.h 19 | x64-windows/include/lzo/lzo1y.h 20 | x64-windows/include/lzo/lzo1z.h 21 | x64-windows/include/lzo/lzo2a.h 22 | x64-windows/include/lzo/lzo_asm.h 23 | x64-windows/include/lzo/lzoconf.h 24 | x64-windows/include/lzo/lzodefs.h 25 | x64-windows/include/lzo/lzoutil.h 26 | x64-windows/lib/ 27 | x64-windows/lib/lzo2.lib 28 | x64-windows/share/ 29 | x64-windows/share/lzo/ 30 | x64-windows/share/lzo/copyright 31 | x64-windows/share/lzo/vcpkg_abi_info.txt 32 | -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/vcpkg/info/openssl_1.1.1d_x64-windows.list: -------------------------------------------------------------------------------- 1 | x64-windows/ 2 | x64-windows/share/ 3 | x64-windows/share/openssl/ 4 | x64-windows/share/openssl/usage 5 | x64-windows/share/openssl/vcpkg_abi_info.txt 6 | -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/vcpkg/info/xxhash_0.7.0_x64-windows.list: -------------------------------------------------------------------------------- 1 | x64-windows/ 2 | x64-windows/debug/ 3 | x64-windows/debug/lib/ 4 | x64-windows/debug/lib/xxhash.lib 5 | x64-windows/include/ 6 | x64-windows/include/xxhash.h 7 | x64-windows/lib/ 8 | x64-windows/lib/xxhash.lib 9 | x64-windows/share/ 10 | x64-windows/share/man/ 11 | x64-windows/share/man/man1/ 12 | x64-windows/share/man/man1/xxhsum.1 13 | x64-windows/share/xxhash/ 14 | x64-windows/share/xxhash/copyright 15 | x64-windows/share/xxhash/vcpkg_abi_info.txt 16 | -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/vcpkg/info/zlib_1.2.11-6_x64-windows.list: -------------------------------------------------------------------------------- 1 | x64-windows/ 2 | x64-windows/bin/ 3 | x64-windows/bin/zlib.pdb 4 | x64-windows/bin/zlib1.dll 5 | x64-windows/debug/ 6 | x64-windows/debug/bin/ 7 | x64-windows/debug/bin/zlibd.pdb 8 | x64-windows/debug/bin/zlibd1.dll 9 | x64-windows/debug/lib/ 10 | x64-windows/debug/lib/zlibd.lib 11 | x64-windows/include/ 12 | x64-windows/include/zconf.h 13 | x64-windows/include/zlib.h 14 | x64-windows/lib/ 15 | x64-windows/lib/zlib.lib 16 | x64-windows/share/ 17 | x64-windows/share/zlib/ 18 | x64-windows/share/zlib/copyright 19 | x64-windows/share/zlib/usage 20 | x64-windows/share/zlib/vcpkg_abi_info.txt 21 | -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x64-windows/bin/libffi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x64-windows/bin/libffi.dll -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x64-windows/bin/libffi.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x64-windows/bin/libffi.pdb -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x64-windows/debug/bin/libffi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x64-windows/debug/bin/libffi.dll -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x64-windows/debug/bin/libffi.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x64-windows/debug/bin/libffi.pdb -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x64-windows/debug/lib/libffi.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x64-windows/debug/lib/libffi.lib -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x64-windows/include/ffi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x64-windows/include/ffi.h -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x64-windows/include/ffitarget.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x64-windows/include/ffitarget.h -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x64-windows/lib/libffi.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x64-windows/lib/libffi.lib -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x64-windows/share/libffi/copyright: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x64-windows/share/libffi/copyright -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x64-windows/share/libffi/libffiConfig.cmake: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x64-windows/share/libffi/libffiConfig.cmake -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x64-windows/share/libffi/libffiConfigVersion.cmake: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x64-windows/share/libffi/libffiConfigVersion.cmake -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x64-windows/share/libffi/libffiTargets-debug.cmake: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x64-windows/share/libffi/libffiTargets-debug.cmake -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x64-windows/share/libffi/libffiTargets-release.cmake: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x64-windows/share/libffi/libffiTargets-release.cmake -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x64-windows/share/libffi/libffiTargets.cmake: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x64-windows/share/libffi/libffiTargets.cmake -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x64-windows/share/libffi/vcpkg_abi_info.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x64-windows/share/libffi/vcpkg_abi_info.txt -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x86-windows/bin/libffi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x86-windows/bin/libffi.dll -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x86-windows/bin/libffi.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x86-windows/bin/libffi.pdb -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x86-windows/debug/bin/libffi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x86-windows/debug/bin/libffi.dll -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x86-windows/debug/bin/libffi.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x86-windows/debug/bin/libffi.pdb -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x86-windows/debug/lib/libffi.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x86-windows/debug/lib/libffi.lib -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x86-windows/include/ffi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x86-windows/include/ffi.h -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x86-windows/include/ffitarget.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x86-windows/include/ffitarget.h -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x86-windows/lib/libffi.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x86-windows/lib/libffi.lib -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x86-windows/share/libffi/copyright: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x86-windows/share/libffi/copyright -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x86-windows/share/libffi/libffiConfig.cmake: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x86-windows/share/libffi/libffiConfig.cmake -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x86-windows/share/libffi/libffiConfigVersion.cmake: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x86-windows/share/libffi/libffiConfigVersion.cmake -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x86-windows/share/libffi/libffiTargets-debug.cmake: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x86-windows/share/libffi/libffiTargets-debug.cmake -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x86-windows/share/libffi/libffiTargets-release.cmake: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x86-windows/share/libffi/libffiTargets-release.cmake -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x86-windows/share/libffi/libffiTargets.cmake: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x86-windows/share/libffi/libffiTargets.cmake -------------------------------------------------------------------------------- /corpus/vcpkg/r2/installed/x86-windows/share/libffi/vcpkg_abi_info.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/corpus/vcpkg/r2/installed/x86-windows/share/libffi/vcpkg_abi_info.txt -------------------------------------------------------------------------------- /example/README: -------------------------------------------------------------------------------- 1 | =pod 2 | 3 | In this directory are some example Ls. You can test them with 4 | the L command if you have L installed. For example: 5 | 6 | % af install --prefix=/tmp/foo -f xz.alienfile 7 | 8 | If you want to force a C install you can use the C<--type> 9 | option: 10 | 11 | % af install --type=share --prefix=/tmp/foo -f xz.alienfile 12 | 13 | For more details on what you can do with the L command, please see 14 | its documentation. 15 | 16 | =cut 17 | -------------------------------------------------------------------------------- /example/curl.alienfile: -------------------------------------------------------------------------------- 1 | use alienfile; 2 | 3 | # PkgConfig uses the pkg-config negotiator to pick the best 4 | # available implementation (as of this writing, in order: 5 | # libpkgconf, pkg-config, PkgConfig,pm), to determine 6 | # if the system already provides the library. In addition, 7 | # it gets the version, cflags and libs during either a 8 | # "system" or "share" install. 9 | plugin 'PkgConfig' => 'libcurl'; 10 | 11 | # in addition to the library, we require that the xz command 12 | # is also available. 13 | plugin 'Probe::CommandLine' => ( 14 | command => 'curl', 15 | secondary => 1, 16 | ); 17 | 18 | share { 19 | 20 | # items in the share block relate to building the package 21 | # from source. It is called share because it will be 22 | # installed into a dist level share directory in your 23 | # perl lib. 24 | 25 | # The Download negotiator picks the best method for 26 | # downloading the package. It uses the version 27 | # regex to parse out the version number from the 28 | # tarball so that it can pick the most recent 29 | # version. 30 | start_url 'https://curl.haxx.se/download/'; 31 | plugin Download => ( 32 | version => qr/^curl-([0-9\.]+)\.tar\.gz$/, 33 | ); 34 | 35 | # The Extract negotiator picks the best method for 36 | # extracting from the tarball. We give it a hint 37 | # here that we expect the tarball to be .gz compressed 38 | # in case it needs to load extra modules to 39 | # decompress. 40 | plugin Extract => 'tar.gz'; 41 | 42 | # The Autoconf plugin builds using the standard 43 | # configure and make tools. It uses a DESTDIR 44 | # ( https://www.gnu.org/prep/standards/html_node/DESTDIR.html ) 45 | # to ensure that the prefix during the build 46 | # (ie when you install the Alien::xz module) 47 | # matches the prefix during runtime 48 | # (ie when you use it from XZ::XS). 49 | plugin 'Build::Autoconf'; 50 | 51 | # This package doesn't build a dynamic library, but if 52 | # it did this would make sure that it wasn't used with XS. 53 | # (See Alien::Build::Manual::AlienAuthor for details). 54 | plugin 'Gather::IsolateDynamic'; 55 | 56 | }; 57 | -------------------------------------------------------------------------------- /example/dontpanic.alienfile: -------------------------------------------------------------------------------- 1 | use alienfile; 2 | 3 | probe sub { 'share' }; 4 | 5 | share { 6 | 7 | start_url 'https://github.com/PerlAlien/dontpanic.git'; 8 | 9 | download [ 10 | [ "git clone --bare %{.meta.start_url}" ] 11 | ]; 12 | 13 | extract [ 14 | [ "git clone %{.install.download}" ] 15 | ]; 16 | 17 | plugin 'Build::Autoconf'; 18 | 19 | plugin 'Gather::IsolateDynamic'; 20 | 21 | build [ 22 | 'git checkout 1.00', 23 | 'bash autogen.sh', 24 | '%{configure} --enable-static --enable-shared', 25 | '%{make}', 26 | '%{make} install', 27 | ]; 28 | 29 | 30 | }; 31 | -------------------------------------------------------------------------------- /example/openssl.alienfile: -------------------------------------------------------------------------------- 1 | use alienfile; 2 | 3 | plugin 'PkgConfig' => ( 4 | pkg_name => 'openssl', 5 | ); 6 | 7 | share { 8 | 9 | # when building OpenSSL from source we have a few challenges. 10 | # - AB uses Net::SSLeay (via HTTP::Tiny) by default when downloading https URLs 11 | # - Net::SSLeay requires OpenSSL 12 | # - We can download OpenSSL from FTP, but that is susceptible to man-in-the-middle attacks 13 | # (and that is a bad look for a security product) 14 | 15 | # Solution: 16 | # - try downloading with curl or wget via the 'bootstrap_ssl' option. 17 | # - if that doesn't work, fallback on FTP 18 | # - don't attempt FTP transfer if ALIEN_OPENSSL_FTP is set to 0 19 | 20 | start_url 'https://www.openssl.org/source/'; 21 | plugin Download => ( 22 | version => qr/^openssl-([0-9\.]+[a-z]*)\.tar\.gz$/, 23 | bootstrap_ssl => 1, 24 | ); 25 | 26 | unless(meta->has_hook('fetch')) 27 | { 28 | my $ftp_ok = $ENV{ALIEN_OPENSSL_FTP}; 29 | $ftp_ok = 1 unless defined $ftp_ok; 30 | if($ftp_ok) 31 | { 32 | log(" ************************************************* "); 33 | log(" * WARNING downloading OpenSSL via FTP * "); 34 | log(" ************************************************* "); 35 | start_url 'ftp://ftp.openssl.org/source/'; 36 | plugin 'Fetch::NetFTP'; 37 | plugin 'Decode::DirListing'; 38 | } 39 | else 40 | { 41 | log("Unable to download OpenSSL via https without OpenSSL!"); 42 | log("Recommend installing wget or curl to bootstrap Alien::OpenSSL"); 43 | die "unable to download OpenSSL via https"; 44 | } 45 | } 46 | 47 | plugin 'Extract' => 'tar.gz'; 48 | 49 | build [ 50 | '%{perl} Configure --prefix=%{.install.prefix} no-shared cc', 51 | '%{make}', 52 | '%{make} install', 53 | ]; 54 | 55 | # This package doesn't build a dynamic library by default, but if 56 | # it did this would make sure that it wasn't used with XS. 57 | # (See Alien::Build::Manual::AlienAuthor for details). 58 | plugin 'Gather::IsolateDynamic'; 59 | 60 | }; 61 | -------------------------------------------------------------------------------- /example/user/README: -------------------------------------------------------------------------------- 1 | This directory contains examples of how to USE an Alien 2 | from another module. These examples use Alien::xz, which 3 | uses alienfile + Alien::Build + Alien::Base, and can be 4 | found on CPAN. 5 | -------------------------------------------------------------------------------- /example/user/ffi-platypus/lib/LZMA/Example.pm: -------------------------------------------------------------------------------- 1 | package LZMA::Example; 2 | 3 | use strict; 4 | use warnings; 5 | use FFI::Platypus; 6 | use Alien::xz; 7 | use Exporter qw( import ); 8 | 9 | our $VERSION = '0.01'; 10 | our @EXPORT = qw( lzma_version_string ); 11 | 12 | my $ffi = FFI::Platypus->new( 13 | lib => [ Alien::xz->dynamic_libs ], 14 | ); 15 | 16 | $ffi->attach( lzma_version_string => [] => 'string' ); 17 | 18 | 1; 19 | -------------------------------------------------------------------------------- /example/user/ffi-platypus/t/lzma_example.t: -------------------------------------------------------------------------------- 1 | use Test2::V0; 2 | use LZMA::Example; 3 | 4 | my $version = lzma_version_string(); 5 | 6 | ok $version, 'returns a version'; 7 | note "version = $version"; 8 | 9 | done_testing; 10 | -------------------------------------------------------------------------------- /example/user/inline-c/lib/LZMA/Example.pm: -------------------------------------------------------------------------------- 1 | package LZMA::Example; 2 | 3 | use strict; 4 | use warnings; 5 | use Inline with => 'Alien::xz'; 6 | use Inline C => <<'END'; 7 | #include 8 | const char * _version_string() 9 | { 10 | return lzma_version_string(); 11 | } 12 | END 13 | use Exporter qw( import ); 14 | 15 | our $VERSION = '0.01'; 16 | our @EXPORT = qw( lzma_version_string ); 17 | 18 | sub lzma_version_string 19 | { 20 | _version_string(); 21 | } 22 | 23 | 1; 24 | -------------------------------------------------------------------------------- /example/user/inline-c/t/lzma_example.t: -------------------------------------------------------------------------------- 1 | use Test2::V0; 2 | use LZMA::Example; 3 | 4 | my $version = lzma_version_string(); 5 | 6 | ok $version, 'returns a version'; 7 | note "version = $version"; 8 | 9 | done_testing; 10 | -------------------------------------------------------------------------------- /example/user/tool/lib/LZMA/Example.pm: -------------------------------------------------------------------------------- 1 | package LZMA::Example; 2 | 3 | use strict; 4 | use warnings; 5 | use Capture::Tiny qw( capture ); 6 | use Alien::xz; 7 | use Env qw( @PATH ); 8 | use Exporter qw( import ); 9 | 10 | our $VERSION = '0.01'; 11 | our @EXPORT = qw( lzma_version_string ); 12 | 13 | unshift @PATH, Alien::xz->bin_dir; 14 | 15 | sub lzma_version_string 16 | { 17 | my $out = capture { system 'xz', '--version' }; 18 | my($version) = $out =~ /liblzma ([0-9.]+)/; 19 | $version; 20 | } 21 | 22 | 1; 23 | -------------------------------------------------------------------------------- /example/user/tool/t/lzma_example.t: -------------------------------------------------------------------------------- 1 | use Test2::V0; 2 | use LZMA::Example; 3 | 4 | my $version = lzma_version_string(); 5 | 6 | ok $version, 'returns a version'; 7 | note "version = $version"; 8 | 9 | done_testing; 10 | -------------------------------------------------------------------------------- /example/user/xs-dzil/Example.xs: -------------------------------------------------------------------------------- 1 | #include "EXTERN.h" 2 | #include "perl.h" 3 | #include "XSUB.h" 4 | #include "lzma.h" 5 | 6 | MODULE = LZMA::Example PACKAGE = LZMA::Example 7 | 8 | const char * 9 | lzma_version_string() 10 | -------------------------------------------------------------------------------- /example/user/xs-dzil/dist.ini: -------------------------------------------------------------------------------- 1 | name = LZMA-Example 2 | version = 0.01 3 | abstract = LZMA example 4 | 5 | [@Filter] 6 | -bundle = @Basic 7 | -remove = MakeMaker 8 | 9 | [Prereqs / ConfigureRequires] 10 | Alien::xz = 0.05 11 | 12 | [MakeMaker::Awesome] 13 | header = use Config; 14 | header = use Alien::xz; 15 | WriteMakefile_arg = CCFLAGS => Alien::xz->cflags . ' ' . $Config{ccflags} 16 | WriteMakefile_arg = LIBS => [ Alien::xz->libs ] 17 | 18 | 19 | -------------------------------------------------------------------------------- /example/user/xs-dzil/lib/LZMA/Example.pm: -------------------------------------------------------------------------------- 1 | package LZMA::Example; 2 | 3 | use strict; 4 | use warnings; 5 | use Exporter qw( import ); 6 | 7 | our $VERSION = '0.01'; 8 | our @EXPORT = qw( lzma_version_string ); 9 | 10 | require XSLoader; 11 | XSLoader::load('LZMA::Example', $VERSION); 12 | 13 | 1; 14 | -------------------------------------------------------------------------------- /example/user/xs-dzil/t/lzma_example.t: -------------------------------------------------------------------------------- 1 | use Test2::V0; 2 | use LZMA::Example; 3 | 4 | my $version = lzma_version_string(); 5 | 6 | ok $version, 'returns a version'; 7 | note "version = $version"; 8 | 9 | done_testing; 10 | -------------------------------------------------------------------------------- /example/user/xs-mb/Build.PL: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | use Module::Build; 4 | use Alien::xz; 5 | 6 | my $build = Module::Build->new( 7 | module_name => 'LZMA::Example', 8 | dist_abstract => 'lzma example', 9 | configure_requires => { 10 | 'Alien::xz' => '0.05', 11 | }, 12 | extra_compiler_flags => Alien::xz->cflags, 13 | extra_linker_flags => Alien::xz->libs, 14 | ); 15 | 16 | $build->create_build_script; 17 | 18 | -------------------------------------------------------------------------------- /example/user/xs-mb/lib/LZMA/Example.pm: -------------------------------------------------------------------------------- 1 | package LZMA::Example; 2 | 3 | use strict; 4 | use warnings; 5 | use Exporter qw( import ); 6 | 7 | our $VERSION = '0.01'; 8 | our @EXPORT = qw( lzma_version_string ); 9 | 10 | require XSLoader; 11 | XSLoader::load('LZMA::Example', $VERSION); 12 | 13 | 1; 14 | -------------------------------------------------------------------------------- /example/user/xs-mb/lib/LZMA/Example.xs: -------------------------------------------------------------------------------- 1 | #include "EXTERN.h" 2 | #include "perl.h" 3 | #include "XSUB.h" 4 | #include "lzma.h" 5 | 6 | MODULE = LZMA::Example PACKAGE = LZMA::Example 7 | 8 | const char * 9 | lzma_version_string() 10 | -------------------------------------------------------------------------------- /example/user/xs-mb/t/lzma_example.t: -------------------------------------------------------------------------------- 1 | use Test2::V0; 2 | use LZMA::Example; 3 | 4 | my $version = lzma_version_string(); 5 | 6 | ok $version, 'returns a version'; 7 | note "version = $version"; 8 | 9 | done_testing; 10 | -------------------------------------------------------------------------------- /example/user/xs-mm/Example.xs: -------------------------------------------------------------------------------- 1 | #include "EXTERN.h" 2 | #include "perl.h" 3 | #include "XSUB.h" 4 | #include "lzma.h" 5 | 6 | MODULE = LZMA::Example PACKAGE = LZMA::Example 7 | 8 | const char * 9 | lzma_version_string() 10 | -------------------------------------------------------------------------------- /example/user/xs-mm/Makefile.PL: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | use ExtUtils::MakeMaker; 4 | use Alien::Base::Wrapper qw( Alien::xz ); 5 | 6 | WriteMakefile( 7 | NAME => 'LZMA::Example', 8 | VERSION_FROM => 'lib/LZMA/Example.pm', 9 | CONFIGURE_REQUIRES => { 10 | 'ExtUtils::MakeMaker' => 6.52, 11 | 'Alien::xz' => '0.05', 12 | }, 13 | Alien::Base::Wrapper->mm_args, 14 | ); 15 | -------------------------------------------------------------------------------- /example/user/xs-mm/lib/LZMA/Example.pm: -------------------------------------------------------------------------------- 1 | package LZMA::Example; 2 | 3 | use strict; 4 | use warnings; 5 | use Exporter qw( import ); 6 | 7 | our $VERSION = '0.01'; 8 | our @EXPORT = qw( lzma_version_string ); 9 | 10 | require XSLoader; 11 | XSLoader::load('LZMA::Example', $VERSION); 12 | 13 | 1; 14 | -------------------------------------------------------------------------------- /example/user/xs-mm/t/lzma_example.t: -------------------------------------------------------------------------------- 1 | use Test2::V0; 2 | use LZMA::Example; 3 | 4 | my $version = lzma_version_string(); 5 | 6 | ok $version, 'returns a version'; 7 | note "version = $version"; 8 | 9 | done_testing; 10 | -------------------------------------------------------------------------------- /example/wrapper.pl: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | use YAML qw( Dump ); 4 | use Alien::Base::Wrapper (); 5 | 6 | # Print out the Module::Build and ExtUtils::MakeMaker 7 | # for a list of aliens, using Alien::Base::Wrapper 8 | 9 | Alien::Base::Wrapper->import(@ARGV, '!export'); 10 | 11 | print Dump( 12 | mb => [Alien::Base::Wrapper->mb_args], 13 | mm => [Alien::Base::Wrapper->mm_args], 14 | ); 15 | 16 | 17 | -------------------------------------------------------------------------------- /example/xz-manual.alienfile: -------------------------------------------------------------------------------- 1 | use alienfile; 2 | 3 | # see xz.alienfile for a more reliable and portable 4 | # example that uses plugins. 5 | 6 | # Use pkg-config to check if the library exists. 7 | # also, use which to check that the xz command is 8 | # in the path. 9 | probe [ 10 | 'pkg-config --exists liblzma', 11 | 'which xz', 12 | ]; 13 | 14 | share { 15 | 16 | start_url 'http://tukaani.org/xz/xz-5.2.3.tar.gz'; 17 | 18 | # the first one which succeeds will be used 19 | download [ 'wget %{.meta.start_url}' ]; 20 | download [ 'curl -O %{.meta.start_url}' ]; 21 | 22 | # use tar to extract the tarball 23 | extract [ 'tar zxf %{.install.download}' ]; 24 | 25 | # use the standard build process 26 | build [ 27 | './configure --prefix=%{.install.prefix} --disable-shared', 28 | '%{make}', 29 | '%{make} install', 30 | ]; 31 | 32 | # This package doesn't build a dynamic library by default, but if 33 | # it did this would make sure that it wasn't used with XS. 34 | # (See Alien::Build::Manual::AlienAuthor for details). 35 | plugin 'Gather::IsolateDynamic'; 36 | 37 | }; 38 | 39 | # You can specify individual gather steps in share {} or 40 | # sys {} too, but for many cases the same procedure can 41 | # be used for both. 42 | gather [ 43 | # store the (chomped) output into the appropriate runtime properties 44 | [ 'pkg-config', '--modversion', 'liblzma', \'%{.runtime.version}' ], 45 | [ 'pkg-config', '--cflags', 'liblzma', \'%{.runtime.cflags}' ], 46 | [ 'pkg-config', '--libs', 'liblzma', \'%{.runtime.libs}' ], 47 | ]; 48 | -------------------------------------------------------------------------------- /example/xz.alienfile: -------------------------------------------------------------------------------- 1 | use alienfile; 2 | 3 | # PkgConfig uses the pkg-config negotiator to pick the best 4 | # available implementation (as of this writing, in order: 5 | # libpkgconf, pkg-config, PkgConfig,pm), to determine 6 | # if the system already provides the library. In addition, 7 | # it gets the version, cflags and libs during either a 8 | # "system" or "share" install. 9 | plugin 'PkgConfig' => 'liblzma'; 10 | 11 | # in addition to the library, we require that the xz command 12 | # is also available. 13 | plugin 'Probe::CommandLine' => ( 14 | command => 'xz', 15 | secondary => 1, 16 | ); 17 | 18 | share { 19 | 20 | # items in the share block relate to building the package 21 | # from source. It is called share because it will be 22 | # installed into a dist level share directory in your 23 | # perl lib. 24 | 25 | # The Download negotiator picks the best method for 26 | # downloading the package. It uses the version 27 | # regex to parse out the version number from the 28 | # tarball so that it can pick the most recent 29 | # version. 30 | start_url 'http://tukaani.org/xz/'; 31 | plugin Download => ( 32 | version => qr/^xz-([0-9\.]+)\.tar\.gz$/, 33 | ); 34 | 35 | # The Extract negotiator picks the best method for 36 | # extracting from the tarball. We give it a hint 37 | # here that we expect the tarball to be .gz compressed 38 | # in case it needs to load extra modules to 39 | # decompress. 40 | plugin Extract => 'tar.gz'; 41 | 42 | # The Autoconf plugin builds using the standard 43 | # configure and make tools. It uses a DESTDIR 44 | # ( https://www.gnu.org/prep/standards/html_node/DESTDIR.html ) 45 | # to ensure that the prefix during the build 46 | # (ie when you install the Alien::xz module) 47 | # matches the prefix during runtime 48 | # (ie when you use it from XZ::XS). 49 | plugin 'Build::Autoconf'; 50 | 51 | # This package doesn't build a dynamic library by default, but if 52 | # it did this would make sure that it wasn't used with XS. 53 | # (See Alien::Build::Manual::AlienAuthor for details). 54 | plugin 'Gather::IsolateDynamic'; 55 | 56 | }; 57 | -------------------------------------------------------------------------------- /inc/trivial.xs: -------------------------------------------------------------------------------- 1 | #include "EXTERN.h" 2 | #include "perl.h" 3 | #include "XSUB.h" 4 | 5 | MODULE = Trivial::XS PACKAGE = Trivial::XS 6 | 7 | int 8 | answer() 9 | CODE: 10 | RETVAL = 42; 11 | OUTPUT: 12 | RETVAL 13 | -------------------------------------------------------------------------------- /lib/Alien/Base/Authoring.pod: -------------------------------------------------------------------------------- 1 | # ABSTRACT: Authoring an Alien distribution using Alien::Base 2 | # PODNAME: Alien::Base::Authoring 3 | 4 | =head1 SYNOPSIS 5 | 6 | % perldoc Alien::Build::Manual::AlienAuthor 7 | % perldoc Alien::Base::ModuleBuild::Authoring 8 | 9 | =head1 DESCRIPTION 10 | 11 | This used to document the only way to author an L distribution, which 12 | was with L. You should now seriously consider using 13 | the newer more reliable method which is via L and L. Read all about it in L and L 14 | 15 | =cut 16 | -------------------------------------------------------------------------------- /lib/Alien/Base/FAQ.pod: -------------------------------------------------------------------------------- 1 | # ABSTRACT: Frequently asked questions 2 | # VERSION 3 | # PODNAME: Alien::Base::FAQ 4 | 5 | =head1 SYNOPSIS 6 | 7 | % perldoc Alien::Build::Manual::FAQ 8 | % perldoc Alien::Base::ModuleBuild::FAQ 9 | 10 | =head1 DESCRIPTION 11 | 12 | This used to answer FAQs regarding the only way to author an L 13 | distribution, which was with L. You should now 14 | seriously consider using the newer more reliable method which is via 15 | L and L. 16 | 17 | =over 4 18 | 19 | =item L 20 | 21 | =item L 22 | 23 | =back 24 | 25 | =cut 26 | -------------------------------------------------------------------------------- /lib/Alien/Build/Log/Abbreviate.pm: -------------------------------------------------------------------------------- 1 | package Alien::Build::Log::Abbreviate; 2 | 3 | use strict; 4 | use warnings; 5 | use 5.008004; 6 | use Term::ANSIColor (); 7 | use Path::Tiny qw( path ); 8 | use File::chdir; 9 | use parent qw( Alien::Build::Log ); 10 | 11 | # ABSTRACT: Log class for Alien::Build which is less verbose 12 | # VERSION 13 | 14 | =head1 SYNOPSIS 15 | 16 | =head1 DESCRIPTION 17 | 18 | =head1 METHODS 19 | 20 | =head2 log 21 | 22 | $log->log(%opts); 23 | 24 | Send single log line to stdout. 25 | 26 | =cut 27 | 28 | sub _colored 29 | { 30 | my($code, @out) = @_; 31 | -t STDOUT ? Term::ANSIColor::colored($code, @out) : @out; 32 | } 33 | 34 | my $root = path("$CWD"); 35 | 36 | sub log 37 | { 38 | my(undef, %args) = @_; 39 | my($message) = $args{message}; 40 | my ($package, $filename, $line) = @{ $args{caller} }; 41 | 42 | my $source = $package; 43 | $source =~ s/^Alien::Build::Auto::[^:]+::Alienfile/alienfile/; 44 | 45 | my $expected = $package; 46 | $expected .= '.pm' unless $package eq 'alienfile'; 47 | $expected =~ s/::/\//g; 48 | if($filename !~ /\Q$expected\E$/) 49 | { 50 | $source = path($filename)->relative($root); 51 | } 52 | else 53 | { 54 | $source =~ s/^Alien::Build::Plugin/ABP/; 55 | $source =~ s/^Alien::Build/AB/; 56 | } 57 | 58 | print _colored([ "bold on_black" ], '['); 59 | print _colored([ "bright_green on_black" ], $source); 60 | print _colored([ "on_black" ], ' '); 61 | print _colored([ "bright_yellow on_black" ], $line); 62 | print _colored([ "bold on_black" ], ']'); 63 | print _colored([ "white on_black" ], ' ', $message); 64 | print "\n"; 65 | } 66 | 67 | 1; 68 | -------------------------------------------------------------------------------- /lib/Alien/Build/Log/Default.pm: -------------------------------------------------------------------------------- 1 | package Alien::Build::Log::Default; 2 | 3 | use strict; 4 | use warnings; 5 | use 5.008004; 6 | use parent qw( Alien::Build::Log ); 7 | 8 | # ABSTRACT: Default Alien::Build log class 9 | # VERSION 10 | 11 | =head1 SYNOPSIS 12 | 13 | Alien::Build->log("message1"); 14 | $build->log("message2"); 15 | 16 | =head1 DESCRIPTION 17 | 18 | This is the default log class for L. It does 19 | the sensible thing of sending the message to stdout, along 20 | with the class that made the log call. For more details 21 | about logging with L, see L. 22 | 23 | =head1 METHODS 24 | 25 | =head2 log 26 | 27 | $log->log(%opts); 28 | 29 | Send single log line to stdout. 30 | 31 | =cut 32 | 33 | sub log 34 | { 35 | my(undef, %args) = @_; 36 | my($message) = $args{message}; 37 | my ($package, $filename, $line) = @{ $args{caller} }; 38 | print "$package> $message\n"; 39 | } 40 | 41 | 1; 42 | 43 | =head1 SEE ALSO 44 | 45 | =over 4 46 | 47 | =item L 48 | 49 | =item L 50 | 51 | =back 52 | 53 | =cut 54 | -------------------------------------------------------------------------------- /lib/Alien/Build/Manual.pod: -------------------------------------------------------------------------------- 1 | # PODNAME: Alien::Build::Manual 2 | # ABSTRACT: The Alien::Build Manual 3 | # VERSION 4 | 5 | =head1 SYNOPSIS 6 | 7 | perldoc Alien::Build::Manual::Alien 8 | perldoc Alien::Build::Manual::AlienAuthor 9 | perldoc Alien::Build::Manual::AlienUser 10 | perldoc Alien::Build::Manual::Contributing 11 | perldoc Alien::Build::Manual::FAQ 12 | perldoc Alien::Build::Manual::PluginAuthor 13 | 14 | =head1 DESCRIPTION 15 | 16 | L comes with a number of manuals that are useful depending on how you 17 | are using L. 18 | 19 | =over 4 20 | 21 | =item L 22 | 23 | General alien author documentation. 24 | 25 | =item L 26 | 27 | Alien author documentation. 28 | 29 | =item L 30 | 31 | Alien user documentation. 32 | 33 | =item L 34 | 35 | Overly-detailed contributing guide. 36 | 37 | =item L 38 | 39 | Frequently Asked Questions about L. 40 | 41 | =item L 42 | 43 | L plugin author documentation — or how to extend L with the plugin system. 44 | 45 | =item L 46 | 47 | Documents some of the challenges and configuration tools related to security of Ls. 48 | 49 | =back 50 | 51 | =head1 SEE ALSO 52 | 53 | =over 4 54 | 55 | =item L 56 | 57 | =item L 58 | 59 | =item L 60 | 61 | =back 62 | 63 | =cut 64 | -------------------------------------------------------------------------------- /lib/Alien/Build/Manual/Alien.pod: -------------------------------------------------------------------------------- 1 | # PODNAME: Alien::Build::Manual::Alien 2 | # ABSTRACT: General alien author documentation 3 | # VERSION 4 | 5 | =head1 SYNOPSIS 6 | 7 | perldoc Alien::Build::Manual::Alien 8 | 9 | =head1 DESCRIPTION 10 | 11 | The goal of the L namespace is to provide non-CPAN dependencies (so called "Alien" dependencies) for 12 | CPAN modules. The history and intent of this idea is documented in the documentation-only L module. 13 | The C distribution provides a framework for building aliens. The intent is to fix bugs and 14 | enhance the interface of a number of common tools so that all aliens may benefit. The distribution is broken 15 | up into these parts: 16 | 17 | =over 4 18 | 19 | =item The Alien Installer (configure / build-time) 20 | 21 | L and L are used to detect and install aliens. They are further documented in 22 | L. 23 | 24 | =item The Alien Runtime (runtime) 25 | 26 | L is the base class for aliens in the C system. Its use by Alien consumers 27 | is documented in L. 28 | 29 | =item The Plugin system (configure / build-time) 30 | 31 | Because many packages are implemented using different tools, the detection, build and install logic 32 | for a particular L can vary a lot. As such, much of L is implemented as a 33 | series of plugins that inherit from L. An overview of building your own 34 | plugins is documented in L. 35 | 36 | =back 37 | 38 | Additional useful documentation may be found here: 39 | 40 | =over 4 41 | 42 | =item FAQ 43 | 44 | L 45 | 46 | =item Contributing 47 | 48 | L 49 | 50 | =back 51 | 52 | =head1 SEE ALSO 53 | 54 | =over 4 55 | 56 | =item L 57 | 58 | Other L manuals. 59 | 60 | =back 61 | 62 | =cut 63 | -------------------------------------------------------------------------------- /lib/Alien/Build/Manual/image/PluginAuthor-flowchart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/lib/Alien/Build/Manual/image/PluginAuthor-flowchart.png -------------------------------------------------------------------------------- /lib/Alien/Build/Plugin/Build.pod: -------------------------------------------------------------------------------- 1 | # PODNAME: Alien::Build::Plugin::Build 2 | # ABSTRACT: Build Alien::Build plugins 3 | # VERSION 4 | 5 | =head1 SYNOPSIS 6 | 7 | For autoconf: 8 | 9 | use alienfile; 10 | plugin 'Build::Autoconf'; 11 | 12 | for unixy (even on windows): 13 | 14 | use alienfile; 15 | plugin 'Build::MSYS'; 16 | 17 | 18 | =head1 DESCRIPTION 19 | 20 | Build plugins provide tools for building your package once it has been 21 | downloaded and extracted. 22 | 23 | =over 4 24 | 25 | =item L 26 | 27 | For dealing with packages that are configured using autotools, 28 | or an autotools-like C script. 29 | 30 | =item L 31 | 32 | For dealing with packages that are configured and built using CMake. 33 | 34 | =item L 35 | 36 | For dealing with packages that do not require any build, and can just 37 | be copied into their final location. 38 | 39 | =item L 40 | 41 | For dealing with packages that require MSYS on Windows in order to 42 | build. This plugin is typically a no-op on other platforms. 43 | 44 | =item L 45 | 46 | For dealing with packages that require Make to build. Several 47 | flavors of Make are supported, including GNU Make and BSD Make. 48 | 49 | =item L 50 | 51 | Add other Ls as dependencies. 52 | 53 | =back 54 | 55 | =cut 56 | 57 | =head1 SEE ALSO 58 | 59 | L, L 60 | 61 | =cut 62 | -------------------------------------------------------------------------------- /lib/Alien/Build/Plugin/Core.pod: -------------------------------------------------------------------------------- 1 | # PODNAME: Alien::Build::Plugin::Core 2 | # ABSTRACT: Core Alien::Build plugins 3 | # VERSION 4 | 5 | =head1 SYNOPSIS 6 | 7 | use alienfile; 8 | # core plugins are already loaded 9 | 10 | =head1 DESCRIPTION 11 | 12 | Core plugins are special plugins that are always loaded, usually first. 13 | 14 | =over 4 15 | 16 | =item L 17 | 18 | =item L 19 | 20 | This contains the default machinery for downloading packages, if no 21 | other download plugin or commands are provided. 22 | 23 | =item L 24 | 25 | =item L 26 | 27 | =item L 28 | 29 | Add interoperability with L 30 | 31 | =item L 32 | 33 | The machinery which allows you to override the type of install 34 | with the C environment variable. 35 | 36 | =item L 37 | 38 | =item L 39 | 40 | =back 41 | 42 | =cut 43 | 44 | =head1 SEE ALSO 45 | 46 | L, L 47 | 48 | =cut 49 | -------------------------------------------------------------------------------- /lib/Alien/Build/Plugin/Core/CleanInstall.pm: -------------------------------------------------------------------------------- 1 | package Alien::Build::Plugin::Core::CleanInstall; 2 | 3 | use strict; 4 | use warnings; 5 | use 5.008004; 6 | use Alien::Build::Plugin; 7 | use Path::Tiny (); 8 | 9 | # ABSTRACT: Implementation for clean_install hook. 10 | # VERSION 11 | 12 | =head1 SYNOPSIS 13 | 14 | use alienfile; 15 | # already loaded 16 | 17 | =head1 DESCRIPTION 18 | 19 | This plugin implements the default C hook. 20 | You shouldn't use it directly. 21 | 22 | =head1 SEE ALSO 23 | 24 | L, L 25 | 26 | =cut 27 | 28 | sub init 29 | { 30 | my($self, $meta) = @_; 31 | 32 | $meta->default_hook( 33 | clean_install => sub { 34 | my($build) = @_; 35 | my $root = Path::Tiny->new( 36 | $build->runtime_prop->{prefix} 37 | ); 38 | if(-d $root) 39 | { 40 | foreach my $child ($root->children) 41 | { 42 | if($child->basename eq '_alien') 43 | { 44 | $build->log("keeping $child"); 45 | } 46 | else 47 | { 48 | $build->log("removing $child"); 49 | $child->remove_tree({ safe => 0}); 50 | } 51 | } 52 | } 53 | } 54 | ); 55 | } 56 | 57 | 1; 58 | -------------------------------------------------------------------------------- /lib/Alien/Build/Plugin/Core/FFI.pm: -------------------------------------------------------------------------------- 1 | package Alien::Build::Plugin::Core::FFI; 2 | 3 | use strict; 4 | use warnings; 5 | use 5.008004; 6 | use Alien::Build::Plugin; 7 | 8 | # ABSTRACT: Core FFI plugin 9 | # VERSION 10 | 11 | =head1 SYNOPSIS 12 | 13 | use alienfile; 14 | # already loaded 15 | 16 | =head1 DESCRIPTION 17 | 18 | This plugin helps make the build_ffi work. You should not 19 | need to interact with it directly. 20 | 21 | =head1 SEE ALSO 22 | 23 | L, L 24 | 25 | =cut 26 | 27 | sub init 28 | { 29 | my($self, $meta) = @_; 30 | 31 | $meta->default_hook( 32 | $_ => sub {}, 33 | ) for qw( build_ffi gather_ffi ); 34 | 35 | $meta->prop->{destdir_ffi_filter} = '^dynamic'; 36 | 37 | } 38 | 39 | 1; 40 | -------------------------------------------------------------------------------- /lib/Alien/Build/Plugin/Core/Legacy.pm: -------------------------------------------------------------------------------- 1 | package Alien::Build::Plugin::Core::Legacy; 2 | 3 | use strict; 4 | use warnings; 5 | use 5.008004; 6 | use Alien::Build::Plugin; 7 | 8 | # ABSTRACT: Core Alien::Build plugin to maintain compatibility with legacy Alien::Base 9 | # VERSION 10 | 11 | =head1 SYNOPSIS 12 | 13 | use alienfile; 14 | # already loaded 15 | 16 | =head1 DESCRIPTION 17 | 18 | This plugin provides some compatibility with the legacy L 19 | interfaces. 20 | 21 | =head1 SEE ALSO 22 | 23 | L, L 24 | 25 | =cut 26 | 27 | sub init 28 | { 29 | my($self, $meta) = @_; 30 | 31 | $meta->after_hook( 32 | $_ => sub { 33 | my($build) = @_; 34 | 35 | $build->log("adding legacy hash to config"); 36 | 37 | my $runtime = $build->runtime_prop; 38 | 39 | if($runtime->{cflags} && ! defined $runtime->{cflags_static}) 40 | { 41 | $runtime->{cflags_static} = $runtime->{cflags}; 42 | } 43 | 44 | if($runtime->{libs} && ! defined $runtime->{libs_static}) 45 | { 46 | $runtime->{libs_static} = $runtime->{libs}; 47 | } 48 | 49 | $runtime->{legacy}->{finished_installing} = 1; 50 | $runtime->{legacy}->{install_type} = $runtime->{install_type}; 51 | $runtime->{legacy}->{version} = $runtime->{version}; 52 | $runtime->{legacy}->{original_prefix} = $runtime->{prefix}; 53 | } 54 | ) for qw( gather_system gather_share ); 55 | } 56 | 57 | 1; 58 | -------------------------------------------------------------------------------- /lib/Alien/Build/Plugin/Core/Override.pm: -------------------------------------------------------------------------------- 1 | package Alien::Build::Plugin::Core::Override; 2 | 3 | use strict; 4 | use warnings; 5 | use 5.008004; 6 | use Alien::Build::Plugin; 7 | 8 | # ABSTRACT: Core override plugin 9 | # VERSION 10 | 11 | =head1 SYNOPSIS 12 | 13 | use alienfile; 14 | # already loaded 15 | 16 | =head1 DESCRIPTION 17 | 18 | This plugin implements the C environment variable. 19 | 20 | =head1 SEE ALSO 21 | 22 | L, L 23 | 24 | =cut 25 | 26 | sub init 27 | { 28 | my($self, $meta) = @_; 29 | 30 | $meta->default_hook( 31 | override => sub { 32 | my($build) = @_; 33 | return $ENV{ALIEN_INSTALL_TYPE} || ''; 34 | }, 35 | ); 36 | } 37 | 38 | 1; 39 | -------------------------------------------------------------------------------- /lib/Alien/Build/Plugin/Core/Tail.pm: -------------------------------------------------------------------------------- 1 | package Alien::Build::Plugin::Core::Tail; 2 | 3 | use strict; 4 | use warnings; 5 | use 5.008004; 6 | use Alien::Build::Plugin; 7 | 8 | # ABSTRACT: Core tail setup plugin 9 | # VERSION 10 | 11 | =head1 SYNOPSIS 12 | 13 | use alienfile; 14 | # already loaded 15 | 16 | =head1 DESCRIPTION 17 | 18 | This plugin does some core tail setup for you. 19 | 20 | =head1 SEE ALSO 21 | 22 | L, L 23 | 24 | =cut 25 | 26 | sub init 27 | { 28 | my($self, $meta) = @_; 29 | 30 | if($meta->prop->{out_of_source}) 31 | { 32 | $meta->add_requires('configure' => 'Alien::Build' => '1.08'); 33 | } 34 | } 35 | 36 | 1; 37 | -------------------------------------------------------------------------------- /lib/Alien/Build/Plugin/Decode.pod: -------------------------------------------------------------------------------- 1 | # PODNAME: Alien::Build::Plugin::Decode 2 | # ABSTRACT: Decode Alien::Build plugins 3 | # VERSION 4 | 5 | =head1 SYNOPSIS 6 | 7 | use alienfile; 8 | plugin 'Decode::HTML'; 9 | plugin 'Decode::DirListing'; 10 | 11 | =head1 DESCRIPTION 12 | 13 | Decode plugins decode HTML and FTP file listings. Normally you 14 | will want to use the L 15 | plugin which will automatically load the appropriate Decode plugins. 16 | 17 | =over 4 18 | 19 | =item L 20 | 21 | Default decoder for FTP file listings, that uses the pure-perl L. 22 | 23 | =item L 24 | 25 | Another decoder for FTP file listings, that uses the XS module L. 26 | 27 | =item L 28 | 29 | Older decoder for HTML file listings, which uses the XS module L. This 30 | used to be the default decoder until L version 1.75. In some cases, this 31 | will be used as the HTML decoder if you configure with L prior to 1.75 32 | and but upgrade to a more recent version for the build stage of your L 33 | 34 | =item L 35 | 36 | Newer decoder for HTML file listings, which uses the pure-perl L or L. 37 | This became the default decoder at L version 1.75. 38 | 39 | =back 40 | 41 | =cut 42 | 43 | =head1 SEE ALSO 44 | 45 | L, L 46 | 47 | =cut 48 | -------------------------------------------------------------------------------- /lib/Alien/Build/Plugin/Decode/DirListing.pm: -------------------------------------------------------------------------------- 1 | package Alien::Build::Plugin::Decode::DirListing; 2 | 3 | use strict; 4 | use warnings; 5 | use 5.008004; 6 | use Alien::Build::Plugin; 7 | use File::Basename (); 8 | 9 | # ABSTRACT: Plugin to extract links from a directory listing 10 | # VERSION 11 | 12 | =head1 SYNOPSIS 13 | 14 | use alienfile; 15 | plugin 'Decode::DirListing'; 16 | 17 | =head1 DESCRIPTION 18 | 19 | Note: in most case you will want to use L 20 | instead. It picks the appropriate decode plugin based on your platform and environment. 21 | In some cases you may need to use this plugin directly instead. 22 | 23 | This plugin decodes a ftp file listing into a list of candidates for your Prefer plugin. 24 | It is useful when fetching from an FTP server via L. 25 | 26 | =cut 27 | 28 | sub init 29 | { 30 | my($self, $meta) = @_; 31 | 32 | $meta->add_requires('share' => 'File::Listing' => 0); 33 | $meta->add_requires('share' => 'URI' => 0); 34 | 35 | $meta->register_hook( decode => sub { 36 | my(undef, $res) = @_; 37 | 38 | die "do not know how to decode @{[ $res->{type} ]}" 39 | unless $res->{type} eq 'dir_listing'; 40 | 41 | my $base = URI->new($res->{base}); 42 | 43 | return { 44 | type => 'list', 45 | list => [ 46 | map { 47 | my($name) = @$_; 48 | my $basename = $name; 49 | $basename =~ s{/$}{}; 50 | my %h = ( 51 | filename => File::Basename::basename($basename), 52 | url => URI->new_abs($name, $base)->as_string, 53 | ); 54 | \%h; 55 | } File::Listing::parse_dir($res->{content}) 56 | ], 57 | }; 58 | }); 59 | 60 | $self; 61 | } 62 | 63 | 1; 64 | 65 | =head1 SEE ALSO 66 | 67 | L, L, L, L, L, L 68 | 69 | =cut 70 | 71 | -------------------------------------------------------------------------------- /lib/Alien/Build/Plugin/Decode/DirListingFtpcopy.pm: -------------------------------------------------------------------------------- 1 | package Alien::Build::Plugin::Decode::DirListingFtpcopy; 2 | 3 | use strict; 4 | use warnings; 5 | use 5.008004; 6 | use Alien::Build::Plugin; 7 | use File::Basename (); 8 | 9 | # ABSTRACT: Plugin to extract links from a directory listing using ftpcopy 10 | # VERSION 11 | 12 | =head1 SYNOPSIS 13 | 14 | use alienfile; 15 | plugin 'Decode::DirListingFtpcopy'; 16 | 17 | =head1 DESCRIPTION 18 | 19 | Note: in most case you will want to use L 20 | instead. It picks the appropriate decode plugin based on your platform and environment. 21 | In some cases you may need to use this plugin directly instead. 22 | 23 | This plugin decodes a ftp file listing into a list of candidates for your Prefer plugin. 24 | It is useful when fetching from an FTP server via L. 25 | It is different from the similarly named L 26 | in that it uses L instead of L. The rationale for 27 | the C version is that it supports a different set of FTP servers, including 28 | OpenVMS. In most cases, however, you probably want to use the non C version 29 | since it is pure perl. 30 | 31 | =cut 32 | 33 | sub init 34 | { 35 | my($self, $meta) = @_; 36 | 37 | $meta->add_requires('share' => 'File::Listing::Ftpcopy' => 0); 38 | $meta->add_requires('share' => 'URI' => 0); 39 | 40 | $meta->register_hook( decode => sub { 41 | my(undef, $res) = @_; 42 | 43 | die "do not know how to decode @{[ $res->{type} ]}" 44 | unless $res->{type} eq 'dir_listing'; 45 | 46 | my $base = URI->new($res->{base}); 47 | 48 | return { 49 | type => 'list', 50 | list => [ 51 | map { 52 | my($name) = @$_; 53 | my $basename = $name; 54 | $basename =~ s{/$}{}; 55 | my %h = ( 56 | filename => File::Basename::basename($basename), 57 | url => URI->new_abs($name, $base)->as_string, 58 | ); 59 | \%h; 60 | } File::Listing::Ftpcopy::parse_dir($res->{content}) 61 | ], 62 | }; 63 | }); 64 | 65 | $self; 66 | } 67 | 68 | 1; 69 | 70 | =head1 SEE ALSO 71 | 72 | L, L, L, L, L, L 73 | 74 | =cut 75 | -------------------------------------------------------------------------------- /lib/Alien/Build/Plugin/Decode/HTML.pm: -------------------------------------------------------------------------------- 1 | package Alien::Build::Plugin::Decode::HTML; 2 | 3 | use strict; 4 | use warnings; 5 | use 5.008004; 6 | use Alien::Build::Plugin; 7 | use File::Basename (); 8 | 9 | # ABSTRACT: Plugin to extract links from HTML 10 | # VERSION 11 | 12 | =head1 SYNOPSIS 13 | 14 | use alienfile; 15 | plugin 'Decode::HTML'; 16 | 17 | =head1 DESCRIPTION 18 | 19 | Note: in most case you will want to use L 20 | instead. It picks the appropriate decode plugin based on your platform and environment. 21 | In some cases you may need to use this plugin directly instead. 22 | 23 | This plugin decodes an HTML file listing into a list of candidates for your Prefer plugin. 24 | 25 | =cut 26 | 27 | sub init 28 | { 29 | my($self, $meta) = @_; 30 | 31 | $meta->add_requires('share' => 'HTML::LinkExtor' => 0); 32 | $meta->add_requires('share' => 'URI' => 0); 33 | $meta->add_requires('share' => 'URI::Escape' => 0); 34 | 35 | $meta->register_hook( decode => sub { 36 | my(undef, $res) = @_; 37 | 38 | die "do not know how to decode @{[ $res->{type} ]}" 39 | unless $res->{type} eq 'html'; 40 | 41 | my $base = URI->new($res->{base}); 42 | 43 | my @list; 44 | 45 | my $p = HTML::LinkExtor->new(sub { 46 | my($tag, %links) = @_; 47 | if($tag eq 'base' && $links{href}) 48 | { 49 | $base = URI->new($links{href}); 50 | } 51 | elsif($tag eq 'a' && $links{href}) 52 | { 53 | my $href = $links{href}; 54 | return if $href =~ m!^\.\.?/?$!; 55 | my $url = URI->new_abs($href, $base); 56 | my $path = $url->path; 57 | $path =~ s{/$}{}; # work around for Perl 5.8.7- gh#8 58 | push @list, { 59 | filename => URI::Escape::uri_unescape(File::Basename::basename($path)), 60 | url => URI::Escape::uri_unescape($url->as_string), 61 | }; 62 | } 63 | }); 64 | 65 | $p->parse($res->{content}); 66 | 67 | return { 68 | type => 'list', 69 | list => \@list, 70 | }; 71 | }); 72 | 73 | $self; 74 | } 75 | 76 | 1; 77 | 78 | =head1 SEE ALSO 79 | 80 | L, L, L, L, L 81 | 82 | =cut 83 | -------------------------------------------------------------------------------- /lib/Alien/Build/Plugin/Digest.pod: -------------------------------------------------------------------------------- 1 | # PODNAME: Alien::Build::Plugin::Digest 2 | # ABSTRACT: Fetch Alien::Digest plugins 3 | # VERSION 4 | 5 | =head1 SYNOPSIS 6 | 7 | use alienfile; 8 | share { 9 | start_url 'http://ftp.gnu.org/gnu/make/make-3.75.tar.gz'; 10 | plugin 'Digest' => [ SHA256 => '2bc876304905aee78abf0f7163ba55a2efcec803034f75c75d1b94650c36aba7'; 11 | plugin 'Download'; 12 | }; 13 | 14 | =head1 DESCRIPTION 15 | 16 | Digest plugins checks the cryptographic signatures of downloaded files. 17 | Typically you will probably want to use SHA256 via the 18 | L. 19 | 20 | =over 4 21 | 22 | =item L 23 | 24 | Negotiate the most appropriate plugin to calculate digest. 25 | 26 | =item L 27 | 28 | Use the XS based L for computing SHA digests. This is the default since 29 | L comes with recent versions of Perl. 30 | 31 | =item L 32 | 33 | Use the pure-perl based L for computing SHA digests. 34 | 35 | =back 36 | 37 | =cut 38 | 39 | =head1 SEE ALSO 40 | 41 | L, L 42 | 43 | =cut 44 | -------------------------------------------------------------------------------- /lib/Alien/Build/Plugin/Digest/SHA.pm: -------------------------------------------------------------------------------- 1 | package Alien::Build::Plugin::Digest::SHA; 2 | 3 | use strict; 4 | use warnings; 5 | use Alien::Build::Plugin; 6 | 7 | # ABSTRACT: Plugin to check SHA digest with Digest::SHA 8 | # VERSION 9 | 10 | =head1 SYNOPSIS 11 | 12 | use alienfile; 13 | plugin 'Digest::SHA'; 14 | 15 | =head1 DESCRIPTION 16 | 17 | This plugin is experimental. 18 | 19 | =cut 20 | 21 | sub init 22 | { 23 | my($self, $meta) = @_; 24 | 25 | $meta->add_requires('configure' => 'Alien::Build' => "2.57" ); 26 | 27 | $meta->register_hook( check_digest => sub { 28 | my($build, $file, $algo, $expected_digest) = @_; 29 | 30 | return 0 unless $algo =~ /^SHA[0-9]+$/; 31 | 32 | my $sha = Digest::SHA->new($algo); 33 | return 0 unless defined $sha; 34 | 35 | if(defined $file->{content}) 36 | { 37 | $sha->add($file->{content}); 38 | } 39 | elsif(defined $file->{path}) 40 | { 41 | $sha->addfile($file->{path}, "b"); 42 | } 43 | else 44 | { 45 | die "unknown file type"; 46 | } 47 | 48 | my $actual_digest = $sha->hexdigest; 49 | 50 | return 1 if $expected_digest eq $actual_digest; 51 | die "@{[ $file->{filename} ]} SHA@{[ $sha->algorithm ]} digest does not match: got $actual_digest, expected $expected_digest"; 52 | 53 | }); 54 | } 55 | 56 | 1; 57 | -------------------------------------------------------------------------------- /lib/Alien/Build/Plugin/Digest/SHAPP.pm: -------------------------------------------------------------------------------- 1 | package Alien::Build::Plugin::Digest::SHAPP; 2 | 3 | use strict; 4 | use warnings; 5 | use Alien::Build::Plugin; 6 | 7 | # ABSTRACT: Plugin to check SHA digest with Digest::SHA::PurePerl 8 | # VERSION 9 | 10 | =head1 SYNOPSIS 11 | 12 | use alienfile; 13 | plugin 'Digest::SHAPP'; 14 | 15 | =head1 DESCRIPTION 16 | 17 | This plugin is experimental. 18 | 19 | =cut 20 | 21 | sub init 22 | { 23 | my($self, $meta) = @_; 24 | 25 | $meta->add_requires('configure' => 'Alien::Build' => "2.57" ); 26 | $meta->add_requires('share' => 'Digest::SHA::PurePerl' => "0" ); 27 | 28 | $meta->register_hook( check_digest => sub { 29 | my($build, $file, $algo, $expected_digest) = @_; 30 | 31 | return 0 unless $algo =~ /^SHA[0-9]+$/; 32 | 33 | my $sha = Digest::SHA::PurePerl->new($algo); 34 | return 0 unless defined $sha; 35 | 36 | if(defined $file->{content}) 37 | { 38 | $sha->add($file->{content}); 39 | } 40 | elsif(defined $file->{path}) 41 | { 42 | $sha->addfile($file->{path}, "b"); 43 | } 44 | else 45 | { 46 | die "unknown file type"; 47 | } 48 | 49 | my $actual_digest = $sha->hexdigest; 50 | 51 | return 1 if $expected_digest eq $actual_digest; 52 | die "@{[ $file->{filename} ]} SHA@{[ $sha->algorithm ]} digest does not match: got $actual_digest, expected $expected_digest"; 53 | 54 | }); 55 | } 56 | 57 | 1; 58 | -------------------------------------------------------------------------------- /lib/Alien/Build/Plugin/Download.pod: -------------------------------------------------------------------------------- 1 | # PODNAME: Alien::Build::Plugin::Download 2 | # ABSTRACT: Download Alien::Build plugins 3 | # VERSION 4 | 5 | =head1 SYNOPSIS 6 | 7 | use alienfile 8 | share { 9 | start_url 'http://ftp.gnu.org/gnu/make'; 10 | plugin 'Download'; 11 | }; 12 | 13 | =head1 DESCRIPTION 14 | 15 | Download plugins download packages from the internet. 16 | 17 | =over 4 18 | 19 | =item L 20 | 21 | =back 22 | 23 | =cut 24 | 25 | =head1 SEE ALSO 26 | 27 | L, L 28 | 29 | =cut 30 | -------------------------------------------------------------------------------- /lib/Alien/Build/Plugin/Extract.pod: -------------------------------------------------------------------------------- 1 | # PODNAME: Alien::Build::Plugin::Extract 2 | # ABSTRACT: Extract Alien::Build plugins 3 | # VERSION 4 | 5 | =head1 SYNOPSIS 6 | 7 | use alienfile 8 | share { 9 | plugin 'Extract' => 'tar.gz'; 10 | }; 11 | 12 | =head1 DESCRIPTION 13 | 14 | Extract plugins extract packages that have been downloaded from the internet. 15 | Unless you are doing something unusual you will likely want to use the 16 | L plugin to select the best 17 | Extract plugin available. 18 | 19 | =over 4 20 | 21 | =item L 22 | 23 | Extract using C. Typically also works with compressed tarballs like C. 24 | 25 | =item L 26 | 27 | Extract using L. 28 | 29 | =item L 30 | 31 | Extract using command line tools like C or C. 32 | 33 | =item L 34 | 35 | Extract a local directory. 36 | 37 | =item L 38 | 39 | "Extract" a single file. 40 | 41 | =item L 42 | 43 | Pick the best extract plugin based on the extension of the package archive. 44 | 45 | =back 46 | 47 | =cut 48 | 49 | =head1 SEE ALSO 50 | 51 | L, L 52 | 53 | =cut 54 | -------------------------------------------------------------------------------- /lib/Alien/Build/Plugin/Extract/ArchiveZip.pm: -------------------------------------------------------------------------------- 1 | package Alien::Build::Plugin::Extract::ArchiveZip; 2 | 3 | use strict; 4 | use warnings; 5 | use 5.008004; 6 | use Alien::Build::Plugin; 7 | 8 | # ABSTRACT: Plugin to extract a tarball using Archive::Zip 9 | # VERSION 10 | 11 | =head1 SYNOPSIS 12 | 13 | use alienfile; 14 | plugin 'Extract::ArchiveZip' => ( 15 | format => 'zip', 16 | ); 17 | 18 | =head1 DESCRIPTION 19 | 20 | Note: in most case you will want to use L 21 | instead. It picks the appropriate Extract plugin based on your platform and environment. 22 | In some cases you may need to use this plugin directly instead. 23 | 24 | B: Seriously do NOT use this plugin! L is pretty unreliable and 25 | breaks all-the-time. If you use the negotiator plugin mentioned above, then it will 26 | prefer installing L, which is much more reliable than L. 27 | 28 | This plugin extracts from an archive in zip format using L. 29 | 30 | =head2 format 31 | 32 | Gives a hint as to the expected format. This should always be C. 33 | 34 | =cut 35 | 36 | has '+format' => 'zip'; 37 | 38 | =head1 METHODS 39 | 40 | =head2 handles 41 | 42 | Alien::Build::Plugin::Extract::ArchiveZip->handles($ext); 43 | $plugin->handles($ext); 44 | 45 | Returns true if the plugin is able to handle the archive of the 46 | given format. 47 | 48 | =cut 49 | 50 | sub handles 51 | { 52 | my($class, $ext) = @_; 53 | 54 | return 1 if $ext eq 'zip'; 55 | 56 | return 0; 57 | } 58 | 59 | =head2 available 60 | 61 | Alien::Build::Plugin::Extract::ArchiveZip->available($ext); 62 | 63 | Returns true if the plugin has what it needs right now to extract from the given format 64 | 65 | =cut 66 | 67 | sub available 68 | { 69 | my(undef, $ext) = @_; 70 | 71 | !! ( $ext eq 'zip' && eval { require Archive::Zip; 1} ); 72 | } 73 | 74 | sub init 75 | { 76 | my($self, $meta) = @_; 77 | 78 | $meta->add_requires('share' => 'Archive::Zip' => 0); 79 | 80 | $meta->register_hook( 81 | extract => sub { 82 | my($build, $src) = @_; 83 | my $zip = Archive::Zip->new; 84 | $zip->read($src); 85 | $zip->extractTree; 86 | } 87 | ); 88 | } 89 | 90 | 1; 91 | 92 | =head1 SEE ALSO 93 | 94 | L, L, L, L, L 95 | 96 | =cut 97 | -------------------------------------------------------------------------------- /lib/Alien/Build/Plugin/Extract/File.pm: -------------------------------------------------------------------------------- 1 | package Alien::Build::Plugin::Extract::File; 2 | 3 | use strict; 4 | use warnings; 5 | use 5.008004; 6 | use Alien::Build::Plugin; 7 | use Alien::Build::Util qw( _mirror ); 8 | use Path::Tiny (); 9 | 10 | # ABSTRACT: Plugin to extract a downloaded file to a build directory 11 | # VERSION 12 | 13 | =head1 SYNOPSIS 14 | 15 | use alienfile; 16 | plugin 'Extract::File'; 17 | 18 | =head1 DESCRIPTION 19 | 20 | Some Download or Fetch plugins may produce a single file (usually an executable) 21 | instead of an archive file. This plugin is used to mirror the file from 22 | the Download step into a fresh directory in the Extract step. 23 | 24 | =head1 PROPERTIES 25 | 26 | =head2 format 27 | 28 | Should always set to C (for file). 29 | 30 | =cut 31 | 32 | has '+format' => 'f'; 33 | 34 | =head1 METHODS 35 | 36 | =head2 handles 37 | 38 | Alien::Build::Plugin::Extract::File->handles($ext); 39 | $plugin->handles($ext); 40 | 41 | Returns true if the plugin is able to handle the archive of the 42 | given format. Only returns true for C (for file). 43 | 44 | =cut 45 | 46 | sub handles 47 | { 48 | my(undef, $ext) = @_; 49 | $ext eq 'f' ? 1 : (); 50 | } 51 | 52 | =head2 available 53 | 54 | Alien::Build::Plugin::Extract::File->available($ext); 55 | $plugin->available($ext); 56 | 57 | Returns true if the plugin can extract the given format with 58 | what is already installed. 59 | 60 | =cut 61 | 62 | sub available 63 | { 64 | my(undef, $ext) = @_; 65 | __PACKAGE__->handles($ext); 66 | } 67 | 68 | sub init 69 | { 70 | my($self, $meta) = @_; 71 | 72 | $meta->register_hook( 73 | extract => sub { 74 | my($build, $src) = @_; 75 | 76 | die "not a file: $src" unless -f $src; 77 | 78 | $src = Path::Tiny->new($src)->absolute->parent;; 79 | 80 | my $dst = Path::Tiny->new('.')->absolute; 81 | # Please note: _mirror and Alien::Build::Util are ONLY 82 | # allowed to be used by core plugins. If you are writing 83 | # a non-core plugin it may be removed. That is why it 84 | # is private. 85 | 86 | $build->log("extracting $src => $dst"); 87 | _mirror $src => $dst, { verbose => 1 }; 88 | } 89 | ); 90 | } 91 | 92 | 1; 93 | 94 | =head1 SEE ALSO 95 | 96 | L, L, L, L, L, L 97 | 98 | =cut 99 | -------------------------------------------------------------------------------- /lib/Alien/Build/Plugin/Fetch.pod: -------------------------------------------------------------------------------- 1 | # PODNAME: Alien::Build::Plugin::Fetch 2 | # ABSTRACT: Fetch Alien::Build plugins 3 | # VERSION 4 | 5 | =head1 SYNOPSIS 6 | 7 | use alienfile; 8 | share { 9 | start_url 'http://ftp.gnu.org/gnu/make'; 10 | plugin 'Download'; 11 | }; 12 | 13 | =head1 DESCRIPTION 14 | 15 | Fetch plugins retrieve single resources from the internet. The difference 16 | between a Fetch plugin and a Download plugin is that Download 17 | plugin may fetch several resources from the internet (usually using 18 | a Fetch plugin), before finding the final archive. Normally you 19 | will not need to use Fetch plugins directly but should instead 20 | use the L plugin, which 21 | will pick the best plugins for your given URL. 22 | 23 | =over 4 24 | 25 | =item L 26 | 27 | Fetch using the C command. 28 | 29 | =item L 30 | 31 | Fetch using L. 32 | 33 | =item L 34 | 35 | Fetch using L. 36 | 37 | =item L 38 | 39 | Fetch from a local file. This is typically used to bundle packages with your L. 40 | 41 | =item L 42 | 43 | Fetch from a local directory. This is typically used to bundle packages with your L. 44 | 45 | =item L 46 | 47 | Fetch using L. Use of FTP should be discouraged as of this writing (August 2022). 48 | 49 | =item L 50 | 51 | Fetch using C. 52 | 53 | =back 54 | 55 | =cut 56 | 57 | =head1 SEE ALSO 58 | 59 | L, L 60 | 61 | =cut 62 | -------------------------------------------------------------------------------- /lib/Alien/Build/Plugin/Gather.pod: -------------------------------------------------------------------------------- 1 | # PODNAME: Alien::Build::Plugin::Gather 2 | # ABSTRACT: Gather Alien::Build plugins 3 | # VERSION 4 | 5 | =head1 SYNOPSIS 6 | 7 | use alienfile; 8 | plugin 'Gather::IsolateDynamic'; # just as an example 9 | 10 | =head1 DESCRIPTION 11 | 12 | Gather plugins enhance L recipes at the gather stage, either 13 | during a C or C install. 14 | 15 | =over 4 16 | 17 | =item L 18 | 19 | Isolate dynamic libraries (C<.so>, <.DLL> or <.dylib>) so that they aren't used 20 | by XS. 21 | 22 | =back 23 | 24 | =cut 25 | 26 | =head1 SEE ALSO 27 | 28 | L, L 29 | 30 | =cut 31 | -------------------------------------------------------------------------------- /lib/Alien/Build/Plugin/Gather/IsolateDynamic.pm: -------------------------------------------------------------------------------- 1 | package Alien::Build::Plugin::Gather::IsolateDynamic; 2 | 3 | use strict; 4 | use warnings; 5 | use 5.008004; 6 | use Alien::Build::Plugin; 7 | use Path::Tiny (); 8 | use Alien::Build::Util qw( _destdir_prefix ); 9 | use File::Copy (); 10 | 11 | # ABSTRACT: Plugin to gather dynamic libraries into a separate directory 12 | # VERSION 13 | 14 | =head1 SYNOPSIS 15 | 16 | use alienfile; 17 | plugin 'Gather::IsolateDynamic'; 18 | 19 | =head1 DESCRIPTION 20 | 21 | This plugin moves dynamic libraries from the C and C directories and puts them in 22 | their own C directory. This allows them to be used by FFI modules, but to be ignored 23 | by XS modules. 24 | 25 | This plugin provides the equivalent functionality of the C attribute 26 | from L. 27 | 28 | =cut 29 | 30 | sub init 31 | { 32 | my($self, $meta) = @_; 33 | 34 | # plugin was introduced in 0.42, but had a bug which was fixed in 0.48 35 | $meta->add_requires('share' => 'Alien::Build::Plugin::Gather::IsolateDynamic' => '0.48' ); 36 | 37 | $meta->after_hook( 38 | gather_share => sub { 39 | my($build) = @_; 40 | $build->log("Isolating dynamic libraries ..."); 41 | 42 | my $install_root; 43 | if($build->meta_prop->{destdir}) 44 | { 45 | my $destdir = $ENV{DESTDIR}; 46 | $install_root = Path::Tiny->new(_destdir_prefix($ENV{DESTDIR}, $build->install_prop->{prefix})); 47 | } 48 | else 49 | { 50 | $install_root = Path::Tiny->new($build->install_prop->{stage}); 51 | } 52 | 53 | foreach my $dir (map { $install_root->child($_) } qw( bin lib )) 54 | { 55 | next unless -d $dir; 56 | foreach my $from ($dir->children) 57 | { 58 | next unless $from->basename =~ /\.so/ 59 | || $from->basename =~ /\.(dylib|bundle|la|dll|dll\.a)$/; 60 | my $to = $install_root->child('dynamic', $from->basename); 61 | $to->parent->mkpath; 62 | unlink "$to" if -e $to; 63 | $build->log("move @{[ $from->parent->basename ]}/@{[ $from->basename ]} => dynamic/@{[ $to->basename ]}"); 64 | File::Copy::move("$from", "$to") || die "unable to move $from => $to $!"; 65 | } 66 | } 67 | 68 | $build->log(" Done!"); 69 | }, 70 | ); 71 | } 72 | 73 | 1; 74 | 75 | =head1 SEE ALSO 76 | 77 | L, L 78 | 79 | =cut 80 | -------------------------------------------------------------------------------- /lib/Alien/Build/Plugin/PkgConfig.pod: -------------------------------------------------------------------------------- 1 | # PODNAME: Alien::Build::Plugin::PkgConfig 2 | # ABSTRACT: PkgConfig Alien::Build plugins 3 | # VERSION 4 | 5 | =head1 SYNOPSIS 6 | 7 | use alienfile; 8 | plugin 'PkgConfig' => ( 9 | pkg_name => 'foo', 10 | ); 11 | 12 | =head1 DESCRIPTION 13 | 14 | PkgConfig plugins use C or a compatible library to retrieve flags 15 | at probe and gather stages. 16 | 17 | =over 4 18 | 19 | =item L 20 | 21 | Use the command-line C or C to get compiler and linker flags. 22 | 23 | =item L 24 | 25 | Use the XS L to get compiler and linker flags. 26 | 27 | =item L 28 | 29 | Convert .pc file to use static linkage by default. 30 | 31 | =item L 32 | 33 | Choose the best plugin to do C work. The best choice is typically 34 | platform and configuration dependent. 35 | 36 | =item L 37 | 38 | Use the pure-perl L to get compiler and linker flags. 39 | 40 | =back 41 | 42 | =cut 43 | 44 | =head1 SEE ALSO 45 | 46 | L, L 47 | 48 | =cut 49 | -------------------------------------------------------------------------------- /lib/Alien/Build/Plugin/Prefer.pod: -------------------------------------------------------------------------------- 1 | # PODNAME: Alien::Build::Plugin::Prefer 2 | # ABSTRACT: Prefer Alien::Build plugins 3 | # VERSION 4 | 5 | =head1 SYNOPSIS 6 | 7 | use alienfile; 8 | share { 9 | start_url 'http://ftp.gnu.org/gnu/make'; 10 | plugin 'Download'; 11 | }; 12 | 13 | =head1 DESCRIPTION 14 | 15 | Prefer plugins sort 16 | 17 | Decode plugins decode HTML and FTP file listings. Normally you 18 | will want to use the L 19 | plugin which will automatically load the appropriate Prefer plugins. 20 | 21 | =over 4 22 | 23 | =item L 24 | 25 | Filter out known bad versions from a candidate list. 26 | 27 | =item L 28 | 29 | Require specific known good versions from a candidate list. 30 | 31 | =item L 32 | 33 | Sort candidates by version. 34 | 35 | =back 36 | 37 | =cut 38 | 39 | =head1 SEE ALSO 40 | 41 | L, L 42 | 43 | =cut 44 | -------------------------------------------------------------------------------- /lib/Alien/Build/Plugin/Probe.pod: -------------------------------------------------------------------------------- 1 | # PODNAME: Alien::Build::Plugin::Probe 2 | # ABSTRACT: Probe Alien::Build plugins 3 | # VERSION 4 | 5 | =head1 SYNOPSIS 6 | 7 | look for libraries in known location: 8 | 9 | use alienfile; 10 | plugin 'Probe::CBuilder' => ( 11 | cflags => '-I/opt/libfoo/include', 12 | libs => '-L/opt/libfoo/lib -lfoo', 13 | ); 14 | 15 | look for tools in the path: 16 | 17 | use alienfile; 18 | plugin 'Probe::CommandLine' => ( 19 | command => 'gzip', 20 | args => [ '--version' ], 21 | match => qr/gzip/, 22 | version => qr/gzip ([0-9\.]+)/, 23 | ); 24 | 25 | Use C for Visual C++ Perl: 26 | 27 | use alienfile; 28 | plugin 'Probe::Vcpkg' => 'libffi'; 29 | 30 | =head1 DESCRIPTION 31 | 32 | Probe plugins try to find existing libraries and tools 33 | I installed on the system. If found they can 34 | be used instead of downloading the source from the 35 | internet and building. 36 | 37 | =over 4 38 | 39 | =item L 40 | 41 | Use L to probe for existing installed 42 | library. 43 | 44 | =item L 45 | 46 | Execute commands to probe for existing tools. 47 | 48 | =item L 49 | 50 | Use L to probe for existing installed library. 51 | 52 | =back 53 | 54 | =cut 55 | 56 | =head1 SEE ALSO 57 | 58 | L, L 59 | 60 | =cut 61 | -------------------------------------------------------------------------------- /lib/Alien/Build/Plugin/Test.pod: -------------------------------------------------------------------------------- 1 | # PODNAME: Alien::Build::Plugin::Test 2 | # ABSTRACT: Probe Alien::Build plugins 3 | # VERSION 4 | 5 | =head1 SYNOPSIS 6 | 7 | use alienfile; 8 | plugin 'Test::Mock' => ( 9 | probe => 'share', 10 | download => 1, 11 | extract => 1, 12 | build => 1, 13 | gather => 1, 14 | ); 15 | 16 | =head1 DESCRIPTION 17 | 18 | Test plugins are used in unit tests for L and possibly 19 | its plugins. 20 | 21 | =over 4 22 | 23 | =item L 24 | 25 | Mocks common steps in an L. 26 | 27 | =back 28 | 29 | =cut 30 | 31 | =head1 SEE ALSO 32 | 33 | L, L 34 | 35 | =cut 36 | -------------------------------------------------------------------------------- /lib/Alien/Build/Temp.pm: -------------------------------------------------------------------------------- 1 | package Alien::Build::Temp; 2 | 3 | use strict; 4 | use warnings; 5 | use 5.008004; 6 | use Carp (); 7 | use Path::Tiny (); 8 | use File::Temp (); 9 | use File::Spec (); 10 | 11 | # ABSTRACT: Temp Dir support for Alien::Build 12 | # VERSION 13 | 14 | =head1 DESCRIPTION 15 | 16 | This class is private to L. 17 | 18 | =cut 19 | 20 | # problem with vanilla File::Temp is that is often uses 21 | # as /tmp that has noexec turned on. Workaround is to 22 | # create a temp directory in the build directory, but 23 | # we have to be careful about cleanup. This puts all that 24 | # (attempted) carefulness in one place so that when we 25 | # later discover it isn't so careful we can fix it in 26 | # one place rather than all the places that we need 27 | # temp directories. 28 | 29 | # we also have a speical case for Windows, which often 30 | # has problems with long paths if we try to use the 31 | # current directory for temp files, so for those we 32 | # use the system tmp directory. 33 | 34 | my %root; 35 | 36 | sub _root 37 | { 38 | return File::Spec->tmpdir if $^O eq 'MSWin32'; 39 | 40 | my $root = Path::Tiny->new(-d "_alien" ? "_alien/tmp" : ".tmp")->absolute; 41 | unless(-d $root) 42 | { 43 | mkdir $root or die "unable to create temp root $!"; 44 | } 45 | 46 | # TODO: doesn't account for fork... 47 | my $lock = $root->child("l$$"); 48 | unless(-f $lock) 49 | { 50 | open my $fh, '>', $lock; 51 | close $fh; 52 | } 53 | $root{"$root"} = 1; 54 | $root; 55 | } 56 | 57 | END { 58 | foreach my $root (keys %root) 59 | { 60 | my $lock = Path::Tiny->new($root)->child("l$$"); 61 | unlink $lock; 62 | # try to delete if possible. 63 | # if not possible then punt 64 | rmdir $root if -d $root; 65 | } 66 | } 67 | 68 | sub newdir 69 | { 70 | my $class = shift; 71 | Carp::croak "uneven" if @_ % 2; 72 | File::Temp->newdir(DIR => _root, @_); 73 | } 74 | 75 | sub new 76 | { 77 | my $class = shift; 78 | Carp::croak "uneven" if @_ % 2; 79 | File::Temp->new(DIR => _root, @_); 80 | } 81 | 82 | 1; 83 | -------------------------------------------------------------------------------- /lib/Alien/Build/rc.pm: -------------------------------------------------------------------------------- 1 | package Alien::Build::rc; 2 | 3 | use strict; 4 | use warnings; 5 | use 5.008004; 6 | 7 | # ABSTRACT: Alien::Build local config 8 | # VERSION 9 | 10 | =head1 SYNOPSIS 11 | 12 | in your C<~/.alienbuild/rc.pl>: 13 | 14 | preload 'Foo::Bar'; 15 | postload 'Baz::Frooble'; 16 | 17 | =head1 DESCRIPTION 18 | 19 | L will load your C<~/.alienbuild/rc.pl> file, if it exists 20 | before running the L recipe. This allows you to alter the 21 | behavior of L based Ls if you have local configuration 22 | requirements. For example you can prompt before downloading remote content 23 | or fetch from a local mirror. 24 | 25 | =head1 FUNCTIONS 26 | 27 | =head2 logx 28 | 29 | log $message; 30 | 31 | Send a message to the L log. 32 | 33 | =cut 34 | 35 | sub logx ($) 36 | { 37 | unshift @_, 'Alien::Build'; 38 | goto &Alien::Build::log; 39 | } 40 | 41 | =head2 preload_plugin 42 | 43 | preload_plugin $plugin, @args; 44 | 45 | Preload the given plugin, with arguments. 46 | 47 | =cut 48 | 49 | sub preload_plugin 50 | { 51 | my(@args) = @_; 52 | push @Alien::Build::rc::PRELOAD, sub { 53 | shift->apply_plugin(@args); 54 | }; 55 | } 56 | 57 | =head2 postload_plugin 58 | 59 | postload_plugin $plugin, @args; 60 | 61 | Postload the given plugin, with arguments. 62 | 63 | =cut 64 | 65 | sub postload_plugin 66 | { 67 | my(@args) = @_; 68 | push @Alien::Build::rc::POSTLOAD, sub { 69 | shift->apply_plugin(@args); 70 | }; 71 | } 72 | 73 | =head2 preload 74 | 75 | [deprecated] 76 | 77 | preload $plugin; 78 | 79 | Preload the given plugin. 80 | 81 | =cut 82 | 83 | sub preload ($) 84 | { 85 | push @Alien::Build::rc::PRELOAD, $_[0]; 86 | } 87 | 88 | =head2 postload 89 | 90 | [deprecated] 91 | 92 | postload $plugin; 93 | 94 | Postload the given plugin. 95 | 96 | =cut 97 | 98 | sub postload ($) 99 | { 100 | push @Alien::Build::rc::POSTLOAD, $_[0]; 101 | } 102 | 103 | 1; 104 | 105 | =head1 SEE ALSO 106 | 107 | =over 4 108 | 109 | =item L 110 | 111 | =item L 112 | 113 | =item L 114 | 115 | =item L 116 | 117 | =back 118 | 119 | -------------------------------------------------------------------------------- /lib/Alien/Role.pm: -------------------------------------------------------------------------------- 1 | package Alien::Role; 2 | 3 | use strict; 4 | use warnings; 5 | use 5.008004; 6 | 7 | # ABSTRACT: Extend Alien::Base with roles! 8 | # VERSION 9 | 10 | =head1 SYNOPSIS 11 | 12 | package Alien::libfoo; 13 | 14 | use parent qw( Alien::Base ); 15 | use Role::Tiny::With qw( with ); 16 | 17 | with 'Alien::Role::Dino'; 18 | 19 | 1; 20 | 21 | =head1 DESCRIPTION 22 | 23 | The C namespace is intended for writing roles that can be 24 | applied to L to extend its functionality. You could of 25 | course write subclasses that extend L, but then you have 26 | to either stick with just one subclass or deal with multiple inheritance! 27 | It is recommended that you use L since it can be used on 28 | plain old Perl classes which is good since L doesn't use 29 | anything fancy like L or L. There is one working example 30 | that use this technique that are worth checking out in the event you 31 | are interested: L. 32 | 33 | This class itself doesn't do anything, it just documents the technique. 34 | 35 | =head1 SEE ALSO 36 | 37 | =over 4 38 | 39 | =item L 40 | 41 | =item L 42 | 43 | =item L 44 | 45 | =item L 46 | 47 | =item L 48 | 49 | =back 50 | 51 | =cut 52 | 53 | 1; 54 | -------------------------------------------------------------------------------- /lib/Alien/Util.pm: -------------------------------------------------------------------------------- 1 | package Alien::Util; 2 | 3 | use strict; 4 | use warnings; 5 | use Exporter qw( import ); 6 | 7 | # ABSTRACT: Alien Utilities used at build and runtime 8 | # VERSION 9 | 10 | =head1 SYNOPSIS 11 | 12 | use Alien::Util qw( version_cmp ); 13 | 14 | =head1 DESCRIPTION 15 | 16 | This module contains some functions used by both the L build-time and 17 | run-time for Alien. 18 | 19 | =cut 20 | 21 | our @EXPORT_OK = qw( version_cmp ); 22 | 23 | =head2 version_cmp 24 | 25 | $cmp = version_cmp($x, $y) 26 | 27 | Comparison method used by L, L and 28 | L. May be useful to implement custom comparisons, or for 29 | subclasses to overload to get different version comparison semantics than the 30 | default rules, for packages that have some other rules than the F 31 | behaviour. 32 | 33 | Should return a number less than, equal to, or greater than zero; similar in 34 | behaviour to the C<< <=> >> and C operators. 35 | 36 | =cut 37 | 38 | # Sort::Versions isn't quite the same algorithm because it differs in 39 | # behaviour with leading zeroes. 40 | # See also https://dev.gentoo.org/~mgorny/pkg-config-spec.html#version-comparison 41 | sub version_cmp { 42 | my @x = (shift =~ m/([0-9]+|[a-z]+)/ig); 43 | my @y = (shift =~ m/([0-9]+|[a-z]+)/ig); 44 | 45 | while(@x and @y) { 46 | my $x = shift @x; my $x_isnum = $x =~ m/[0-9]/; 47 | my $y = shift @y; my $y_isnum = $y =~ m/[0-9]/; 48 | 49 | if($x_isnum and $y_isnum) { 50 | # Numerical comparison 51 | return $x <=> $y if $x != $y; 52 | } 53 | elsif(!$x_isnum && !$y_isnum) { 54 | # Alphabetic comparison 55 | return $x cmp $y if $x ne $y; 56 | } 57 | else { 58 | # Of differing types, the numeric one is newer 59 | return $x_isnum - $y_isnum; 60 | } 61 | } 62 | 63 | # Equal so far; the longer is newer 64 | return @x <=> @y; 65 | } 66 | 67 | 1; 68 | 69 | =head1 SEE ALSO 70 | 71 | L, L, L 72 | 73 | =cut 74 | -------------------------------------------------------------------------------- /lib/Test/Alien/CanCompile.pm: -------------------------------------------------------------------------------- 1 | package Test::Alien::CanCompile; 2 | 3 | use strict; 4 | use warnings; 5 | use 5.008004; 6 | use Test2::API qw( context ); 7 | 8 | # ABSTRACT: Skip a test file unless a C compiler is available 9 | # VERSION 10 | 11 | =head1 SYNOPSIS 12 | 13 | use Test::Alien::CanCompile; 14 | 15 | =head1 DESCRIPTION 16 | 17 | This is just a L plugin that requires that a compiler 18 | be available. Otherwise the test will be skipped. 19 | 20 | =cut 21 | 22 | sub skip 23 | { 24 | require ExtUtils::CBuilder; 25 | ExtUtils::CBuilder->new->have_compiler ? undef : 'This test requires a compiler.'; 26 | } 27 | 28 | sub import 29 | { 30 | my $skip = __PACKAGE__->skip; 31 | return unless defined $skip; 32 | 33 | my $ctx = context(); 34 | $ctx->plan(0, SKIP => $skip); 35 | $ctx->release; 36 | } 37 | 38 | 1; 39 | 40 | =head1 SEE ALSO 41 | 42 | =over 4 43 | 44 | =item L 45 | 46 | =back 47 | 48 | =cut 49 | -------------------------------------------------------------------------------- /lib/Test/Alien/CanPlatypus.pm: -------------------------------------------------------------------------------- 1 | package Test::Alien::CanPlatypus; 2 | 3 | use strict; 4 | use warnings; 5 | use 5.008004; 6 | use Test2::API qw( context ); 7 | 8 | # ABSTRACT: Skip a test file unless FFI::Platypus is available 9 | # VERSION 10 | 11 | =head1 SYNOPSIS 12 | 13 | use Test::Alien::CanPlatypus; 14 | 15 | =head1 DESCRIPTION 16 | 17 | This is just a L plugin that requires that L 18 | be available. Otherwise the test will be skipped. 19 | 20 | =cut 21 | 22 | sub skip 23 | { 24 | eval { require FFI::Platypus; 1 } ? undef : 'This test requires FFI::Platypus.'; 25 | } 26 | 27 | sub import 28 | { 29 | my $skip = __PACKAGE__->skip; 30 | return unless defined $skip; 31 | 32 | my $ctx = context(); 33 | $ctx->plan(0, SKIP => $skip); 34 | $ctx->release; 35 | } 36 | 37 | 1; 38 | 39 | =head1 SEE ALSO 40 | 41 | =over 4 42 | 43 | =item L 44 | 45 | =item L 46 | 47 | =back 48 | 49 | =cut 50 | -------------------------------------------------------------------------------- /maint/Alien-Base-PkgConfig/Makefile.PL: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | use ExtUtils::MakeMaker; 4 | 5 | WriteMakefile( 6 | NAME => "Alien::Base::PkgConfig", 7 | VERSION_FROM => "lib/Alien/Base/PkgConfig.pm", 8 | PREREQ_PM => { 9 | 'Capture::Tiny' => 0, 10 | 'Path::Tiny' => 0, 11 | }, 12 | ); 13 | -------------------------------------------------------------------------------- /maint/ci-test-plugins.pl: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | use File::Glob qw( bsd_glob ); 4 | 5 | exit if $] < 5.012; 6 | 7 | my $exit = 0; 8 | 9 | my @fails; 10 | 11 | sub run 12 | { 13 | print "% @_\n"; 14 | system(@_); 15 | if($?) 16 | { 17 | push @fails, [@_]; 18 | warn "command failed!"; 19 | } 20 | } 21 | 22 | my(@tarball) = bsd_glob 'Alien-Build-*.tar.gz'; 23 | die "not exactly one tarball: @tarball" if @tarball != 1; 24 | my $tarball = shift @tarball; 25 | run 'cpanm', '-n', $tarball; 26 | 27 | my %min = ( 28 | 'Alien::Build::Plugin::Extract::Libarchive' => 5.020 29 | ); 30 | 31 | # TODO: Alien::Build::Plugin::Build::Premake5 32 | 33 | my @mods = qw( 34 | Alien::Build::MB 35 | Alien::Build::Git 36 | Alien::Role::Dino 37 | Alien::Build::Plugin::Decode::SourceForge 38 | Alien::Build::Plugin::Download::GitHub 39 | Alien::Build::Plugin::Download::GitLab 40 | Alien::Build::Plugin::Cleanse::BuildDir 41 | Alien::Build::Plugin::Extract::Libarchive 42 | Alien::Build::Plugin::Fetch::Cache 43 | Alien::Build::Plugin::Fetch::HostAllowList 44 | Alien::Build::Plugin::Fetch::HostBlockList 45 | Alien::Build::Plugin::Fetch::Prompt 46 | Alien::Build::Plugin::PkgConfig::PPWrapper 47 | Alien::Build::Plugin::Probe::GnuWin32 48 | Alien::Build::Plugin::Probe::Override 49 | Alien::Build::Plugin::Fetch::Rewrite 50 | ); 51 | 52 | foreach my $mod (@mods) 53 | { 54 | my $min = $min{$mod}; 55 | if(defined $min) 56 | { 57 | next unless $] >= $min; 58 | } 59 | { 60 | local $ENV{ALIEN_DOWNLOAD_RULE} = 'default'; 61 | local $ENV{ALIEN_INSTALL_TYPE} = 'default'; 62 | run 'cpanm', '--installdeps', '-n', $mod; 63 | } 64 | run 'cpanm', '--reinstall', '-v', $mod; 65 | } 66 | 67 | if(@fails) 68 | { 69 | print "failure summary:\n"; 70 | print "+@{[ @$_ ]}" for @fails; 71 | exit 2; 72 | } 73 | -------------------------------------------------------------------------------- /maint/cip-after-install: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ex 4 | 5 | if [ "x$ALIEN_BUILD_INSTALL_EXTRA" == "x1" ]; then 6 | 7 | cip exec $CIP_DIST_DIR/t/bin/httpd -d 8 | cip exec $CIP_DIST_DIR/t/bin/ftpd -d 9 | 10 | fi 11 | 12 | -------------------------------------------------------------------------------- /maint/cip-before-install: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ex 4 | 5 | if echo $CIP_TAG | grep -q -- -alpine ; then 6 | echo alpine 7 | cip sudo apk add cmake 8 | cip sudo apk add pkgconf-dev 9 | cip sudo apk add libffi-dev 10 | # needed for plugin tests later 11 | cip sudo apk add git 12 | cip sudo apk add g++ 13 | elif echo $CIP_TAG | grep -q -- -fedora ; then 14 | echo Fedora 15 | cip sudo yum install cmake libffi-devel wget git g++ -y 16 | else 17 | echo Debian or Ubuntu 18 | cip sudo apt-get update 19 | cip sudo apt-get -y install pkg-config cmake libffi-dev wget git g++ 20 | fi 21 | 22 | if [ "x$ALIEN_BUILD_INSTALL_EXTRA" == "x1" ]; then 23 | 24 | cip exec env PERL_ALT_INSTALL=OVERWRITE cpanm -n Alt::Alien::cmake3::System 25 | 26 | cip exec cpanm -n \ 27 | Test2::Harness \ 28 | File::Listing \ 29 | File::Listing::Ftpcopy \ 30 | HTML::LinkExtor \ 31 | HTTP::Tiny \ 32 | LWP \ 33 | PkgConfig \ 34 | PkgConfig::LibPkgConf \ 35 | Sort::Versions \ 36 | URI \ 37 | YAML \ 38 | Env::ShellWords \ 39 | Archive::Tar \ 40 | Archive::Zip \ 41 | Devel::Hide \ 42 | Readonly \ 43 | Alien::Base::ModuleBuild \ 44 | FFI::Platypus \ 45 | Mojo::DOM58 \ 46 | Mojolicious \ 47 | Win32::Vcpkg \ 48 | Plack \ 49 | Proc::Daemon \ 50 | AnyEvent::FTP \ 51 | Digest::SHA::PurePerl 52 | 53 | fi 54 | 55 | -------------------------------------------------------------------------------- /maint/cip-test-plugins: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ex 4 | 5 | if [ "$CIP_TAG" = "static" ]; then 6 | echo skip 7 | else 8 | cip exec perl maint/ci-test-plugins.pl 9 | fi 10 | 11 | -------------------------------------------------------------------------------- /maint/gen-test-archives.pl: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | use File::Temp qw( tempdir ); 4 | use File::chdir; 5 | use Path::Tiny qw( path ); 6 | use Capture::Tiny qw( capture_merged ); 7 | 8 | sub run 9 | { 10 | my @cmd = @_; 11 | 12 | my($out, $exit) = capture_merged { 13 | print "+@cmd\n"; 14 | system @cmd; 15 | $?; 16 | }; 17 | if($exit) 18 | { 19 | print $out; 20 | print STDERR "command failed\n"; 21 | exit 2; 22 | } 23 | } 24 | 25 | { 26 | local $CWD = tempdir( CLEANUP => 1 ); 27 | 28 | path('xx.txt')->spew("xx\n"); 29 | 30 | run 'tar', 'cvf', 'xx.tar', 'xx.txt'; 31 | run 'cp', 'xx.tar', 'xx.tar.bak'; 32 | run 'compress', 'xx.tar'; 33 | run 'mv', 'xx.tar.bak', 'xx.tar'; 34 | run 'gzip', '-k', 'xx.tar'; 35 | run 'bzip2', '-k', 'xx.tar'; 36 | run 'xz', '-k', 'xx.tar'; 37 | run 'zip', 'xx.zip', 'xx.txt'; 38 | run 'rm', '-f', 'xx.txt'; 39 | 40 | foreach my $file (sort { $a->basename cmp $b->basename } path('.')->children) 41 | { 42 | my $content = $file->slurp_raw; 43 | print "[ @{[ $file->basename ]} ]\n"; 44 | print pack('u', $content), "\n\n"; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /maint/gen.pl: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | my @list = sort map { chomp; s/\.pm$//; s/^lib\///; s/\//::/g; $_ } `find lib -name \*.pm`; 5 | 6 | open my $fh, '>', 't/01_use.t'; 7 | 8 | print $fh <<'EOM'; 9 | use Test2::V0 -no_srand => 1; 10 | 11 | sub require_ok ($); 12 | 13 | EOM 14 | 15 | foreach my $module (@list) 16 | { 17 | print $fh "require_ok '$module';\n"; 18 | } 19 | 20 | foreach my $module (@list) 21 | { 22 | my $test = lc $module; 23 | $test =~ s/::/_/g; 24 | $test = "t/$test.t"; 25 | printf $fh "ok -f %-55s %s\n", "'$test',", "'test for $module';"; 26 | } 27 | 28 | print $fh <<'EOM'; 29 | done_testing; 30 | 31 | sub require_ok ($) 32 | { 33 | # special case of when I really do want require_ok. 34 | # I just want a test that checks that the modules 35 | # will compile okay. I won't be trying to use them. 36 | my($mod) = @_; 37 | my $ctx = context(); 38 | { 39 | my $pm = "$mod.pm"; 40 | $pm =~ s/::/\//g; 41 | eval { require $pm }; 42 | } 43 | my $error = $@; 44 | my $ok = !$error; 45 | $ctx->ok($ok, "require $mod"); 46 | $ctx->diag("error: $error") if $error ne ''; 47 | $ctx->release; 48 | } 49 | EOM 50 | 51 | close $fh; 52 | 53 | #system 'perltidy -b -i=2 -l=900 t/01_use.t'; 54 | #unlink 't/01_use.t.bak'; 55 | 56 | 57 | { 58 | sub run 59 | { 60 | my(@cmd) = @_; 61 | print "% @cmd\n"; 62 | system @cmd; 63 | die 'command failed' if $?; 64 | } 65 | use autodie; 66 | mkdir 'corpus/dist2' unless -d 'corpus/dist2'; 67 | chdir 'corpus/dist2'; 68 | run 'rm', '-rf', 'foo', 'foo.tar'; 69 | mkdir 'foo'; 70 | run 'git', -C => 'foo', 'init'; 71 | open my $fh, '>', 'foo/foo.txt'; 72 | print $fh "xx\n"; 73 | close $fh; 74 | run 'git', -C => 'foo', 'add', '.'; 75 | run 'git', -C => 'foo', 'commit', -m => 'yy'; 76 | run 'git', -C => 'foo', 'archive', '--prefix=foo-1.00/', -o => '../foo.tar', 'master'; 77 | run 'rm', '-rf', 'foo'; 78 | chdir '../..'; 79 | } 80 | 81 | 82 | -------------------------------------------------------------------------------- /maint/update-cmake-libpalindrome: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -euo pipefail 4 | IFS=$'\n\t' 5 | 6 | cd corpus 7 | 8 | rm -rf libpalindrome 9 | rm -rf cmake-libpalindrome 10 | git clone https://github.com/plicease/cmake-libpalindrome.git 11 | 12 | cd cmake-libpalindrome 13 | rm -rf .git* 14 | cd .. 15 | 16 | -------------------------------------------------------------------------------- /perlcriticrc: -------------------------------------------------------------------------------- 1 | severity = 1 2 | only = 1 3 | 4 | [Community::ArrayAssignAref] 5 | [Community::BarewordFilehandles] 6 | [Community::ConditionalDeclarations] 7 | [Community::ConditionalImplicitReturn] 8 | [Community::DeprecatedFeatures] 9 | [Community::DiscouragedModules] 10 | [Community::DollarAB] 11 | [Community::Each] 12 | [Community::EmptyReturn] 13 | [Community::IndirectObjectNotation] 14 | [Community::LexicalForeachIterator] 15 | [Community::LoopOnHash] 16 | [Community::ModPerl] 17 | [Community::OpenArgs] 18 | [Community::OverloadOptions] 19 | [Community::POSIXImports] 20 | [Community::PackageMatchesFilename] 21 | [Community::PreferredAlternatives] 22 | [Community::StrictWarnings] 23 | extra_importers = Test2::V0 24 | [Community::Threads] 25 | [Community::Wantarray] 26 | [Community::WarningsSwitch] 27 | [Community::WhileDiamondDefaultAssignment] 28 | 29 | [BuiltinFunctions::ProhibitBooleanGrep] 30 | [BuiltinFunctions::ProhibitStringyEval] 31 | [BuiltinFunctions::ProhibitStringySplit] 32 | [BuiltinFunctions::ProhibitVoidGrep] 33 | [BuiltinFunctions::ProhibitVoidMap] 34 | [ClassHierarchies::ProhibitExplicitISA] 35 | [ClassHierarchies::ProhibitOneArgBless] 36 | [CodeLayout::ProhibitHardTabs] 37 | allow_leading_tabs = 0 38 | [CodeLayout::ProhibitTrailingWhitespace] 39 | [CodeLayout::RequireConsistentNewlines] 40 | [ControlStructures::ProhibitLabelsWithSpecialBlockNames] 41 | [ControlStructures::ProhibitMutatingListFunctions] 42 | [ControlStructures::ProhibitUnreachableCode] 43 | [InputOutput::ProhibitBarewordFileHandles] 44 | [InputOutput::ProhibitJoinedReadline] 45 | [InputOutput::ProhibitTwoArgOpen] 46 | [Miscellanea::ProhibitFormats] 47 | [Miscellanea::ProhibitUselessNoCritic] 48 | [Modules::ProhibitConditionalUseStatements] 49 | ;[Modules::RequireEndWithOne] 50 | [Modules::RequireNoMatchVarsWithUseEnglish] 51 | [Objects::ProhibitIndirectSyntax] 52 | [RegularExpressions::ProhibitUselessTopic] 53 | [Subroutines::ProhibitNestedSubs] 54 | [ValuesAndExpressions::ProhibitLeadingZeros] 55 | [ValuesAndExpressions::ProhibitMixedBooleanOperators] 56 | [ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator] 57 | [ValuesAndExpressions::RequireUpperCaseHeredocTerminator] 58 | [Variables::ProhibitPerl4PackageNames] 59 | [Variables::ProhibitUnusedVariables] 60 | -------------------------------------------------------------------------------- /spellcheck.ini: -------------------------------------------------------------------------------- 1 | [Perl] 2 | skip_sections = contributors 3 | skip_sections = author 4 | skip_sections = copyright and license 5 | skip_sections = thanks 6 | [StopWords] 7 | word = unixy 8 | word = umake 9 | word = tar.exe 10 | -------------------------------------------------------------------------------- /t/alien_build_commandsequence__cd.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Alien::Build::CommandSequence; 4 | use Test::Alien::Build; 5 | use File::chdir; 6 | use File::Temp qw( tempdir ); 7 | use Path::Tiny qw( path ); 8 | use Capture::Tiny qw( capture_merged ); 9 | 10 | my $build = alienfile q{ use alienfile }; 11 | 12 | subtest 'cd list' => sub { 13 | 14 | local $Alien::Build::VERSION = '1.05'; 15 | 16 | local $CWD; 17 | 18 | my $where; 19 | 20 | my $dir = path(tempdir( CLEANUP => 1 ))->child('foo')->canonpath; 21 | 22 | my $seq = Alien::Build::CommandSequence->new( 23 | [ "%{make_path} $dir" ], 24 | [ "cd", "$dir" ], 25 | sub { path('foo.txt')->spew('here') }, 26 | ); 27 | 28 | note scalar capture_merged { $seq->execute($build) }; 29 | 30 | my $foo_txt = path($dir)->child('foo.txt'); 31 | 32 | is( -f $foo_txt, T(), "created file" ); 33 | is( $foo_txt->slurp, "here", "content" ); 34 | 35 | }; 36 | 37 | subtest 'cd list' => sub { 38 | 39 | local $Alien::Build::VERSION = '1.05'; 40 | 41 | local $CWD; 42 | 43 | my $where; 44 | 45 | my $dir = path(tempdir( CLEANUP => 1 ))->child('foo')->canonpath; 46 | 47 | my $seq = Alien::Build::CommandSequence->new( 48 | [ "%{make_path} $dir" ], 49 | "cd $dir", 50 | sub { path('foo.txt')->spew('here') }, 51 | ); 52 | 53 | note scalar capture_merged { $seq->execute($build) }; 54 | 55 | my $foo_txt = path($dir)->child('foo.txt'); 56 | 57 | is( -f $foo_txt, T(), "created file" ); 58 | is( $foo_txt->slurp, "here", "content" ); 59 | 60 | }; 61 | 62 | subtest 'cd list with code ref' => sub { 63 | 64 | local $Alien::Build::VERSION = '1.05'; 65 | 66 | local $CWD; 67 | 68 | my $where; 69 | 70 | my $dir = path(tempdir( CLEANUP => 1 ))->child('foo')->canonpath; 71 | 72 | my $seq = Alien::Build::CommandSequence->new( 73 | [ "%{make_path} $dir" ], 74 | [ "cd", "$dir", sub { path('foo.txt')->spew('here') } ], 75 | ); 76 | 77 | note scalar capture_merged { $seq->execute($build) }; 78 | 79 | my $foo_txt = path($dir)->child('foo.txt'); 80 | 81 | is( -f $foo_txt, T(), "created file" ); 82 | is( $foo_txt->slurp, "here", "content" ); 83 | 84 | }; 85 | 86 | done_testing; 87 | -------------------------------------------------------------------------------- /t/alien_build_interpolate_default.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Alien::Build::Interpolate::Default; 4 | use lib 'corpus/lib'; 5 | 6 | subtest 'basic usage' => sub { 7 | 8 | my $intr = Alien::Build::Interpolate::Default->new; 9 | isa_ok $intr, 'Alien::Build::Interpolate'; 10 | 11 | if(eval { require YAML }) 12 | { 13 | note YAML::Dump($intr); 14 | } 15 | else 16 | { 17 | require Data::Dumper; 18 | note Data::Dumper::Dumper($intr); 19 | } 20 | 21 | }; 22 | 23 | subtest 'cwd' => sub { 24 | 25 | my $intr = Alien::Build::Interpolate::Default->new; 26 | 27 | my $val = $intr->interpolate('%{cwd}'); 28 | 29 | ok $val, "%{cwd} is okay"; 30 | note "val = $val"; 31 | 32 | }; 33 | 34 | subtest 'mkdir_deep' => sub { 35 | 36 | local $Alien::Build::VERSION = '1.04'; 37 | 38 | my $intr = Alien::Build::Interpolate::Default->new; 39 | 40 | my $val = $intr->interpolate('%{mkdir_deep} foo'); 41 | 42 | my $expected = $^O eq 'MSWin32' ? 'md foo' : 'mkdir -p foo'; 43 | 44 | is($val, $expected); 45 | }; 46 | 47 | subtest 'make_path' => sub { 48 | 49 | local $Alien::Build::VERSION = '1.05'; 50 | 51 | my $intr = Alien::Build::Interpolate::Default->new; 52 | 53 | my $val = $intr->interpolate('%{make_path} foo'); 54 | 55 | my $expected = $^O eq 'MSWin32' ? 'md foo' : 'mkdir -p foo'; 56 | 57 | is($val, $expected); 58 | }; 59 | 60 | subtest dynamic => sub { 61 | 62 | my %which; 63 | 64 | my $mock = mock 'Alien::Build::Interpolate::Default' => ( 65 | override => [ 66 | which => sub { my $command = shift; $which{$command} }, 67 | ], 68 | ); 69 | 70 | subtest 'have bison' => sub { 71 | 72 | $which{bison} = '/usr/bin/bison'; 73 | 74 | my $intr = Alien::Build::Interpolate::Default->new; 75 | 76 | is 77 | [$intr->requires('%{bison}')], 78 | [] 79 | ; 80 | 81 | is 82 | $intr->interpolate('-%{bison}-'), 83 | '-bison-', 84 | ; 85 | 86 | }; 87 | 88 | subtest 'no bison' => sub { 89 | 90 | delete $which{bison}; 91 | 92 | my $intr = Alien::Build::Interpolate::Default->new; 93 | 94 | is 95 | [$intr->requires('%{bison}')], 96 | [ 'Alien::bison' => '0.17' ] 97 | ; 98 | 99 | }; 100 | 101 | }; 102 | 103 | done_testing; 104 | -------------------------------------------------------------------------------- /t/alien_build_log_abbreviate.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Alien::Build::Log::Abbreviate; 4 | 5 | ok 1; 6 | 7 | done_testing; 8 | -------------------------------------------------------------------------------- /t/alien_build_log_default.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Alien::Build::Log::Default; 4 | 5 | ok 1; 6 | 7 | done_testing; 8 | -------------------------------------------------------------------------------- /t/alien_build_meta.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Test::Alien::Build; 4 | use Alien::Build; 5 | 6 | subtest 'basic' => sub { 7 | 8 | my $build = alienfile_ok qq{ use alienfile }; 9 | my $meta = $build->meta; 10 | 11 | isa_ok( $build->meta, 'Alien::Build::Meta' ); 12 | 13 | }; 14 | 15 | done_testing; 16 | -------------------------------------------------------------------------------- /t/alien_build_plugin_build_copy.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Test::Alien::Build; 4 | use Alien::Build::Plugin::Build::Copy; 5 | use Path::Tiny; 6 | 7 | alien_subtest 'basic' => sub { 8 | 9 | my $build = alienfile_ok q{ 10 | use alienfile; 11 | 12 | plugin 'Test::Mock', 13 | probe => 'share', 14 | download => 1; 15 | 16 | share { 17 | extract sub { 18 | my $bin = Path::Tiny->new('.')->absolute->child('bin')->child('mycommand'); 19 | log "bin=$bin"; 20 | $bin->parent->mkpath; 21 | $bin->touch; 22 | $bin->chmod(0755) if $^O ne 'MSWin32'; 23 | 24 | my $include = Path::Tiny->new('.')->absolute->child('include')->child('foo.h'); 25 | $include->parent->mkpath; 26 | $include->touch; 27 | }; 28 | plugin 'Build::Copy'; 29 | }; 30 | }; 31 | 32 | alien_build_ok 'builds okay'; 33 | 34 | my $stage = Path::Tiny->new($build->install_prop->{stage}); 35 | 36 | my $mycommand = $stage->child('bin', 'mycommand'); 37 | ok(-f $mycommand, "file $mycommand exists"); 38 | ok(-x $mycommand, "file $mycommand is executable") 39 | if $^O !~ /^(MSWin32|msys|cygwin)$/; 40 | 41 | my $inc = $stage->child('include','foo.h'); 42 | ok(-f $inc, "file $inc exists"); 43 | 44 | is( 45 | $build->requires('configure')->{'Alien::Build::Plugin::Build::Copy'}, 46 | D(), 47 | 'requires self', 48 | ); 49 | 50 | }; 51 | 52 | done_testing; 53 | -------------------------------------------------------------------------------- /t/alien_build_plugin_build_msys.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Test::Alien::Build; 4 | use Alien::Build::Plugin::Build::MSYS; 5 | 6 | subtest 'basic' => sub { 7 | 8 | my $plugin = Alien::Build::Plugin::Build::MSYS->new; 9 | isa_ok $plugin, 'Alien::Build::Plugin'; 10 | isa_ok $plugin, 'Alien::Build::Plugin::Build::MSYS'; 11 | 12 | my $build = alienfile_ok q{ use alienfile }; 13 | my $meta = $build->meta; 14 | 15 | $plugin->init($meta); 16 | 17 | }; 18 | 19 | done_testing; 20 | 21 | 22 | { 23 | package 24 | Alien::MSYS; 25 | 26 | BEGIN { 27 | our $VERSION = '0.07'; 28 | $INC{'Alien/MSYS.pm'} = __FILE__; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /t/alien_build_plugin_core_cleaninstall.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Alien::Build::Plugin::Core::CleanInstall; 4 | use Test::Alien::Build; 5 | use Path::Tiny qw( path ); 6 | 7 | subtest 'basic' => sub { 8 | 9 | my $build = alienfile_ok q{ 10 | use alienfile; 11 | probe sub { 'share' }; 12 | }; 13 | 14 | my $dir = path($build->runtime_prop->{prefix}); 15 | 16 | $dir->child($_)->mkpath for qw( _alien bin include lib ); 17 | $dir->child('foo.txt')->touch; 18 | $dir->child('_alien/alienfile')->touch; 19 | $dir->child('bin/myexe')->touch; 20 | $dir->child('include/myheader.h')->touch; 21 | $dir->child('lib/libfoo.a')->touch; 22 | 23 | alien_clean_install; 24 | 25 | ok -d "$dir/_alien"; 26 | ok -f "$dir/_alien/alienfile"; 27 | ok !-e "$dir/foo.txt"; 28 | ok !-e "$dir/bin/myexe"; 29 | ok !-e "$dir/include/myheader.h"; 30 | ok !-e "$dir/lib/libfoo.a"; 31 | }; 32 | 33 | subtest 'do remove on system install' => sub { 34 | 35 | my $build = alienfile_ok q{ 36 | use alienfile; 37 | probe sub { 'system' }; 38 | }; 39 | 40 | my $dir = path($build->runtime_prop->{prefix}); 41 | 42 | $dir->child($_)->mkpath for qw( _alien bin include lib ); 43 | $dir->child('foo.txt')->touch; 44 | $dir->child('_alien/alienfile')->touch; 45 | $dir->child('bin/myexe')->touch; 46 | $dir->child('include/myheader.h')->touch; 47 | $dir->child('lib/libfoo.a')->touch; 48 | 49 | alien_clean_install; 50 | 51 | ok -d "$dir/_alien"; 52 | ok -f "$dir/_alien/alienfile"; 53 | ok !-e "$dir/foo.txt"; 54 | ok !-e "$dir/bin/myexe"; 55 | ok !-e "$dir/include/myheader.h"; 56 | ok !-e "$dir/lib/libfoo.a"; 57 | }; 58 | 59 | subtest 'do not try to remove when it isn\'t there' => sub { 60 | 61 | my $build = alienfile_ok q{ 62 | use alienfile; 63 | probe sub { 'share' }; 64 | }; 65 | 66 | path($build->runtime_prop->{prefix})->remove_tree; 67 | 68 | alien_clean_install; 69 | 70 | }; 71 | 72 | done_testing; 73 | -------------------------------------------------------------------------------- /t/alien_build_plugin_core_legacy.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Test::Alien::Build; 4 | use Alien::Build::Plugin::Core::Legacy; 5 | use Capture::Tiny qw( capture_merged ); 6 | use File::Temp qw( tempdir ); 7 | 8 | subtest 'basic' => sub { 9 | 10 | my $build = alienfile q{ 11 | use alienfile; 12 | plugin 'Test::Mock', 13 | probe => 'share', 14 | download => 1, 15 | extract => 1, 16 | build => 1, 17 | share { 18 | gather sub { 19 | my($build) = @_; 20 | $build->runtime_prop->{cflags} = '-DFOO=1'; 21 | $build->runtime_prop->{libs} = '-lfoo'; 22 | $build->runtime_prop->{version} = '1.2.3'; 23 | }; 24 | }; 25 | }; 26 | 27 | capture_merged { 28 | $build->probe; 29 | $build->download; 30 | $build->build; 31 | }; 32 | 33 | is( $build->runtime_prop->{cflags}, '-DFOO=1', 'cflags' ); 34 | is( $build->runtime_prop->{libs}, '-lfoo', 'libs' ); 35 | is( $build->runtime_prop->{cflags_static}, '-DFOO=1', 'cflags_static' ); 36 | is( $build->runtime_prop->{libs_static}, '-lfoo', 'libs_static' ); 37 | 38 | is( 39 | $build->runtime_prop->{legacy}, 40 | hash { 41 | field 'finished_installing' => T(); 42 | field 'install_type' => 'share'; 43 | field 'version' => '1.2.3'; 44 | field 'original_prefix' => $build->runtime_prop->{prefix}; 45 | }, 46 | 'legacy hash', 47 | ); 48 | 49 | }; 50 | 51 | done_testing; 52 | -------------------------------------------------------------------------------- /t/alien_build_plugin_core_setup.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Test::Alien::Build; 4 | use Alien::Build::Plugin::Core::Setup; 5 | use Alien::Build::Util qw( _dump ); 6 | 7 | subtest 'compiler type' => sub { 8 | 9 | my $build = alienfile_ok q{ 10 | use alienfile; 11 | }; 12 | 13 | ok( $build->meta_prop->{platform}->{compiler_type}, 'has a compiler type' ); 14 | note "compiler type = @{[ $build->meta_prop->{platform}->{compiler_type} ]}"; 15 | }; 16 | 17 | subtest 'CPU count' => sub { 18 | 19 | my $build = alienfile_ok q{ 20 | use alienfile; 21 | }; 22 | 23 | ok( $build->meta_prop->{platform}->{cpu}{count}, 'has a CPU count' ); 24 | cmp_ok( $build->meta_prop->{platform}->{cpu}{count}, '>', '0', 25 | 'CPU count is non-negative' ); 26 | note "CPU count = @{[ $build->meta_prop->{platform}->{cpu}{count} ]}"; 27 | 28 | subtest "ALIEN_CPU_COUNT environment variable" => sub { 29 | subtest "ALIEN_CPU_COUNT=1" => sub { 30 | local $ENV{ALIEN_CPU_COUNT} = 1; 31 | my $build = alienfile_ok q{ 32 | use alienfile; 33 | }; 34 | is( $build->meta_prop->{platform}->{cpu}{count}, 1, 'CPU count = 1' ); 35 | }; 36 | subtest "ALIEN_CPU_COUNT=2" => sub { 37 | local $ENV{ALIEN_CPU_COUNT} = 2; 38 | my $build = alienfile_ok q{ 39 | use alienfile; 40 | }; 41 | is( $build->meta_prop->{platform}->{cpu}{count}, 2, 'CPU count = 2' ); 42 | }; 43 | subtest "ALIEN_CPU_COUNT=0" => sub { 44 | local $ENV{ALIEN_CPU_COUNT} = 0; 45 | my $build = alienfile_ok q{ 46 | use alienfile; 47 | }; 48 | my $cpu_count = $build->meta_prop->{platform}->{cpu}{count}; 49 | cmp_ok( $cpu_count, '>', 0, "ALIEN_CPU_COUNT=0 is ignored (value: $cpu_count)" ); 50 | }; 51 | }; 52 | }; 53 | 54 | subtest 'CPU arch' => sub { 55 | 56 | my $build = alienfile_ok q{ 57 | use alienfile; 58 | }; 59 | 60 | ok( $build->meta_prop->{platform}->{cpu}{arch}, 'has a CPU arch' ); 61 | note "CPU arch:\n@{[ _dump($build->meta_prop->{platform}->{cpu}{arch}) ]}"; 62 | }; 63 | 64 | done_testing; 65 | -------------------------------------------------------------------------------- /t/alien_build_plugin_core_tail.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Test::Alien::Build; 4 | use Alien::Build::Plugin::Core::Tail; 5 | 6 | subtest 'out-of-source build' => sub { 7 | 8 | my $build = alienfile_ok q{ 9 | use alienfile; 10 | meta->prop->{out_of_source} = 1; 11 | }; 12 | 13 | is( 14 | $build->requires('configure'), 15 | hash { 16 | field 'Alien::Build' => '1.08'; 17 | etc; 18 | }, 19 | ); 20 | 21 | 22 | }; 23 | 24 | done_testing; 25 | -------------------------------------------------------------------------------- /t/alien_build_plugin_decode_dirlisting.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Test::Alien::Build; 4 | use Alien::Build::Plugin::Decode::DirListing; 5 | use Path::Tiny; 6 | use Alien::Build::Util qw( _dump ); 7 | 8 | subtest 'updates requires' => sub { 9 | 10 | my $plugin = Alien::Build::Plugin::Decode::DirListing->new; 11 | 12 | my $build = alienfile filename => 'corpus/blank/alienfile'; 13 | my $meta = $build->meta; 14 | 15 | $plugin->init($meta); 16 | 17 | is( $build->requires('share')->{'File::Listing'}, 0 ); 18 | is( $build->requires('share')->{'URI'}, 0 ); 19 | 20 | note _dump $meta; 21 | 22 | }; 23 | 24 | subtest 'decode' => sub { 25 | 26 | my $plugin = Alien::Build::Plugin::Decode::DirListing->new; 27 | 28 | my $build = alienfile filename => 'corpus/blank/alienfile'; 29 | my $meta = $build->meta; 30 | 31 | $plugin->init($meta); 32 | 33 | eval { $build->load_requires('share') }; 34 | skip_all 'test requires File::Listing and URI' if $@; 35 | 36 | foreach my $file (path('corpus/dir')->children(qr/\.list$/)) 37 | { 38 | subtest "parse $file" => sub { 39 | my $res1 = { 40 | type => 'dir_listing', 41 | base => "ftp://example.test/foo/bar/", 42 | content => $file->slurp, 43 | }; 44 | my $res2 = $build->decode($res1); 45 | is( 46 | $res2, 47 | hash { 48 | field type => 'list'; 49 | field list => array { 50 | foreach my $filename (qw( foo-1.00 foo-1.00.tar foo-1.00.tar.Z foo-1.00.tar.bz2 foo-1.00.tar.gz foo-1.00.tar.xz foo-1.00.zip)) 51 | { 52 | item hash { 53 | field filename => $filename; 54 | field url => match qr{\Q$filename\E}; 55 | }; 56 | } 57 | }; 58 | }, 59 | ); 60 | note "url = $_" for map { $_->{url} } @{ $res2->{list} } 61 | }; 62 | } 63 | 64 | }; 65 | 66 | done_testing; 67 | -------------------------------------------------------------------------------- /t/alien_build_plugin_decode_dirlistingftpcopy.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Test::Alien::Build; 4 | use Alien::Build::Plugin::Decode::DirListingFtpcopy; 5 | use Path::Tiny; 6 | use Alien::Build::Util qw( _dump ); 7 | 8 | subtest 'updates requires' => sub { 9 | 10 | my $plugin = Alien::Build::Plugin::Decode::DirListingFtpcopy->new; 11 | 12 | my $build = alienfile filename => 'corpus/blank/alienfile'; 13 | my $meta = $build->meta; 14 | 15 | $plugin->init($meta); 16 | 17 | is( $build->requires('share')->{'File::Listing::Ftpcopy'}, 0 ); 18 | is( $build->requires('share')->{'URI'}, 0 ); 19 | 20 | note _dump $meta; 21 | 22 | }; 23 | 24 | subtest 'decode' => sub { 25 | 26 | my $plugin = Alien::Build::Plugin::Decode::DirListingFtpcopy->new; 27 | 28 | my $build = alienfile filename => 'corpus/blank/alienfile'; 29 | my $meta = $build->meta; 30 | 31 | $plugin->init($meta); 32 | 33 | eval { $build->load_requires('share') }; 34 | skip_all 'test requires File::Listing::Ftpcopy and URI' if $@; 35 | 36 | foreach my $file (path('corpus/dir')->children(qr/\.list$/)) 37 | { 38 | subtest "parse $file" => sub { 39 | my $res1 = { 40 | type => 'dir_listing', 41 | base => "ftp://example.test/foo/bar/", 42 | content => $file->slurp, 43 | }; 44 | my $res2 = $build->decode($res1); 45 | is( 46 | $res2, 47 | hash { 48 | field type => 'list'; 49 | field list => array { 50 | foreach my $filename (qw( foo-1.00 foo-1.00.tar foo-1.00.tar.Z foo-1.00.tar.bz2 foo-1.00.tar.gz foo-1.00.tar.xz foo-1.00.zip)) 51 | { 52 | item hash { 53 | field filename => $filename; 54 | field url => match qr{\Q$filename\E}; 55 | }; 56 | } 57 | }; 58 | }, 59 | ); 60 | note "url = $_" for map { $_->{url} } @{ $res2->{list} } 61 | }; 62 | } 63 | 64 | }; 65 | 66 | done_testing; 67 | -------------------------------------------------------------------------------- /t/alien_build_plugin_decode_html.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Test::Alien::Build; 4 | use Alien::Build::Plugin::Decode::HTML; 5 | use Path::Tiny; 6 | use Alien::Build::Util qw( _dump ); 7 | 8 | subtest 'updates requires' => sub { 9 | 10 | my $plugin = Alien::Build::Plugin::Decode::HTML->new; 11 | 12 | my $build = alienfile filename => 'corpus/blank/alienfile'; 13 | my $meta = $build->meta; 14 | 15 | $plugin->init($meta); 16 | 17 | is( $build->requires('share')->{'HTML::LinkExtor'}, 0 ); 18 | is( $build->requires('share')->{'URI'}, 0 ); 19 | 20 | note _dump $meta; 21 | 22 | }; 23 | 24 | subtest 'decode' => sub { 25 | 26 | my $plugin = Alien::Build::Plugin::Decode::HTML->new; 27 | 28 | my $build = alienfile filename => 'corpus/blank/alienfile'; 29 | my $meta = $build->meta; 30 | 31 | $plugin->init($meta); 32 | 33 | eval { $build->load_requires('share') }; 34 | skip_all 'test requires HTML::LinkExtor' if $@; 35 | 36 | foreach my $file (path('corpus/dir')->children(qr/\.html$/)) 37 | { 38 | subtest "parse $file" => sub { 39 | my $res1 = { 40 | type => 'html', 41 | base => "http://example.test/foo/bar/index.html", 42 | content => $file->slurp, 43 | }; 44 | my $res2 = $build->decode($res1); 45 | is( 46 | $res2, 47 | hash { 48 | field type => 'list'; 49 | field list => array { 50 | foreach my $filename (qw( foo-1.00 foo-1.00.tar foo-1.00.tar.Z foo-1.00.tar.bz2 foo-1.00.tar.gz foo-1.00.tar.xz foo-1.00.tgz foo-1.00.zip)) 51 | { 52 | item hash { 53 | field filename => $filename; 54 | field url => match qr{\Q$filename\E}; 55 | }; 56 | } 57 | }; 58 | }, 59 | ); 60 | note "filename = $_" for map { $_->{filename} } @{ $res2->{list} }; 61 | note "url = $_" for map { $_->{url} } @{ $res2->{list} }; 62 | }; 63 | } 64 | 65 | }; 66 | 67 | done_testing; 68 | -------------------------------------------------------------------------------- /t/alien_build_plugin_decode_mojo.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Alien::Build::Plugin::Decode::Mojo; 4 | use Test::Alien::Build; 5 | use Path::Tiny qw( path ); 6 | use Data::Dumper qw( Dumper ); 7 | 8 | subtest 'updates requires' => sub { 9 | 10 | my $build = alienfile q{ 11 | use alienfile; 12 | plugin 'Decode::Mojo'; 13 | }; 14 | 15 | is( 16 | $build->requires('share'), 17 | hash { 18 | field 'URI' => 0; 19 | field 'URI::Escape' => 0; 20 | if($build->requires('share')->{'Mojo::DOM58'}) 21 | { 22 | field 'Mojo::DOM58' => '1.00'; 23 | } 24 | elsif($build->requires('share')->{'Mojo::DOM58'}) 25 | { 26 | field 'Mojo::DOM' => '0'; 27 | field 'Mojolicious' => '0'; 28 | } 29 | etc; 30 | }, 31 | ); 32 | 33 | note Dumper($build->requires('share')); 34 | 35 | }; 36 | 37 | foreach my $class (qw( Mojo::DOM Mojo::DOM58 )) 38 | { 39 | subtest "decode class = $class" => sub { 40 | 41 | my $build = alienfile qq{ 42 | use alienfile; 43 | plugin 'Decode::Mojo' => ( _class => "$class" ); 44 | probe sub { 'share' }; 45 | }; 46 | 47 | alienfile_skip_if_missing_prereqs; 48 | 49 | is 50 | $build->requires('share'), 51 | hash { 52 | field $class => D(); 53 | field 'Mojolicious' => D() if $class eq 'Mojo::DOM'; 54 | etc; 55 | } 56 | ; 57 | 58 | foreach my $file (path('corpus/dir')->children(qr/\.html$/)) 59 | { 60 | subtest "parse $file" => sub { 61 | my $res1 = { 62 | type => 'html', 63 | base => "http://example.test/foo/bar/index.html", 64 | content => $file->slurp, 65 | }; 66 | my $res2 = $build->decode($res1); 67 | is( 68 | $res2, 69 | hash { 70 | field type => 'list'; 71 | field list => array { 72 | foreach my $filename (qw( foo-1.00 foo-1.00.tar foo-1.00.tar.Z foo-1.00.tar.bz2 foo-1.00.tar.gz foo-1.00.tar.xz foo-1.00.tgz foo-1.00.zip)) 73 | { 74 | item hash { 75 | field filename => $filename; 76 | field url => match qr{\Q$filename\E}; 77 | }; 78 | } 79 | }; 80 | }, 81 | ); 82 | note "filename = $_" for map { $_->{filename} } @{ $res2->{list} }; 83 | note "url = $_" for map { $_->{url} } @{ $res2->{list} }; 84 | }; 85 | } 86 | 87 | }; 88 | } 89 | 90 | done_testing 91 | -------------------------------------------------------------------------------- /t/alien_build_plugin_digest_sha.t: -------------------------------------------------------------------------------- 1 | use Test2::V0 -no_srand => 1; 2 | use Test::Alien::Build; 3 | use Path::Tiny qw( path ); 4 | use Alien::Build::Util qw( _dump ); 5 | 6 | subtest 'basic' => sub { 7 | 8 | local $Alien::Build::VERSION = $Alien::Build::VERSION || 2.57; 9 | 10 | my $build = alienfile_ok q{ 11 | use alienfile; 12 | plugin 'Digest::SHA'; 13 | 14 | probe sub { 'share' }; 15 | }; 16 | 17 | alienfile_skip_if_missing_prereqs; 18 | 19 | foreach my $type (qw( path content )) 20 | { 21 | 22 | my $good = 'a7e79996a02d3dfc47f6f3ec043c67690dc06a10d091bf1d760fee7c8161391a'; 23 | my $bad = '032772271db8f134e4914bca0e933361e1946c91c21e43610d301d39cbdb9d52'; 24 | 25 | subtest "file stored as $type" => sub { 26 | my $file = { 27 | type => 'file', 28 | filename => 'foo.txt.gz', 29 | path => path("corpus/alien_build_plugin_digest_shapp/foo.txt.gz")->absolute->stringify, 30 | tmp => 0, 31 | }; 32 | 33 | if($type eq 'content') 34 | { 35 | $file->{content} = path(delete $file->{path})->slurp_raw; 36 | delete $file->{tmp}; 37 | } 38 | 39 | note _dump($file); 40 | 41 | is 42 | $build->meta->call_hook( check_digest => $build, $file, 'xxx', $good ), 43 | 0, 44 | 'plugin returns 0 if it does not recognize the algorthim (xxx)'; 45 | 46 | is 47 | $build->meta->call_hook( check_digest => $build, $file, 'SHA13', $good ), 48 | 0, 49 | 'plugin returns 0 if it does not recognize the algorthim (SHA13)'; 50 | 51 | is 52 | $build->meta->call_hook( check_digest => $build, $file, 'SHA256', $good ), 53 | 1, 54 | 'plugin returns 1 for valid signature'; 55 | 56 | is 57 | dies { $build->meta->call_hook( check_digest => $build, $file, 'SHA256', $bad ) }, 58 | match qr/^foo.txt.gz SHA256 digest does not match: got $good, expected $bad/, 59 | 'plugin dies on invalid signature'; 60 | } 61 | } 62 | 63 | }; 64 | 65 | done_testing; 66 | -------------------------------------------------------------------------------- /t/alien_build_plugin_digest_shapp.t: -------------------------------------------------------------------------------- 1 | use Test2::V0 -no_srand => 1; 2 | use Test::Alien::Build; 3 | use Path::Tiny qw( path ); 4 | use Alien::Build::Util qw( _dump ); 5 | 6 | subtest 'basic' => sub { 7 | 8 | local $Alien::Build::VERSION = $Alien::Build::VERSION || 2.57; 9 | 10 | my $build = alienfile_ok q{ 11 | use alienfile; 12 | plugin 'Digest::SHAPP'; 13 | 14 | probe sub { 'share' }; 15 | }; 16 | 17 | alienfile_skip_if_missing_prereqs; 18 | 19 | foreach my $type (qw( path content )) 20 | { 21 | 22 | my $good = 'a7e79996a02d3dfc47f6f3ec043c67690dc06a10d091bf1d760fee7c8161391a'; 23 | my $bad = '032772271db8f134e4914bca0e933361e1946c91c21e43610d301d39cbdb9d52'; 24 | 25 | subtest "file stored as $type" => sub { 26 | my $file = { 27 | type => 'file', 28 | filename => 'foo.txt.gz', 29 | path => path("corpus/alien_build_plugin_digest_shapp/foo.txt.gz")->absolute->stringify, 30 | tmp => 0, 31 | }; 32 | 33 | if($type eq 'content') 34 | { 35 | $file->{content} = path(delete $file->{path})->slurp_raw; 36 | delete $file->{tmp}; 37 | } 38 | 39 | note _dump($file); 40 | 41 | is 42 | $build->meta->call_hook( check_digest => $build, $file, 'xxx', $good ), 43 | 0, 44 | 'plugin returns 0 if it does not recognize the algorthim (xxx)'; 45 | 46 | is 47 | $build->meta->call_hook( check_digest => $build, $file, 'SHA13', $good ), 48 | 0, 49 | 'plugin returns 0 if it does not recognize the algorthim (SHA13)'; 50 | 51 | is 52 | $build->meta->call_hook( check_digest => $build, $file, 'SHA256', $good ), 53 | 1, 54 | 'plugin returns 1 for valid signature'; 55 | 56 | is 57 | dies { $build->meta->call_hook( check_digest => $build, $file, 'SHA256', $bad ) }, 58 | match qr/^foo.txt.gz SHA256 digest does not match: got $good, expected $bad/, 59 | 'plugin dies on invalid signature'; 60 | } 61 | } 62 | 63 | }; 64 | 65 | done_testing; 66 | -------------------------------------------------------------------------------- /t/alien_build_plugin_extract_archivezip.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Test::Alien::Build; 4 | use Alien::Build::Plugin::Extract::ArchiveZip; 5 | use Path::Tiny qw( path ); 6 | use Capture::Tiny qw( capture_merged ); 7 | use File::Temp qw( tempdir ); 8 | 9 | subtest 'available' => sub { 10 | 11 | is( 12 | Alien::Build::Plugin::Extract::ArchiveZip->available('tar'), 13 | F(), 14 | 'tar is always false', 15 | ); 16 | 17 | subtest 'with Archive::Zip' => sub { 18 | 19 | local $INC{'Archive/Zip.pm'} = __FILE__; 20 | 21 | is( 22 | Alien::Build::Plugin::Extract::ArchiveZip->available('zip'), 23 | T(), 24 | ); 25 | 26 | }; 27 | 28 | subtest 'with Archive::Zip' => sub { 29 | 30 | skip_all 'subtest requires Devel::Hide' unless eval { require Devel::Hide }; 31 | 32 | note scalar capture_merged { Devel::Hide->import(qw( Archive::Zip )) }; 33 | 34 | local %INC; 35 | delete $INC{'Archive/Zip.pm'}; 36 | 37 | is( 38 | Alien::Build::Plugin::Extract::ArchiveZip->available('zip'), 39 | F(), 40 | ); 41 | 42 | }; 43 | 44 | }; 45 | 46 | subtest 'archive' => sub { 47 | 48 | foreach my $ext (qw( zip )) 49 | { 50 | subtest "with extension $ext" => sub { 51 | 52 | my $build = alienfile_ok q{ 53 | use alienfile; 54 | use Path::Tiny qw( path ); 55 | plugin 'Test::Mock', 56 | probe => 'share', 57 | download => { 58 | 'foo.zip' => path(__FILE__)->parent->parent->child('corpus/dist/foo-1.00.zip')->slurp_raw, 59 | }; 60 | share { 61 | plugin 'Extract::ArchiveZip'; 62 | }; 63 | }; 64 | 65 | alienfile_skip_if_missing_prereqs; 66 | 67 | my $dir = alien_extract_ok; 68 | 69 | if(defined $dir) 70 | { 71 | $dir = path($dir); 72 | foreach my $name (qw( configure foo.c )) 73 | { 74 | my $file = $dir->child($name); 75 | ok -f $file, "$name exists"; 76 | } 77 | } 78 | } 79 | } 80 | 81 | }; 82 | 83 | done_testing; 84 | -------------------------------------------------------------------------------- /t/alien_build_plugin_extract_commandline__tar_can.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Test::Alien::Build; 4 | use Alien::Build::Plugin::Extract::CommandLine; 5 | 6 | eval { require Readonly; Readonly->VERSION('1.60') }; ## no critic (Community::PreferredAlternatives) 7 | skip_all 'test requires Readonly 1.60' if $@; 8 | 9 | subtest 'tar can' => sub { 10 | my $build = alienfile filename => 'corpus/blank/alienfile'; 11 | my $meta = $build->meta; 12 | 13 | my $plugin = Alien::Build::Plugin::Extract::CommandLine->new; 14 | 15 | Readonly::Scalar($_ => 'a'); 16 | $plugin->init($meta); 17 | 18 | ok lives { 19 | $plugin->_tar_can('.tar.gz'); 20 | }, 'can read from with readonly $_' or note($@); 21 | }; 22 | 23 | done_testing; 24 | -------------------------------------------------------------------------------- /t/alien_build_plugin_extract_directory.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Test::Alien::Build; 4 | use Alien::Build::Plugin::Extract::Directory; 5 | use Path::Tiny qw( path ); 6 | use Capture::Tiny qw( capture_merged ); 7 | 8 | subtest 'handles' => sub { 9 | 10 | is( 11 | Alien::Build::Plugin::Extract::Directory->handles('d'), 12 | T(), 13 | ); 14 | 15 | is( 16 | Alien::Build::Plugin::Extract::Directory->handles('tar'), 17 | F(), 18 | ); 19 | 20 | }; 21 | 22 | subtest 'available' => sub { 23 | 24 | is( 25 | Alien::Build::Plugin::Extract::Directory->available('d'), 26 | T(), 27 | ); 28 | 29 | is( 30 | Alien::Build::Plugin::Extract::Directory->available('tar'), 31 | F(), 32 | ); 33 | 34 | }; 35 | 36 | subtest 'basic' => sub { 37 | 38 | # Test uses download directory, which is unsupported by 39 | # digest checks 40 | local $ENV{ALIEN_DOWNLOAD_RULE} = 'warn'; 41 | 42 | my $build = alienfile_ok q{ 43 | use alienfile; 44 | use Path::Tiny qw( path ); 45 | plugin 'Extract::Directory'; 46 | }; 47 | 48 | $build->install_prop->{download} = path('corpus/dist/foo-1.00')->absolute->stringify; 49 | 50 | my($out, $dir) = capture_merged { $build->extract }; 51 | 52 | $dir = path($dir); 53 | 54 | ok( defined $dir && -d $dir, "directory created" ); 55 | note "dir = $dir"; 56 | 57 | foreach my $name (qw( configure foo.c )) 58 | { 59 | my $file = $dir->child($name); 60 | ok -f $file, "$name exists"; 61 | } 62 | 63 | }; 64 | 65 | done_testing; 66 | -------------------------------------------------------------------------------- /t/alien_build_plugin_extract_file.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Test::Alien::Build; 4 | use Alien::Build::Plugin::Extract::File; 5 | use Path::Tiny qw( path ); 6 | use Capture::Tiny qw( capture_merged ); 7 | 8 | subtest 'handles' => sub { 9 | 10 | is( 11 | Alien::Build::Plugin::Extract::File->handles('f'), 12 | T(), 13 | ); 14 | 15 | is( 16 | Alien::Build::Plugin::Extract::File->handles('tar'), 17 | F(), 18 | ); 19 | 20 | }; 21 | 22 | subtest 'available' => sub { 23 | 24 | is( 25 | Alien::Build::Plugin::Extract::File->available('f'), 26 | T(), 27 | ); 28 | 29 | is( 30 | Alien::Build::Plugin::Extract::File->available('tar'), 31 | F(), 32 | ); 33 | 34 | }; 35 | 36 | subtest 'basic' => sub { 37 | 38 | local $Alien::Build::VERSION = $Alien::Build::VERSION || '2.70'; 39 | 40 | my $build = alienfile_ok q{ 41 | use alienfile; 42 | use Path::Tiny qw( path ); 43 | plugin 'Test::Mock' => ( 44 | probe => 'share', 45 | download => { 46 | "frooble.exe" => 'a faux exe', 47 | }, 48 | ); 49 | plugin 'Extract::File'; 50 | }; 51 | 52 | alien_install_type_is 'share'; 53 | alien_download_ok; 54 | alien_extract_ok; 55 | 56 | }; 57 | 58 | done_testing; 59 | -------------------------------------------------------------------------------- /t/alien_build_plugin_fetch_localdir.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Test::Alien::Build; 4 | use Alien::Build::Plugin::Fetch::LocalDir; 5 | use Capture::Tiny qw( capture_merged ); 6 | use Path::Tiny qw( path ); 7 | 8 | subtest 'basic' => sub { 9 | 10 | local $Alien::Build::Plugin::Fetch::LocalDir::VERSION = $Alien::Build::Plugin::Fetch::LocalDir::VERSION || 2.57; 11 | 12 | # This test "downloads" a directory which isn't uspported 13 | # by check_digest 14 | local $ENV{ALIEN_DOWNLOAD_RULE} = 'warn'; 15 | 16 | my $build = alienfile_ok q{ 17 | use alienfile; 18 | 19 | plugin 'Test::Mock', 20 | probe => 'share'; 21 | 22 | share { 23 | meta->prop->{start_url} = 'corpus/dist/foo-1.00/'; 24 | plugin 'Fetch::LocalDir'; 25 | plugin 'Extract' => format => 'd'; 26 | }; 27 | }; 28 | 29 | alienfile_skip_if_missing_prereqs; 30 | alien_install_type_is 'share'; 31 | alien_download_ok; 32 | 33 | my $download = $build->install_prop->{download}; 34 | 35 | ok -d $download, 'download is a directory'; 36 | note "download = $download"; 37 | 38 | ok -f path($download)->child('configure'), 'configure is a file'; 39 | ok -f path($download)->child('foo.c'), 'foo.c is a file'; 40 | 41 | alien_extract_ok; 42 | }; 43 | 44 | done_testing; 45 | -------------------------------------------------------------------------------- /t/alien_build_plugin_meta.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use lib 'corpus/lib'; 4 | use Alien::Build::Plugin::RogerRamjet; 5 | 6 | subtest 'basic' => sub { 7 | 8 | my $plugin = Alien::Build::Plugin::RogerRamjet->new; 9 | 10 | isa_ok( $plugin->meta, 'Alien::Build::PluginMeta' ); 11 | 12 | }; 13 | 14 | done_testing; 15 | -------------------------------------------------------------------------------- /t/alien_build_plugin_pkgconfig_makestatic.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Test::Alien::Build; 4 | use Alien::Build::Plugin::PkgConfig::MakeStatic; 5 | use Capture::Tiny qw( capture_merged ); 6 | 7 | skip_all 'test requires PkgConfig.pm' 8 | unless eval { require PkgConfig; PkgConfig->VERSION(0.14026) }; 9 | 10 | subtest 'recursive' => sub { 11 | 12 | my $build = alienfile q{ 13 | use alienfile; 14 | use Path::Tiny qw( path ); 15 | 16 | plugin 'Test::Mock', 17 | probe => 'share', 18 | download => 1, 19 | extract => 1; 20 | plugin 'PkgConfig::MakeStatic'; 21 | plugin 'PkgConfig::PP' => 'foo1'; 22 | 23 | share { 24 | build sub { 25 | my($build) = @_; 26 | my $dir = path($build->install_prop->{prefix}, 'lib', 'pkgconfig'); 27 | $dir->mkpath; 28 | path($dir, 'foo1.pc')->spew( 29 | "libdir=/foo/bar\n" . 30 | "Cflags: -I/baz/include\n" . 31 | "Cflags.private: -DUSE_STATIC=1\n" . 32 | "Libs: -L\${libdir} -lxml2\n" . 33 | "Libs.private: -lpthread -lz -liconv -lm\n" 34 | ); 35 | path($dir, 'bar1.pc')->spew( 36 | "libdir=/foo/bar\n" . 37 | "Libs: -L\${libdir} -lfoo2\n" . 38 | "Libs.private: -lbar -lbaz\n" 39 | ); 40 | }; 41 | 42 | }; 43 | }; 44 | 45 | note capture_merged { 46 | $build->download; 47 | $build->build; 48 | (); 49 | }; 50 | 51 | like $build->runtime_prop->{libs}, qr{-L/foo/bar -lxml2 -lpthread -lz -liconv -lm}; 52 | 53 | }; 54 | 55 | done_testing; 56 | -------------------------------------------------------------------------------- /t/alien_build_plugin_prefer_badversion.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use lib 'corpus/lib'; 3 | use Test2::V0 -no_srand => 1; 4 | use Test::Alien::Build; 5 | use Alien::Build::Plugin::Prefer::BadVersion; 6 | use Path::Tiny qw( path ); 7 | 8 | eval { require Sort::Versions }; 9 | skip_all 'test requires Sort::Versions' if $@; 10 | 11 | $Alien::Build::Plugin::Prefer::BadVersion::VERSION ||= '1.05'; 12 | 13 | subtest 'compiles okay' => sub { 14 | 15 | alienfile_ok q{ 16 | use alienfile; 17 | plugin 'Prefer::BadVersion' => '1.2.3'; 18 | }; 19 | 20 | }; 21 | 22 | subtest 'filter is required' => sub { 23 | 24 | eval { 25 | alienfile q{ 26 | use alienfile; 27 | plugin 'Prefer::BadVersion'; 28 | } 29 | }; 30 | 31 | like $@, qr/The filter property is required for the Prefer::BadVersion plugin/; 32 | 33 | }; 34 | 35 | subtest 'filters out string version' => sub { 36 | 37 | alienfile_ok q{ 38 | use alienfile; 39 | share { 40 | plugin 'Fetch::Foo' => [ qw( 1.2.3 1.2.4 1.2.5 ) ]; 41 | plugin 'Prefer::SortVersions'; 42 | plugin 'Prefer::BadVersion' => '1.2.5'; 43 | }; 44 | }; 45 | 46 | my $file = alien_download_ok; 47 | is(path($file)->slurp, "data:foo-1.2.4.tar.gz"); 48 | 49 | }; 50 | 51 | subtest 'filters out list version' => sub { 52 | 53 | alienfile_ok q{ 54 | use alienfile; 55 | share { 56 | plugin 'Fetch::Foo' => [ qw( 1.2.3 1.2.4 1.2.5 ) ]; 57 | plugin 'Prefer::SortVersions'; 58 | plugin 'Prefer::BadVersion' => ['1.2.4', '1.2.5']; 59 | }; 60 | }; 61 | 62 | my $file = alien_download_ok; 63 | is(path($file)->slurp, "data:foo-1.2.3.tar.gz"); 64 | 65 | }; 66 | 67 | subtest 'filters out code ref' => sub { 68 | 69 | alienfile_ok q{ 70 | use alienfile; 71 | share { 72 | plugin 'Fetch::Foo' => [ qw( 1.2.3 1.2.4 1.2.5 ) ]; 73 | plugin 'Prefer::SortVersions'; 74 | plugin 'Prefer::BadVersion' => sub { 75 | my($file) = @_; 76 | $file->{version} eq '1.2.5'; 77 | }; 78 | }; 79 | }; 80 | 81 | my $file = alien_download_ok; 82 | is(path($file)->slurp, "data:foo-1.2.4.tar.gz"); 83 | 84 | 85 | }; 86 | 87 | done_testing; 88 | -------------------------------------------------------------------------------- /t/alien_build_plugin_prefer_goodversion.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use lib 'corpus/lib'; 3 | use Test2::V0 -no_srand => 1; 4 | use Test::Alien::Build; 5 | use Alien::Build::Plugin::Prefer::GoodVersion; 6 | use Path::Tiny qw( path ); 7 | 8 | eval { require Sort::Versions }; 9 | skip_all 'test requires Sort::Versions' if $@; 10 | 11 | $Alien::Build::Plugin::Prefer::GoodVersion::VERSION ||= '1.44'; 12 | 13 | subtest 'compiles okay' => sub { 14 | 15 | alienfile_ok q{ 16 | use alienfile; 17 | plugin 'Prefer::GoodVersion' => '1.2.3'; 18 | }; 19 | 20 | }; 21 | 22 | subtest 'filter is required' => sub { 23 | 24 | eval { 25 | alienfile q{ 26 | use alienfile; 27 | plugin 'Prefer::GoodVersion'; 28 | } 29 | }; 30 | 31 | like $@, qr/The filter property is required for the Prefer::GoodVersion plugin/; 32 | 33 | }; 34 | 35 | subtest 'filters out string version' => sub { 36 | 37 | alienfile_ok q{ 38 | use alienfile; 39 | share { 40 | plugin 'Fetch::Foo' => [ qw( 1.2.3 1.2.4 1.2.5 ) ]; 41 | plugin 'Prefer::SortVersions'; 42 | plugin 'Prefer::GoodVersion' => '1.2.4'; 43 | }; 44 | }; 45 | 46 | my $file = alien_download_ok; 47 | is(path($file)->slurp, "data:foo-1.2.4.tar.gz"); 48 | 49 | }; 50 | 51 | subtest 'filters out list version' => sub { 52 | 53 | alienfile_ok q{ 54 | use alienfile; 55 | share { 56 | plugin 'Fetch::Foo' => [ qw( 1.2.3 1.2.4 1.2.5 ) ]; 57 | plugin 'Prefer::SortVersions'; 58 | plugin 'Prefer::GoodVersion' => ['1.2.4', '1.2.3']; 59 | }; 60 | }; 61 | 62 | my $file = alien_download_ok; 63 | is(path($file)->slurp, "data:foo-1.2.4.tar.gz"); 64 | 65 | }; 66 | 67 | subtest 'filters out code ref' => sub { 68 | 69 | alienfile_ok q{ 70 | use alienfile; 71 | share { 72 | plugin 'Fetch::Foo' => [ qw( 1.2.3 1.2.4 1.2.5 ) ]; 73 | plugin 'Prefer::SortVersions'; 74 | plugin 'Prefer::GoodVersion' => sub { 75 | my($file) = @_; 76 | $file->{version} eq '1.2.4'; 77 | }; 78 | }; 79 | }; 80 | 81 | my $file = alien_download_ok; 82 | is(path($file)->slurp, "data:foo-1.2.4.tar.gz"); 83 | 84 | 85 | }; 86 | 87 | done_testing; 88 | -------------------------------------------------------------------------------- /t/alien_build_plugin_probe_cbuilder__live.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Test::Alien::Build; 4 | use Alien::Build::Plugin::Probe::CBuilder; 5 | use Capture::Tiny qw( capture_merged ); 6 | 7 | skip_all 'CI only' unless defined $ENV{CIPSOMETHING} && $ENV{CIPSOMETHING} eq 'true'; 8 | 9 | subtest 'live test' => sub { 10 | 11 | require ExtUtils::CBuilder; 12 | 13 | my $build = alienfile_ok q{ 14 | use alienfile; 15 | plugin 'Probe::CBuilder' => ( 16 | cflags => '-I/usr/local/include ', 17 | libs => '-L/usr/local/lib ', 18 | ); 19 | }; 20 | 21 | alien_build_ok; 22 | alien_install_type_is 'system'; 23 | 24 | is( 25 | $build->runtime_prop, 26 | hash { 27 | field cflags => '-I/usr/local/include '; 28 | field libs => '-L/usr/local/lib '; 29 | etc; 30 | }, 31 | ); 32 | 33 | }; 34 | 35 | 36 | alien_subtest 'multiple probes' => sub { 37 | 38 | require ExtUtils::CBuilder; 39 | 40 | my $build = alienfile_ok q{ 41 | use alienfile; 42 | 43 | plugin 'Probe::CBuilder' => ( 44 | cflags => '-I/usr/local/include ', 45 | libs => '-L/usr/local/lib ', 46 | ); 47 | 48 | probe sub { 'system' }; 49 | 50 | my $count = 0; 51 | meta->around_hook(probe => sub { 52 | my $orig = shift; 53 | my $build = shift; 54 | my $type = $orig->($build, @_); 55 | if($count++ == 0) 56 | { 57 | Test2::V0::note("first convert $type to share"); 58 | return 'share'; 59 | } 60 | else 61 | { 62 | Test2::V0::note("finally return $type"); 63 | return $type; 64 | } 65 | }); 66 | 67 | }; 68 | 69 | alien_install_type_is 'system'; 70 | alien_build_ok; 71 | 72 | is( 73 | $build->runtime_prop, 74 | hash { 75 | field cflags => DNE(); 76 | field libs => DNE(); 77 | etc; 78 | }, 79 | ); 80 | 81 | }; 82 | 83 | 84 | done_testing; 85 | 86 | -------------------------------------------------------------------------------- /t/alien_build_rc.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Test::Alien::Build; 4 | 5 | subtest 'preload code ref' => sub { 6 | 7 | my $meta1; 8 | my $meta2; 9 | 10 | no warnings 'once'; 11 | 12 | local @Alien::Build::rc::PRELOAD = (sub { 13 | ($meta1) = @_; 14 | }); 15 | 16 | local @Alien::Build::rc::POSTLOAD = (sub { 17 | ($meta2) = @_; 18 | }); 19 | 20 | my $build = alienfile_ok q{ 21 | use alienfile; 22 | }; 23 | 24 | isa_ok $meta1, 'Alien::Build::Meta'; 25 | isa_ok $meta2, 'Alien::Build::Meta'; 26 | 27 | }; 28 | 29 | done_testing; 30 | -------------------------------------------------------------------------------- /t/alien_build_rc__prepostload.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Alien::Build; 4 | use Test::Alien::Build; 5 | 6 | subtest 'basic' => sub { 7 | 8 | alien_rc q{ 9 | use strict; 10 | use warnings; 11 | 12 | print "package is @{[ __PACKAGE__ ]}\n"; 13 | 14 | logx "hey"; 15 | 16 | our $run_basic_pl; 17 | 18 | $run_basic_pl = 1; 19 | 20 | preload 'Foo::Bar'; 21 | postload 'Baz::Frooble'; 22 | 23 | 1; 24 | }; 25 | 26 | my $in_foobar; 27 | my $in_bazfrooble; 28 | 29 | my $foobar = mock 'Alien::Build::Plugin::Foo::Bar' => ( 30 | override => [ init => sub { $in_foobar++ }], 31 | ); 32 | 33 | my $frooble = mock 'Alien::Build::Plugin::Baz::Frooble' => ( 34 | override => [ init => sub { $in_bazfrooble++ }], 35 | ); 36 | 37 | my $build = alienfile_ok q{ 38 | use alienfile; 39 | }; 40 | 41 | is $in_foobar, 1; 42 | is $in_bazfrooble, 1; 43 | 44 | }; 45 | 46 | done_testing; 47 | 48 | package Alien::Build::Plugin::Foo::Bar; 49 | use Alien::Build::Plugin; 50 | package Alien::Build::Plugin::Baz::Frooble; 51 | use Alien::Build::Plugin; 52 | 53 | -------------------------------------------------------------------------------- /t/alien_build_rc__prepostload_plugin.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Test::Alien::Build; 4 | 5 | { 6 | package Alien::Build::Plugin::Foo::Foo; 7 | use Alien::Build::Plugin; 8 | has arg => -1; 9 | sub init { 10 | my($self, $meta) = @_; 11 | push @{ $meta->prop->{test} }, $self->arg; 12 | }; 13 | } 14 | 15 | subtest 'basic' => sub { 16 | 17 | alien_rc q{ 18 | preload_plugin 'Foo::Foo', arg => 10; 19 | postload_plugin 'Foo::Foo', arg => 12; 20 | }; 21 | 22 | my $build = alienfile_ok q{ 23 | use alienfile; 24 | plugin 'Foo::Foo', arg => 11; 25 | }; 26 | 27 | is( 28 | $build, 29 | object { 30 | call meta_prop => hash { 31 | field test => [ 10,11,12 ]; 32 | etc; 33 | }; 34 | }, 35 | 'loaded in correct order'); 36 | 37 | }; 38 | 39 | done_testing; 40 | -------------------------------------------------------------------------------- /t/alien_build_temp.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Alien::Build::Temp; 4 | 5 | my $dir = Alien::Build::Temp->newdir; 6 | ok -d $dir; 7 | note "dir = $dir"; 8 | 9 | my $fh = Alien::Build::Temp->new; 10 | close $fh; 11 | note "file = @{[ $fh->filename ]}"; 12 | 13 | done_testing; 14 | -------------------------------------------------------------------------------- /t/alien_build_tempdir.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Test::Alien::Build; 4 | use Alien::Build; 5 | use File::Temp qw( tempdir ); 6 | use Path::Tiny qw( path ); 7 | 8 | my $build = alienfile filename => 'corpus/blank/alienfile'; 9 | 10 | ok( 11 | -d $build->root, 12 | "root = @{[ $build->root ]}", 13 | ); 14 | 15 | subtest 'cleanup on empty' => sub { 16 | 17 | my $tmpdir = Alien::Build::TempDir->new($build, "foo"); 18 | 19 | ok( -d "$tmpdir", "tempdir = $tmpdir" ); 20 | 21 | my $str = "$tmpdir"; 22 | 23 | undef $tmpdir; 24 | 25 | ok( ! -d "$str", "directory removed" ); 26 | 27 | }; 28 | 29 | subtest 'do not cleanup non-empty' => sub { 30 | 31 | my $tmpdir = Alien::Build::TempDir->new($build, "bar"); 32 | 33 | ok( -d "$tmpdir", "tempdir = $tmpdir" ); 34 | 35 | my $str = "$tmpdir"; 36 | 37 | path("$str")->child('baz.txt')->touch; 38 | 39 | undef $tmpdir; 40 | 41 | ok( -d "$str", "directory not removed" ); 42 | 43 | }; 44 | 45 | done_testing; 46 | 47 | -------------------------------------------------------------------------------- /t/alien_role.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Alien::Role (); 4 | 5 | ok 1; 6 | 7 | done_testing; 8 | 9 | -------------------------------------------------------------------------------- /t/alien_util.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Alien::Util qw( version_cmp ); 4 | 5 | 6 | subtest 'version_cmp' => sub { 7 | 8 | is( version_cmp('1.0.1', '1.0.1'), 0 ); 9 | is( version_cmp('1.0.1', '1.0.2'), -1 ); 10 | is( version_cmp('1.0.1', '1.0.0'), 1 ); 11 | 12 | }; 13 | 14 | done_testing; 15 | -------------------------------------------------------------------------------- /t/bin/ftpd: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | use URI; 6 | use AnyEvent; ## no critic 7 | use AnyEvent::FTP::Server; 8 | use JSON::PP qw( encode_json decode_json ); 9 | use Path::Tiny qw( path ); 10 | use Getopt::Long qw( GetOptions ); 11 | 12 | my $daemon = 0; 13 | my $kill = 0; 14 | my $host = 'localhost'; 15 | 16 | GetOptions( 17 | "d" => \$daemon, 18 | "k" => \$kill, 19 | "hosth=s" => \$host, 20 | ); 21 | 22 | my $bindir = path(__FILE__)->parent->absolute; 23 | my $distdir = $bindir->parent->parent; 24 | 25 | my $config_file = $bindir->child('ftpd.json'); 26 | 27 | if(-r $config_file) 28 | { 29 | my $config = decode_json($config_file->slurp); 30 | my $pid = $config->{pid}; 31 | if(defined $pid) 32 | { 33 | kill 'KILL', $pid; 34 | } 35 | } 36 | 37 | exit if $kill; 38 | 39 | if($daemon) 40 | { 41 | require Proc::Daemon; 42 | my $daemon = Proc::Daemon->new( 43 | child_STDOUT => $bindir->child('ftpd.log')->stringify, 44 | child_STDERR => $bindir->child('ftpd.log')->stringify, 45 | ); 46 | $daemon->Init; 47 | } 48 | 49 | my $server = AnyEvent::FTP::Server->new( 50 | host => $host, 51 | port => 0, 52 | default_context => 'AnyEvent::FTP::Server::Context::FSRO', 53 | ); 54 | 55 | my %config = ( 56 | user => join('', map { chr(ord('a') + int rand(26)) } (1..10)), 57 | pass => join('', map { chr(ord('a') + int rand(26)) } (1..10)), 58 | root => $distdir->child('corpus/dist')->stringify, 59 | pid => $$, 60 | ); 61 | 62 | my $url = URI->new("ftp://localhost"); 63 | $url->host($host); 64 | $url->path($config{root}); 65 | $url->user($config{user}); 66 | $url->password($config{pass}); 67 | 68 | $server->on_bind(sub { 69 | my $port = shift; 70 | $url->port($port); 71 | }); 72 | 73 | $server->on_connect(sub { 74 | my $con = shift; 75 | $con->context->authenticator(sub { 76 | my($user, $pass) = @_; 77 | $user eq $config{user} && $pass eq $config{pass} ? 1 : 0; 78 | }); 79 | $con->context->bad_authentication_delay(0); 80 | }); 81 | 82 | 83 | $server->start; 84 | 85 | $config{url} = $url->as_string; 86 | $config_file->spew(encode_json(\%config)); 87 | 88 | print "$url\n"; 89 | 90 | AnyEvent->condvar->recv; 91 | -------------------------------------------------------------------------------- /t/cip/needs-alien-unzip/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG cip_tag=default 2 | 3 | FROM plicease/ciperl:$cip_tag 4 | 5 | ADD Alien-Build-*.tar.gz . 6 | RUN bash -c 'set -ex; cd Alien-Build-*; cpanm -n --install .; rm -rf ~/.cpanm; cd ..; rm -rf Alien-Build-*' 7 | 8 | # alpine includes a unzip -> busybox symlink 9 | RUN rm -rf /usr/bin/unzip 10 | 11 | COPY t/cip/needs-alien-unzip/cpanfile ./cpanfile 12 | RUN bash -c 'set -ex; cpanm -n --installdeps .; rm -rf ~/.cpanm' 13 | 14 | COPY t/cip/needs-alien-unzip/ ./ 15 | CMD bash -c 'set -ex; prove -lvm' 16 | -------------------------------------------------------------------------------- /t/cip/needs-alien-unzip/alienfile: -------------------------------------------------------------------------------- 1 | use alienfile; 2 | 3 | probe sub { 'share' }; 4 | 5 | share { 6 | 7 | start_url './src/src.zip'; 8 | plugin 'Download'; 9 | plugin 'Extract' => 'zip'; 10 | 11 | build [ './configure' ]; 12 | } 13 | -------------------------------------------------------------------------------- /t/cip/needs-alien-unzip/cpanfile: -------------------------------------------------------------------------------- 1 | requires 'Test2::V0'; 2 | # need TAP-Parser 0.52 (which is an old name for Test-Harness) 3 | # for the prove -m option 4 | requires 'TAP::Parser' => '0.52'; 5 | -------------------------------------------------------------------------------- /t/cip/needs-alien-unzip/src/Makefile: -------------------------------------------------------------------------------- 1 | FILES=Makefile configure 2 | 3 | src.zip: $(FILES) 4 | zip src.zip $(FILES) 5 | -------------------------------------------------------------------------------- /t/cip/needs-alien-unzip/src/configure: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo 'looks good' 4 | 5 | echo 'something random' > config.h 6 | 7 | true; 8 | -------------------------------------------------------------------------------- /t/cip/needs-alien-unzip/src/src.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerlAlien/Alien-Build/0282efe8081b27baeea4d1826fddd8967c0be586/t/cip/needs-alien-unzip/src/src.zip -------------------------------------------------------------------------------- /t/lib/MyTest/CaptureNote.pm: -------------------------------------------------------------------------------- 1 | package MyTest::CaptureNote; 2 | 3 | use strict; 4 | use warnings; 5 | use Test2::API qw( context ); 6 | use Capture::Tiny qw( capture_merged ); 7 | use Exporter qw( import ); 8 | 9 | our @EXPORT = qw( capture_note ); 10 | 11 | sub capture_note (&) 12 | { 13 | my($code) = @_; 14 | my($out, $error, @ret) = Capture::Tiny::capture_merged(sub { my @ret = eval { $code->() }; ($@, @ret) }); 15 | 16 | my $ctx = context(); 17 | $ctx->note($out) if $out ne ''; 18 | $ctx->release; 19 | 20 | die $error if $error; 21 | wantarray ? @ret : $ret[0]; ## no critic 22 | } 23 | 24 | 1; 25 | -------------------------------------------------------------------------------- /t/lib/MyTest/FTP.pm: -------------------------------------------------------------------------------- 1 | package MyTest::FTP; 2 | 3 | use strict; 4 | use warnings; 5 | use Path::Tiny qw( path ); 6 | use JSON::PP qw( decode_json ); 7 | use Exporter qw( import ); 8 | 9 | our @EXPORT = qw( ftp_url ftp_error ); 10 | 11 | my $ftp_error; 12 | 13 | sub ftp_error 14 | { 15 | my($new) = @_; 16 | if($new) 17 | { 18 | $ftp_error = $new; 19 | return undef; 20 | } 21 | else 22 | { 23 | return $ftp_error; 24 | } 25 | } 26 | 27 | sub ftp_url 28 | { 29 | my $file = path('t/bin/ftpd.json'); 30 | return ftp_error('no ftpd.json') unless -r $file; 31 | 32 | my $config = eval { decode_json($file->slurp) }; 33 | return ftp_error("error loading ftpd.json $@") if $@; 34 | 35 | my $url = $config->{url}; 36 | return ftp_error("no url in ftpd.json") unless $url; 37 | 38 | require Net::FTP; 39 | require URI; 40 | 41 | $url = URI->new($url); 42 | 43 | my $ftp = Net::FTP->new($url->host, Port => $url->port) or do { 44 | return ftp_error("Connot connect to @{[ $url->host ]}"); 45 | }; 46 | 47 | eval { 48 | $ftp->login($url->user, $url->password) or die; 49 | $ftp->binary; 50 | $ftp->cwd($url->path) or die; 51 | my $path = Path::Tiny->tempfile; 52 | $ftp->get('foo-1.00.tar.xz', $path->stringify) or die; 53 | -e $path || die; 54 | $ftp->quit; 55 | }; 56 | 57 | return ftp_error($ftp->message) if $@; 58 | 59 | $url->path($url->path . '/') 60 | unless $url->path =~ m!/$!; 61 | 62 | return $url; 63 | } 64 | 65 | 1; 66 | -------------------------------------------------------------------------------- /t/lib/MyTest/File.pm: -------------------------------------------------------------------------------- 1 | package MyTest::File; 2 | 3 | use strict; 4 | use warnings; 5 | use Path::Tiny qw( path ); 6 | use JSON::PP qw( decode_json ); 7 | use Exporter qw( import ); 8 | 9 | our @EXPORT = qw( file_url file_error ); 10 | 11 | my $file_error; 12 | 13 | sub file_error 14 | { 15 | $file_error; 16 | } 17 | 18 | sub file_url 19 | { 20 | if(eval { require URI::file }) 21 | { 22 | return URI::file->new(path("corpus/dist")->absolute . "/"); 23 | } 24 | else 25 | { 26 | $file_error = 'test requires URI::file'; 27 | return undef; 28 | } 29 | } 30 | 31 | 1; 32 | -------------------------------------------------------------------------------- /t/lib/MyTest/HTTP.pm: -------------------------------------------------------------------------------- 1 | package MyTest::HTTP; 2 | 3 | use strict; 4 | use warnings; 5 | use Path::Tiny qw( path ); 6 | use JSON::PP qw( decode_json ); 7 | use Exporter qw( import ); 8 | 9 | our @EXPORT = qw( http_url http_error ); 10 | 11 | my $http_error; 12 | 13 | sub http_error 14 | { 15 | my($new) = @_; 16 | if($new) 17 | { 18 | $http_error = $new; 19 | return undef; 20 | } 21 | else 22 | { 23 | return $http_error; 24 | } 25 | } 26 | 27 | sub http_url 28 | { 29 | my $file = path('t/bin/httpd.json'); 30 | return http_error('no httpd.json') unless -r $file; 31 | 32 | my $config = eval { decode_json($file->slurp) }; 33 | return http_error("error loading httpd.json $@") if $@; 34 | 35 | my $url = $config->{url}; 36 | return http_error("no url in httpd.json") unless $url; 37 | 38 | require HTTP::Tiny; 39 | my $res = HTTP::Tiny->new->get("${url}about.json"); 40 | my $about = eval { decode_json( $res->{content} ) }; 41 | return http_error($@) if $@; 42 | return http_error("not a AB TEST HTTPd") 43 | unless $about->{ident} eq 'AB Test HTTPd'; 44 | 45 | return $url; 46 | } 47 | 48 | 1; 49 | -------------------------------------------------------------------------------- /t/lib/MyTest/HaveCompiler.pm: -------------------------------------------------------------------------------- 1 | package MyTest::HaveCompiler; 2 | 3 | use strict; 4 | use warnings; 5 | use Test2::V0 (); 6 | use Capture::Tiny qw( capture_merged ); 7 | use parent qw( Exporter ); 8 | 9 | our @EXPORT_OK = qw( require_compiler ); 10 | 11 | { 12 | my $first = 1; 13 | sub require_compiler 14 | { 15 | my $skip; 16 | my($diag) = capture_merged { 17 | $skip = !ExtUtils::CBuilder->new->have_compiler; 18 | }; 19 | Test2::V0::note $diag if defined $diag && $diag ne ''; 20 | Test2::V0::skip_all 'test requires a compiler' if $skip; 21 | } 22 | } 23 | 24 | 1; 25 | -------------------------------------------------------------------------------- /t/lib/MyTest/System.pm: -------------------------------------------------------------------------------- 1 | package MyTest::System; 2 | 3 | use strict; 4 | use warnings; 5 | use Exporter qw( import ); 6 | use Scalar::Util qw( refaddr ); 7 | use Text::ParseWords qw( shellwords ); 8 | use Scalar::Util qw( weaken ); 9 | use File::Which (); 10 | 11 | our @EXPORT = qw( system_fake system_add ); 12 | 13 | sub system_fake 14 | { 15 | __PACKAGE__->new(@_); 16 | } 17 | 18 | my @stack; 19 | 20 | *CORE::GLOBAL::system = sub { 21 | 22 | my $system = $stack[-1]; 23 | 24 | if($system) 25 | { 26 | $system->call(@_); 27 | } 28 | else 29 | { 30 | return CORE::system(@_); 31 | } 32 | 33 | }; 34 | 35 | { 36 | my $old = \&File::Which::which; 37 | no warnings 'redefine'; 38 | *File::Which::which = sub 39 | { 40 | my $system = $stack[-1]; 41 | 42 | if($system) 43 | { 44 | $system->can_run(@_); 45 | } 46 | else 47 | { 48 | return $old->(@_); 49 | } 50 | }; 51 | } 52 | 53 | sub new 54 | { 55 | my($class, %cmds) = @_; 56 | my $self = bless { %cmds }, $class; 57 | push @stack, $self; 58 | weaken $stack[-1]; 59 | $self; 60 | } 61 | 62 | sub add 63 | { 64 | my($self, $command, $code) = @_; 65 | $self->{$command} = $code; 66 | } 67 | 68 | sub call 69 | { 70 | my($self, $command, @args) = @_; 71 | 72 | if(@args == 0) 73 | { 74 | if($^O eq 'MSWin32' && $command =~ /^"(.*)"$/) 75 | { $command = $1 } 76 | ($command, @args) = shellwords $command; 77 | } 78 | 79 | if($self->{$command}) 80 | { 81 | my $exit = $self->{$command}->(@args); 82 | return $? = ($exit << 8); 83 | } 84 | else 85 | { 86 | $! = 'No such file or directory'; 87 | return $? = -1; 88 | } 89 | } 90 | 91 | sub can_run 92 | { 93 | my($self, $command) = @_; 94 | 95 | # we only really use can_run to figure out if 96 | # we CAN run an executable, but make up some 97 | # path just for pretends. 98 | $self->{$command} 99 | ? "/bin/$command" 100 | : undef; 101 | } 102 | 103 | sub DESTROY 104 | { 105 | my($self) = @_; 106 | @stack = grep { refaddr($_) ne refaddr($self) } @stack; 107 | } 108 | 109 | 1; 110 | -------------------------------------------------------------------------------- /t/test_alien_cancompile.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Test::Alien::CanCompile (); 4 | use ExtUtils::CBuilder; 5 | use Capture::Tiny qw( capture_merged ); 6 | 7 | subtest 'unmocked' => sub { 8 | 9 | my($diag, $ta_cc_skip, $eucb_have_compiler) = capture_merged { 10 | !!Test::Alien::CanCompile->skip, 11 | !!ExtUtils::CBuilder->new->have_compiler, 12 | }; 13 | note $diag; 14 | 15 | is( 16 | $ta_cc_skip, !$eucb_have_compiler, 17 | 'skip computed by Test::Alien::CanCompile should match ExtUtils::CBuilder#have_compiler' 18 | ); 19 | }; 20 | 21 | subtest 'skip/import' => sub { 22 | 23 | my $have_compiler; 24 | 25 | my $mock = mock 'ExtUtils::CBuilder' => ( 26 | override => [ 27 | have_compiler => sub { $have_compiler }, 28 | ], 29 | ); 30 | 31 | subtest 'have compiler' => sub { 32 | $have_compiler = 1; 33 | is 34 | [Test::Alien::CanCompile->skip], 35 | [F()], 36 | 'skip' 37 | ; 38 | is 39 | intercept { Test::Alien::CanCompile->import }, 40 | [], 41 | 'import', 42 | ; 43 | }; 44 | 45 | subtest 'no compiler' => sub { 46 | $have_compiler = 0; 47 | is 48 | [Test::Alien::CanCompile->skip], 49 | ['This test requires a compiler.'], 50 | 'skip' 51 | ; 52 | is 53 | intercept { Test::Alien::CanCompile->import }, 54 | array { 55 | event Plan => sub { 56 | call directive => 'SKIP'; 57 | call reason => 'This test requires a compiler.'; 58 | }; 59 | end; 60 | }, 61 | 'import', 62 | ; 63 | }; 64 | 65 | }; 66 | 67 | done_testing; 68 | -------------------------------------------------------------------------------- /t/test_alien_canplatypus.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Test::Alien::CanPlatypus (); 4 | use ExtUtils::CBuilder; 5 | 6 | subtest 'skip/import' => sub { 7 | 8 | subtest 'have platypus' => sub { 9 | 10 | local $INC{'FFI/Platypus.pm'} = __FILE__; 11 | 12 | is 13 | [Test::Alien::CanPlatypus->skip], 14 | [F()], 15 | 'skip' 16 | ; 17 | is 18 | intercept { Test::Alien::CanPlatypus->import }, 19 | [], 20 | 'import', 21 | ; 22 | }; 23 | 24 | subtest 'no platypus' => sub { 25 | 26 | $Devel::Hide::VERBOSE = 27 | $Devel::Hide::VERBOSE = 0; 28 | skip_all 'test does not work on Perl 5.8' unless $] >= 5.010; 29 | skip_all 'subtest requires Devel::Hide' unless eval { require Devel::Hide }; 30 | Devel::Hide->import( 'FFI::Platypus' ); 31 | 32 | is 33 | [Test::Alien::CanPlatypus->skip], 34 | ['This test requires FFI::Platypus.'], 35 | 'skip' 36 | ; 37 | is 38 | intercept { Test::Alien::CanPlatypus->import }, 39 | array { 40 | event Plan => sub { 41 | call directive => 'SKIP'; 42 | call reason => 'This test requires FFI::Platypus.'; 43 | }; 44 | end; 45 | }, 46 | 'import', 47 | ; 48 | 49 | }; 50 | 51 | }; 52 | 53 | done_testing; 54 | -------------------------------------------------------------------------------- /t/test_alien_synthetic.t: -------------------------------------------------------------------------------- 1 | use 5.008004; 2 | use Test2::V0 -no_srand => 1; 3 | use Test::Alien; 4 | use File::Temp qw( tempdir ); 5 | use Path::Tiny qw( path ); 6 | 7 | is( 8 | synthetic(), 9 | object { 10 | prop blessed => 'Test::Alien::Synthetic'; 11 | prop reftype => 'HASH'; 12 | call cflags => ''; 13 | call libs => ''; 14 | call sub { [shift->dynamic_libs] } => []; 15 | call sub { [shift->bin_dir] } => []; 16 | }, 17 | 'empty synthetic alien', 18 | ); 19 | 20 | is( 21 | synthetic({ cflags => '-DFOO=1 -I/foo/bar/baz'}), 22 | object { 23 | prop blessed => 'Test::Alien::Synthetic'; 24 | call cflags => '-DFOO=1 -I/foo/bar/baz'; 25 | call cflags_static => '-DFOO=1 -I/foo/bar/baz'; 26 | }, 27 | 'cflags', 28 | ); 29 | 30 | is( 31 | synthetic({ libs => '-L/foo/bar/baz -lfoo'}), 32 | object { 33 | prop blessed => 'Test::Alien::Synthetic'; 34 | call libs => '-L/foo/bar/baz -lfoo'; 35 | call libs_static => '-L/foo/bar/baz -lfoo'; 36 | }, 37 | 'libs', 38 | ); 39 | 40 | is( 41 | synthetic({ dynamic_libs => [qw( foo bar baz )] }), 42 | object { 43 | prop blessed => 'Test::Alien::Synthetic'; 44 | call sub { [shift->dynamic_libs] } => [qw( foo bar baz )]; 45 | }, 46 | 'dynamic_libs', 47 | ); 48 | 49 | my $dir = tempdir( CLEANUP => 1 ); 50 | 51 | is( 52 | synthetic({ bin_dir => $dir }), 53 | object { 54 | prop blessed => 'Test::Alien::Synthetic'; 55 | call bin_dir => $dir; 56 | }, 57 | 'bin_dir (exists)', 58 | ); 59 | 60 | is( 61 | synthetic({ bin_dir => path($dir)->child('foo')->stringify }), 62 | object { 63 | prop blessed => 'Test::Alien::Synthetic'; 64 | call sub { [shift->bin_dir] } => []; 65 | }, 66 | 'bin_dir (does not exist)', 67 | ); 68 | 69 | is( 70 | synthetic({ cflags => '-DCFLAGS=1', cflags_static => '-DCFLAGS_STATIC=1', libs => '-L/lib -lfoo', libs_static => '-L/lib -lfoo -lbar -lbaz' }), 71 | object { 72 | prop blessed => 'Test::Alien::Synthetic'; 73 | call cflags => '-DCFLAGS=1'; 74 | call cflags_static => '-DCFLAGS_STATIC=1'; 75 | call libs => '-L/lib -lfoo'; 76 | call libs_static => '-L/lib -lfoo -lbar -lbaz'; 77 | }, 78 | 'static flags', 79 | ); 80 | 81 | done_testing; 82 | -------------------------------------------------------------------------------- /weaver.ini: -------------------------------------------------------------------------------- 1 | [@CorePrep] 2 | [-SingleEncoding] 3 | [Name] 4 | [Version] 5 | [Region / prelude] 6 | [Leftovers] 7 | [Region / postlude] 8 | [Authors] 9 | [Legal] 10 | -------------------------------------------------------------------------------- /xt/author/critic.t: -------------------------------------------------------------------------------- 1 | use Test2::Require::Module 'Test2::Tools::PerlCritic'; 2 | use Test2::Require::Module 'Perl::Critic'; 3 | use Test2::Require::Module 'Perl::Critic::Community'; 4 | use Test2::V0; 5 | use Perl::Critic; 6 | use Test2::Tools::PerlCritic; 7 | 8 | my $critic = Perl::Critic->new( 9 | -profile => 'perlcriticrc', 10 | ); 11 | 12 | perl_critic_ok ['lib','t'], $critic; 13 | 14 | done_testing; 15 | -------------------------------------------------------------------------------- /xt/author/filename.t: -------------------------------------------------------------------------------- 1 | use Test2::V0 -no_srand => 1; 2 | use File::chdir; 3 | use File::Find qw( find ); 4 | use File::Basename qw( basename ); 5 | 6 | my $basename = basename $CWD; 7 | 8 | my $dev = $basename =~ /^([A-Z]+)(-[A-Z]+)*$/i; 9 | 10 | local $CWD = '..'; 11 | 12 | find(sub { 13 | my $path = $File::Find::name; 14 | return if $path =~ /^$basename\/\./; 15 | return if $dev && $path =~ /^$basename\/$basename-/; 16 | my $length = length($path); 17 | cmp_ok $length, '<', 100, "$path"; 18 | }, $basename); 19 | 20 | note "dev = $dev"; 21 | 22 | done_testing; 23 | -------------------------------------------------------------------------------- /xt/author/pod_link.t: -------------------------------------------------------------------------------- 1 | use Test2::Require::Module 'Test::Pod::LinkCheck::Lite'; 2 | use Test2::Require::EnvVar 'POD_CHECK'; 3 | use Test2::V0; 4 | use Test::Pod::LinkCheck::Lite; 5 | 6 | my @checks; 7 | 8 | if(-d 'blib/script') 9 | { 10 | push @checks, 'blib/script'; 11 | } 12 | elsif(-d 'bin') 13 | { 14 | push @checks, 'bin'; 15 | } 16 | 17 | if(-d 'blib') 18 | { 19 | push @checks, 'blib'; 20 | } 21 | else 22 | { 23 | push @checks, 'lib'; 24 | diag "checking lib instead of blib"; 25 | } 26 | 27 | Test::Pod::LinkCheck::Lite 28 | ->new 29 | ->all_pod_files_ok(@checks); 30 | 31 | done_testing; 32 | --------------------------------------------------------------------------------