From afb3c8bd34771074f6b91c519e3e3c928f3f8f3f Mon Sep 17 00:00:00 2001 From: Leonid Plyushch Date: Thu, 23 May 2019 00:22:43 +0300 Subject: [PATCH] dart: update to 2.3.1 + some fixes (#3858) * dart: update to 2.3.1 * dart: attempt to fix path to /bin/sh * dart: add '~/.pub-cache/bin' to PATH (sh/bash only) --- packages/dart/build.sh | 7 ++++- packages/dart/dart-pub-bin.sh | 3 ++ packages/dart/fix-shell-path.patch | 45 ++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 packages/dart/dart-pub-bin.sh create mode 100644 packages/dart/fix-shell-path.patch diff --git a/packages/dart/build.sh b/packages/dart/build.sh index 37296cbc3..ed8f854ac 100644 --- a/packages/dart/build.sh +++ b/packages/dart/build.sh @@ -1,7 +1,7 @@ TERMUX_PKG_HOMEPAGE=https://www.dartlang.org/ TERMUX_PKG_DESCRIPTION="Dart is a general-purpose programming language." TERMUX_PKG_LICENSE="BSD" -TERMUX_PKG_VERSION=2.3.0 +TERMUX_PKG_VERSION=2.3.1 TERMUX_PKG_SKIP_SRC_EXTRACT=1 TERMUX_PKG_BUILD_IN_SRC=yes @@ -68,3 +68,8 @@ termux_step_make_install() { fi done } + +termux_step_post_make_install() { + install -Dm600 $TERMUX_PKG_BUILDER_DIR/dart-pub-bin.sh \ + $TERMUX_PREFIX/etc/profile.d/dart-pub-bin.sh +} diff --git a/packages/dart/dart-pub-bin.sh b/packages/dart/dart-pub-bin.sh new file mode 100644 index 000000000..4c2cab4f6 --- /dev/null +++ b/packages/dart/dart-pub-bin.sh @@ -0,0 +1,3 @@ +# Executables installed with 'pub global activate' are available +# in directory $HOME/.pub-cache. +export PATH="$HOME/.pub-cache:$PATH" diff --git a/packages/dart/fix-shell-path.patch b/packages/dart/fix-shell-path.patch new file mode 100644 index 000000000..fa21bd14a --- /dev/null +++ b/packages/dart/fix-shell-path.patch @@ -0,0 +1,45 @@ +diff -uNr src/sdk/pkg/front_end/lib/src/api_prototype/terminal_color_support.dart src.mod/sdk/pkg/front_end/lib/src/api_prototype/terminal_color_support.dart +--- src/sdk/pkg/front_end/lib/src/api_prototype/terminal_color_support.dart 2019-05-22 18:59:58.264004304 +0000 ++++ src.mod/sdk/pkg/front_end/lib/src/api_prototype/terminal_color_support.dart 2019-05-22 19:21:02.019682122 +0000 +@@ -55,7 +55,7 @@ + + // Check if stdin is a terminal (TTY). + ProcessResult result = +- Process.runSync("/bin/sh", ["-c", "tty > /dev/null 2> /dev/null"]); ++ Process.runSync("@TERMUX_PREFIX@/bin/sh", ["-c", "tty > /dev/null 2> /dev/null"]); + + if (result.exitCode != 0) { + if (debug) { +@@ -67,7 +67,7 @@ + // The `-S` option of `tput` allows us to query multiple capabilities at + // once. + result = Process.runSync( +- "/bin/sh", ["-c", "printf '%s' '$TERMINAL_CAPABILITIES' | tput -S"]); ++ "@TERMUX_PREFIX@/bin/sh", ["-c", "printf '%s' '$TERMINAL_CAPABILITIES' | tput -S"]); + + if (result.exitCode != 0) { + if (debug) { +diff -uNr src/sdk/pkg/front_end/lib/src/fasta/colors.dart src.mod/sdk/pkg/front_end/lib/src/fasta/colors.dart +--- src/sdk/pkg/front_end/lib/src/fasta/colors.dart 2019-05-22 18:59:58.267004322 +0000 ++++ src.mod/sdk/pkg/front_end/lib/src/fasta/colors.dart 2019-05-22 19:19:14.722850300 +0000 +@@ -154,7 +154,7 @@ + // The `-S` option of `tput` allows us to query multiple capabilities at + // once. + ProcessResult result = Process.runSync( +- "/bin/sh", ["-c", "printf '%s' '$TERMINAL_CAPABILITIES' | tput -S"]); ++ "@TERMUX_PREFIX@/bin/sh", ["-c", "printf '%s' '$TERMINAL_CAPABILITIES' | tput -S"]); + + if (result.exitCode != 0) { + if (context.options.verbose) { +diff -uNr src/sdk/runtime/bin/process_patch.dart src.mod/sdk/runtime/bin/process_patch.dart +--- src/sdk/runtime/bin/process_patch.dart 2019-05-22 18:59:58.641006510 +0000 ++++ src.mod/sdk/runtime/bin/process_patch.dart 2019-05-22 19:15:52.594173281 +0000 +@@ -321,7 +321,7 @@ + if (Platform.isWindows) { + return 'cmd.exe'; + } +- return '/bin/sh'; ++ return '@TERMUX_PREFIX@/bin/sh'; + } + + static List _getShellArguments(