* [gentoo-devhelp] Building project twice in the same ebuild
@ 2015-02-16 2:32 Nikos Chantziaras
2015-02-17 17:48 ` Michael Orlitzky
0 siblings, 1 reply; 2+ messages in thread
From: Nikos Chantziaras @ 2015-02-16 2:32 UTC (permalink / raw
To: gentoo-devhelp
I need to build a project (which uses cmake) twice and install it twice.
Each time with a different configuration. The files it generates in each
configuration do not conflict with each other (except for share/doc/).
Which configs are built depends on USE flags. Either qt4, qt5 or both.
How would I go on about this? The project's build system *can not* build
both sets in the same build. When building normally, outside of portage,
this is built with:
mkdir build && cd build
cmake -DQT_VERSION=4 ../
make && make install
rm -r *
cmake -DQT_VERSION=5 ../
make && make install
I'm not sure I can do something like that in an ebuild.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [gentoo-devhelp] Building project twice in the same ebuild
2015-02-16 2:32 [gentoo-devhelp] Building project twice in the same ebuild Nikos Chantziaras
@ 2015-02-17 17:48 ` Michael Orlitzky
0 siblings, 0 replies; 2+ messages in thread
From: Michael Orlitzky @ 2015-02-17 17:48 UTC (permalink / raw
To: gentoo-devhelp
On 02/15/2015 09:32 PM, Nikos Chantziaras wrote:
> I need to build a project (which uses cmake) twice and install it twice.
> Each time with a different configuration. The files it generates in each
> configuration do not conflict with each other (except for share/doc/).
>
> Which configs are built depends on USE flags. Either qt4, qt5 or both.
>
> How would I go on about this? The project's build system *can not* build
> both sets in the same build. When building normally, outside of portage,
> this is built with:
>
> mkdir build && cd build
> cmake -DQT_VERSION=4 ../
> make && make install
> rm -r *
> cmake -DQT_VERSION=5 ../
> make && make install
>
> I'm not sure I can do something like that in an ebuild.
>
I would set S="${WORKDIR}" and then in src_prepare(), make a copy of the
entire package directory. The configure, compile, etc. phases would look
something like,
src_compile() {
for qt in 4 5; do # Make this list from the user's USE flags
cd "${WORKDIR}/${P}-qt${qt}" || die
cmake -DQT_VERSION=${qt} || die
emake
done
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-02-17 17:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-16 2:32 [gentoo-devhelp] Building project twice in the same ebuild Nikos Chantziaras
2015-02-17 17:48 ` Michael Orlitzky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox