automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Supporting multiple python runtimes with automake


From: Mathieu Lirzin
Subject: Re: Supporting multiple python runtimes with automake
Date: Wed, 31 Jan 2018 19:49:23 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Yuval Turgeman <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]