On Tue, Oct 18, 2016 at 12:24 PM, Pavel Raiskup <praiskup(a)redhat.com> wrote:
On Tuesday, October 18, 2016 11:24:02 AM CEST Igor Gnatenko wrote:
> > Is this strictly %meson related? Could the generalizing be done in
> > `redhat-rpm-macros` within %meson_ namespace so we can avoid touching all
> > packages?
>
> Actually it's related for any buildsystem with supports (or even
> requires out-of-tree building).
Hms, I'm not sure... Autotooled projects have VPATH builds (info
automake) usually optional, and it usually requires maintainer uses
`make distcheck` at least during release time (otherwise VPATH build
likely get broken with time). I don't see much benefits in changing
something which works now, or risk something..
mostly I'm talking here about
cmake and meson (and probably gyp in future).
> > Though I'm not aware of the actual PoC, neither what boilerplate typing
> > needs to be done for every %meson package, probably worth sharing ...
>
> mkdir build
> pushd build
> %meson ..
The '..' is parent dir here I bet...
yes
> popd
> %ninja_build -C build
> %ninja_install -C build
... TBH, I don't see a big issues here. :) Can can simplify this by:
mkdir build
pushd build
%meson ..
%ninja_build
%ninja_install
popd
?
%ninja_install should go under %install, so you have to add pushd once
more there.
> instead of this I would prefer to have
> %meson
> %meson_build
> %meson_install
But, yes this sounds cool.
> In case of angelscript it's:
> mkdir build
> pushd build
> %meson ../sdk/angelscript/projects/meson/
> popd
> %ninja_build -C build
> %ninja_install -C build
>
> With some macro it would be just
> %global __srcdir sdk/angelscript/projects/meson
Without knowing background peculiarities, this sounds wrong to me. Can we
have this named like %meson_srcdir? From the "namespace" reasons ..
as I
said, it's general thing for buildsystems. Not always you have
CMakeListst.txt under the root directory (usually yes, but there are
exceptions).
Or at least %vpath_builddir? So particular language specific macros could
take %vpath_builddir in future? %__srcdir does not say what it is used for.
%__srcdir: I wrote it somewhere. It stands for directory with
CMakeLists.txt/configure/meson.build/etc.
I think %vpath_srcdir and %vpath_builddir are good names.
> %meson
> %meson_build
> %meson_install
Though I'm not sure you need to have the %__srcdir at all. Can't you have
parametrized %meson_vpath macro instead of %mason (so you say where build
directory actually is)?
it's just complicating things. Almost no one will
override %vpath_srcdir.
> but this applies for other buildsystems. For example, currently with
> CMake almost everyone does
> mkdir %{_target_platform}
> pushd %{_target_platform}
> %cmake ..
> popd
> %make_build -C %{_target_platform}
> %make_install -C %{_target_platform}
Similarly here, if there was %vpath_builddir, %cmake could have been
hacked to support that.
Here comes question, where %vpath_srcdir and
%vpath_builddir should be
defined? I would prefer to see it somewhere in RPM, so other distros
can use it as well. But I can agree on redhat-rpm-macro or any other
packages.
Pavel
--
-Igor Gnatenko