Skip to content

Commit

Permalink
Install dependencies also when distribution uses Makefile.PL
Browse files Browse the repository at this point in the history
in such case build MYMETA and install dependencies using it

Although `cpanm` can do that with just simple `--installdeps .`,
`cpm`, toolused by this tooling, doesn't support simple way.
  • Loading branch information
happy-barney committed Nov 2, 2023
1 parent 2552a7c commit cf5c777
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions bin/cpan-install-dist-deps
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,26 @@
set -e -u -o pipefail

main() (
[[ -e cpanfile ]] &&
cpm-install "$@"
for file in cpanfile Build.PL Makefile.PL; do
[[ -e $file ]] || continue

[[ -e Build.PL ]] &&
build-and-install-deps
case $file in
Build.PL ) build-and-install-deps "$@" ;;
cpanfile ) cpm-install --cpanfile $file "$@" ;;
Makefile.PL)
perl $file
cpm-install --metafile MYMETA.json "$@"
;;
esac

break;
done

true
)

cpm-install() (
cpm install -g \
--cpanfile cpanfile \
--with-recommends \
--with-suggests \
--show-build-log-on-failure \
Expand Down

0 comments on commit cf5c777

Please sign in to comment.