mirror of https://github.com/NekoX-Dev/NekoX.git
sync native with tfoss
This commit is contained in:
parent
054494a475
commit
af9c719d69
|
@ -17,9 +17,9 @@ ${CMAKE_HOME_DIRECTORY}/boringssl/build/${ANDROID_ABI}/crypto/libcrypto.a")
|
|||
|
||||
if (${ANDROID_ABI} STREQUAL "armeabi-v7a" OR ${ANDROID_ABI} STREQUAL "arm64-v8a")
|
||||
enable_language(ASM)
|
||||
else ()
|
||||
else()
|
||||
enable_language(ASM_NASM)
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
add_library(avutil STATIC IMPORTED)
|
||||
set_target_properties(avutil PROPERTIES IMPORTED_LOCATION ${CMAKE_HOME_DIRECTORY}/ffmpeg/build/${ANDROID_ABI}/lib/libavutil.a)
|
||||
|
|
|
@ -63,6 +63,7 @@ echo "Configuring..."
|
|||
--enable-decoder=alac \
|
||||
--enable-demuxer=mov \
|
||||
--enable-demuxer=gif \
|
||||
--enable-demuxer=ogg \
|
||||
--enable-hwaccels \
|
||||
--enable-runtime-cpudetect \
|
||||
$ADDITIONAL_CONFIGURE_FLAG
|
||||
|
|
|
@ -9,6 +9,10 @@ function build_one {
|
|||
NM="${CROSS_PREFIX}nm"
|
||||
STRIP="${CROSS_PREFIX}strip"
|
||||
|
||||
echo "Cleaning..."
|
||||
rm -f config.h
|
||||
make clean || true
|
||||
rm -rf ${TOOLCHAIN_PREFIX}
|
||||
|
||||
echo "Toolchain..."
|
||||
python $NDK/build/tools/make_standalone_toolchain.py \
|
||||
|
@ -78,6 +82,7 @@ function build_one {
|
|||
--enable-decoder=alac \
|
||||
--enable-demuxer=mov \
|
||||
--enable-demuxer=gif \
|
||||
--enable-demuxer=ogg \
|
||||
--enable-hwaccels \
|
||||
$ADDITIONAL_CONFIGURE_FLAG
|
||||
|
||||
|
@ -85,12 +90,6 @@ function build_one {
|
|||
#read
|
||||
make -j$COMPILATION_PROC_COUNT
|
||||
make install
|
||||
|
||||
echo "Cleaning..."
|
||||
rm -f config.h
|
||||
make clean || true
|
||||
rm -rf ${TOOLCHAIN_PREFIX}
|
||||
|
||||
}
|
||||
|
||||
function setCurrentPlatform {
|
||||
|
@ -191,4 +190,4 @@ CPU=i686
|
|||
OPTIMIZE_CFLAGS="-march=$CPU"
|
||||
PREFIX=./build/x86
|
||||
ADDITIONAL_CONFIGURE_FLAG="--disable-x86asm --disable-inline-asm --disable-asm"
|
||||
build_one
|
||||
build_one
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 89daac5fe2edb86f45fbd3281ac680bc598d6a97
|
||||
Subproject commit f719f869907764e6412a6af6e178c46e5f915d25
|
|
@ -1 +1 @@
|
|||
Subproject commit 47f64f6eddb9da0d1271c4af9a87ac78244f0b57
|
||||
Subproject commit 113968ca47b1d1affbfe88472364b15699e239d6
|
|
@ -3,27 +3,38 @@
|
|||
set -e
|
||||
|
||||
patch -d ffmpeg -p1 < patches/ffmpeg/0001-compilation-magic.patch
|
||||
patch -d ffmpeg -p1 < patches/ffmpeg/0002-compilation-magic-2.patch
|
||||
|
||||
libavformat=('dv.h' 'isom.h')
|
||||
libavcodec=('bytestream.h' 'get_bits.h' 'put_bits.h' 'golomb.h' 'vlc.h')
|
||||
libavutil=('intmath.h' 'reverse.h')
|
||||
cp ffmpeg/libavformat/dv.h ffmpeg/build/arm64-v8a/include/libavformat/dv.h
|
||||
cp ffmpeg/libavformat/isom.h ffmpeg/build/arm64-v8a/include/libavformat/isom.h
|
||||
cp ffmpeg/libavformat/dv.h ffmpeg/build/armeabi-v7a/include/libavformat/dv.h
|
||||
cp ffmpeg/libavformat/isom.h ffmpeg/build/armeabi-v7a/include/libavformat/isom.h
|
||||
cp ffmpeg/libavformat/dv.h ffmpeg/build/x86/include/libavformat/dv.h
|
||||
cp ffmpeg/libavformat/isom.h ffmpeg/build/x86/include/libavformat/isom.h
|
||||
cp ffmpeg/libavformat/dv.h ffmpeg/build/x86_64/include/libavformat/dv.h
|
||||
cp ffmpeg/libavformat/isom.h ffmpeg/build/x86_64/include/libavformat/isom.h
|
||||
|
||||
for arch in arm64-v8a armeabi-v7a x86 x86_64
|
||||
do
|
||||
for file in ${libavformat[*]}
|
||||
do
|
||||
cp ffmpeg/libavformat/"$file" ffmpeg/build/$arch/include/libavformat/"$file"
|
||||
done
|
||||
cp ffmpeg/libavcodec/bytestream.h ffmpeg/build/arm64-v8a/include/libavcodec/bytestream.h
|
||||
cp ffmpeg/libavcodec/bytestream.h ffmpeg/build/armeabi-v7a/include/libavcodec/bytestream.h
|
||||
cp ffmpeg/libavcodec/bytestream.h ffmpeg/build/x86/include/libavcodec/bytestream.h
|
||||
cp ffmpeg/libavcodec/bytestream.h ffmpeg/build/x86_64/include/libavcodec/bytestream.h
|
||||
|
||||
# fix DrKLo's mystery include since 7.8.0
|
||||
for file in ${libavcodec[*]}
|
||||
do
|
||||
cp ffmpeg/libavcodec/"$file" ffmpeg/build/$arch/include/libavcodec/"$file"
|
||||
done
|
||||
for file in ${libavutil[*]}
|
||||
do
|
||||
cp ffmpeg/libavutil/"$file" ffmpeg/build/$arch/include/libavutil/"$file"
|
||||
done
|
||||
cp ffmpeg_mathops_fix.h ffmpeg/build/$arch/include/libavcodec/ffmpeg_mathops_fix.h
|
||||
sed -i 's/mathops/ffmpeg_mathops_fix/g' ffmpeg/build/$arch/include/libavcodec/get_bits.h
|
||||
done
|
||||
cp ffmpeg/libavcodec/get_bits.h ffmpeg/build/arm64-v8a/include/libavcodec/get_bits.h
|
||||
cp ffmpeg/libavcodec/get_bits.h ffmpeg/build/armeabi-v7a/include/libavcodec/get_bits.h
|
||||
cp ffmpeg/libavcodec/get_bits.h ffmpeg/build/x86/include/libavcodec/get_bits.h
|
||||
cp ffmpeg/libavcodec/get_bits.h ffmpeg/build/x86_64/include/libavcodec/get_bits.h
|
||||
|
||||
cp ffmpeg/libavcodec/golomb.h ffmpeg/build/arm64-v8a/include/libavcodec/golomb.h
|
||||
cp ffmpeg/libavcodec/golomb.h ffmpeg/build/armeabi-v7a/include/libavcodec/golomb.h
|
||||
cp ffmpeg/libavcodec/golomb.h ffmpeg/build/x86/include/libavcodec/golomb.h
|
||||
cp ffmpeg/libavcodec/golomb.h ffmpeg/build/x86_64/include/libavcodec/golomb.h
|
||||
|
||||
cp ffmpeg/libavcodec/vlc.h ffmpeg/build/arm64-v8a/include/libavcodec/vlc.h
|
||||
cp ffmpeg/libavcodec/vlc.h ffmpeg/build/armeabi-v7a/include/libavcodec/vlc.h
|
||||
cp ffmpeg/libavcodec/vlc.h ffmpeg/build/x86/include/libavcodec/vlc.h
|
||||
cp ffmpeg/libavcodec/vlc.h ffmpeg/build/x86_64/include/libavcodec/vlc.h
|
||||
|
||||
cp ffmpeg/libavutil/intmath.h ffmpeg/build/arm64-v8a/include/libavutil/intmath.h
|
||||
cp ffmpeg/libavutil/intmath.h ffmpeg/build/armeabi-v7a/include/libavutil/intmath.h
|
||||
cp ffmpeg/libavutil/intmath.h ffmpeg/build/x86/include/libavutil/intmath.h
|
||||
cp ffmpeg/libavutil/intmath.h ffmpeg/build/x86_64/include/libavutil/intmath.h
|
||||
|
|
|
@ -1,8 +1,19 @@
|
|||
From 02952ace408e331237a1ccd724f072b3e67ceb20 Mon Sep 17 00:00:00 2001
|
||||
From: thermatk <thermatk@thermatk.com>
|
||||
Date: Wed, 23 Jan 2019 22:16:34 +0100
|
||||
Subject: [PATCH] only build what we need
|
||||
|
||||
---
|
||||
CMakeLists.txt | 36 ---------------------
|
||||
crypto/CMakeLists.txt | 74 -------------------------------------------
|
||||
ssl/CMakeLists.txt | 18 ------------------
|
||||
3 files changed, 128 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index f58e853cd..a56305ce5 100644
|
||||
index fd3532664..7fcfb1627 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -564,44 +564,8 @@ if(USE_CUSTOM_LIBCXX)
|
||||
@@ -562,44 +562,8 @@ if(USE_CUSTOM_LIBCXX)
|
||||
target_link_libraries(libcxx libcxxabi)
|
||||
endif()
|
||||
|
||||
|
@ -47,11 +58,10 @@ index f58e853cd..a56305ce5 100644
|
|||
|
||||
if(FUZZ)
|
||||
if(LIBFUZZER_FROM_DEPS)
|
||||
@@ -617,39 +581,4 @@ endif()
|
||||
|
||||
@@ -589,38 +564,3 @@ endif()
|
||||
if(UNIX AND NOT APPLE AND NOT ANDROID)
|
||||
set(HANDSHAKER_ARGS "-handshaker-path" $<TARGET_FILE:handshaker>)
|
||||
-endif()
|
||||
endif()
|
||||
-
|
||||
-if(FIPS)
|
||||
- add_custom_target(
|
||||
|
@ -87,13 +97,11 @@ index f58e853cd..a56305ce5 100644
|
|||
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
- DEPENDS all_tests bssl_shim handshaker fips_specific_tests_if_any
|
||||
- USES_TERMINAL)
|
||||
+endif()
|
||||
\ No newline at end of file
|
||||
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt
|
||||
index cde92b591..1807d036a 100644
|
||||
index e940f7d5f..f5221d70d 100644
|
||||
--- a/crypto/CMakeLists.txt
|
||||
+++ b/crypto/CMakeLists.txt
|
||||
@@ -91,7 +91,6 @@ function(perlasm dest src)
|
||||
@@ -85,7 +85,6 @@ function(perlasm dest src)
|
||||
endfunction()
|
||||
|
||||
add_subdirectory(fipsmodule)
|
||||
|
@ -101,10 +109,13 @@ index cde92b591..1807d036a 100644
|
|||
|
||||
if(FIPS_DELOCATE OR FIPS_SHARED)
|
||||
SET_SOURCE_FILES_PROPERTIES(fipsmodule/bcm.o PROPERTIES EXTERNAL_OBJECT true)
|
||||
@@ -475,93 +474,4 @@ endif()
|
||||
|
||||
# urandom_test is a separate binary because it needs to be able to observe the
|
||||
# PRNG initialisation, which means that it can't have other tests running before
|
||||
@@ -466,96 +466,3 @@ endif()
|
||||
if(USE_CUSTOM_LIBCXX)
|
||||
target_link_libraries(crypto libcxx)
|
||||
endif()
|
||||
-
|
||||
-# urandom_test is a separate binary because it needs to be able to observe the
|
||||
-# PRNG initialisation, which means that it can't have other tests running before
|
||||
-# it does.
|
||||
-add_executable(
|
||||
- urandom_test
|
||||
|
@ -195,8 +206,6 @@ index cde92b591..1807d036a 100644
|
|||
- target_link_libraries(crypto_test ws2_32)
|
||||
-endif()
|
||||
-add_dependencies(all_tests crypto_test)
|
||||
+# it does.
|
||||
\ No newline at end of file
|
||||
diff --git a/ssl/CMakeLists.txt b/ssl/CMakeLists.txt
|
||||
index 0fb532eae..f5cab9807 100644
|
||||
--- a/ssl/CMakeLists.txt
|
||||
|
@ -223,3 +232,6 @@ index 0fb532eae..f5cab9807 100644
|
|||
- target_link_libraries(ssl_test ws2_32)
|
||||
-endif()
|
||||
-add_dependencies(all_tests ssl_test)
|
||||
--
|
||||
2.20.1
|
||||
|
||||
|
|
|
@ -35,12 +35,6 @@ public:
|
|||
void setOverrideProxy(std::string address, uint16_t port, std::string username, std::string password, std::string secret);
|
||||
void onHostNameResolved(std::string host, std::string ip, bool ipv6);
|
||||
|
||||
std::string overrideProxyUser = "";
|
||||
std::string overrideProxyPassword = "";
|
||||
std::string overrideProxyAddress = "";
|
||||
std::string overrideProxySecret = "";
|
||||
uint16_t overrideProxyPort = 1080;
|
||||
|
||||
protected:
|
||||
int32_t instanceNum;
|
||||
void onEvent(uint32_t events);
|
||||
|
@ -52,6 +46,12 @@ protected:
|
|||
virtual void onConnected() = 0;
|
||||
virtual bool hasPendingRequests() = 0;
|
||||
|
||||
std::string overrideProxyUser = "";
|
||||
std::string overrideProxyPassword = "";
|
||||
std::string overrideProxyAddress = "";
|
||||
std::string overrideProxySecret = "";
|
||||
uint16_t overrideProxyPort = 1080;
|
||||
|
||||
private:
|
||||
ByteStream *outgoingByteStream = nullptr;
|
||||
struct epoll_event eventMask;
|
||||
|
|
|
@ -62,7 +62,6 @@ public:
|
|||
void resumeNetwork(bool partial);
|
||||
void pauseNetwork();
|
||||
void setNetworkAvailable(bool value, int32_t type, bool slow);
|
||||
|
||||
void setIpStrategy(uint8_t value);
|
||||
void init(uint32_t version, int32_t layer, int32_t apiId, std::string deviceModel, std::string systemVersion, std::string appVersion, std::string langCode, std::string systemLangCode, std::string configPath, std::string logPath, std::string regId, std::string cFingerprint, std::string installerId, std::string packageId, int32_t timezoneOffset, int64_t userId, bool isPaused, bool enablePushConnection, bool hasNetwork, int32_t networkType);
|
||||
void setProxySettings(std::string address, uint16_t port, std::string username, std::string password, std::string secret);
|
||||
|
@ -123,11 +122,8 @@ private:
|
|||
TLObject *getRequestWithMessageId(int64_t messageId);
|
||||
void onDatacenterHandshakeComplete(Datacenter *datacenter, HandshakeType type, int32_t timeDiff);
|
||||
void onDatacenterExportAuthorizationComplete(Datacenter *datacenter);
|
||||
|
||||
int64_t generateMessageId();
|
||||
|
||||
uint8_t getIpStratagy();
|
||||
|
||||
bool isNetworkAvailable();
|
||||
|
||||
void scheduleCheckProxyInternal(ProxyCheckInfo *proxyCheckInfo);
|
||||
|
@ -253,7 +249,6 @@ private:
|
|||
friend class Config;
|
||||
friend class FileLog;
|
||||
friend class Handshake;
|
||||
|
||||
};
|
||||
|
||||
#ifdef ANDROID
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
cmake_minimum_required(VERSION 3.6.0)
|
||||
|
||||
#libvpx_yasm
|
||||
if (${ANDROID_ABI} STREQUAL "x86" OR ${ANDROID_ABI} STREQUAL "x86_64")
|
||||
add_library(libvpx_yasm STATIC IMPORTED)
|
||||
set_target_properties(libvpx_yasm PROPERTIES IMPORTED_LOCATION ${CMAKE_HOME_DIRECTORY}/third_party/libvpx/source/libvpx/vpx_dsp/x86/libvpx_${ANDROID_ABI}_yasm.a)
|
||||
endif()
|
||||
#if (${ANDROID_ABI} STREQUAL "x86" OR ${ANDROID_ABI} STREQUAL "x86_64")
|
||||
#add_library(libvpx_yasm STATIC IMPORTED)
|
||||
#set_target_properties(libvpx_yasm PROPERTIES IMPORTED_LOCATION ${CMAKE_HOME_DIRECTORY}/third_party/libvpx/source/libvpx/vpx_dsp/x86/libvpx_${ANDROID_ABI}_yasm.a)
|
||||
#endif()
|
||||
|
||||
#tgvoip
|
||||
add_library(tgvoip STATIC
|
||||
|
|
Loading…
Reference in New Issue