PerlAlien / Alien-Build

Build external dependencies for use in CPAN
16 stars 25 forks source link

DESTDIR in environment will be ignored if DESTDIR defined in Makefile #408

Open djerius opened 5 months ago

djerius commented 5 months ago

Howdy,

The value of a Makefile variable is decided by whichever of these definitions comes first:

  1. on command line
  2. in Makefile
  3. in environment

Alien::Build uses approach 3 to define DESTDIR, but upstream packages can break this if they define DESTDIR in the Makefile (if only to define it as empty). For example, the CFITSIO library maintainers recently changed the Makefile to define DESTDIR as empty, which broke Alien::Build's installation to blib, as instead it installed it directly to the final destination.

I'm not sure why upstream CFITSIO made this change, but to be safe, Alien::Build should specify DESTDIR on the command line.

Cheers, Diab