diff options
-rw-r--r-- | full_crespo-vendor.mk | 68 | ||||
-rw-r--r-- | full_crespo.mk | 4 | ||||
-rwxr-xr-x | setup-makefiles.sh | 31 |
3 files changed, 90 insertions, 13 deletions
diff --git a/full_crespo-vendor.mk b/full_crespo-vendor.mk new file mode 100644 index 0000000..2d767e6 --- /dev/null +++ b/full_crespo-vendor.mk @@ -0,0 +1,68 @@ +# Copyright (C) 2010 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This file is an "interesting" abuse of the build system. +# +# So, here's the reason why this file exists: +# +# The live wallpaper stuff is all open-source, but it fundamentally +# relies on non-open-source features (specifically, OpenGL drivers, +# which don't seem to ever get open-sourced). Because of that, we can't +# use them in pure open-source builds (they crash). +# +# The clean solution would be to maintain two entirely separate +# device and product configurations, one purely open-source and the +# other that'd use proprietary drivers. +# +# That's very nice in theory, but the reality is that in such a setup +# the two variants would inevitably drift. Been there, done that. +# +# So, we're in a situation where we want to include those open-source +# packages only in non-open-source builds. To be as transparent as +# possible, we want to do that in an open-source way. +# +# One approach (which has been used in the past) is to pretend that +# those files are drivers, so that when we include the driver-level +# modules that are necessary we also include those apps. That works +# fine if you only ever build a single configuration in open-source +# environments with proprietary drivers added. However it breaks down +# once you try to do multiple builds: those are very high-level features +# that shouldn't clutter the build of someone trying to do a minimally +# booting system. +# +# The approach I'm using here really considers these as product-level, +# not device-level. The plain product definition doesn't include this +# file directly. Instead, it conditionally includes a file on the +# proprietary side, which trampolines back to this file. In pure +# open-source builds, this file is never reached. In private builds +# with the true vendor tree, the trampoline exists and bounces back +# here. In open-source builds with proprietary drivers added, a +# trampoline is created along with the proprietary drivers. +# +# That's a long explanation, but, really, it just works. Trust me. + +# Live wallpaper packages +PRODUCT_PACKAGES := \ + LiveWallpapers \ + LiveWallpapersPicker \ + MagicSmokeWallpapers \ + VisualizationWallpapers \ + librs_jni + +# Publish that we support the live wallpaper feature. +PRODUCT_COPY_FILES := \ + packages/wallpapers/LivePicker/android.software.live_wallpaper.xml:/system/etc/permissions/android.software.live_wallpaper.xml + +# Pick up overlay for features that depend on non-open-source files +DEVICE_PACKAGE_OVERLAYS := vendor/samsung/crespo/overlay diff --git a/full_crespo.mk b/full_crespo.mk index 4b0bf74..fcf904a 100644 --- a/full_crespo.mk +++ b/full_crespo.mk @@ -29,6 +29,10 @@ PRODUCT_PACKAGES := \ Nfc \ Tag +# Get the parts that are either non-open-source or depend +# on non-open-source drivers +$(call inherit-product-if-exists, vendor/samsung/crespo/full_crespo-trampoline.mk) + # Inherit from those products. Most specific first. $(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk) # This is where we'd set a backup provider if we had one diff --git a/setup-makefiles.sh b/setup-makefiles.sh index 6458a2e..1e54f2a 100755 --- a/setup-makefiles.sh +++ b/setup-makefiles.sh @@ -36,22 +36,27 @@ mkdir -p ../../../vendor/$MANUFACTURER/$DEVICE # This file is generated by device/__MANUFACTURER__/__DEVICE__/setup-makefiles.sh -# Live wallpaper packages -PRODUCT_PACKAGES := \\ - LiveWallpapers \\ - LiveWallpapersPicker \\ - MagicSmokeWallpapers \\ - VisualizationWallpapers \\ - librs_jni +\$(call inherit-product, vendor/__MANUFACTURER__/__DEVICE__/device-vendor-blobs.mk) +EOF -# Publish that we support the live wallpaper feature. -PRODUCT_COPY_FILES := \\ - packages/wallpapers/LivePicker/android.software.live_wallpaper.xml:/system/etc/permissions/android.software.live_wallpaper.xml +(cat << EOF) | sed s/__DEVICE__/$DEVICE/g | sed s/__MANUFACTURER__/$MANUFACTURER/g > ../../../vendor/$MANUFACTURER/$DEVICE/full_$DEVICE-trampoline.mk +# Copyright (C) 2010 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. -# Pick up overlay for features that depend on non-open-source files -DEVICE_PACKAGE_OVERLAYS := vendor/__MANUFACTURER__/__DEVICE__/overlay +# This file is generated by device/__MANUFACTURER__/__DEVICE__/setup-makefiles.sh -\$(call inherit-product, vendor/__MANUFACTURER__/__DEVICE__/device-vendor-blobs.mk) +\$(call inherit-product, device/__MANUFACTURER__/__DEVICE__/full___DEVICE__-vendor.mk) EOF (cat << EOF) | sed s/__DEVICE__/$DEVICE/g | sed s/__MANUFACTURER__/$MANUFACTURER/g > ../../../vendor/$MANUFACTURER/$DEVICE/BoardConfigVendor.mk |