Re: Supporting multiple python runtimes with automake

Yuval Turgeman <[email protected]>
Newsgroups gmane.comp.sysutils.automake.patches
Message-ID <CAGDbUeeizK=EdCFuPqjRVwyLUOkqexYHKZeqXSOgOoTvFRquZQ@mail.gmail.com>
Hi,

Thanks for the feedback !  What you described is what we are doing today,
it does the job nicely, I just thought it would be nice to avoid 2 calls.
Honestly, both VPATH and my patch feel a little hackish to me, and the
existing way is not really that painful, I guess.  Your call, I will not be
offended if this gets rejected, as I wasnt 100% sure I should post this
anyway, but since I already played with it one night, I thought why not :)

Thanks !


On Jan 31, 2018 8:49 PM, "Mathieu Lirzin" <[email protected]> wrote:

Yuval Turgeman <[email protected]> writes:

> Because when I want to package an rpm, I have a single %build and
> %install in my spec, so my second call to configure will override the
> first, and then i will need to run make install. So the process would
> be result in something like
>
> (from %build)
> configure PYTHON=/usr/bin/python2
> make
> configure PYTHON=/usr/bin/python3
> make
> (from %install)
> make install
>
> which wont work (unless we move make install to %build i guess). With
> this patch, a single configure would nail both pythons, and make
> install would install the relevant files to their correct location.

What could be done is to use out-of-tree “VPATH” builds [1] to configure
and build with both python versions in different directories in the
‘%build’ phase and run ‘make install’ in each of these directories in
the ’%install’ phase.

Maybe something like this (totally untested :-)):
--8<---------------cut here---------------start------------->8---
%build
mkdir py2 && cd py2
../%configure PYTHON=/path/to/python2
%make_build
cd ..
mkdir py3 && cd py3
../%configure PYTHON=/path/to/python3
%make_build
cd ..

%install
%make_install -C py2
%make_install -C py3
--8<---------------cut here---------------end--------------->8---

It seems not ideal to handle distro specific packaging guidelines on the
upstream configuration side.  As a consequence I would rather avoid
adding macros to be run at configure time.

WDYT?

[1] https://www.gnu.org/software/automake/manual/html_node/VPATH-Builds.html

--
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.