Skip to content

Commit

Permalink
Simplify ndk location
Browse files Browse the repository at this point in the history
  • Loading branch information
jarnedemeulemeester committed Jan 1, 2023
1 parent 86c4b0a commit 652799b
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 28 deletions.
23 changes: 4 additions & 19 deletions buildscripts/include/download-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,10 @@ sdkmanager () {
"$exe" --sdk_root="${ANDROID_HOME}" "$@"
}
echo y | sdkmanager \
"platforms;android-33" "build-tools;${v_sdk_build_tools}" "cmake;3.22.1"

# Android NDK (either standalone or installed by SDK)
if [ -d "android-ndk-${v_ndk}" ]; then
:
elif [ -d "android-sdk-$os/ndk/${v_ndk_n}" ]; then
ln -s "android-sdk-$os/ndk/${v_ndk_n}" "android-ndk-${v_ndk}"
elif [ -z "${os_ndk}" ]; then
echo y | sdkmanager "ndk;${v_ndk_n}"
ln -s "android-sdk-$os/ndk/${v_ndk_n}" "android-ndk-${v_ndk}"
else
$WGET "http://dl.google.com/android/repository/android-ndk-${v_ndk}-${os_ndk}.zip"
unzip -q "android-ndk-${v_ndk}-${os_ndk}.zip"
rm "android-ndk-${v_ndk}-${os_ndk}.zip"
fi
if ! grep -qF "${v_ndk_n}" "android-ndk-${v_ndk}/source.properties"; then
echo "Error: NDK exists but is not the correct version (expecting ${v_ndk_n})"
exit 255
fi
"platforms;android-33" \
"build-tools;${v_sdk_build_tools}" \
"ndk;${v_ndk_n}" \
"cmake;3.22.1"

# gas-preprocessor
mkdir -p bin
Expand Down
4 changes: 2 additions & 2 deletions buildscripts/include/path.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ if [ -n "$ndk_triple" ]; then
unset PKG_CONFIG_PATH
fi

toolchain=$(echo "$DIR/sdk/android-ndk-r25b/toolchains/llvm/prebuilt/"*)
export PATH="$toolchain/bin:$DIR/sdk/android-ndk-r25b:$DIR/sdk/bin:$PATH"
toolchain=$(echo "$DIR/sdk/android-sdk-linux/ndk/$v_ndk_n/toolchains/llvm/prebuilt/"*)
export PATH="$toolchain/bin:$DIR/sdk/android-sdk-linux/ndk/$v_ndk_n:$DIR/sdk/bin:$PATH"
export ANDROID_HOME="$DIR/sdk/android-sdk-$os"
1 change: 1 addition & 0 deletions buildscripts/scripts/dav1d.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash -e

. ../../include/depinfo.sh
. ../../include/path.sh

build=_build$ndk_suffix
Expand Down
9 changes: 2 additions & 7 deletions buildscripts/scripts/ffmpeg.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash -e

. ../../include/depinfo.sh
. ../../include/path.sh

if [ "$1" == "build" ]; then
Expand Down Expand Up @@ -29,13 +30,7 @@ cpuflags=
--enable-{jni,mediacodec,mbedtls,libdav1d} --disable-vulkan \
--disable-static --enable-shared --enable-{gpl,version3} \
--disable-{stripping,doc,programs} \
--disable-{muxers,encoders,devices,filters} \
#--disable-decoders \
#--enable-decoder={h264,h264_mediacodec,hevc,hevc_mediacodec,vp8,vp8_mediacodec,vp9,vp9_mediacodec,mpeg2video,mpeg2_mediacodec,mpeg4,mpeg4_mediacodec,av1_mediacodec,ssa,srt,dvdsub,webvtt,aac,flac,ac3,eac3,truehd,dca,opus,libdav1d,vorbis,subrip} \
#--disable-demuxers \
#--enable-demuxer={matroska,mov,avi,srt,ass,webvtt,hls,mpegts,mpegvideo} \
#--disable-parsers \
#--enable-parser={aac,ac3,flac,h264,hevc,dvdsub,opus,vp8,vp9,vorbis,mpegvideo}
--disable-{muxers,encoders,devices,filters}

make -j$cores
make DESTDIR="$prefix_dir" install
Expand Down
1 change: 1 addition & 0 deletions buildscripts/scripts/freetype.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash -e

. ../../include/depinfo.sh
. ../../include/path.sh

build=_build$ndk_suffix
Expand Down
1 change: 1 addition & 0 deletions buildscripts/scripts/fribidi.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash -e

. ../../include/depinfo.sh
. ../../include/path.sh

build=_build$ndk_suffix
Expand Down
1 change: 1 addition & 0 deletions buildscripts/scripts/harfbuzz.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash -e

. ../../include/depinfo.sh
. ../../include/path.sh

build=_build$ndk_suffix
Expand Down
1 change: 1 addition & 0 deletions buildscripts/scripts/libass.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash -e

. ../../include/depinfo.sh
. ../../include/path.sh

if [ "$1" == "build" ]; then
Expand Down
1 change: 1 addition & 0 deletions buildscripts/scripts/libplacebo.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash -e

. ../../include/depinfo.sh
. ../../include/path.sh

build=_build$ndk_suffix
Expand Down
1 change: 1 addition & 0 deletions buildscripts/scripts/lua.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash -e

. ../../include/depinfo.sh
. ../../include/path.sh

if [ "$1" == "build" ]; then
Expand Down
1 change: 1 addition & 0 deletions buildscripts/scripts/mbedtls.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash -e

. ../../include/depinfo.sh
. ../../include/path.sh

if [ "$1" == "build" ]; then
Expand Down
1 change: 1 addition & 0 deletions buildscripts/scripts/mpv.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash -e

. ../../include/depinfo.sh
. ../../include/path.sh

if [ "$1" == "build" ]; then
Expand Down
1 change: 1 addition & 0 deletions buildscripts/scripts/shaderc.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash -e

. ../../include/depinfo.sh
. ../../include/path.sh

if [ "$1" == "build" ]; then
Expand Down

0 comments on commit 652799b

Please sign in to comment.