package/flutter-sdk-bin: new package
flutter-sdk-bin is a collection of host tools and plugins used to compile flutter applications. - As this is a collection of pre-compiled tools, append -bin to the end of the package name. - We must set the HOME directory variable to the sdk directory or else the flutter dart binaries place .dart, .dart-sdk, and .flutter in ~/. - set --clear-features, --no-analytics and --disable-telemetry first to disable google tracking as soon as possible. Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com> [yann.morin.1998@free.fr: - set FLUTTER_SDK_BIN_PUB_CACHE for other packages to make use of it ] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
This commit is contained in:
parent
48730a1a9d
commit
fc8a67f169
@ -33,6 +33,7 @@ F: package/vulkan-tools/
|
|||||||
|
|
||||||
N: Adam Duskett <adam.duskett@amarulasolutions.com>
|
N: Adam Duskett <adam.duskett@amarulasolutions.com>
|
||||||
F: package/depot-tools/
|
F: package/depot-tools/
|
||||||
|
F: package/flutter-sdk-bin/
|
||||||
|
|
||||||
N: Adam Heinrich <adam@adamh.cz>
|
N: Adam Heinrich <adam@adamh.cz>
|
||||||
F: package/jack1/
|
F: package/jack1/
|
||||||
|
@ -36,6 +36,7 @@ menu "Host utilities"
|
|||||||
source "package/faketime/Config.in.host"
|
source "package/faketime/Config.in.host"
|
||||||
source "package/fatcat/Config.in.host"
|
source "package/fatcat/Config.in.host"
|
||||||
source "package/firmware-utils/Config.in.host"
|
source "package/firmware-utils/Config.in.host"
|
||||||
|
source "package/flutter-sdk-bin/Config.in.host"
|
||||||
source "package/fwup/Config.in.host"
|
source "package/fwup/Config.in.host"
|
||||||
source "package/genext2fs/Config.in.host"
|
source "package/genext2fs/Config.in.host"
|
||||||
source "package/genimage/Config.in.host"
|
source "package/genimage/Config.in.host"
|
||||||
|
16
package/flutter-sdk-bin/Config.in.host
Normal file
16
package/flutter-sdk-bin/Config.in.host
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# All host rust packages should depend on this option
|
||||||
|
config BR2_PACKAGE_HOST_FLUTTER_SDK_BIN_ARCH_SUPPORTS
|
||||||
|
bool
|
||||||
|
default y if BR2_HOSTARCH = "x86_64"
|
||||||
|
|
||||||
|
config BR2_PACKAGE_HOST_FLUTTER_SDK_BIN
|
||||||
|
bool "host flutter-sdk-bin"
|
||||||
|
depends on BR2_PACKAGE_HOST_FLUTTER_SDK_BIN_ARCH_SUPPORTS
|
||||||
|
help
|
||||||
|
Flutter is Google's SDK for crafting beautiful, fast user
|
||||||
|
experiences for mobile, web, and desktop from a single
|
||||||
|
codebase. Flutter works with existing code, is used by
|
||||||
|
developers and organizations around the world, and is
|
||||||
|
free and open source.
|
||||||
|
|
||||||
|
https://flutter.dev/
|
3
package/flutter-sdk-bin/flutter-sdk-bin.hash
Normal file
3
package/flutter-sdk-bin/flutter-sdk-bin.hash
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Locally calculated
|
||||||
|
sha256 d9bbfbfb6fe3c72a29c1040235126edd0cd461e4e18556335fd1cf217c2e1473 flutter_linux_3.13.4-stable.tar.xz
|
||||||
|
sha256 a598db94b6290ffbe10b5ecf911057b6a943351c727fdda9e5f2891d68700a20 LICENSE
|
98
package/flutter-sdk-bin/flutter-sdk-bin.mk
Normal file
98
package/flutter-sdk-bin/flutter-sdk-bin.mk
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# host-flutter-sdk-bin
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
FLUTTER_SDK_BIN_VERSION = 3.13.4
|
||||||
|
FLUTTER_SDK_BIN_SITE = https://storage.googleapis.com/flutter_infra_release/releases/stable/linux
|
||||||
|
FLUTTER_SDK_BIN_SOURCE = flutter_linux_$(FLUTTER_SDK_BIN_VERSION)-stable.tar.xz
|
||||||
|
FLUTTER_SDK_BIN_LICENSE = BSD-3-Clause
|
||||||
|
FLUTTER_SDK_BIN_LICENSE_FILES = LICENSE
|
||||||
|
|
||||||
|
HOST_FLUTTER_SDK_BIN_SDK = $(HOST_DIR)/share/flutter/sdk
|
||||||
|
HOST_FLUTTER_SDK_BIN_DART_SDK = $(HOST_FLUTTER_SDK_BIN_SDK)/bin/cache/dart-sdk
|
||||||
|
HOST_FLUTTER_SDK_BIN_SDK_ENGINE = $(HOST_FLUTTER_SDK_BIN_SDK)/bin/cache/artifacts/engine
|
||||||
|
|
||||||
|
# We must set the home directory to the sdk directory or else flutter will
|
||||||
|
# place .dart, .dart-sdk, and .flutter in ~/.
|
||||||
|
HOST_FLUTTER_SDK_BIN_ENV = \
|
||||||
|
HOME=$(HOST_FLUTTER_SDK_BIN_SDK) \
|
||||||
|
PATH=$(BR_PATH):$(HOST_FLUTTER_SDK_BIN_SDK):$(HOST_FLUTTER_SDK_BIN_SDK)/bin \
|
||||||
|
PUB_CACHE=$(FLUTTER_SDK_BIN_PUB_CACHE)
|
||||||
|
|
||||||
|
# The following config options must be ran one at a time.
|
||||||
|
HOST_FLUTTER_SDK_BIN_CONF_OPTS = \
|
||||||
|
--clear-features \
|
||||||
|
--no-analytics \
|
||||||
|
--disable-telemetry \
|
||||||
|
--enable-custom-devices \
|
||||||
|
--enable-linux-desktop \
|
||||||
|
--no-enable-android \
|
||||||
|
--no-enable-fuchsia \
|
||||||
|
--no-enable-ios \
|
||||||
|
--no-enable-macos-desktop \
|
||||||
|
--no-enable-windows-desktop
|
||||||
|
|
||||||
|
define HOST_FLUTTER_SDK_BIN_CONFIGURE_CMDS
|
||||||
|
$(foreach i,$(HOST_FLUTTER_SDK_BIN_CONF_OPTS),
|
||||||
|
$(HOST_FLUTTER_SDK_BIN_ENV) $(@D)/bin/flutter config $(i); \
|
||||||
|
)
|
||||||
|
$(HOST_FLUTTER_SDK_BIN_ENV) $(@D)/bin/dart --disable-analytics
|
||||||
|
endef
|
||||||
|
|
||||||
|
# Remove the cache, as we will run precache after setting up flutter and dart
|
||||||
|
# with the new config options.
|
||||||
|
define HOST_FLUTTER_SDK_BIN_BUILD_CMDS
|
||||||
|
mkdir -p $(HOST_FLUTTER_SDK_BIN_SDK)
|
||||||
|
rm -rf $(HOST_FLUTTER_SDK_BIN_SDK)/.pub-cache
|
||||||
|
cd $(@D) && \
|
||||||
|
$(HOST_FLUTTER_SDK_BIN_ENV) $(@D)/bin/flutter precache;
|
||||||
|
endef
|
||||||
|
|
||||||
|
define HOST_FLUTTER_SDK_BIN_INSTALL_CMDS
|
||||||
|
cp -rpdT $(@D)/. $(HOST_FLUTTER_SDK_BIN_SDK)/
|
||||||
|
endef
|
||||||
|
|
||||||
|
ifeq ($(BR2_ENABLE_RUNTIME_DEBUG),y)
|
||||||
|
HOST_FLUTTER_SDK_BIN_SDK_ROOT = \
|
||||||
|
$(HOST_FLUTTER_SDK_BIN_SDK_ENGINE)/common/flutter_patched_sdk
|
||||||
|
HOST_FLUTTER_SDK_BIN_SDK_PRODUCT = false
|
||||||
|
else
|
||||||
|
HOST_FLUTTER_SDK_BIN_SDK_ROOT = \
|
||||||
|
$(HOST_FLUTTER_SDK_BIN_SDK_ENGINE)/common/flutter_patched_sdk_product
|
||||||
|
HOST_FLUTTER_SDK_BIN_SDK_PRODUCT = true
|
||||||
|
endif
|
||||||
|
|
||||||
|
# The Order matters.Taken from:
|
||||||
|
# https://github.com/meta-flutter/meta-flutter/blob/kirkstone/classes/flutter-app.inc
|
||||||
|
HOST_FLUTTER_SDK_BIN_DART_ARGS = \
|
||||||
|
--verbose \
|
||||||
|
--disable-analytics \
|
||||||
|
--disable-dart-dev $(HOST_FLUTTER_SDK_BIN_SDK_ENGINE)/linux-x64/frontend_server.dart.snapshot \
|
||||||
|
--sdk-root $(HOST_FLUTTER_SDK_BIN_SDK_ROOT) \
|
||||||
|
--target=flutter \
|
||||||
|
--no-print-incremental-dependencies \
|
||||||
|
-Ddart.vm.profile=false \
|
||||||
|
-Ddart.vm.product=$(HOST_FLUTTER_SDK_BIN_SDK_PRODUCT) \
|
||||||
|
--aot \
|
||||||
|
--tfa \
|
||||||
|
--packages .dart_tool/package_config.json \
|
||||||
|
--output-dill .dart_tool/flutter_build/*/app.dill \
|
||||||
|
--depfile .dart_tool/flutter_build/*/kernel_snapshot.d
|
||||||
|
|
||||||
|
# Helper wrapper to run flutter when building flutter applications.
|
||||||
|
HOST_FLUTTER_SDK_BIN_FLUTTER = \
|
||||||
|
$(HOST_FLUTTER_SDK_BIN_ENV) \
|
||||||
|
$(HOST_FLUTTER_SDK_BIN_SDK)/bin/flutter
|
||||||
|
|
||||||
|
# Helper wrapper to run dart when building flutter applications.
|
||||||
|
HOST_FLUTTER_SDK_BIN_DART_BIN = \
|
||||||
|
$(HOST_FLUTTER_SDK_BIN_ENV) \
|
||||||
|
$(HOST_FLUTTER_SDK_BIN_DART_SDK)/bin/dart \
|
||||||
|
$(HOST_FLUTTER_SDK_BIN_DART_ARGS)
|
||||||
|
|
||||||
|
$(eval $(host-generic-package))
|
||||||
|
|
||||||
|
# For target packages to locate said pub-cache
|
||||||
|
FLUTTER_SDK_BIN_PUB_CACHE = $(HOST_FLUTTER_SDK_BIN_SDK)/.pub-cache
|
Loading…
Reference in New Issue
Block a user