[DEV] add support of heritage of target and better support of Debian distro

This commit is contained in:
Edouard DUPIN 2016-10-05 21:17:12 +02:00
parent 3b37e78dd3
commit 092843cd02
10 changed files with 150 additions and 154 deletions

View File

@ -928,26 +928,26 @@ class Module:
## ##
## @brief Add a tools in dependency ## @brief Add a tools in dependency
## @param[in] self (handle) Class handle ## @param[in] self (handle) Class handle
## @param[in] in_list ([string,...] or string) Name(s) of the tools ## @param[in] list ([string,...] or string) Name(s) of the tools
## @return None ## @return None
## ##
def add_tools(self, in_list): def add_tools(self, list):
tools.list_append_to(self._tools, in_list, True) tools.list_append_to(self._tools, list, True)
## ##
## @brief Add a dependency on this module ## @brief Add a dependency on this module
## @param[in] self (handle) Class handle ## @param[in] self (handle) Class handle
## @param[in] in_list ([string,...] or string) Name(s) of the modules dependency ## @param[in] list ([string,...] or string) Name(s) of the modules dependency
## @return None ## @return None
## ##
def add_depend(self, in_list): def add_depend(self, list):
tools.list_append_to(self._depends, in_list, True) tools.list_append_to(self._depends, list, True)
## @brief deprecated ... ## @brief deprecated ...
## @return None ## @return None
def add_module_depend(self, in_list): def add_module_depend(self, list):
debug.warning("[" + self._name + "] add_module_depend is deprecated ==> use add_depend(...)") debug.warning("[" + self._name + "] add_module_depend is deprecated ==> use add_depend(...)")
self.add_depend(in_list) self.add_depend(list)
## ##
## @brief Add an optionnal dependency on this module ## @brief Add an optionnal dependency on this module
@ -971,64 +971,64 @@ class Module:
## ##
## @brief Add a path to include when build ## @brief Add a path to include when build
## @param[in] self (handle) Class handle ## @param[in] self (handle) Class handle
## @param[in] in_list ([string,...] or string) List of path to include (default: local path) only relative path... ## @param[in] list ([string,...] or string) List of path to include (default: local path) only relative path...
## @param[in] in_type (string) inclusion group name 'c', 'c++', 'java' ... ## @param[in] type (string) inclusion group name 'c', 'c++', 'java' ...
## @param[in] export (bool) export the include path. ## @param[in] export (bool) export the include path.
## @return None ## @return None
## ##
def add_path(self, in_list=".", in_type='c', export=False): def add_path(self, list=".", type='c', export=False):
if type(in_list) == list: if tools.get_type_string(list) == "list":
add_list = [] add_list = []
for elem in in_list: for elem in list:
if len(elem) > 1 \ if len(elem) > 1 \
and elem[0] == '/': and elem[0] == '/':
# unix case # unix case
debug.warning(" add_path(" + in_list + ")") debug.warning(" add_path(" + list + ")")
debug.warning("[" + self._name + "] Not permited to add a path that start in / directory (only relative path) (compatibility until 3.x)") debug.warning("[" + self._name + "] Not permited to add a path that start in / directory (only relative path) (compatibility until 2.x)")
add_list.append(elem) add_list.append(elem)
elif len(elem) > 2 \ elif len(elem) > 2 \
and elem[1] == ':': and elem[1] == ':':
# windows case : # windows case :
debug.warning(" add_path(" + in_list + ")") debug.warning(" add_path(" + list + ")")
debug.warning("[" + self._name + "] Not permited to add a path that start in '" + elem[0] + ":' directory (only relative path) (compatibility until 3.x)") debug.warning("[" + self._name + "] Not permited to add a path that start in '" + elem[0] + ":' directory (only relative path) (compatibility until 2.x)")
add_list.append(elem) add_list.append(elem)
if elem == ".": if elem == ".":
add_list.append(tools.get_current_path(self._origin_file)) add_list.append(tools.get_current_path(self._origin_file))
else: else:
add_list.append(os.path.join(tools.get_current_path(self._origin_file), elem)) add_list.append(os.path.join(tools.get_current_path(self._origin_file), elem))
else: else:
if len(in_list) > 1 \ if len(list) > 1 \
and in_list[0] == '/': and list[0] == '/':
# unix case # unix case
debug.warning(" add_path(" + in_list + ")") debug.warning(" add_path(" + list + ")")
debug.warning("[" + self._name + "] Not permited to add a path that start in / directory (only relative path) (compatibility until 3.x)") debug.warning("[" + self._name + "] Not permited to add a path that start in / directory (only relative path) (compatibility until 2.x)")
add_list = in_list add_list = list
elif len(in_list) > 2 \ elif len(list) > 2 \
and in_list[1] == ':': and list[1] == ':':
# windows case : # windows case :
debug.warning(" add_path(" + in_list + ")") debug.warning(" add_path(" + list + ")")
debug.warning("[" + self._name + "] Not permited to add a path that start in '" + in_list[0] + ":' directory (only relative path) (compatibility until 3.x)") debug.warning("[" + self._name + "] Not permited to add a path that start in '" + list[0] + ":' directory (only relative path) (compatibility until 2.x)")
add_list = in_list add_list = list
elif in_list == ".": elif list == ".":
add_list = tools.get_current_path(self._origin_file) add_list = tools.get_current_path(self._origin_file)
else: else:
add_list = os.path.join(tools.get_current_path(self._origin_file), in_list) add_list = os.path.join(tools.get_current_path(self._origin_file), list)
debug.verbose("Convert path : " + str(in_list) + " in " + str(add_list)) debug.verbose("Convert path : " + str(list) + " in " + str(add_list))
self._add_path(add_list, in_type, export) self._add_path(add_list, type, export)
## ##
## @brief (INTERNAL API) Add a path to include when build ## @brief (INTERNAL API) Add a path to include when build
## @param[in] self (handle) Class handle ## @param[in] self (handle) Class handle
## @param[in] in_list ([string,...] or string) List of path to include (default: local path) ## @param[in] list ([string,...] or string) List of path to include (default: local path)
## @param[in] in_type (string) inclusion group name 'c', 'c++', 'java' ... ## @param[in] type (string) inclusion group name 'c', 'c++', 'java' ...
## @param[in] export (bool) export the include path. ## @param[in] export (bool) export the include path.
## @return None ## @return None
## ##
def _add_path(self, in_list=".", in_type='c', export=False): def _add_path(self, list=".", type='c', export=False):
if export == True: if export == True:
tools.list_append_to_2(self._path["export"], in_type, in_list) tools.list_append_to_2(self._path["export"], type, list)
else: else:
tools.list_append_to_2(self._path["local"], in_type, in_list) tools.list_append_to_2(self._path["local"], type, list)
## ##
## @brief deprecated ... ## @brief deprecated ...
@ -1041,27 +1041,27 @@ class Module:
## @brief Add compilation flags ## @brief Add compilation flags
## @param[in] self (handle) Class handle ## @param[in] self (handle) Class handle
## @param[in] type (string) inclusion group name 'c', 'c++', 'java' ... ## @param[in] type (string) inclusion group name 'c', 'c++', 'java' ...
## @param[in] in_list ([string,...] or string) List of path to include ## @param[in] list ([string,...] or string) List of path to include
## @param[in] export (bool) export the flat that has been requested to add if module is present. ## @param[in] export (bool) export the flat that has been requested to add if module is present.
## @return None ## @return None
## ##
def add_flag(self, type, in_list, export=False): def add_flag(self, type, list, export=False):
if export == True: if export == True:
tools.list_append_to_2(self._flags["export"], type, in_list) tools.list_append_to_2(self._flags["export"], type, list)
else: else:
tools.list_append_to_2(self._flags["local"], type, in_list) tools.list_append_to_2(self._flags["local"], type, list)
## @brief deprecated ... ## @brief deprecated ...
## @return None ## @return None
def add_export_flag(self, type, in_list): def add_export_flag(self, type, list):
debug.warning("[" + self._name + "] add_export_flag is deprecated ==> use add_flag(xxx, yyy, export=True)") debug.warning("[" + self._name + "] add_export_flag is deprecated ==> use add_flag(xxx, yyy, export=True)")
self.add_flag(type, in_list, export=True) self.add_flag(type, list, export=True)
## @brief deprecated ... ## @brief deprecated ...
## @return None ## @return None
def compile_flags(self, type, in_list): def compile_flags(self, type, list):
debug.warning("[" + self._name + "] compile_flags is deprecated ==> use add_flag(xxx, yyy)") debug.warning("[" + self._name + "] compile_flags is deprecated ==> use add_flag(xxx, yyy)")
self.add_flag(type, in_list) self.add_flag(type, list)
## ##
## @brief Set the compilation version of the ## @brief Set the compilation version of the
@ -1109,15 +1109,15 @@ class Module:
## ##
## @brief Add source file to compile ## @brief Add source file to compile
## @param[in] self (handle) Class handle ## @param[in] self (handle) Class handle
## @param[in] in_list ([string,...] or string) File(s) to compile ## @param[in] list ([string,...] or string) File(s) to compile
## @return None ## @return None
## ##
def add_src_file(self, in_list): def add_src_file(self, list):
tools.list_append_to(self._src, in_list, True) tools.list_append_to(self._src, list, True)
## ##
## @brief An an header file in the install directory ## @brief An an header file in the install directory
## @param[in] self (handle) Class handle ## @param[in] self (handle) Class handle
## @param[in] in_list ([string,...] or string) List of element that is needed to install ## @param[in] list ([string,...] or string) List of element that is needed to install
## @param[in] destination_path (string) Path to install the files (remove all the path of the file) ## @param[in] destination_path (string) Path to install the files (remove all the path of the file)
## @param[in] clip_path (string) Remove a part of the path set in the list and install data in generic include path ## @param[in] clip_path (string) Remove a part of the path set in the list and install data in generic include path
## @param[in] recursive (bool) when use regexp in file list ==> we can add recursive property ## @param[in] recursive (bool) when use regexp in file list ==> we can add recursive property
@ -1160,13 +1160,13 @@ class Module:
## ##
## @return None ## @return None
## ##
def add_header_file(self, in_list, destination_path=None, clip_path=None, recursive=False): def add_header_file(self, list, destination_path=None, clip_path=None, recursive=False):
if destination_path != None: if destination_path != None:
debug.verbose("Change destination PATH: '" + str(destination_path) + "'") debug.verbose("Change destination PATH: '" + str(destination_path) + "'")
new_list = [] new_list = []
if type(in_list) == str: if tools.get_type_string(list) == "string":
in_list = [in_list] list = [list]
for elem in in_list: for elem in list:
base = os.path.basename(elem) base = os.path.basename(elem)
if destination_path != None: if destination_path != None:
if clip_path != None: if clip_path != None:
@ -1270,7 +1270,7 @@ class Module:
## @return None ## @return None
## ##
def _print_list(self, description, input_list): def _print_list(self, description, input_list):
if type(input_list) == list: if tools.get_type_string(input_list) == "list":
if len(input_list) > 0: if len(input_list) > 0:
print(' ' + str(description)) print(' ' + str(description))
for elem in input_list: for elem in input_list:
@ -1364,13 +1364,13 @@ class Module:
and value[0] == '/': and value[0] == '/':
# unix case # unix case
debug.warning(" set_pkg('ICON', " + value + ")") debug.warning(" set_pkg('ICON', " + value + ")")
debug.warning("[" + self._name + "] Not permited to add an ICON that start in / directory (only relative path) (compatibility until 3.x)") debug.warning("[" + self._name + "] Not permited to add an ICON that start in / directory (only relative path) (compatibility until 2.x)")
self._package_prop[variable] = value self._package_prop[variable] = value
elif len(value) > 2 \ elif len(value) > 2 \
and value[1] == ':': and value[1] == ':':
# windows case : # windows case :
debug.warning(" set_pkg('ICON', " + value + ")") debug.warning(" set_pkg('ICON', " + value + ")")
debug.warning("[" + self._name + "] Not permited to add a path that start in '" + value[0] + ":' directory (only relative path) (compatibility until 3.x)") debug.warning("[" + self._name + "] Not permited to add a path that start in '" + value[0] + ":' directory (only relative path) (compatibility until 2.x)")
self._package_prop[variable] = value self._package_prop[variable] = value
else: else:
self._package_prop[variable] = os.path.join(tools.get_current_path(self._origin_file), value) self._package_prop[variable] = os.path.join(tools.get_current_path(self._origin_file), value)
@ -1404,13 +1404,13 @@ class Module:
and value[0] == '/': and value[0] == '/':
# unix case # unix case
debug.warning(" set_pkg('ANDROID_SIGN', " + value + ")") debug.warning(" set_pkg('ANDROID_SIGN', " + value + ")")
debug.warning("[" + self._name + "] Not permited to add an ICON that start in / directory (only relative path) (compatibility until 3.x)") debug.warning("[" + self._name + "] Not permited to add an ICON that start in / directory (only relative path) (compatibility until 2.x)")
self._package_prop[variable] = value self._package_prop[variable] = value
elif len(value) > 2 \ elif len(value) > 2 \
and value[1] == ':': and value[1] == ':':
# windows case : # windows case :
debug.warning(" set_pkg('ANDROID_SIGN', " + value + ")") debug.warning(" set_pkg('ANDROID_SIGN', " + value + ")")
debug.warning("[" + self._name + "] Not permited to add a path that start in '" + value[0] + ":' directory (only relative path) (compatibility until 3.x)") debug.warning("[" + self._name + "] Not permited to add a path that start in '" + value[0] + ":' directory (only relative path) (compatibility until 2.x)")
self._package_prop[variable] = value self._package_prop[variable] = value
else: else:
self._package_prop[variable] = os.path.join(tools.get_current_path(self._origin_file), value) self._package_prop[variable] = os.path.join(tools.get_current_path(self._origin_file), value)
@ -1553,7 +1553,7 @@ def load_module(target, name):
tmp_element = None tmp_element = None
elif "create" in dir(the_module): elif "create" in dir(the_module):
# parse in a second time to permit to implement retro-compat build # parse in a second time to permit to implement retro-compat build
debug.warning("[DEPRECATED] (" + name + ") module creation: function 'create', use 'configure' ... (remove compatibility in next major version (3.x)") debug.warning("[DEPRECATED] (" + name + ") module creation: function 'create', use 'configure' ... (remove compatibility in next major version (2.x)")
tmp_element = the_module.create(target, name) tmp_element = the_module.create(target, name)
if tmp_element != None: if tmp_element != None:
# overwrite some package default property (if not set by user) # overwrite some package default property (if not set by user)

View File

@ -254,15 +254,22 @@ def display():
## ##
## @brief Check if a system Module is availlable for a specific target ## @brief Check if a system Module is availlable for a specific target
## @param[in] lib_name (string) Name of the Library ## @param[in] lib_name (string) Name of the Library
## @param[in] target_name (string) Name of the target ## @param[in] list_target_name ([string,...]) list of name of the target (ordered by request order)
## @param[in] target (handle) Handle on the @ref Target build engine ## @param[in] target (handle) Handle on the @ref Target build engine
## @return (bool) find the system lib or not ## @return (bool) find the system lib or not
## ##
def exist(lib_name, target_name, target) : def exist(lib_name, list_target_name, target) :
global __system_list global __system_list
debug.verbose("exist= " + lib_name + " in " + target_name) debug.verbose("exist= " + lib_name + " in " + str(list_target_name))
if target_name not in __system_list: find_target = False
for target_name in list_target_name:
if target_name in __system_list:
find_target = True
if find_target == False:
return False return False
for target_name in reversed(list_target_name):
if target_name not in __system_list:
continue
for data in __system_list[target_name]: for data in __system_list[target_name]:
if data["name"] == lib_name: if data["name"] == lib_name:
# we find it in the List ==> need to check if it is present in the system : # we find it in the List ==> need to check if it is present in the system :
@ -285,13 +292,21 @@ def exist(lib_name, target_name, target) :
## @brief Load a system Module for a specific target ## @brief Load a system Module for a specific target
## @param[in] target (handle) Handle on the @ref Target build engine ## @param[in] target (handle) Handle on the @ref Target build engine
## @param[in] lib_name (string) Name of the Library ## @param[in] lib_name (string) Name of the Library
## @param[in] target_name (string) Name of the target ## @param[in] list_target_name ([string,...]) list of name of the target (ordered by request order)
## @return None ## @return None
## ##
def load(target, lib_name, target_name): def load(target, lib_name, list_target_name):
global __system_list global __system_list
if target_name not in __system_list: find_target = False
for target_name in list_target_name:
if target_name in __system_list:
find_target = True
if find_target == False:
debug.error("you must call this function after checking of the system exist() !1!") debug.error("you must call this function after checking of the system exist() !1!")
return
for target_name in reversed(list_target_name):
if target_name not in __system_list:
continue
for data in __system_list[target_name]: for data in __system_list[target_name]:
if data["name"] == lib_name: if data["name"] == lib_name:
if data["exist"] == False: if data["exist"] == False:

