-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
77eb00c
commit 2bac52f
Showing
1 changed file
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
TERMUX_PKG_HOMEPAGE=https://www.dartlang.org/ | ||
TERMUX_PKG_DESCRIPTION="Dart is a general-purpose programming language." | ||
TERMUX_PKG_LICENSE="https://raw.githubusercontent.com/dart-lang/sdk/master/LICENSE" | ||
TERMUX_PKG_VERSION=2.2.0 | ||
TERMUX_PKG_BUILD_DEPENDS="python, python2" | ||
DART_MAKE_PLATFORM_SDK=true | ||
|
||
termux_step_extract_package() { | ||
mkdir -p $TERMUX_PKG_SRCDIR | ||
cd $TERMUX_PKG_SRCDIR | ||
|
||
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git | ||
export PATH="$(pwd)/depot_tools:${PATH}" | ||
|
||
fetch dart | ||
|
||
cd sdk | ||
git checkout $TERMUX_PKG_VERSION | ||
cd ../ | ||
|
||
echo "target_os = ['android']" >> .gclient | ||
gclient sync -D --force --reset | ||
|
||
export TERMUX_PKG_SRCDIR=$(pwd)/sdk | ||
export TERMUX_PKG_BUILDDIR=$(pwd) | ||
} | ||
|
||
termux_step_configure() { | ||
return | ||
} | ||
|
||
termux_step_make() { | ||
cd $TERMUX_PKG_SRCDIR | ||
|
||
local DEST_CPU | ||
if [ $TERMUX_ARCH = "arm" ]; then | ||
DEST_CPU="arm" | ||
elif [ $TERMUX_ARCH = "i686" ]; then | ||
DEST_CPU="ia32" | ||
elif [ $TERMUX_ARCH = "aarch64" ]; then | ||
DEST_CPU="arm64" | ||
elif [ $TERMUX_ARCH = "x86_64" ]; then | ||
DEST_CPU="x64" | ||
else | ||
termux_error_exit "Unsupported arch '$TERMUX_ARCH'" | ||
fi | ||
|
||
rm -f ./out/*/args.gn | ||
python2 ./tools/build.py --mode release --arch=$DEST_CPU --os=android create_sdk | ||
} | ||
|
||
termux_step_make_install() { | ||
cd $TERMUX_PKG_SRCDIR | ||
|
||
local DEST_CPU | ||
if [ $TERMUX_ARCH = "arm" ]; then | ||
DEST_CPU="ARM" | ||
elif [ $TERMUX_ARCH = "i686" ]; then | ||
DEST_CPU="IA32" | ||
elif [ $TERMUX_ARCH = "aarch64" ]; then | ||
DEST_CPU="ARM64" | ||
elif [ $TERMUX_ARCH = "x86_64" ]; then | ||
DEST_CPU="X64" | ||
else | ||
termux_error_exit "Unsupported arch '$TERMUX_ARCH'" | ||
fi | ||
|
||
rm -rf ${TERMUX_PREFIX}/lib/dart-sdk | ||
cp -a ./out/ReleaseAndroid${DEST_CPU}/dart-sdk ${TERMUX_PREFIX}/lib/dart-sdk | ||
} |