commit:     3915d3281902c71dee53b9bc57466e532f510ad1
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 10 12:37:23 2018 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Fri Aug 10 12:37:23 2018 +0000
URL:        https://gitweb.gentoo.org/proj/android.git/commit/?id=3915d328

dev-util/soong: add soong-9999 from KirenaHoro.

  Remove bootstrap recipe generator, because it is not needed
  after soong is built.

Package-Manager: Portage-2.3.40, Repoman-2.3.9

 dev-util/soong/Manifest                            |  4 ++
 .../soong/files/soong-9999-bootstrap-clean.patch   | 57 +++++++++++++++++
 dev-util/soong/files/soong-no-bootstrap.patch      | 12 ++++
 dev-util/soong/soong-9999.ebuild                   | 71 ++++++++++++++++++++++
 4 files changed, 144 insertions(+)

diff --git a/dev-util/soong/Manifest b/dev-util/soong/Manifest
index dbae562..adfeb92 100644
--- a/dev-util/soong/Manifest
+++ b/dev-util/soong/Manifest
@@ -1,7 +1,11 @@
 AUX blueprint-test-go-1.10.patch 1533 BLAKE2B 
3f764ea5ac68cdce8ecadb0dc40f4e676d8db21095b88cf99d7aa6c950ffd578029782d075d59290fc4898544458cab730471f9f0581dccefccc5a2951aa7234
 SHA512 
2846a098840b4543ec34466d5e97d0f6f8b05ba8dbb01e23c4a802a2bc3995fbb64020e88fa49ded8d7cac527cbfbb5614447165f7f17b392925f4f02556d480
+AUX soong-9999-bootstrap-clean.patch 1539 BLAKE2B 
95c06e8242d4d2e7a65d0f5e25b77bfe8079edf71213be318465250c78a1869e0b9ac0a7bb7be8123f586d1150a86951fb30b021230f3e3857ecdbdadab61d63
 SHA512 
b08a6314e3bee2b6d3ee7fa60afe3678a61d08c4930f9e55a643cf3bbe3373fef08d245b048a03a246d9cb0f9b3974b7e1dcb3f44f614cd9fd7f062d5c096384
 AUX soong-bootstrap-clean.patch 1588 BLAKE2B 
ec20e7fece7c126a19586d1a6db7264f64f2b427c7386a6a9f2df77d5171a024185e119683ae2d5e87f483937bc05d40b6d3ffd4132826ff7e42448348d96e75
 SHA512 
bb39af5fd5d8ec310506b8a3bb782389e9a3c4a31429d6cf32f4681b5fee64d41c01ecf05f692060bcf15ff53952a31d1d6ffe2ee4de6a6e65ee8f44cca42972
+AUX soong-no-bootstrap.patch 719 BLAKE2B 
2d6bef0e256f4bf1c7bac48b1a725aaf53f061ec04b67dcc47a94fcb406cc32499557c9c97198748a904a6ab5e9a5ff4d375de2ca0f030deabe31e177795b8bd
 SHA512 
05617b717c05eecd1b6971a4e72302341904a23481fccca83beb9b329ba91afda562b0d594600e2a91d784995dcf125fc71c955da60d0a1648128c71ec751c33
 AUX soong-no-kernel-header.patch 346 BLAKE2B 
9e830f028a47a031b46c5cefbc4ddafc922b1506756ba36266aa97f48e670efd1bae8a438f712add004b17fff3bf3c3f4c059a48039ee6ef619afc39163445d2
 SHA512 
b0ae8e277050911baf262a54c7324f03d69e5f8dd87505942d0a554451e69c6d6f0668801b83d66ac5c69d7827ea7d613d1d55e376c761c7e1f54c3b1ff286be
 DIST blueprint-8.1.0_p41.tar.gz 114222 BLAKE2B 
cb2335fd766212d1c3279ae4d6ee91df5f3c3a9522230ca70cbc080eed9b387a7d567963ba8ea5ffc4a48b01400958cc1d619b9da897e0f90a29b4446becdf46
 SHA512 
8ada4f309767567e7e08e6c8e61f0e442eb14a59333323bb6b47bb72c2b923bbb342166cddf6d31ec05a27f70ae60a981c0c8b4a3438820ce20ef47028e9f02b
+DIST lineage-15.1.tar.gz 49859612 BLAKE2B 
2203f51a8610100c9b6e3754d54da0310414abfac60b21a7fb4739f8f70bfc81cf0f61fb820b82891fbaf4bc89162d2b891c9c75ef86abe61de91525b7cb5e61
 SHA512 
