Skip to content

Commit

Permalink
build ton from tonlib repository
Browse files Browse the repository at this point in the history
  • Loading branch information
overtake committed Nov 6, 2019
1 parent e6accb2 commit 23a7fce
Show file tree
Hide file tree
Showing 45 changed files with 208 additions and 4,221 deletions.
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "Signals"]
path = Signals
url = https://github.com/peter-iakovlev/Signals.git
[submodule "submodules/libtgvoip"]
path = submodules/libtgvoip
url=git@github.com:telegramdesktop/libtgvoip
Expand All @@ -19,3 +16,6 @@ url=git@gitlab.com:peter-iakovlev/telegram-ios.git
[submodule "submodules/rlottie"]
path = submodules/rlottie
url=git@github.com:overtake/rlottie.git
[submodule "submodules/ton"]
path = submodules/ton
url = git@github.com:ton-blockchain/ton.git
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Telegram-Mac/InAppLinks.swift"
timestampString = "594726001.5698251"
timestampString = "594743706.743349"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "748"
Expand All @@ -115,7 +115,7 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Telegram-Mac/InAppLinks.swift"
timestampString = "594726001.569888"
timestampString = "594743706.743557"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "742"
Expand Down
2 changes: 1 addition & 1 deletion Telegram-Mac/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>185679</string>
<string>185684</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.social-networking</string>
<key>LSFileQuarantineEnabled</key>
Expand Down
2 changes: 1 addition & 1 deletion TelegramShare/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleShortVersionString</key>
<string>5.8.1</string>
<key>CFBundleVersion</key>
<string>185679</string>
<string>185684</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSExtension</key>
Expand Down
10 changes: 10 additions & 0 deletions core-xprojects/TonBinding/TonBinding/TonBinding.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//
// TonBinding.xcconfig
// TonBinding
//
// Created by Mikhail Filimonov on 06.11.2019.
// Copyright © 2019 Telegram. All rights reserved.
//

// Configuration settings file format documentation can be found at:
// https://help.apple.com/xcode/#/dev745c5c974
62 changes: 62 additions & 0 deletions core-xprojects/TonBinding/TonBinding/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#/bin/sh

set -x
set -e

OUT_DIR="$1"
SOURCE_DIR="$2"
openssl_base_path="$3"
if [ -z "$openssl_base_path" ]; then
echo "Usage: sh build.sh path/to/openssl"
exit 1
fi

if [ ! -d "$openssl_base_path" ]; then
echo "$openssl_base_path not found"
exit 1
fi

if [ -d "$OUT_DIR/build/out" ]
then
exit 0
fi

td_path="$SOURCE_DIR"

mkdir -p "$OUT_DIR"
mkdir -p "$OUT_DIR/build"
cd "$OUT_DIR/build"

platforms="macOS"
for platform in $platforms; do
install="install-${platform}"
build="build-${platform}"
openssl_path="$openssl_base_path"
echo "OpenSSL path = ${openssl_path}"
openssl_crypto_library="${openssl_path}/lib/libcrypto.a"
options="$options -DOPENSSL_FOUND=1"
options="$options -DOPENSSL_CRYPTO_LIBRARY=${openssl_crypto_library}"
options="$options -DOPENSSL_INCLUDE_DIR=${openssl_path}/include"
options="$options -DOPENSSL_LIBRARIES=${openssl_crypto_library}"
options="$options -DTON_ONLY_TONLIB=ON"
options="$options -DCMAKE_BUILD_TYPE=Release"
options="$options -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11"
rm -rf $build
mkdir -p $build
mkdir -p $install
cd $build
cmake $td_path $options -DCMAKE_INSTALL_PREFIX=../${install} ${SOURCE_DIR} -GNinja
ninja install || exit
cd ..
done
mkdir -p $platform

mkdir -p "out"
cp -r "install-macOS/include" "out/"
mkdir -p "out/lib"

for f in install-macOS/lib/*.a; do
lib_name=$(basename "$f")
lipo -create "install-macOS/lib/$lib_name" -o "out/lib/$lib_name"
done

274 changes: 119 additions & 155 deletions core-xprojects/TonBinding/TonBinding_Xcode.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "DebugHockeyapp"
buildConfiguration = "DebugAppStore"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,7 @@
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = (
"../../thrid-party/openssl/lib/",
"../../thrid-party/ton/lib/",
);
LIBRARY_SEARCH_PATHS = "../../thrid-party/openssl/lib";
MACH_O_TYPE = mh_dylib;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = org.telegram.WalletCore;
Expand Down Expand Up @@ -356,10 +353,7 @@
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = (
"../../thrid-party/openssl/lib/",
"../../thrid-party/ton/lib/",
);
LIBRARY_SEARCH_PATHS = "../../thrid-party/openssl/lib";
MACH_O_TYPE = mh_dylib;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = org.telegram.WalletCore;
Expand Down Expand Up @@ -447,10 +441,7 @@
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = (
"../../thrid-party/openssl/lib/",
"../../thrid-party/ton/lib/",
);
LIBRARY_SEARCH_PATHS = "../../thrid-party/openssl/lib";
MACH_O_TYPE = mh_dylib;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = org.telegram.WalletCore;
Expand Down Expand Up @@ -538,10 +529,7 @@
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = (
"../../thrid-party/openssl/lib/",
"../../thrid-party/ton/lib/",
);
LIBRARY_SEARCH_PATHS = "../../thrid-party/openssl/lib";
MACH_O_TYPE = mh_dylib;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = org.telegram.WalletCore;
Expand Down Expand Up @@ -629,10 +617,7 @@
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = (
"../../thrid-party/openssl/lib/",
"../../thrid-party/ton/lib/",
);
LIBRARY_SEARCH_PATHS = "../../thrid-party/openssl/lib";
MACH_O_TYPE = mh_dylib;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = org.telegram.WalletCore;
Expand Down
2 changes: 1 addition & 1 deletion submodules/Zip
Submodule Zip updated from 673ff6 to 2f2dfb
2 changes: 1 addition & 1 deletion submodules/rlottie
2 changes: 1 addition & 1 deletion submodules/telegram-ios
Submodule telegram-ios updated from 6df7b4 to c8d927
1 change: 1 addition & 0 deletions submodules/ton
Submodule ton added at 950e29
Loading

0 comments on commit 23a7fce

Please sign in to comment.