Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sgxwallet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董子豪
sgxwallet
Commits
b1c851b5
Unverified
Commit
b1c851b5
authored
Dec 13, 2019
by
Sergiy Lavrynenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-1850 improved deps build script
parent
cdb966f3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
83 deletions
+28
-83
build.py
scripts/build.py
+28
-83
No files found.
scripts/build.py
View file @
b1c851b5
#!/usr/bin/env python
#------------------------------------------------------------------------------
#
------------------------------------------------------------------------------
# Bash script to build cpp-ethereum within TravisCI.
#
# The documentation for cpp-ethereum is hosted at http://cpp-ethereum.org
...
...
@@ -22,7 +22,7 @@
# along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>
#
# (c) 2016 cpp-ethereum contributors.
#------------------------------------------------------------------------------
#
------------------------------------------------------------------------------
#
# Copyright (C) 2018-2019 SKALE Labs
#
...
...
@@ -49,17 +49,11 @@
import
sys
import
os
import
subprocess
os
.
chdir
(
".."
);
topDir
=
os
.
getcwd
();
os
.
chdir
(
".."
)
topDir
=
os
.
getcwd
()
print
(
"Starting build"
)
print
(
"Top directory is:"
+
topDir
)
print
(
"Top directory is:"
+
topDir
)
makeExecutable
=
subprocess
.
check_output
([
"which"
,
"make"
])
SCRIPTS_DIR
=
topDir
+
"/scripts"
GMP_DIR
=
topDir
+
"/sgx-gmp"
SSL_DIR
=
topDir
+
"/intel-sgx-ssl"
...
...
@@ -67,112 +61,63 @@ SSL_SOURCE_DIR = SSL_DIR + "/openssl_source"
SSL_MAKE_DIR
=
SSL_DIR
+
"/Linux"
SGX_SDK_DIR_SSL
=
topDir
+
"/sgx-sdk-build/sgxsdk"
LEVELDB_DIR
=
topDir
+
"/leveldb"
LEVELDB_BUILD_DIR
=
LEVELDB_DIR
+
"/build"
GMP_BUILD_DIR
=
topDir
+
"/gmp-build"
TGMP_BUILD_DIR
=
topDir
+
"/tgmp-build"
SDK_DIR
=
topDir
+
"/sgx-sdk-build"
BLS_DIR
=
topDir
+
"/libBLS"
BLS_BUILD_DIR
=
BLS_DIR
+
"/build"
AUTOMAKE_DIR
=
"/usr/share/automake-1.15"
if
not
os
.
path
.
isdir
(
AUTOMAKE_DIR
):
raise
Exception
(
"Could not find "
+
AUTOMAKE_DIR
)
subprocess
.
call
([
"git"
,
"submodule"
,
"update"
,
"--init"
])
#subprocess.call(["git", "submodule", "update", "--init"])
subprocess
.
call
([
"rm"
,
"-f"
,
"install-sh"
])
subprocess
.
call
([
"rm"
,
"-f"
,
"compile"
])
subprocess
.
call
([
"rm"
,
"-f"
,
"missing"
])
subprocess
.
call
([
"rm"
,
"-f"
,
"depcomp"
])
subprocess
.
call
([
"rm"
,
"-rf"
,
GMP_BUILD_DIR
])
subprocess
.
call
([
"rm"
,
"-rf"
,
TGMP_BUILD_DIR
])
subprocess
.
call
([
"rm"
,
"-rf"
,
SDK_DIR
])
subprocess
.
call
([
"ln"
,
"-s"
,
AUTOMAKE_DIR
+
"/install-sh"
,
"install-sh"
])
subprocess
.
call
([
"ln"
,
"-s"
,
AUTOMAKE_DIR
+
"/depcomp"
,
"depcomp"
])
subprocess
.
call
([
"ln"
,
"-s"
,
AUTOMAKE_DIR
+
"/missing"
,
"missing"
])
subprocess
.
call
([
"ln"
,
"-s"
,
AUTOMAKE_DIR
+
"/compile"
,
"compile"
])
assert
subprocess
.
call
([
"cp"
,
"configure.gmp"
,
GMP_DIR
+
"/configure"
])
==
0
os
.
chdir
(
LEVELDB_DIR
);
assert
subprocess
.
call
([
"bash"
,
"-c"
,
"mkdir -p build"
])
==
0
os
.
chdir
(
LEVELDB_BUILD_DIR
);
assert
subprocess
.
call
([
"bash"
,
"-c"
,
"cmake -DCMAKE_BUILD_TYPE=Release .. && cmake --build ."
])
==
0
os
.
chdir
(
BLS_DIR
);
assert
subprocess
.
call
([
"bash"
,
"-c"
,
"cmake -H. -Bbuild"
])
==
0
os
.
chdir
(
BLS_BUILD_DIR
);
assert
subprocess
.
call
([
"bash"
,
"-c"
,
"make"
])
==
0
os
.
chdir
(
LEVELDB_DIR
)
assert
subprocess
.
call
([
"bash"
,
"-c"
,
"mkdir -p build"
])
==
0
os
.
chdir
(
LEVELDB_BUILD_DIR
)
assert
subprocess
.
call
([
"bash"
,
"-c"
,
"cmake -DCMAKE_BUILD_TYPE=Release .. && cmake --build ."
])
==
0
os
.
chdir
(
BLS_DIR
+
"/deps"
)
assert
subprocess
.
call
([
"bash"
,
"-c"
,
"./build.sh"
])
==
0
os
.
chdir
(
BLS_DIR
)
assert
subprocess
.
call
([
"bash"
,
"-c"
,
"cmake -H. -Bbuild"
])
==
0
os
.
chdir
(
BLS_DIR
+
"/build"
)
assert
subprocess
.
call
([
"bash"
,
"-c"
,
"make"
])
==
0
os
.
chdir
(
SCRIPTS_DIR
)
assert
subprocess
.
call
([
"bash"
,
"-c"
,
"./sgx_linux_x64_sdk_2.5.100.49891.bin --prefix="
+
topDir
+
"/sgx-sdk-build"
])
==
0
assert
subprocess
.
call
([
"bash"
,
"-c"
,
"./sgx_linux_x64_sdk_2.5.100.49891.bin --prefix="
+
topDir
+
"/sgx-sdk-build"
])
==
0
os
.
chdir
(
GMP_DIR
);
assert
subprocess
.
call
([
"bash"
,
"-c"
,
"./configure --prefix="
+
TGMP_BUILD_DIR
+
" --disable-shared "
+
" --enable-static --with-pic --enable-sgx --with-sgxsdk="
+
SDK_DIR
+
"/sgxsdk"
])
==
0
os
.
chdir
(
GMP_DIR
)
assert
subprocess
.
call
([
"bash"
,
"-c"
,
"./configure --prefix="
+
TGMP_BUILD_DIR
+
" --disable-shared --enable-static --with-pic --enable-sgx --with-sgxsdk="
+
SDK_DIR
+
"/sgxsdk"
])
==
0
assert
subprocess
.
call
([
"make"
,
"install"
])
==
0
assert
subprocess
.
call
([
"make"
,
"clean"
])
==
0
assert
subprocess
.
call
([
"bash"
,
"-c"
,
"./configure --prefix="
+
GMP_BUILD_DIR
+
" --disable-shared --enable-static --with-pic --with-sgxsdk="
+
SDK_DIR
+
"/sgxsdk"
])
==
0
assert
subprocess
.
call
([
"bash"
,
"-c"
,
"./configure --prefix="
+
GMP_BUILD_DIR
+
" --disable-shared "
+
" --enable-static --with-pic --with-sgxsdk="
+
SDK_DIR
+
"/sgxsdk"
])
==
0
assert
subprocess
.
call
([
"make"
,
"install"
])
==
0
assert
subprocess
.
call
([
"make"
,
"clean"
])
==
0
os
.
chdir
(
topDir
)
assert
subprocess
.
call
([
"cp"
,
"sgx_tgmp.h"
,
TGMP_BUILD_DIR
+
"/include/sgx_tgmp.h"
])
==
0
os
.
chdir
(
SSL_DIR
);
os
.
chdir
(
SSL_DIR
)
print
"===>>> Downloading vanilla openssl source package"
os
.
chdir
(
SSL_SOURCE_DIR
);
os
.
chdir
(
SSL_SOURCE_DIR
)
assert
subprocess
.
call
([
"wget"
,
"https://www.openssl.org/source/openssl-1.1.1b.tar.gz"
])
==
0
print
"===>>> Making SSL project"
os
.
chdir
(
SSL_MAKE_DIR
);
os
.
chdir
(
SSL_MAKE_DIR
)
assert
subprocess
.
call
([
"make"
,
"SGX_SDK="
+
SGX_SDK_DIR_SSL
,
"all"
,
"test"
])
==
0
os
.
chdir
(
topDir
)
print
(
"Build successfull."
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment