[DEBUG] Run / intall executable on MacOs
This commit is contained in:
parent
1cf731910d
commit
f46c5116b1
@ -41,7 +41,7 @@ myArgs.add("i", "isolate-system", desc="Isolate system build (copy header of c a
|
|||||||
|
|
||||||
myArgs.add_section("properties", "keep in the sequency of the cible")
|
myArgs.add_section("properties", "keep in the sequency of the cible")
|
||||||
myArgs.add("t", "target", haveParam=True, desc="Select a target (by default the platform is the computer that compile this) To know list : 'lutin.py --list-target'")
|
myArgs.add("t", "target", haveParam=True, desc="Select a target (by default the platform is the computer that compile this) To know list : 'lutin.py --list-target'")
|
||||||
myArgs.add("c", "compilator", list=[["clang",""],["gcc",""]], desc="Compile with clang or Gcc mode (by default gcc will be used)")
|
myArgs.add("c", "compilator", list=[["clang",""],["gcc",""]], desc="Compile with clang or Gcc mode (by default " + lutinHost.HOST_DEFAULT_COMPILATOR + " will be used)")
|
||||||
myArgs.add("", "compilator-version", haveParam=True, desc="With travis we need to specify the name of the version if we want to compile with gcc 4.9 ==> --compilator-version=4.9")
|
myArgs.add("", "compilator-version", haveParam=True, desc="With travis we need to specify the name of the version if we want to compile with gcc 4.9 ==> --compilator-version=4.9")
|
||||||
myArgs.add("m", "mode", list=[["debug",""],["release",""]], desc="Compile in release or debug mode (default release)")
|
myArgs.add("m", "mode", list=[["debug",""],["release",""]], desc="Compile in release or debug mode (default release)")
|
||||||
myArgs.add("a", "arch", list=[["auto","Automatic choice"],["arm","Arm processer"],["x86","Generic PC : AMD/Intel"],["ppc","Power PC"]], desc="Architecture to compile")
|
myArgs.add("a", "arch", list=[["auto","Automatic choice"],["arm","Arm processer"],["x86","Generic PC : AMD/Intel"],["ppc","Power PC"]], desc="Architecture to compile")
|
||||||
@ -323,7 +323,7 @@ lutin.init()
|
|||||||
#available target : Linux / MacOs / Windows / Android ...
|
#available target : Linux / MacOs / Windows / Android ...
|
||||||
targetName = host.OS
|
targetName = host.OS
|
||||||
config = {
|
config = {
|
||||||
"compilator":"gcc",
|
"compilator":lutinHost.HOST_DEFAULT_COMPILATOR,
|
||||||
"mode":"release",
|
"mode":"release",
|
||||||
"bus-size":"auto",
|
"bus-size":"auto",
|
||||||
"arch":"auto",
|
"arch":"auto",
|
||||||
@ -364,7 +364,7 @@ for argument in localArgument:
|
|||||||
debug.debug("change target ==> '" + targetName + "' & reset mode : gcc&release")
|
debug.debug("change target ==> '" + targetName + "' & reset mode : gcc&release")
|
||||||
#reset properties by defauult:
|
#reset properties by defauult:
|
||||||
config = {
|
config = {
|
||||||
"compilator":"gcc",
|
"compilator":lutinHost.HOST_DEFAULT_COMPILATOR,
|
||||||
"mode":"release",
|
"mode":"release",
|
||||||
"bus-size":"auto",
|
"bus-size":"auto",
|
||||||
"arch":"auto",
|
"arch":"auto",
|
||||||
|
@ -15,10 +15,13 @@ from . import debug
|
|||||||
# print os.name # ==> 'posix'
|
# print os.name # ==> 'posix'
|
||||||
if platform.system() == "Linux":
|
if platform.system() == "Linux":
|
||||||
OS = "Linux"
|
OS = "Linux"
|
||||||
|
HOST_DEFAULT_COMPILATOR = "gcc"
|
||||||
elif platform.system() == "Windows":
|
elif platform.system() == "Windows":
|
||||||
OS = "Windows"
|
OS = "Windows"
|
||||||
|
HOST_DEFAULT_COMPILATOR = "gcc"
|
||||||
elif platform.system() == "Darwin":
|
elif platform.system() == "Darwin":
|
||||||
OS = "MacOs"
|
OS = "MacOs"
|
||||||
|
HOST_DEFAULT_COMPILATOR = "clang"
|
||||||
else:
|
else:
|
||||||
debug.error("Unknow the Host OS ... '" + platform.system() + "'")
|
debug.error("Unknow the Host OS ... '" + platform.system() + "'")
|
||||||
|
|
||||||
|
@ -55,8 +55,9 @@ def run_command_no_lock_out(cmd_line):
|
|||||||
p = subprocess.Popen(args)
|
p = subprocess.Popen(args)
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
debug.error("subprocess.CalledProcessError : " + str(args))
|
debug.error("subprocess.CalledProcessError : " + str(args))
|
||||||
except:
|
return
|
||||||
debug.error("Exception on : " + str(args))
|
#except:
|
||||||
|
# debug.error("Exception on : " + str(args))
|
||||||
# launch the subprocess:
|
# launch the subprocess:
|
||||||
p.communicate()
|
p.communicate()
|
||||||
|
|
||||||
|
@ -87,25 +87,37 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
|
|||||||
cmd.append(local_ref_on_builder_c.get_version_compilation_flags(flags, depancy.flags))
|
cmd.append(local_ref_on_builder_c.get_version_compilation_flags(flags, depancy.flags))
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
try:
|
list_flags = [];
|
||||||
cmd.append(target.global_flags["c"])
|
if "c" in target.global_flags:
|
||||||
except:
|
list_flags.append(target.global_flags["c"])
|
||||||
pass
|
if "m" in target.global_flags:
|
||||||
try:
|
list_flags.append(target.global_flags["m"])
|
||||||
cmd.append(target.global_flags["m"])
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
for type in ["c", "m"]:
|
for type in ["c", "m"]:
|
||||||
try:
|
if type in depancy.flags:
|
||||||
cmd.append(depancy.flags[type])
|
list_flags.append(depancy.flags[type])
|
||||||
except:
|
|
||||||
pass
|
|
||||||
for view in ["local", "export"]:
|
for view in ["local", "export"]:
|
||||||
for type in ["c", "m"]:
|
if view in flags:
|
||||||
try:
|
for type in ["c", "m"]:
|
||||||
cmd.append(flags[view][type])
|
if type in flags[view]:
|
||||||
except:
|
list_flags.append(flags[view][type])
|
||||||
pass
|
# get blacklist of flags
|
||||||
|
list_flags_blacklist = [];
|
||||||
|
if "c-remove" in target.global_flags:
|
||||||
|
list_flags_blacklist.append(target.global_flags["c-remove"])
|
||||||
|
if "m-remove" in target.global_flags:
|
||||||
|
list_flags_blacklist.append(target.global_flags["m-remove"])
|
||||||
|
for type in ["c-remove", "m-remove"]:
|
||||||
|
if type in depancy.flags:
|
||||||
|
list_flags_blacklist.append(depancy.flags[type])
|
||||||
|
for view in ["local", "export"]:
|
||||||
|
if view in flags:
|
||||||
|
for type in ["c-remove", "m-remove"]:
|
||||||
|
if type in flags[view]:
|
||||||
|
list_flags_blacklist.append(flags[view][type])
|
||||||
|
# apply blacklisting of data and add it on the cmdLine
|
||||||
|
clean_flags = tools.remove_element(list_flags, list_flags_blacklist)
|
||||||
|
#debug.warning("plop " + str(list_flags_blacklist) + " " + str(list_flags) + " --> " + str(clean_flags) )
|
||||||
|
cmd.append(clean_flags);
|
||||||
cmd.append("-c -MMD -MP")
|
cmd.append("-c -MMD -MP")
|
||||||
cmd.append("-x objective-c")
|
cmd.append("-x objective-c")
|
||||||
cmd.append(file_src)
|
cmd.append(file_src)
|
||||||
|
@ -87,22 +87,45 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
|
|||||||
cmd.append(local_ref_on_builder_cpp.get_version_compilation_flags(flags, depancy.flags))
|
cmd.append(local_ref_on_builder_cpp.get_version_compilation_flags(flags, depancy.flags))
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
list_flags = [];
|
||||||
|
if "c" in target.global_flags:
|
||||||
|
list_flags.append(target.global_flags["c"])
|
||||||
|
if "c++" in target.global_flags:
|
||||||
|
list_flags.append(target.global_flags["c++"])
|
||||||
|
if "m" in target.global_flags:
|
||||||
|
list_flags.append(target.global_flags["m"])
|
||||||
|
if "mm" in target.global_flags:
|
||||||
|
list_flags.append(target.global_flags["mm"])
|
||||||
for type in ["c", "c++", "m", "mm"]:
|
for type in ["c", "c++", "m", "mm"]:
|
||||||
try:
|
if type in depancy.flags:
|
||||||
cmd.append(target.global_flags[type])
|
list_flags.append(depancy.flags[type])
|
||||||
except:
|
for view in ["local", "export"]:
|
||||||
pass
|
if view in flags:
|
||||||
for type in ["c", "c++", "m", "mm"]:
|
for type in ["c", "c++", "m", "mm"]:
|
||||||
try:
|
if type in flags[view]:
|
||||||
cmd.append(depancy.flags[type])
|
list_flags.append(flags[view][type])
|
||||||
except:
|
# get blacklist of flags
|
||||||
pass
|
list_flags_blacklist = [];
|
||||||
for view in ["export", "local"]:
|
if "c-remove" in target.global_flags:
|
||||||
for type in ["c", "c++", "m", "mm"]:
|
list_flags_blacklist.append(target.global_flags["c-remove"])
|
||||||
try:
|
if "c++-remove" in target.global_flags:
|
||||||
cmd.append(flags[view][type])
|
list_flags_blacklist.append(target.global_flags["c++-remove"])
|
||||||
except:
|
if "m-remove" in target.global_flags:
|
||||||
pass
|
list_flags_blacklist.append(target.global_flags["m-remove"])
|
||||||
|
if "mm-remove" in target.global_flags:
|
||||||
|
list_flags_blacklist.append(target.global_flags["mm-remove"])
|
||||||
|
for type in ["c-remove", "c++-remove","m-remove", "mm-remove"]:
|
||||||
|
if type in depancy.flags:
|
||||||
|
list_flags_blacklist.append(depancy.flags[type])
|
||||||
|
for view in ["local", "export"]:
|
||||||
|
if view in flags:
|
||||||
|
for type in ["c-remove", "c++-remove","m-remove", "mm-remove"]:
|
||||||
|
if type in flags[view]:
|
||||||
|
list_flags_blacklist.append(flags[view][type])
|
||||||
|
# apply blacklisting of data and add it on the cmdLine
|
||||||
|
clean_flags = tools.remove_element(list_flags, list_flags_blacklist)
|
||||||
|
#debug.warning("plop " + str(list_flags_blacklist) + " " + str(list_flags) + " --> " + str(clean_flags) )
|
||||||
|
cmd.append(clean_flags);
|
||||||
cmd.append("-c -MMD -MP")
|
cmd.append("-c -MMD -MP")
|
||||||
cmd.append("-x objective-c++")
|
cmd.append("-x objective-c++")
|
||||||
cmd.append(file_src)
|
cmd.append(file_src)
|
||||||
|
@ -514,6 +514,6 @@ class Target(target.Target):
|
|||||||
debug.debug("------------------------------------------------------------------------")
|
debug.debug("------------------------------------------------------------------------")
|
||||||
debug.info("cmd: " + self.path_sdk + "/platform-tools/adb shell logcat ")
|
debug.info("cmd: " + self.path_sdk + "/platform-tools/adb shell logcat ")
|
||||||
cmdLine = self.path_sdk + "/platform-tools/adb shell logcat "
|
cmdLine = self.path_sdk + "/platform-tools/adb shell logcat "
|
||||||
multiprocess.run_command(cmdLine)
|
multiprocess.run_command_no_lock_out(cmdLine)
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,6 +30,9 @@ class Target(target.Target):
|
|||||||
#bus size selection (auto/32/64)
|
#bus size selection (auto/32/64)
|
||||||
if config["bus-size"] == "auto":
|
if config["bus-size"] == "auto":
|
||||||
config["bus-size"] = "64"
|
config["bus-size"] = "64"
|
||||||
|
if config["compilator"] != "clang":
|
||||||
|
debug.warning("compilator is not clang ==> force it...")
|
||||||
|
config["compilator"] = "clang"
|
||||||
|
|
||||||
# http://biolpc22.york.ac.uk/pub/linux-mac-cross/
|
# http://biolpc22.york.ac.uk/pub/linux-mac-cross/
|
||||||
# http://devs.openttd.org/~truebrain/compile-farm/apple-darwin9.txt
|
# http://devs.openttd.org/~truebrain/compile-farm/apple-darwin9.txt
|
||||||
@ -55,7 +58,7 @@ class Target(target.Target):
|
|||||||
#self.suffix_binary=''
|
#self.suffix_binary=''
|
||||||
#self.suffix_package=''
|
#self.suffix_package=''
|
||||||
|
|
||||||
if False: #self.simulator == True:
|
if self.get_simulation() == True:
|
||||||
self.sysroot = "-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk"
|
self.sysroot = "-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk"
|
||||||
self.add_flag("link", "-mios-simulator-version-min=8.0")
|
self.add_flag("link", "-mios-simulator-version-min=8.0")
|
||||||
self.add_flag("c", "-mios-simulator-version-min=8.0")
|
self.add_flag("c", "-mios-simulator-version-min=8.0")
|
||||||
@ -69,7 +72,7 @@ class Target(target.Target):
|
|||||||
"-objc_abi_version",
|
"-objc_abi_version",
|
||||||
"-Xlinker 2",
|
"-Xlinker 2",
|
||||||
"-Xlinker",
|
"-Xlinker",
|
||||||
"-no_implicit_dylibs",
|
#"-no_implicit_dylibs",
|
||||||
"-stdlib=libc++",
|
"-stdlib=libc++",
|
||||||
"-fobjc-arc",
|
"-fobjc-arc",
|
||||||
"-fobjc-link-runtime"
|
"-fobjc-link-runtime"
|
||||||
@ -186,7 +189,7 @@ class Target(target.Target):
|
|||||||
data_file += " \n"
|
data_file += " \n"
|
||||||
data_file += " <key>CFBundleResourceSpecification</key>\n"
|
data_file += " <key>CFBundleResourceSpecification</key>\n"
|
||||||
data_file += " <string>ResourceRules.plist</string>\n"
|
data_file += " <string>ResourceRules.plist</string>\n"
|
||||||
if self.sumulator == False:
|
if self.get_simulation() == False:
|
||||||
data_file += " <key>LSRequiresIPhoneOS</key>\n"
|
data_file += " <key>LSRequiresIPhoneOS</key>\n"
|
||||||
data_file += " <true/>\n"
|
data_file += " <true/>\n"
|
||||||
else:
|
else:
|
||||||
@ -239,7 +242,7 @@ class Target(target.Target):
|
|||||||
cmdLine += " -genpkginfo " + self.get_staging_path(pkg_name) + "/PkgInfo"
|
cmdLine += " -genpkginfo " + self.get_staging_path(pkg_name) + "/PkgInfo"
|
||||||
cmdLine += " -expandbuildsettings "
|
cmdLine += " -expandbuildsettings "
|
||||||
cmdLine += " -format binary "
|
cmdLine += " -format binary "
|
||||||
if self.sumulator == False:
|
if self.get_simulation() == False:
|
||||||
cmdLine += " -platform iphonesimulator "
|
cmdLine += " -platform iphonesimulator "
|
||||||
else:
|
else:
|
||||||
cmdLine += " -platform iphoneos "
|
cmdLine += " -platform iphoneos "
|
||||||
@ -315,7 +318,7 @@ class Target(target.Target):
|
|||||||
# Must create the tarball of the application
|
# Must create the tarball of the application
|
||||||
#cd $(TARGET_OUT_FINAL)/; tar -cf $(PROJECT_NAME).tar $(PROJECT_NAME).app
|
#cd $(TARGET_OUT_FINAL)/; tar -cf $(PROJECT_NAME).tar $(PROJECT_NAME).app
|
||||||
#cd $(TARGET_OUT_FINAL)/; tar -czf $(PROJECT_NAME).tar.gz $(PROJECT_NAME).app
|
#cd $(TARGET_OUT_FINAL)/; tar -czf $(PROJECT_NAME).tar.gz $(PROJECT_NAME).app
|
||||||
if self.sumulator == False:
|
if self.get_simulation() == False:
|
||||||
if "APPLE_APPLICATION_IOS_ID" not in pkg_properties:
|
if "APPLE_APPLICATION_IOS_ID" not in pkg_properties:
|
||||||
pkg_properties["APPLE_APPLICATION_IOS_ID"] = "00000000"
|
pkg_properties["APPLE_APPLICATION_IOS_ID"] = "00000000"
|
||||||
debug.warning("Missing package property : APPLE_APPLICATION_IOS_ID USE " + pkg_properties["APPLE_APPLICATION_IOS_ID"] + " ID ... ==> CAN NOT WORK ..." )
|
debug.warning("Missing package property : APPLE_APPLICATION_IOS_ID USE " + pkg_properties["APPLE_APPLICATION_IOS_ID"] + " ID ... ==> CAN NOT WORK ..." )
|
||||||
@ -363,7 +366,7 @@ class Target(target.Target):
|
|||||||
debug.debug("------------------------------------------------------------------------")
|
debug.debug("------------------------------------------------------------------------")
|
||||||
debug.info("Install package '" + pkg_name + "'")
|
debug.info("Install package '" + pkg_name + "'")
|
||||||
debug.debug("------------------------------------------------------------------------")
|
debug.debug("------------------------------------------------------------------------")
|
||||||
if self.sumulator == False:
|
if self.get_simulation() == False:
|
||||||
if tools.file_size("ewol/ios-deploy/ios-deploy") == 0:
|
if tools.file_size("ewol/ios-deploy/ios-deploy") == 0:
|
||||||
debug.print_element("tool", "ios-deploy", "<==", "external sources")
|
debug.print_element("tool", "ios-deploy", "<==", "external sources")
|
||||||
cmdLine = 'cd ewol/ios-deploy ; make ; cd ../.. '
|
cmdLine = 'cd ewol/ios-deploy ; make ; cd ../.. '
|
||||||
@ -407,7 +410,7 @@ class Target(target.Target):
|
|||||||
debug.debug("------------------------------------------------------------------------")
|
debug.debug("------------------------------------------------------------------------")
|
||||||
debug.info("Un-Install package '" + pkg_name + "'")
|
debug.info("Un-Install package '" + pkg_name + "'")
|
||||||
debug.debug("------------------------------------------------------------------------")
|
debug.debug("------------------------------------------------------------------------")
|
||||||
if self.sumulator == False:
|
if self.get_simulation() == False:
|
||||||
debug.warning("not implemented")
|
debug.warning("not implemented")
|
||||||
else:
|
else:
|
||||||
simulatorIdFile = ".iosSimutatorId_" + pkg_name + ".txt"
|
simulatorIdFile = ".iosSimutatorId_" + pkg_name + ".txt"
|
||||||
@ -420,7 +423,7 @@ class Target(target.Target):
|
|||||||
debug.debug("------------------------------------------------------------------------")
|
debug.debug("------------------------------------------------------------------------")
|
||||||
debug.info("log of iOs board")
|
debug.info("log of iOs board")
|
||||||
debug.debug("------------------------------------------------------------------------")
|
debug.debug("------------------------------------------------------------------------")
|
||||||
if self.sumulator == False:
|
if self.get_simulation() == False:
|
||||||
if tools.file_size("ewol/ios-deploy/ios-deploy") == 0:
|
if tools.file_size("ewol/ios-deploy/ios-deploy") == 0:
|
||||||
debug.print_element("tool", "ios-deploy", "<==", "external sources")
|
debug.print_element("tool", "ios-deploy", "<==", "external sources")
|
||||||
cmdLine = 'cd ewol/ios-deploy ; make ; cd ../.. '
|
cmdLine = 'cd ewol/ios-deploy ; make ; cd ../.. '
|
||||||
|
@ -25,6 +25,9 @@ class Target(target.Target):
|
|||||||
#bus size selection (auto/32/64)
|
#bus size selection (auto/32/64)
|
||||||
if config["bus-size"] == "auto":
|
if config["bus-size"] == "auto":
|
||||||
config["bus-size"] = str(host.BUS_SIZE)
|
config["bus-size"] = str(host.BUS_SIZE)
|
||||||
|
if config["compilator"] != "clang":
|
||||||
|
debug.warning("compilator is not clang ==> force it...")
|
||||||
|
config["compilator"] = "clang"
|
||||||
# http://biolpc22.york.ac.uk/pub/linux-mac-cross/
|
# http://biolpc22.york.ac.uk/pub/linux-mac-cross/
|
||||||
# http://devs.openttd.org/~truebrain/compile-farm/apple-darwin9.txt
|
# http://devs.openttd.org/~truebrain/compile-farm/apple-darwin9.txt
|
||||||
target.Target.__init__(self, "MacOs", config, "")
|
target.Target.__init__(self, "MacOs", config, "")
|
||||||
@ -133,11 +136,11 @@ class Target(target.Target):
|
|||||||
debug.debug("------------------------------------------------------------------------")
|
debug.debug("------------------------------------------------------------------------")
|
||||||
debug.info("Install package '" + pkg_name + "'")
|
debug.info("Install package '" + pkg_name + "'")
|
||||||
debug.debug("------------------------------------------------------------------------")
|
debug.debug("------------------------------------------------------------------------")
|
||||||
debug.info("copy " + tools.get_run_path() + self.path_out + self.path_staging + "/" + pkg_name + ".app in /Applications/")
|
debug.info("copy " + os.path.join(self.get_staging_path(pkg_name), pkg_name + ".app") + " in /Applications/")
|
||||||
if os.path.exists("/Applications/" + pkg_name + ".app") == True:
|
if os.path.exists("/Applications/" + pkg_name + ".app") == True:
|
||||||
shutil.rmtree("/Applications/" + pkg_name + ".app")
|
shutil.rmtree("/Applications/" + pkg_name + ".app")
|
||||||
# copy the application in the basic application path : /Applications/xxx.app
|
# copy the application in the basic application path : /Applications/xxx.app
|
||||||
shutil.copytree(os.path.join(tools.get_run_path(),self.path_out,self.path_staging,pkg_name + ".app"), os.path.join("/Applications", pkg_name + ".app"))
|
shutil.copytree(os.path.join(self.get_staging_path(pkg_name), pkg_name + ".app"), os.path.join("/Applications", pkg_name + ".app"))
|
||||||
|
|
||||||
def un_install_package(self, pkg_name):
|
def un_install_package(self, pkg_name):
|
||||||
debug.debug("------------------------------------------------------------------------")
|
debug.debug("------------------------------------------------------------------------")
|
||||||
@ -152,7 +155,8 @@ class Target(target.Target):
|
|||||||
debug.debug("------------------------------------------------------------------------")
|
debug.debug("------------------------------------------------------------------------")
|
||||||
debug.info("-- Run package '" + pkg_name + "'")
|
debug.info("-- Run package '" + pkg_name + "'")
|
||||||
debug.debug("------------------------------------------------------------------------")
|
debug.debug("------------------------------------------------------------------------")
|
||||||
appl_path = os.path.join(tools.get_run_path(),self.path_out,self.path_staging,pkg_name + ".app", "bin", pkg_name)
|
appl_path = os.path.join(self.get_staging_path(pkg_name), pkg_name + ".app" , "Contents", "MacOS", pkg_name)
|
||||||
|
appl_path = os.path.join(self.get_staging_path(pkg_name), pkg_name + ".app", "Contents", "MacOS", pkg_name)
|
||||||
cmd = appl_path + " "
|
cmd = appl_path + " "
|
||||||
for elem in option_list:
|
for elem in option_list:
|
||||||
cmd += elem + " "
|
cmd += elem + " "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user