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 81FA01380DC for ; Wed, 5 Feb 2014 19:48:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 179E1E0CC6; Wed, 5 Feb 2014 19:48:51 +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 AA9C8E0CC6 for ; Wed, 5 Feb 2014 19:48:50 +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 C1B4633F8EE for ; Wed, 5 Feb 2014 19:48:49 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id ED8AD18278 for ; Wed, 5 Feb 2014 19:48:47 +0000 (UTC) From: "Anthony G. Basile" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anthony G. Basile" Message-ID: <1391629756.b81a0c349874f03b6ef9980d3f10f02cc7513b16.blueness@gentoo> Subject: [gentoo-commits] proj/releng:master commit in: tools-musl/portage/, tools-musl/ X-VCS-Repository: proj/releng X-VCS-Files: tools-musl/portage/make.conf tools-musl/run.sh X-VCS-Directories: tools-musl/portage/ tools-musl/ X-VCS-Committer: blueness X-VCS-Committer-Name: Anthony G. Basile X-VCS-Revision: b81a0c349874f03b6ef9980d3f10f02cc7513b16 X-VCS-Branch: master Date: Wed, 5 Feb 2014 19:48:47 +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: 6f630daa-7d83-4a50-b605-c097939b1076 X-Archives-Hash: e9bfcb8124742484f340e52d89f844f9 commit: b81a0c349874f03b6ef9980d3f10f02cc7513b16 Author: Anthony G. Basile gentoo org> AuthorDate: Wed Feb 5 19:49:16 2014 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Wed Feb 5 19:49:16 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/releng.git;a=commit;h=b81a0c34 tools-musl: make the run.sh script work for both amd64 and i686 --- tools-musl/portage/make.conf | 2 +- tools-musl/run.sh | 30 +++++++++++++++++++++++++----- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/tools-musl/portage/make.conf b/tools-musl/portage/make.conf index 041ec69..63003ee 100644 --- a/tools-musl/portage/make.conf +++ b/tools-musl/portage/make.conf @@ -1,4 +1,4 @@ -CHOST=x86_64-gentoo-linux-musl +CHOST=ALTARCH-gentoo-linux-musl CFLAGS="-Os -pipe -fomit-frame-pointer" CXXFLAGS="${CFLAGS}" diff --git a/tools-musl/run.sh b/tools-musl/run.sh index ae21c08..4ff3785 100755 --- a/tools-musl/run.sh +++ b/tools-musl/run.sh @@ -1,24 +1,40 @@ #!/bin/bash -ROOTFS="stage4-amd64-musl-vanilla" +MYARCH=${1:-"amd64"} + +if [[ "$MYARCH" != "amd64" && "$MYARCH" != "i686" ]]; then + echo "Unsupported arch $MYARCH" + exit +fi + +[[ "$MYARCH" == "amd64" ]] && ALTARCH="x86_64" +[[ "$MYARCH" == "i686" ]] && ALTARCH="i386" + +ROOTFS="stage4-${MYARCH}-musl-vanilla" PWD="$(pwd)" prepare_etc () { mkdir -p "${ROOTFS}"/etc cp -a "${PWD}"/portage/ "${ROOTFS}"/etc/ + + if [[ "$MYARCH" == "amd64" ]]; then + sed -i "s/ALTARCH/${ALTARCH}/" "${ROOTFS}"/etc/make.conf + elif [[ "$MYARCH" == "i686" ]]; then + sed -i "s/ALTARCH/${MYARCH}/" "${ROOTFS}"/etc/make.conf + fi } prepare_usr_etc() { mkdir -p "${ROOTFS}"/usr/etc - cat <<-EOF > "${ROOTFS}"/usr/etc/ld-musl-x86_64.path + cat <<-EOF > "${ROOTFS}"/usr/etc/ld-musl-${ALTARCH}.path /lib /usr/lib - /usr/lib/gcc/x86_64-gentoo-linux-musl/4.7.3 - /usr/x86_64-gentoo-linux-musl/lib + /usr/lib/gcc/${ALTARCH}-gentoo-linux-musl/4.7.3 + /usr/${ALTARCH}-gentoo-linux-musl/lib EOF - ln -sf ld-musl-x86_64.path "${ROOTFS}"/usr/etc/ld-musl.path + ln -sf ld-musl-${ALTARCH}.path "${ROOTFS}"/usr/etc/ld-musl.path } prepare_overlay() { @@ -39,6 +55,10 @@ setup_configs() { sed -i '/^SYNC/d' "${ROOTFS}"/etc/portage/make.conf sed -i '/^GENTOO_MIRRORS/d' "${ROOTFS}"/etc/portage/make.conf sed -i 's/^MAKEOPTS/#MAKEOPTS/' "${ROOTFS}"/etc/portage/make.conf + + # There are some issue with python3, so let's select python2 + # which so far is option 1 in elesect python. + chroot "${ROOTFS}" eselect python set 1 } bundle_it() {