[pacman-dev] [PATCH] Introduce destarch keyword into makepkg

Dan McGee dpmcgee at gmail.com
Wed Jul 2 00:26:04 EDT 2008


On Tue, Jul 1, 2008 at 11:11 PM, Allan McRae <allan at archlinux.org> wrote:
> Dan McGee wrote:
>> On Tue, Jul 1, 2008 at 8:58 PM, Allan McRae <allan at archlinux.org> wrote:
>>
>>> Thomas Bächler wrote:
>>>
>>>> If destarch is added to a PKGBUILD,
>>>>
>>> I read that as de-starch and was confused for a while...  :)
>>>
>>>
>>>> makepkg sets the architecture of the
>>>> resulting package to $destarch instead of $CARCH. This is useful if you
>>>> want to cross-create packages for one architecture on the other.
>>>>
>>>> Using
>>>>
>>>> arch=('i686')
>>>> destarch='x86_64'
>>>>
>>>> makes it possible to build multilib packages and to build grub without
>>>> the export CARCH="x86_64" hack.
>>>>
>>>>
>>> So when you are building the i686 packages, you have to comment out the
>>> destarch value?  I think it would be better to use a flag like -D/--dest
>>> x86_64.
>>>
>>
>> I wanted to make this same point too but I was afraid I interpreted
>> the patch wrong. It doesn't seem intuitive to have to comment things
>> in and out of the PKGBUILD.
>>
>> Of course, it is now just as easy to do:
>> CARCH=blah makepkg
>>
>> which seems to make this patch not worth it?
>
> But CARCH=blah requires that blah is in the arch array which indicates
> that is can be built on that arch - not the case for grub.

Oooohh, I guess I still didn't understand this then. So what is the
deal here? We are just faking the arch extension at the end along with
putting a different value in PKGINFO? I guess someone explaining the
entire situation for stupid me would be best- I'm not very familiar on
the grub build procedure, especially when it comes to building for
"other" architectures.

> Would this make more sense?
> arch=('i686' 'x86_64)
> buildarch=('i686')
>
> To build for i686 just type "makepkg" on an i686 machine.  To build for
> x86_64, type "makepkg -D x86_64" on an i686 machine.  Typing "makepkg"
> on a x86_64 machine fails.  I think this would be clearer.

I would rather not introduce a new variable for such a specific use
case like this. It seems overkill to me, especially since i686/x86_64
is one of the few cases where the architectures share a lot in common.
You wouldn't really do something along the lines of i686/ppc for
instance.

-Dan


More information about the pacman-dev mailing list