diff options
author | Mike Frysinger <vapier@google.com> | 2015-10-02 17:02:36 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@google.com> | 2015-10-03 00:38:15 -0400 |
commit | 021bca0c657545290975e71d01622d97d1cbb6a3 (patch) | |
tree | 0ee74de8258f62086219d477a0ece835dccb7d9b | |
parent | 3b1b415bdfa467f9a736517dff2be072feb7425e (diff) | |
download | integration-021bca0c657545290975e71d01622d97d1cbb6a3.tar.gz |
add main target logic to glue Gentoo packages in
This is the main entry point for gluing Gentoo packages in.
To use this, just update your device's mk files like so:
PRODUCT_3RD_PARTY_PACKAGES := <list of Gentoo packages>
PRODUCT_PACKAGES += 3rd-party-packages
When you build, those packages will be built & installed automatically.
Examples for building your own code against those will be a follow up
commit.
BUG=24611334
TEST=built packages and they worked in qemu
Change-Id: Ic86d62415fdab1b94947dbfa7658264c2824d6e0
-rw-r--r-- | Android.mk | 50 | ||||
-rw-r--r-- | TODO | 4 |
2 files changed, 54 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk new file mode 100644 index 0000000..a302010 --- /dev/null +++ b/Android.mk @@ -0,0 +1,50 @@ +LOCAL_PATH := $(call my-dir) + +# Only load these subdirs when 3rd party packages have been requested. +ifneq ($(PRODUCT_3RD_PARTY_PACKAGES),) + +3RD_PARTY_COMPILER = $(HOST_OUT_EXECUTABLES)/3rd-party-compiler + +TARGET_OUT_GENTOO := $(TARGET_OUT_INTERMEDIATES)/gentoo +TARGET_OUT_COMMON_GENTOO := $(TARGET_OUT_COMMON_INTERMEDIATES)/gentoo +3RD_PARTY_ROOT := $(TARGET_OUT_GENTOO)/root +3RD_PARTY_ROOT_SUBDIR := $(patsubst $(PRODUCT_OUT)/%,%,$(3RD_PARTY_ROOT)) + +# We have to include subdirs first as they set up some vars we use below. +include $(call all-subdir-makefiles) + +# Actually run the emerge command for the specific package. +%.emerge: TARGET_TO_ATOM = $(notdir $(patsubst %/,%,$(dir $(1))))/$(notdir $(1:.emerge=)) +%.emerge: | $(HOST_OUT_EXECUTABLES)/3rd-party-compiler $(3RD_PARTY_WRAPPERS) $(3RD_PARTY_CONFIGS) + $(hide)mkdir -p $(dir $@) $(TARGET_OUT_GENTOO)/tmp + $(hide)emerge $(call TARGET_TO_ATOM,$@) + $(hide)3rd-party-merge \ + --package $(call TARGET_TO_ATOM,$@) \ + --input-root $(3RD_PARTY_ROOT) \ + --output-root $(TARGET_OUT) \ + --make-root $(TARGET_OUT_GENTOO)/mk-installed + $(hide)touch $@ + +# Set up a module for each requested package. +define 3rd-party-merge +include $(CLEAR_VARS) +LOCAL_MODULE := mk-installed/$(1).emerge +LOCAL_MODULE_CLASS := GENTOO +LOCAL_UNINSTALLABLE_MODULE := true +include $$(BUILD_SYSTEM)/base_rules.mk +endef +$(foreach p,$(PRODUCT_3RD_PARTY_PACKAGES),$(eval $(call 3rd-party-merge,$(p)))) + +# A pseudo target that depends on all the generated packages above. +# The board can use this in their PRODUCT_PACKAGES list. +include $(CLEAR_VARS) +LOCAL_MODULE := 3rd-party-packages +LOCAL_MODULE_CLASS := GENTOO +LOCAL_ADDITIONAL_DEPENDENCIES := $(foreach p,$(PRODUCT_3RD_PARTY_PACKAGES),mk-installed/$(p).emerge) +include $(BUILD_SYSTEM)/base_rules.mk +LOCAL_BUILT_MODULE := $(intermediates)/$(LOCAL_MODULE) +$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES) + $(hide)mkdir -p $(dir $@) + $(hide)touch $@ + +endif @@ -0,0 +1,4 @@ +- set LINGUAS to ' ' to never install +- disable nls support +- filter out systemd files +- rewrite SONAME libs and drop all the symlinks |