mirror of
https://github.com/fastogt/pyfastogt
synced 2025-03-09 23:38:55 +00:00
Fix global variables
This commit is contained in:
parent
e19dcdb8f7
commit
3133a8fe59
1 changed files with 5 additions and 4 deletions
|
@ -4,6 +4,7 @@ import os
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import tarfile
|
import tarfile
|
||||||
|
import shutil
|
||||||
from urllib.request import urlopen
|
from urllib.request import urlopen
|
||||||
|
|
||||||
|
|
||||||
|
@ -93,9 +94,9 @@ def extract_file(path, current_dir):
|
||||||
return os.path.join(current_dir, target_path)
|
return os.path.join(current_dir, target_path)
|
||||||
|
|
||||||
|
|
||||||
def build_command_configure(compiler_flags: CompileInfo, prefix_path):
|
def build_command_configure(compiler_flags: CompileInfo, source_dir_path, prefix_path):
|
||||||
# patches
|
# patches
|
||||||
script_dir = os.path.dirname(g_script_path)
|
script_dir = os.path.dirname(source_dir_path)
|
||||||
|
|
||||||
for dir in compiler_flags.patches():
|
for dir in compiler_flags.patches():
|
||||||
scan_dir = os.path.join(script_dir, dir)
|
scan_dir = os.path.join(script_dir, dir)
|
||||||
|
@ -113,12 +114,12 @@ def build_command_configure(compiler_flags: CompileInfo, prefix_path):
|
||||||
subprocess.call(['make', 'install'])
|
subprocess.call(['make', 'install'])
|
||||||
|
|
||||||
|
|
||||||
def build_from_sources(url, compiler_flags: CompileInfo, prefix_path):
|
def build_from_sources(url, compiler_flags: CompileInfo, source_dir_path, prefix_path):
|
||||||
pwd = os.getcwd()
|
pwd = os.getcwd()
|
||||||
file_path = download_file(url, pwd)
|
file_path = download_file(url, pwd)
|
||||||
extracted_folder = extract_file(file_path, pwd)
|
extracted_folder = extract_file(file_path, pwd)
|
||||||
os.chdir(extracted_folder)
|
os.chdir(extracted_folder)
|
||||||
build_command_configure(compiler_flags, prefix_path)
|
build_command_configure(compiler_flags, source_dir_path, prefix_path)
|
||||||
os.chdir(pwd)
|
os.chdir(pwd)
|
||||||
shutil.rmtree(extracted_folder)
|
shutil.rmtree(extracted_folder)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue