From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 4FE4A138A1A for ; Tue, 17 Feb 2015 17:48:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2F954E084E; Tue, 17 Feb 2015 17:48:43 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C0456E084E for ; Tue, 17 Feb 2015 17:48:42 +0000 (UTC) Received: from [192.168.1.100] (c-98-218-46-55.hsd1.md.comcast.net [98.218.46.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mjo) by smtp.gentoo.org (Postfix) with ESMTPSA id 68596340727 for ; Tue, 17 Feb 2015 17:48:41 +0000 (UTC) Message-ID: <54E37EEF.7060402@gentoo.org> Date: Tue, 17 Feb 2015 12:48:31 -0500 From: Michael Orlitzky User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Development-related help X-BeenThere: gentoo-devhelp@gentoo.org X-BeenThere: gentoo-devhelp@lists.gentoo.org Reply-To: gentoo-devhelp@lists.gentoo.org MIME-Version: 1.0 To: gentoo-devhelp@lists.gentoo.org Subject: Re: [gentoo-devhelp] Building project twice in the same ebuild References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Archives-Salt: 910dad78-7d5d-4ffb-b70b-a9d1b69805c5 X-Archives-Hash: 040f1cdae93da2380d7b8246cdce223f 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 }