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 9C28613877A for ; Thu, 19 Jun 2014 09:57:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 72603E085A; Thu, 19 Jun 2014 09:57:48 +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 09FAAE0857 for ; Thu, 19 Jun 2014 09:57:47 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0544E340198 for ; Thu, 19 Jun 2014 09:57:47 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id B760F18913 for ; Thu, 19 Jun 2014 09:57:44 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1403171850.9a28529d05071e5a0ab00de2e757a49e01e62107.mgorny@gentoo> Subject: [gentoo-commits] dev/mgorny:master commit in: sys-devel/multilib-gcc-wrapper/ X-VCS-Repository: dev/mgorny X-VCS-Files: sys-devel/multilib-gcc-wrapper/multilib-gcc-wrapper-0.ebuild X-VCS-Directories: sys-devel/multilib-gcc-wrapper/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 9a28529d05071e5a0ab00de2e757a49e01e62107 X-VCS-Branch: master Date: Thu, 19 Jun 2014 09:57:44 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 66ce1c40-6ce9-44ef-99d8-df9a48cd79dd X-Archives-Hash: 3cf13e872a52867a052877d437d83fd9 commit: 9a28529d05071e5a0ab00de2e757a49e01e62107 Author: Michał Górny gentoo org> AuthorDate: Thu Jun 19 09:57:30 2014 +0000 Commit: Michał Górny gentoo org> CommitDate: Thu Jun 19 09:57:30 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=9a28529d New awesome multilib-gcc-wrapper to play with distcc. --- .../multilib-gcc-wrapper-0.ebuild | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/sys-devel/multilib-gcc-wrapper/multilib-gcc-wrapper-0.ebuild b/sys-devel/multilib-gcc-wrapper/multilib-gcc-wrapper-0.ebuild new file mode 100644 index 0000000..adc2cae --- /dev/null +++ b/sys-devel/multilib-gcc-wrapper/multilib-gcc-wrapper-0.ebuild @@ -0,0 +1,61 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=5 + +inherit multilib-build + +DESCRIPTION="Wrappers for gcc tools to be used on non-native CHOSTs" +HOMEPAGE="" +SRC_URI="" + +LICENSE="" +SLOT="0" +KEYWORDS="~amd64" +IUSE="distcc" + +RDEPEND="sys-devel/gcc:=" + +S=${WORKDIR} + +mkwrap() { + cat > "${T}"/wrapper <<-_EOF_ + #!/bin/bash + exec ${1} $(get_abi_CFLAGS) "\${@}" + _EOF_ + + newbin "${T}"/wrapper "${2}" +} + +src_install() { + local host_prefix=${CHOST} + local tools=( c++ cpp g++ gcc gfortran ) # XXX + + if use distcc; then + local distcc_dir=/usr/$(get_libdir)/distcc/bin + local distcc_sym_prefix=../../../bin + dodir "${distcc_dir}" + fi + + create_wrappers() { + [[ ${CHOST} == ${host_prefix} ]] && continue + + local t e + for t in "${tools[@]}"; do + for e in "${ROOT%/}"/usr/bin/${host_prefix}-${t} \ + "${ROOT%/}"/usr/bin/${host_prefix}-${t}-[34]*; do + local basename=${e##*/} + local newname=${basename/${host_prefix}/${CHOST}} + + mkwrap "${basename}" "${newname}" + + if use distcc; then + dosym "${distcc_sym_prefix}/${newname}" \ + "${distcc_dir}/${newname}" + fi + done + done + } + multilib_foreach_abi create_wrappers +}