when we're packaging software we want to install it to %{buildroot}/%{_prefix}/.... and we can't set prefix to %{buildroot}/%{_prefix}/, because it can break auto-config files and etc.
P.S. %{buildroot} in RPM == $(DESTDIR) in automake
Meson already supports DESTDIR and it works exactly the same as with CMake and Autotools. Just do this:
DESTDIR=/your/staging/area ninja install
The installer for Meson itself takes a --destdir argument. I should probably make it behave the same.
So in your case roughly the following:
meson --prefix=%{_prefix}
ninja
ninja test
DESTDIR=%{buildroot} ninja install
really, it works. Thanks!
can you add this to documentation?
Fixed.
Most helpful comment
Meson already supports DESTDIR and it works exactly the same as with CMake and Autotools. Just do this:
DESTDIR=/your/staging/area ninja install
The installer for Meson itself takes a --destdir argument. I should probably make it behave the same.