View File

@ -27,11 +27,15 @@ from . import env
class Target: class Target:
## ##
## @brief contructor ## @brief contructor
## @param[in] name (string) Name of the target ## @param[in] name ([string,...]) Name of the target
## @param[in] config (dict) User configuration ## @param[in] config (dict) User configuration
## @param[in] arch (string) specific parameter for gcc -arch element ## @param[in] arch (string) specific parameter for gcc -arch element
## ##
def __init__(self, name, config, arch): def __init__(self, name, config, arch):
if tools.get_type_string(name) != "list":
debug.error("You must define a name in a list ...")
if len(name) < 1:
debug.error("You must define a name for your target ...")
## configuration of the build ## configuration of the build
self.config = config self.config = config
@ -48,10 +52,11 @@ class Target:
self.end_generate_package = config["generate-package"] self.end_generate_package = config["generate-package"]
# todo : remove this : # todo : remove this :
self._name = name self._name = name[-1]
self._config_based_on = [name] self._config_based_on = name
debug.info("================================="); debug.info("=================================");
debug.info("== Target='" + self._name + "' " + self.config["bus-size"] + " bits for arch '" + self.config["arch"] + "'"); debug.info("== Target='" + self._name + "' " + self.config["bus-size"] + " bits for arch '" + self.config["arch"] + "'");
debug.info("== Target list=" + str(self._config_based_on))
debug.info("================================="); debug.info("=================================");
self.set_cross_base() self.set_cross_base()
@ -78,8 +83,9 @@ class Target:
self.path_generate_code="/generate_header" self.path_generate_code="/generate_header"
self.path_arch = "/" + self._name self.path_arch = "/" + self._name
for elem in self._config_based_on:
self.add_flag("c", '-D__TARGET_OS__' + elem)
self.add_flag("c", [ self.add_flag("c", [
'-D__TARGET_OS__' + self._name,
'-D__TARGET_ARCH__' + self.config["arch"], '-D__TARGET_ARCH__' + self.config["arch"],
'-D__TARGET_ADDR__' + self.config["bus-size"] + 'BITS', '-D__TARGET_ADDR__' + self.config["bus-size"] + 'BITS',
'-D_REENTRANT' '-D_REENTRANT'
@ -583,9 +589,9 @@ class Target:
module.load_module(self, name) module.load_module(self, name)
return True; return True;
# need to import the module (or the system module ...) # need to import the module (or the system module ...)
exist = system.exist(name, self._name, self) exist = system.exist(name, self._config_based_on, self)
if exist == True: if exist == True:
system.load(self, name, self._name) system.load(self, name, self._config_based_on)
return True; return True;
# we did not find the module ... # we did not find the module ...
return False; return False;

View File

@ -316,6 +316,14 @@ def store_warning(file, output, err):
file2.flush() file2.flush()
file2.close() file2.close()
def get_type_string(in_type):
if type(in_type) == str:
return "string"
elif type(in_type) == list:
return "list"
elif type(in_type) == dict:
return "dict"
return "unknow"
## List tools: ## List tools:
def list_append_and_check(listout, newElement, order): def list_append_and_check(listout, newElement, order):

View File

@ -18,7 +18,7 @@ import os
import sys import sys
class Target(target.Target): class Target(target.Target):
def __init__(self, config): def __init__(self, config, sub_name=[]):
#processor type selection (auto/arm/ppc/x86) #processor type selection (auto/arm/ppc/x86)
if config["arch"] == "auto": if config["arch"] == "auto":
config["arch"] = "arm" config["arch"] = "arm"
@ -26,7 +26,7 @@ class Target(target.Target):
if config["bus-size"] == "auto": if config["bus-size"] == "auto":
config["bus-size"] = "32" config["bus-size"] = "32"
self.type_arch = "" self.type_arch = ""
target.Target.__init__(self, "Android", config, self.type_arch) target.Target.__init__(self, ["Android"] + sub_name, config, self.type_arch)
if config["bus-size"] == "32": if config["bus-size"] == "32":
self.type_arch="armv7" self.type_arch="armv7"
@ -330,10 +330,10 @@ class Target(target.Target):
debug.error("missing parameter 'ANDROID_MANIFEST' in the properties ... ") debug.error("missing parameter 'ANDROID_MANIFEST' in the properties ... ")
#add properties on wallpaper : #add properties on wallpaper :
# myModule.pkg_add("ANDROID_WALLPAPER_PROPERTIES", ["list", key, title, summary, [["key","value display"],["key2","value display 2"]]) # myModule.add_pkg("ANDROID_WALLPAPER_PROPERTIES", ["list", key, title, summary, [["key","value display"],["key2","value display 2"]])
# myModule.pkg_add("ANDROID_WALLPAPER_PROPERTIES", ["list", "testpattern", "Select test pattern", "Choose which test pattern to display", [["key","value display"],["key2","value display 2"]]]) # myModule.add_pkg("ANDROID_WALLPAPER_PROPERTIES", ["list", "testpattern", "Select test pattern", "Choose which test pattern to display", [["key","value display"],["key2","value display 2"]]])
# myModule.pkg_add("ANDROID_WALLPAPER_PROPERTIES", ["bool", key, title, summary, ["enable string", "disable String"]) # myModule.add_pkg("ANDROID_WALLPAPER_PROPERTIES", ["bool", key, title, summary, ["enable string", "disable String"])
# myModule.pkg_add("ANDROID_WALLPAPER_PROPERTIES", ["bool", "movement", "Motion", "Apply movement to test pattern", ["Moving test pattern", "Still test pattern"] # myModule.add_pkg("ANDROID_WALLPAPER_PROPERTIES", ["bool", "movement", "Motion", "Apply movement to test pattern", ["Moving test pattern", "Still test pattern"]
#copy needed resources : #copy needed resources :
for res_source, res_dest in pkg_properties["ANDROID_RESOURCES"]: for res_source, res_dest in pkg_properties["ANDROID_RESOURCES"]:
if res_source == "": if res_source == "":

View File

@ -16,38 +16,11 @@ import stat
import re import re
from lutin import host from lutin import host
from lutin import multiprocess from lutin import multiprocess
import lutinTarget_Linux
class Target(target.Target): class Target(lutinTarget_Linux.Target):
def __init__(self, config): def __init__(self, config, sub_name=[]):
#processor type selection (auto/arm/ppc/x86) lutinTarget_Linux.Target.__init__(self, config, ["Debian"] + sub_name)
if config["arch"] == "auto":
config["arch"] = "x86"
#bus size selection (auto/32/64)
if config["bus-size"] == "auto":
config["bus-size"] = str(host.BUS_SIZE)
target.Target.__init__(self, "Linux", config, "")
if self.config["bus-size"] == "64":
# 64 bits
if host.BUS_SIZE != 64:
self.add_flag("c", "-m64")
else:
# 32 bits
if host.BUS_SIZE != 32:
self.add_flag("c", "-m32")
self.add_flag("c", "-fpic")
self.pkg_path_data = "share"
self.pkg_path_bin = "bin"
self.pkg_path_lib = "lib"
self.pkg_path_license = "license"
self.add_flag("link-lib", [
"dl"
])
self.add_flag("link", [
"-rdynamic"
])
""" """
.local/application .local/application
@ -80,6 +53,8 @@ class Target(target.Target):
*--> sources *--> sources
""" """
def make_package_binary(self, pkg_name, pkg_properties, base_pkg_path, heritage_list, static): def make_package_binary(self, pkg_name, pkg_properties, base_pkg_path, heritage_list, static):
# http://alp.developpez.com/tutoriels/debian/creer-paquet/
debianpkg_name = re.sub("_", "-", pkg_name)
debug.debug("------------------------------------------------------------------------") debug.debug("------------------------------------------------------------------------")
debug.info("Generate generic '" + pkg_name + "' v" + tools.version_to_string(pkg_properties["VERSION"])) debug.info("Generate generic '" + pkg_name + "' v" + tools.version_to_string(pkg_properties["VERSION"]))
debug.debug("------------------------------------------------------------------------") debug.debug("------------------------------------------------------------------------")
@ -98,23 +73,15 @@ class Target(target.Target):
## Create generic files: ## Create generic files:
self.make_package_generic_files(target_outpath, pkg_properties, pkg_name, base_pkg_path, heritage_list, static) self.make_package_generic_files(target_outpath, pkg_properties, pkg_name, base_pkg_path, heritage_list, static)
"""
## create the package: ## create the package:
debug.debug("package : " + self.get_staging_path(pkg_name) + "/" + pkg_name + ".app.pkg") debug.debug("package : " + self.get_staging_path(pkg_name) + "/" + pkg_name + ".app.pkg")
os.system("cd " + self.get_staging_path(pkg_name) + " ; tar -czf " + pkg_name + ".app.tar.gz " + pkg_name + ".app") os.system("cd " + self.get_staging_path(pkg_name) + " ; tar -czf " + pkg_name + ".app.tar.gz " + pkg_name + ".app")
#multiprocess.run_command("cd " + self.get_staging_path(pkg_name) + " ; tar -czf " + pkg_name + ".app.tar.gz " + pkg_name + ".app") #multiprocess.run_command("cd " + self.get_staging_path(pkg_name) + " ; tar -czf " + pkg_name + ".app.tar.gz " + pkg_name + ".app")
tools.create_directory_of_file(self.get_final_path()) tools.create_directory_of_file(self.get_final_path())
tools.copy_file(self.get_staging_path(pkg_name) + "/" + pkg_name + ".app.tar.gz", self.get_final_path() + "/" + pkg_name + ".app.gpkg") tools.copy_file(self.get_staging_path(pkg_name) + "/" + pkg_name + ".app.tar.gz", self.get_final_path() + "/" + pkg_name + ".app.gpkg")
def make_package_binary(self, pkg_name, pkg_properties, base_pkg_path, heritage_list, static):
"""
def make_package_debian(self, pkg_name, pkg_properties, base_pkg_path, heritage_list):
# http://alp.developpez.com/tutoriels/debian/creer-paquet/
debianpkg_name = re.sub("_", "-", pkg_name)
debug.debug("------------------------------------------------------------------------")
debug.info("Generate package '" + debianpkg_name + "' v"+pkg_properties["VERSION"])
debug.debug("------------------------------------------------------------------------")
self.get_staging_path(pkg_name) self.get_staging_path(pkg_name)
target_outpathDebian = self.get_staging_path(pkg_name) + "/DEBIAN/" target_outpathDebian = self.get_staging_path(pkg_name) + "/DEBIAN/"
finalFileControl = target_outpathDebian + "control" finalFileControl = target_outpathDebian + "control"
@ -126,7 +93,7 @@ class Target(target.Target):
tools.create_directory_of_file(finalFileControl) tools.create_directory_of_file(finalFileControl)
tmpFile = open(finalFileControl, 'w') tmpFile = open(finalFileControl, 'w')
tmpFile.write("Package: " + debianpkg_name + "\n") tmpFile.write("Package: " + debianpkg_name + "\n")
tmpFile.write("Version: " + pkg_properties["VERSION"] + "\n") tmpFile.write("Version: " + tools.version_to_string(pkg_properties["VERSION"]) + "\n")
tmpFile.write("Section: " + self.generate_list_separate_coma(pkg_properties["SECTION"]) + "\n") tmpFile.write("Section: " + self.generate_list_separate_coma(pkg_properties["SECTION"]) + "\n")
tmpFile.write("Priority: " + pkg_properties["PRIORITY"] + "\n") tmpFile.write("Priority: " + pkg_properties["PRIORITY"] + "\n")
tmpFile.write("Architecture: all\n") tmpFile.write("Architecture: all\n")

View File

@ -20,7 +20,7 @@ import random
import re import re
class Target(target.Target): class Target(target.Target):
def __init__(self, config): def __init__(self, config, sub_name=[]):
if config["compilator"] == "gcc": if config["compilator"] == "gcc":
debug.info("compile only with clang for IOs"); debug.info("compile only with clang for IOs");
config["compilator"] = "clang" config["compilator"] = "clang"
@ -41,7 +41,7 @@ class Target(target.Target):
else: else:
arch="arm64" # for ipad air arch="arm64" # for ipad air
#arch="armv7" # for Iphone 4 #arch="armv7" # for Iphone 4
target.Target.__init__(self, "IOs", config, arch) target.Target.__init__(self, ["IOs"] + sub_name, config, arch)
if self.config["simulation"] == True: if self.config["simulation"] == True:
self.set_cross_base("/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/") self.set_cross_base("/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/")
else: else:

View File

@ -19,14 +19,14 @@ from lutin import host
from lutin import multiprocess from lutin import multiprocess
class Target(target.Target): class Target(target.Target):
def __init__(self, config): def __init__(self, config, sub_name=[]):
#processor type selection (auto/arm/ppc/x86) #processor type selection (auto/arm/ppc/x86)
if config["arch"] == "auto": if config["arch"] == "auto":
config["arch"] = "x86" config["arch"] = "x86"
#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)
target.Target.__init__(self, "Linux", config, "") target.Target.__init__(self, ["Linux"] + sub_name, config, "")
if self.config["bus-size"] == "64": if self.config["bus-size"] == "64":
# 64 bits # 64 bits
if host.BUS_SIZE != 64: if host.BUS_SIZE != 64:

View File

@ -18,7 +18,7 @@ import stat
import shutil import shutil
class Target(target.Target): class Target(target.Target):
def __init__(self, config): def __init__(self, config, sub_name=[]):
#processor type selection (auto/arm/ppc/x86) #processor type selection (auto/arm/ppc/x86)
if config["arch"] == "auto": if config["arch"] == "auto":
config["arch"] = "x86" config["arch"] = "x86"
@ -30,7 +30,7 @@ class Target(target.Target):
config["compilator"] = "clang" 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"] + sub_name, config, "")
#self.path_bin="MacOS" #self.path_bin="MacOS"
#self.path_lib="lib" #self.path_lib="lib"

View File

@ -19,7 +19,7 @@ from lutin import zip
from lutin import multiprocess from lutin import multiprocess
class Target(target.Target): class Target(target.Target):
def __init__(self, config): def __init__(self, config, sub_name=[]):
if config["compilator"] != "gcc": if config["compilator"] != "gcc":
debug.error("Windows does not support '" + config["compilator"] + "' compilator ... availlable : [gcc]") debug.error("Windows does not support '" + config["compilator"] + "' compilator ... availlable : [gcc]")
config["compilator"] = "gcc" config["compilator"] = "gcc"
@ -31,7 +31,7 @@ class Target(target.Target):
if config["bus-size"] == "auto": if config["bus-size"] == "auto":
config["bus-size"] = str(host.BUS_SIZE) config["bus-size"] = str(host.BUS_SIZE)
target.Target.__init__(self, "Windows", config, "") target.Target.__init__(self, ["Windows"] + sub_name, config, "")
# on windows board the basic path is not correct # on windows board the basic path is not correct
# TODO : get external PATH for the minGW path # TODO : get external PATH for the minGW path