5f7f92cf310d45c51f687a84205a8de68390fd2462e754bbe8d7226041e19938614d4f68eafb046dbb34ad29c67d70cfa6a3bea98841935d2c1659a5ee7c90c9
 DIST soong-8.1.0_p41.tar.gz 355543 BLAKE2B 
0d2b47c30d0515426cffa19c73495f68633dcdbcd5fc33fbbabb8892b712eb85ec68657ea73e07b34573af525055c0f791cd6b54ca58dedd5c14bd4af1a37623
 SHA512 
50f65ac86f4466adfed6fddf6e8288e16fdc0c1717ba57e59d40395115d4f55ceed3407ce6542ef0173c2076783a7bdc908ff0aac6f19aad7c62a8f63daef6e3
 EBUILD soong-8.1.0_p41.ebuild 1676 BLAKE2B 
f262faa3e8dbe45414160220975c8ca5c64104f3479f8b4fc2bc2fe50b79ce2af3a732375616906c7db1a13b0295dc21e937a208f670aa37d404badd79d2ed68
 SHA512 
da536c2b5f000739a70c8a932f921ef2d52e3e73e4062dfa4b4c13b56612a6e95346b5cc425f8bfe79493c04e52a79e759d8abf704ae090caaa1f6a5b0a64aca
+EBUILD soong-9999.ebuild 1985 BLAKE2B 
17de5d9d82e706c9f39d262f739d60af4d7252d3c859431ca4180fee2838156b2516dd9edc5ee982028453fdf358cdcbd00c8027d6e8baac85d441f74a56c56b
 SHA512 
d1b1cc0aed74ce03af4a4859f804256206bc48a06cd1913e5e22d03d08f7a7e1ad6c385e1a4eda57b553c0dc2da83417b3fa7722298ebb9a8867f33bf73efb82
 MISC metadata.xml 242 BLAKE2B 
08b4880748ab6d685ce28f65a9f6cc5ad62deff8f85d4e0a55a3dc12aa8bd63cf1de56b28ff89929e054a6831e223d6ef0207e8b19c6887f09ee22621bd76928
 SHA512 
ae57aaeecc094cffa640d88329a0baa6c2b0703330d84f6406f3f68d8bb9b724d2e19a8478be8708de284db9ac452f95f225a9f79cd1c5d0236aa2f9935b9b21

diff --git a/dev-util/soong/files/soong-9999-bootstrap-clean.patch 
b/dev-util/soong/files/soong-9999-bootstrap-clean.patch
new file mode 100644
index 0000000..1f1eec6
--- /dev/null
+++ b/dev-util/soong/files/soong-9999-bootstrap-clean.patch
@@ -0,0 +1,57 @@
+diff --git a/build/soong/bootstrap.bash b/build/soong/bootstrap.bash
+index aedbe94..1eb864e 100755
+--- a/build/soong/bootstrap.bash
++++ b/build/soong/bootstrap.bash
+@@ -1,16 +1,7 @@
+ #!/bin/bash
+ 
+-set -e
+-
+-ORIG_SRCDIR=$(dirname "${BASH_SOURCE[0]}")
+-if [[ "$ORIG_SRCDIR" != "." ]]; then
+-  if [[ ! -z "$BUILDDIR" ]]; then
+-    echo "error: To use BUILDDIR, run from the source directory"
+-    exit 1
+-  fi
+-  export BUILDDIR=$("${ORIG_SRCDIR}/build/soong/scripts/reverse_path.py" 
"$ORIG_SRCDIR")
+-  cd $ORIG_SRCDIR
+-fi
++set -exv
++
+ if [[ -z "$BUILDDIR" ]]; then
+   echo "error: Run ${BASH_SOURCE[0]} from the build output directory"
+   exit 1
+@@ -22,21 +13,6 @@ export TOPNAME="Android.bp"
+ export BOOTSTRAP_MANIFEST="${SRCDIR}/build/soong/build.ninja.in"
+ export RUN_TESTS="-t"
+ 
+-case $(uname) in
+-    Linux)
+-      export GOOS="linux"
+-      export PREBUILTOS="linux-x86"
+-      ;;
+-    Darwin)
+-      export GOOS="darwin"
+-      export PREBUILTOS="darwin-x86"
+-      ;;
+-    *) echo "unknown OS:" $(uname) && exit 1;;
+-esac
+-#export GOROOT="${SRCDIR}/prebuilts/go/$PREBUILTOS/"
+-#export GOARCH="amd64"
+-#export GOCHAR="6"
+-
+ if [[ $# -eq 0 ]]; then
+     mkdir -p $BUILDDIR
+ 
+Index: soong-8.1.0_p41/build/blueprint/bootstrap.bash
+===================================================================
+--- soong-8.1.0_p41.orig/build/blueprint/bootstrap.bash
++++ soong-8.1.0_p41/build/blueprint/bootstrap.bash
+@@ -22,7 +22,7 @@
+ # The invoking script should then run this script, passing along all of its
+ # command line arguments.
+ 
+-set -e
++set -exv
+ 
+ EXTRA_ARGS=""

diff --git a/dev-util/soong/files/soong-no-bootstrap.patch 
b/dev-util/soong/files/soong-no-bootstrap.patch
new file mode 100644
index 0000000..3104e68
--- /dev/null
+++ b/dev-util/soong/files/soong-no-bootstrap.patch
@@ -0,0 +1,12 @@
+Index: soong-9999/build/blueprint/bootstrap/command.go
+===================================================================
+--- soong-9999.orig/build/blueprint/bootstrap/command.go
++++ soong-9999/build/blueprint/bootstrap/command.go
+@@ -115,7 +115,6 @@ func Main(ctx *blueprint.Context, config
+       ctx.RegisterModuleType("bootstrap_go_binary", 
newGoBinaryModuleFactory(bootstrapConfig, StagePrimary))
+       ctx.RegisterModuleType("blueprint_go_binary", 
newGoBinaryModuleFactory(bootstrapConfig, StageMain))
+       ctx.RegisterTopDownMutator("bootstrap_stage", propagateStageBootstrap)
+-      ctx.RegisterSingletonType("bootstrap", 
newSingletonFactory(bootstrapConfig))
+ 
+       ctx.RegisterSingletonType("glob", globSingletonFactory(ctx))
+ 

diff --git a/dev-util/soong/soong-9999.ebuild b/dev-util/soong/soong-9999.ebuild
new file mode 100644
index 0000000..f5078cd
--- /dev/null
+++ b/dev-util/soong/soong-9999.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit ninja-utils git-r3
+EGIT_REPO_URI=https://github.com/KireinaHoro/android_build_${PN}
+EGIT_CHECKOUT_DIR=${WORKDIR}/${P}/build/${PN}
+
+A_URI=http://aosp.airelinux.org/platform/build
+# blueprint is a source level dependency of soong.
+MPV=8.1.0_p41
+SRC_URI="${A_URI}/blueprint/+archive/android-${MPV/p/r}.tar.gz -> 
blueprint-${MPV}.tar.gz
+       
https://github.com/LineageOS/android_vendor_lineage/archive/lineage-15.1.tar.gz";
+DESCRIPTION="JSON-like build system for Android."
+HOMEPAGE="${A_URI}/${PN}"
+LICENSE="Apache-2.0"
+KEYWORDS="~amd64"
+SLOT=0
+
+DEPEND="dev-lang/go
+       dev-util/ninja"
+RDEPEND="dev-lang/go"
+
+PATCHES=(
+       "${FILESDIR}"/blueprint-test-go-1.10.patch
+       "${FILESDIR}"/soong-9999-bootstrap-clean.patch
+       "${FILESDIR}"/soong-no-kernel-header.patch
+       "${FILESDIR}"/soong-no-bootstrap.patch
+)
+
+src_unpack() {
+       git-r3_src_unpack
+
+       mkdir -p "${S}"/vendor || die
+       cd "${S}"/vendor || die
+       unpack lineage-15.1.tar.gz
+       mv android_vendor_lineage-lineage-15.1 lineage || die
+
+       mkdir -p "${S}"/build/blueprint || die
+       cd "${S}"/build/blueprint || die
+       unpack blueprint-${MPV}.tar.gz
+}
+
+src_prepare() {
+       default
+       ln -s build/soong/root.bp Android.bp || die
+       ln -s build/soong/bootstrap.bash || die
+
+       for c in vendor/lineage/*; do
+               [[ ${c} = */build ]] || rm -r ${c} || die
+       done
+}
+
+src_compile() {
+       BUILDDIR="${S}"/out bash -xv build/soong/bootstrap.bash || die
+       eninja -v -f out/.minibootstrap/build.ninja
+       eninja -v -f out/.bootstrap/build.ninja
+
+       # go run cmd/microfactory/microfactory.go -s cmd/microfactory \
+       #    -pkg-path android/soong=. -o out/soong_ui 
android/soong/cmd/soong_ui
+       # eninja -v -f .bootstrap/build.ninja
+}
+
+src_install() {
+       dobin out/.bootstrap/bin/*
+       sed -n '/\/\/.*host bionic/,$p' < build/soong/Android.bp > 
"${T}"/Android.bp
+       sed '/build = \[/,+3d' < build/soong/root.bp > "${T}"/root.bp
+       insinto /usr/share/soong
+       doins "${T}"/{Android,root}.bp
+}

Reply via email to