Today I Learned: collection of notes, tips and tricks and stuff I learn from day to day working with computers and technology as an open source contributor and product manager

View project on GitHub

Install DateTime::Astro

I am using DateTime::Astro for Date::Holidays::CN via DateTime::Calendar::Chinese which again uses DateTime::Event::Chinese, which is included in Task::Date::Holidays, which is a development helper distribution for Date::Holidays.

The DateTime::Astro distribution requires:

  • GMP a free C library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating-point numbers
  • MPFR a C library for multiple-precision floating-point computations with correct rounding

Both can be installed via Homebrew

  • brew install gmp
  • brew install mpfr

In addition I need to set the following two environment variables, which DateTime::Astro is looking for: $MPFR_HOME and $GMP_HOME.

These can be set like this:

export MPFR_HOME="/opt/homebrew/opt/mpfr"
export GMP_HOME="/opt/homebrew/opt/gmp"

When this is in place I can do:

perl Build.PL && ./Build && ./Build test && ./Build install

And I am good to go.

Now I just need to be able to redo this my toolchain, like GitHub Actions etc.

Resources and References