From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Kc47I-0001q5-AU for garchives@archives.gentoo.org; Sat, 06 Sep 2008 20:10:44 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7901DE02D8; Sat, 6 Sep 2008 20:10:43 +0000 (UTC) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.233]) by pigeon.gentoo.org (Postfix) with ESMTP id 47CF8E02D8 for ; Sat, 6 Sep 2008 20:10:43 +0000 (UTC) Received: by wr-out-0506.google.com with SMTP id c37so970777wra.26 for ; Sat, 06 Sep 2008 13:10:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=8p+Wdbo8FH/y0AL28BANghQhLob8qsX18MpnuQB2SkM=; b=wli5yMO0pA9OhnhnEBzrMOUW+GqPDnyPN6eP8Rsw/lnXoN+VN616kyBRIRZx3sbjc/ a4TX/Aiu18nMbgHw29Xq6zGXg2RDzrw/jVmxzgTy4kgHYBKiKzrSloyWmE6N7JDEcOPE nU4XCM75NSfuT48CodDZnuhZ3a6fwObwf5mkw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=gwN6qdoPz8+Swk457eRx/+OkLFLAaP5ZVvrSQK9gX0s6mBW9ZKUGbAk/9Vu2fzjogh qNmqVFMG17WbGBFKeYbMOtKQqonKbvFsQ1ZLIyS0Sdj0h3qdnalhMX66MCvJ359Se108 TjS0N+EuiDPRxSpSTP8PS5oFLxtY3UyFylAkk= Received: by 10.90.32.18 with SMTP id f18mr16867191agf.109.1220731842405; Sat, 06 Sep 2008 13:10:42 -0700 (PDT) Received: by 10.90.49.6 with HTTP; Sat, 6 Sep 2008 13:10:42 -0700 (PDT) Message-ID: <3c32af40809061310j5666312aw5fa6bb62317f985@mail.gmail.com> Date: Sat, 6 Sep 2008 22:10:42 +0200 From: "Santiago M. Mola" Sender: cooldwind@gmail.com To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] [RFC] Ability to pass arguments to src_configure/src_compile In-Reply-To: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080906173656.GB5434@spoc.mpa.com> X-Google-Sender-Auth: 8640fbdd8d6f4493 X-Archives-Salt: 9c5e55e8-99dd-49b3-9481-d1c78f50fca6 X-Archives-Hash: bbbbe2f83d3cbf168fd76a1172bab031 On Sat, Sep 6, 2008 at 9:00 PM, Alec Warner wrote: > On Sat, Sep 6, 2008 at 10:36 AM, Thomas Anderson wrote: >> Hi, >> Currently we have a lot of: >> src_configure() { >> econf $(use_enable dvdr) \ >> $(use_with ipv6 ssl) \ >> --with-system-zlib >> } >> >> Introducing(Idea shamelessly taken from Exherbo): >> DEFAULT_SRC_CONFIGURE_USE_{WITHS,ENABLES} >> DEFAULT_SRc_CONFIGURE_EXTRA_PARAMS >> >> The code from above could be rewritten like so: >> >> DEFAULT_SRC_CONFIGURE_USE_ENABLES=( 'dvdr' ) >> DEFAULT_SRC_CONFIGURE_USE_WITHS=( 'ipv6 ssl' ) >> DEFAULT_SRC_CONFIGURE_EXTRA_PARAMS=( '--with-system-zlib' ) >> >> That's much simpler. > > It saves you 1 line and reduces readability and intuitiveness by a > fair margin; how is it simpler? > In the given example it's not a big deal. However, when you're dealing with more arguments it simplifies things. For example, this (based on an existing ebuild, but simplified a bit for brevity): -------------------------- src_compile() { local myconf=" --sysconfdir=/etc/${PN} --without-xgrid --enable-pretty-print-stacktrace --enable-orterun-prefix-by-default --without-slurm" if use threads; then myconf="${myconf} --enable-mpi-threads --with-progress-threads fi econf ${myconf} \ $(use_enable !nocxx mpi-cxx) \ $(use_enable romio io-romio) \ $(use_enable heterogeneous) \ $(use_with pbs tm) \ $(use_enable ipv6) \ || die "econf failed" emake || die "emake failed" } -------------------------- becomes -------------------------- SRC_DEFAULT_CONFIGURE_WITHS=( "pbs tm" "ipv6" "threads progress-threads" SRC_DEFAULT_CONFIGURE_ENABLES=( "cxx mpi-cxx" "romio io-romio" "heterogeneous" "threads mpi-threads" SRC_DEFAULT_CONFIGURE_EXTRA_PARAMS=( --sysconfdir=/etc/${PN} --without-xgrid --enable-pretty-print-stacktrace --enable-orterun-prefix-by-default --without-slurm ) -------------------------- You save some lines, but also you keep out all the use_* calls with their backslashes, myconf=$myconf crap, econf/emake || die... Regards, -- Santiago M. Mola Jabber ID: cooldwind@gmail.com