Fix llvm binary tarball requirement
Removed redundant is_llvm_binary_compatible() and fixed zlib prerequisite
This commit is contained in:
parent
be615cb351
commit
74b99152db
@ -245,14 +245,6 @@ def fetch_llvm(llvm_revision):
|
||||
else:
|
||||
get_fresh_llvm()
|
||||
|
||||
def is_llvm_binary_compatible():
|
||||
if DIST == 'Ubuntu':
|
||||
return True
|
||||
if DIST == 'MacOSX':
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def download_llvm_binary():
|
||||
global llvm_flags, tar_required
|
||||
box_draw("Fetching LLVM binary")
|
||||
@ -270,7 +262,7 @@ def download_llvm_binary():
|
||||
os.path.join(llvm_dir, 'bin'))
|
||||
else:
|
||||
tar_required = True
|
||||
if DIST == 'MacOSX':
|
||||
elif DIST == 'MacOSX':
|
||||
subprocess.call("sudo -H pip install lit", shell=True)
|
||||
if tar_required is False:
|
||||
llvm_dir = os.path.join("/opt", "local", "libexec", "llvm-"+llvm_vers)
|
||||
@ -281,6 +273,8 @@ def download_llvm_binary():
|
||||
-DLLVM_TOOLS_BINARY_DIR={5} -DLLVM_TOOL_CLING_BUILD=ON".format(llvm_dir, llvm_config_path,
|
||||
os.path.join(llvm_dir, 'lib'), os.path.join(llvm_dir, 'include'), os.path.join(llvm_dir, 'bin', 'llvm-tblgen'),
|
||||
os.path.join(llvm_dir, 'bin'))
|
||||
else:
|
||||
raise Exception("Building clang using LLVM binary not possible. Please invoke cpt without --with-binary-llvm and --with-llvm-tar flags")
|
||||
if tar_required:
|
||||
llvm_flags = "-DLLVM_BINARY_DIR={0} -DLLVM_CONFIG={1} -DLLVM_LIBRARY_DIR={2} -DLLVM_MAIN_INCLUDE_DIR={3} -DLLVM_TABLEGEN_EXE={4} \
|
||||
-DLLVM_TOOLS_BINARY_DIR={5} -DLLVM_TOOL_CLING_BUILD=ON".format(srcdir, os.path.join(srcdir, 'bin', 'llvm-config'),
|
||||
@ -302,7 +296,7 @@ def download_llvm_binary():
|
||||
exec_subprocess_call('tar xvf clang+llvm-5.0.2-x86_64-apple-darwin.tar.xz', workdir)
|
||||
exec_subprocess_call('sudo mv clang+llvm-5.0.2-x86_64-apple-darwin %s' % srcdir, workdir)
|
||||
else:
|
||||
raise Exception("Building clang using LLVM binary not possible")
|
||||
raise Exception("Building clang using LLVM binary not possible. Please invoke cpt without --with-binary-llvm and --with-llvm-tar flags")
|
||||
# FIXME: Add Fedora and SUSE support
|
||||
|
||||
# TODO Refactor all fetch_ functions to use this class will remove a lot of dup
|
||||
@ -345,7 +339,7 @@ def fetch_clang(llvm_revision):
|
||||
print()
|
||||
return
|
||||
|
||||
if is_llvm_binary_compatible() and args["with_binary_llvm"]:
|
||||
if args["with_binary_llvm"]:
|
||||
dir = workdir
|
||||
else:
|
||||
dir = os.path.join(srcdir, 'tools')
|
||||
@ -388,7 +382,7 @@ def fetch_clang(llvm_revision):
|
||||
|
||||
def fetch_cling(arg):
|
||||
|
||||
if is_llvm_binary_compatible() and args["with_binary_llvm"]:
|
||||
if args["with_binary_llvm"]:
|
||||
global CLING_SRC_DIR
|
||||
CLING_SRC_DIR = os.path.join(clangdir, 'tools', 'cling')
|
||||
dir = clangdir
|
||||
@ -2098,11 +2092,12 @@ if args['check_requirements']:
|
||||
box_draw('Check availability of required softwares')
|
||||
if DIST == 'Ubuntu':
|
||||
install_line = ""
|
||||
prerequisite = ['git', 'cmake', 'gcc', 'g++', 'debhelper', 'devscripts', 'gnupg', 'python', 'SSL']
|
||||
if is_llvm_binary_compatible():
|
||||
prerequisite.extend(['subversion', 'zlib*'])
|
||||
prerequisite = ['git', 'cmake', 'gcc', 'g++', 'debhelper', 'devscripts', 'gnupg', 'python', 'SSL', 'zlib1g-dev']
|
||||
if args["with_binary_llvm"] or args["with_llvm_tar"]:
|
||||
prerequisite.extend(['subversion'])
|
||||
if check_ubuntu('lit') is False:
|
||||
prerequisite.extend(['python-pip'])
|
||||
if args["with_binary_llvm"] and not args["with_llvm_tar"]:
|
||||
if check_ubuntu('llvm-'+llvm_vers+'-dev') is False:
|
||||
llvm_binary_name = 'llvm-{0}-dev'.format(llvm_vers)
|
||||
for pkg in prerequisite:
|
||||
@ -2245,8 +2240,8 @@ Refer to the documentation of CPT for information on setting up your Windows env
|
||||
stdout=None,
|
||||
stderr=subprocess.STDOUT).communicate('yes'.encode('utf-8'))
|
||||
|
||||
if is_llvm_binary_compatible():
|
||||
download_llvm_binary()
|
||||
if args["with_llvm_tar"] or args["with_binary_llvm"]:
|
||||
download_llvm_binary()
|
||||
|
||||
if args['current_dev']:
|
||||
travis_fold_start("git-clone")
|
||||
@ -2254,7 +2249,7 @@ if args['current_dev']:
|
||||
"https://raw.githubusercontent.com/root-project/cling/master/LastKnownGoodLLVMSVNRevision.txt").readline().strip().decode(
|
||||
'utf-8')
|
||||
|
||||
if is_llvm_binary_compatible() and args['with_binary_llvm']:
|
||||
if args['with_binary_llvm']:
|
||||
compile = compile_for_binary
|
||||
install_prefix = install_prefix_for_binary
|
||||
fetch_clang(llvm_revision)
|
||||
@ -2303,7 +2298,7 @@ if args['current_dev']:
|
||||
'cling-' + DIST + '-' + REV + '-' + platform.machine().lower() + '-' + VERSION))
|
||||
install_prefix()
|
||||
if not args['no_test']:
|
||||
if is_llvm_binary_compatible() and args['with_binary_llvm']:
|
||||
if args['with_binary_llvm']:
|
||||
build_filecheck()
|
||||
test_cling()
|
||||
tarball()
|
||||
@ -2313,7 +2308,7 @@ if args['current_dev']:
|
||||
compile(os.path.join(workdir, 'cling-' + VERSION))
|
||||
install_prefix()
|
||||
if not args['no_test']:
|
||||
if is_llvm_binary_compatible() and args['with_binary_llvm']:
|
||||
if args['with_binary_llvm']:
|
||||
build_filecheck()
|
||||
test_cling()
|
||||
tarball_deb()
|
||||
@ -2343,7 +2338,7 @@ if args['current_dev']:
|
||||
compile(os.path.join(workdir, 'cling-' + DIST + '-' + REV + '-' + platform.machine().lower() + '-' + VERSION))
|
||||
install_prefix()
|
||||
if not args['no_test']:
|
||||
if is_llvm_binary_compatible() and args['with_binary_llvm']:
|
||||
if args['with_binary_llvm']:
|
||||
build_filecheck()
|
||||
test_cling()
|
||||
make_dmg()
|
||||
@ -2360,7 +2355,7 @@ if args['current_dev']:
|
||||
compile(os.path.join(workdir, 'cling-' + DIST + '-' + REV + '-' + platform.machine().lower() + '-' + VERSION))
|
||||
install_prefix()
|
||||
if not args['no_test']:
|
||||
if is_llvm_binary_compatible() and args['with_binary_llvm']:
|
||||
if args['with_binary_llvm']:
|
||||
build_filecheck()
|
||||
test_cling()
|
||||
tarball()
|
||||
@ -2382,7 +2377,7 @@ if args['last_stable']:
|
||||
|
||||
args["with_binary_llvm"] = True
|
||||
|
||||
if is_llvm_binary_compatible() and args["with_binary_llvm"]:
|
||||
if args["with_binary_llvm"]:
|
||||
compile = compile_for_binary
|
||||
install_prefix = install_prefix_for_binary
|
||||
fetch_clang(llvm_revision)
|
||||
@ -2407,7 +2402,7 @@ if args['last_stable']:
|
||||
'cling-' + DIST + '-' + REV + '-' + platform.machine().lower() + '-' + VERSION))
|
||||
install_prefix()
|
||||
if not args['no_test']:
|
||||
if is_llvm_binary_compatible() and args['with_binary_llvm']:
|
||||
if args['with_binary_llvm']:
|
||||
build_filecheck()
|
||||
test_cling()
|
||||
tarball()
|
||||
@ -2418,7 +2413,7 @@ if args['last_stable']:
|
||||
compile(os.path.join(workdir, 'cling-' + VERSION))
|
||||
install_prefix()
|
||||
if not args['no_test']:
|
||||
if is_llvm_binary_compatible() and args['with_binary_llvm']:
|
||||
if args['with_binary_llvm']:
|
||||
build_filecheck()
|
||||
test_cling()
|
||||
tarball_deb()
|
||||
@ -2451,7 +2446,7 @@ if args['last_stable']:
|
||||
compile(os.path.join(workdir, 'cling-' + DIST + '-' + REV + '-' + platform.machine().lower() + '-' + VERSION))
|
||||
install_prefix()
|
||||
if not args['no_test']:
|
||||
if is_llvm_binary_compatible() and args['with_binary_llvm']:
|
||||
if args['with_binary_llvm']:
|
||||
build_filecheck()
|
||||
test_cling()
|
||||
make_dmg()
|
||||
@ -2462,7 +2457,7 @@ if args['last_stable']:
|
||||
compile(os.path.join(workdir, 'cling-' + DIST + '-' + REV + '-' + platform.machine().lower() + '-' + VERSION))
|
||||
install_prefix()
|
||||
if not args['no_test']:
|
||||
if is_llvm_binary_compatible() and args['with_binary_llvm']:
|
||||
if args['with_binary_llvm']:
|
||||
build_filecheck()
|
||||
test_cling()
|
||||
tarball()
|
||||
@ -2473,7 +2468,7 @@ if args['tarball_tag']:
|
||||
"https://raw.githubusercontent.com/root-project/cling/%s/LastKnownGoodLLVMSVNRevision.txt" % args[
|
||||
'tarball_tag']).readline().strip().decode(
|
||||
'utf-8')
|
||||
if is_llvm_binary_compatible() and args["with_binary_llvm"]:
|
||||
if args["with_binary_llvm"]:
|
||||
compile = compile_for_binary
|
||||
install_prefix = install_prefix_for_binary
|
||||
fetch_clang(llvm_revision)
|
||||
@ -2497,7 +2492,7 @@ if args['tarball_tag']:
|
||||
|
||||
install_prefix()
|
||||
if not args['no_test']:
|
||||
if is_llvm_binary_compatible() and args['with_binary_llvm']:
|
||||
if args['with_binary_llvm']:
|
||||
build_filecheck()
|
||||
test_cling()
|
||||
tarball()
|
||||
|
Loading…
x
Reference in New Issue
Block a user