You are not logged in.

#1 2013-04-29 20:26:44

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 168

Is it possible to override makepkg.conf settings on the command-line ?

Simple question, hopefully I've just missed the answer while googling this.

To cross-compile an ARM package on my x86 box, I have to change the value of ${CARCH}. The only way I've been able to do this is to modify its setting in /etc/makepkg.conf. I'd like to be able to just specify it on the command-line along with my other variables; something like:

CROSS_COMPILE=/opt/arm-bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi- ARCH=arm CARCH=arm makepkg -s

However, the setting of CARCH like that is ignored. All other variables have the desired effect. Is it not possible to set makepkg variables on the command-line ?

If I have this completely wrong and I should be doing it another way, I'd appreciate some guidance. But, by that, I don't mean build on arm with distcc because I have already done that and it takes over three hours versus under ten minutes for the above method which, apart from needing to modify makepkg.conf, works great smile

Offline

#2 2013-04-29 20:45:01

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: Is it possible to override makepkg.conf settings on the command-line ?

Maybe you'll find this article helplful a bit.


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#3 2013-04-29 22:28:22

cookies
Member
Registered: 2013-01-17
Posts: 253

Re: Is it possible to override makepkg.conf settings on the command-line ?

You could specify an alternate configuration file instead of the default one.

Offline

#4 2013-04-29 23:01:54

fukawi2
Forum Moderator
From: .vic.au
Registered: 2007-09-28
Posts: 5,266
Website

Re: Is it possible to override makepkg.conf settings on the command-line ?

This patch should do what you want;

From f273bbd559b453e0af5a038b3bb8f3111272f9a7 Mon Sep 17 00:00:00 2001
From: Phillip Smith <fukawi2@gmail.com>
Date: Tue, 30 Apr 2013 09:00:21 +1000
Subject: [PATCH] makepkg: add support for CARCH environment var

Add support for overriding configuration in /etc/makepkg.conf and
~/.makepkg.conf by setting the environment variable CARCH similar to
how SRCDEST and PKGDEST behave.
---
 scripts/makepkg.sh.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index da620a4..50bf41d 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -2604,6 +2604,7 @@ trap 'trap_exit USR1 "$(gettext "An unknown error has occurred. Exiting...")"' E
 [[ -n ${SRCEXT} ]] && _SRCEXT=${SRCEXT}
 [[ -n ${GPGKEY} ]] && _GPGKEY=${GPGKEY}
 [[ -n ${PACKAGER} ]] && _PACKAGER=${PACKAGER}
+[[ -n ${CARCH} ]] && _CARCH=${CARCH}
 
 # default config is makepkg.conf
 MAKEPKG_CONF=${MAKEPKG_CONF:-$confdir/makepkg.conf}
@@ -2703,6 +2704,7 @@ PKGEXT=${_PKGEXT:-$PKGEXT}
 SRCEXT=${_SRCEXT:-$SRCEXT}
 GPGKEY=${_GPGKEY:-$GPGKEY}
 PACKAGER=${_PACKAGER:-$PACKAGER}
+CARCH=${_CARCH:-$CARCH}
 
 if (( ! INFAKEROOT )); then
        if (( EUID == 0 && ! ASROOT )); then
-- 
1.8.2.1

EDIT: https://bugs.archlinux.org/task/35030

Last edited by fukawi2 (2013-04-29 23:11:27)

Offline

#5 2013-04-30 08:29:23

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 168

Re: Is it possible to override makepkg.conf settings on the command-line ?

Yes @fukawi2 that patch does exactly what I want. I have voted for it and hope it makes it into the official package. Thanks.

Offline

Board footer

Powered by FluxBB