[DEV] better isolation
This commit is contained in:
parent
3804de2078
commit
7e44373f79
@ -29,6 +29,7 @@ class System:
|
|||||||
self.export_path=[]
|
self.export_path=[]
|
||||||
self.action_on_state={}
|
self.action_on_state={}
|
||||||
self.headers=[]
|
self.headers=[]
|
||||||
|
self.version=None
|
||||||
|
|
||||||
def add_export_sources(self, list):
|
def add_export_sources(self, list):
|
||||||
tools.list_append_to(self.export_src, list)
|
tools.list_append_to(self.export_src, list)
|
||||||
@ -43,6 +44,9 @@ class System:
|
|||||||
def add_export_flag(self, type, list):
|
def add_export_flag(self, type, list):
|
||||||
tools.list_append_to_2(self.export_flags, type, list)
|
tools.list_append_to_2(self.export_flags, type, list)
|
||||||
|
|
||||||
|
def set_version(self, version_list):
|
||||||
|
self.version = version_list
|
||||||
|
|
||||||
def add_action(self, name_of_state="PACKAGE", level=5, name="no-name", action=None):
|
def add_action(self, name_of_state="PACKAGE", level=5, name="no-name", action=None):
|
||||||
if name_of_state not in self.action_on_add_src_filestate:
|
if name_of_state not in self.action_on_add_src_filestate:
|
||||||
self.action_on_state[name_of_state] = [[level, name, action]]
|
self.action_on_state[name_of_state] = [[level, name, action]]
|
||||||
@ -82,6 +86,8 @@ def create_module_from_system(target, dict):
|
|||||||
destination_path=elem["dst"],
|
destination_path=elem["dst"],
|
||||||
clip_path=elem["clip"],
|
clip_path=elem["clip"],
|
||||||
recursive=elem["recursive"])
|
recursive=elem["recursive"])
|
||||||
|
if dict["system"].version != None:
|
||||||
|
myModule.package_prop["VERSION"] = dict["system"].version
|
||||||
return myModule
|
return myModule
|
||||||
|
|
||||||
|
|
||||||
@ -158,8 +164,8 @@ def exist(lib_name, target_name, target) :
|
|||||||
debug.verbose("SYSTEM: request: " + data["name"])
|
debug.verbose("SYSTEM: request: " + data["name"])
|
||||||
data["system"] = theSystem.System(target)
|
data["system"] = theSystem.System(target)
|
||||||
data["exist"] = data["system"].valid
|
data["exist"] = data["system"].valid
|
||||||
except:
|
except Exception as e:
|
||||||
debug.warning("Not find: '" + data["name"] + "' ==> get exception")
|
debug.warning("Not find: '" + data["name"] + "' ==> get exception:" + str(e))
|
||||||
return data["exist"]
|
return data["exist"]
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -145,12 +145,20 @@ def link(file, binary, target, depancy, flags, name, basic_path, static = False)
|
|||||||
for type in ["link-lib"]:
|
for type in ["link-lib"]:
|
||||||
if type in flags[view]:
|
if type in flags[view]:
|
||||||
cmd.append([("-l" + sss).replace("-l/", "/") for sss in flags[view][type] ])
|
cmd.append([("-l" + sss).replace("-l/", "/") for sss in flags[view][type] ])
|
||||||
|
for type in ["link-bin"]:
|
||||||
|
if type in flags[view]:
|
||||||
|
cmd.append(flags[view][type])
|
||||||
for type in ["link-lib"]:
|
for type in ["link-lib"]:
|
||||||
if type in depancy.flags:
|
if type in depancy.flags:
|
||||||
cmd.append([("-l" + sss).replace("-l/", "/") for sss in depancy.flags[type] ])
|
cmd.append([("-l" + sss).replace("-l/", "/") for sss in depancy.flags[type] ])
|
||||||
for type in ["link-lib"]:
|
for type in ["link-lib"]:
|
||||||
if type in target.global_flags:
|
if type in target.global_flags:
|
||||||
cmd.append([("-l" + sss).replace("-l/", "/") for sss in target.global_flags[type] ])
|
cmd.append([("-l" + sss).replace("-l/", "/") for sss in target.global_flags[type] ])
|
||||||
|
for type in ["link-bin"]:
|
||||||
|
if type in target.global_flags:
|
||||||
|
cmd.append(target.global_flags[type])
|
||||||
|
if type in depancy.flags:
|
||||||
|
cmd.append(depancy.flags[type])
|
||||||
cmd_line = tools.list_to_str(cmd)
|
cmd_line = tools.list_to_str(cmd)
|
||||||
# check the dependency for this file :
|
# check the dependency for this file :
|
||||||
if depend.need_re_package(file_dst, file_src, True, file_cmd=file_cmd, cmd_line=cmd_line) == False \
|
if depend.need_re_package(file_dst, file_src, True, file_cmd=file_cmd, cmd_line=cmd_line) == False \
|
||||||
|
@ -26,5 +26,15 @@ class System(system.System):
|
|||||||
self.valid = True
|
self.valid = True
|
||||||
# todo : create a searcher of the presence of the library:
|
# todo : create a searcher of the presence of the library:
|
||||||
self.add_export_flag("link-lib", "asound")
|
self.add_export_flag("link-lib", "asound")
|
||||||
|
self.add_header_file([
|
||||||
|
"/usr/include/alsa/*",
|
||||||
|
],
|
||||||
|
destination_path="alsa",
|
||||||
|
recursive=True)
|
||||||
|
self.add_header_file([
|
||||||
|
"/usr/include/dssi/*",
|
||||||
|
],
|
||||||
|
destination_path="dssi",
|
||||||
|
recursive=True)
|
||||||
|
|
||||||
|
|
||||||
|
33
lutin/z_system/lutinSystem_Linux_arpa.py
Normal file
33
lutin/z_system/lutinSystem_Linux_arpa.py
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
##
|
||||||
|
## @author Edouard DUPIN
|
||||||
|
##
|
||||||
|
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||||
|
##
|
||||||
|
## @license APACHE v2.0 (see license file)
|
||||||
|
##
|
||||||
|
|
||||||
|
from lutin import debug
|
||||||
|
from lutin import system
|
||||||
|
from lutin import tools
|
||||||
|
import os
|
||||||
|
|
||||||
|
class System(system.System):
|
||||||
|
def __init__(self, target):
|
||||||
|
system.System.__init__(self)
|
||||||
|
# create some HELP:
|
||||||
|
self.help="rpc : generic RPC library (developed by oracle)"
|
||||||
|
# No check ==> on the basic std libs:
|
||||||
|
self.valid = True
|
||||||
|
# todo : create a searcher of the presence of the library:
|
||||||
|
#self.add_export_flag("link-lib", "xns")
|
||||||
|
self.add_header_file([
|
||||||
|
"/usr/include/arpa/*"
|
||||||
|
],
|
||||||
|
destination_path="arpa",
|
||||||
|
recursive=True)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -38,6 +38,7 @@ class System(system.System):
|
|||||||
"/usr/include/setjmp.h*",
|
"/usr/include/setjmp.h*",
|
||||||
"/usr/include/signal.h*",
|
"/usr/include/signal.h*",
|
||||||
"/usr/include/string.h*",
|
"/usr/include/string.h*",
|
||||||
|
"/usr/include/strings.h*",
|
||||||
"/usr/include/std*",
|
"/usr/include/std*",
|
||||||
"/usr/include/tgmath.h*",
|
"/usr/include/tgmath.h*",
|
||||||
"/usr/include/time.h*",
|
"/usr/include/time.h*",
|
||||||
@ -57,39 +58,59 @@ class System(system.System):
|
|||||||
"/usr/include/getopt.h*",
|
"/usr/include/getopt.h*",
|
||||||
"/usr/include/dirent.h*",
|
"/usr/include/dirent.h*",
|
||||||
"/usr/include/setjmp.h*",
|
"/usr/include/setjmp.h*",
|
||||||
|
"/usr/include/netdb.h*",
|
||||||
|
"/usr/include/syslog.h*",
|
||||||
|
"/usr/include/memory.h*",
|
||||||
|
"/usr/include/poll.h*",
|
||||||
|
"/usr/include/termios.h*",
|
||||||
|
"/usr/include/regex.h*",
|
||||||
|
"/usr/include/semaphore.h*",
|
||||||
|
"/usr/include/libgen.h*",
|
||||||
|
"/usr/include/ifaddrs.h*",
|
||||||
|
"/usr/include/stropts.h*",
|
||||||
|
"/usr/include/pwd.h*",
|
||||||
],
|
],
|
||||||
recursive=False)
|
recursive=False)
|
||||||
self.add_header_file([
|
self.add_header_file([
|
||||||
"/usr/include/sys/*",
|
"/usr/include/sys/*",
|
||||||
],
|
],
|
||||||
destination_path="sys",
|
destination_path="sys",
|
||||||
recursive=False)
|
recursive=True)
|
||||||
self.add_header_file([
|
self.add_header_file([
|
||||||
"/usr/include/bits/*",
|
"/usr/include/bits/*",
|
||||||
],
|
],
|
||||||
destination_path="bits",
|
destination_path="bits",
|
||||||
recursive=False)
|
recursive=True)
|
||||||
self.add_header_file([
|
self.add_header_file([
|
||||||
"/usr/include/gnu/*",
|
"/usr/include/gnu/*",
|
||||||
],
|
],
|
||||||
destination_path="gnu",
|
destination_path="gnu",
|
||||||
recursive=False)
|
recursive=True)
|
||||||
self.add_header_file([
|
self.add_header_file([
|
||||||
"/usr/include/linux/*",
|
"/usr/include/linux/*",
|
||||||
],
|
],
|
||||||
destination_path="linux",
|
destination_path="linux",
|
||||||
recursive=False)
|
recursive=True)
|
||||||
self.add_header_file([
|
self.add_header_file([
|
||||||
"/usr/include/asm/*",
|
"/usr/include/asm/*",
|
||||||
],
|
],
|
||||||
destination_path="asm",
|
destination_path="asm",
|
||||||
recursive=False)
|
recursive=True)
|
||||||
self.add_header_file([
|
self.add_header_file([
|
||||||
"/usr/include/asm-generic/*",
|
"/usr/include/asm-generic/*",
|
||||||
],
|
],
|
||||||
destination_path="asm-generic",
|
destination_path="asm-generic",
|
||||||
recursive=False)
|
recursive=True)
|
||||||
self.add_export_flag("link-bin", "/usr/lib/crti.o")
|
self.add_header_file([
|
||||||
self.add_export_flag("link-bin", "/usr/lib/crt1.o")
|
"/usr/include/netinet/*",
|
||||||
|
],
|
||||||
|
destination_path="netinet",
|
||||||
|
recursive=True)
|
||||||
|
self.add_header_file([
|
||||||
|
"/usr/include/net/*",
|
||||||
|
],
|
||||||
|
destination_path="net",
|
||||||
|
recursive=True)
|
||||||
|
self.add_export_flag("link", "-B/usr/lib")
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,11 +20,13 @@ class System(system.System):
|
|||||||
self.help = "CXX: Generic C++ library"
|
self.help = "CXX: Generic C++ library"
|
||||||
self.valid = True
|
self.valid = True
|
||||||
# no check needed ==> just add this:
|
# no check needed ==> just add this:
|
||||||
self.add_module_depend(['c'])
|
self.add_module_depend([
|
||||||
|
'c'
|
||||||
|
])
|
||||||
self.add_export_flag("c++", "-D__STDCPP_GNU__")
|
self.add_export_flag("c++", "-D__STDCPP_GNU__")
|
||||||
#self.add_export_flag("c++-remove", "-nostdlib")
|
#self.add_export_flag("c++-remove", "-nostdlib")
|
||||||
#self.add_export_flag("need-libstdc++", True)
|
#self.add_export_flag("need-libstdc++", True)
|
||||||
|
self.add_export_flag("link-lib", "stdc++")
|
||||||
self.add_header_file([
|
self.add_header_file([
|
||||||
"/usr/include/c++/6.1.1/*"
|
"/usr/include/c++/6.1.1/*"
|
||||||
],
|
],
|
||||||
|
@ -25,5 +25,13 @@ class System(system.System):
|
|||||||
self.valid = True
|
self.valid = True
|
||||||
# todo : create a searcher of the presence of the library:
|
# todo : create a searcher of the presence of the library:
|
||||||
self.add_export_flag("link-lib", "jack")
|
self.add_export_flag("link-lib", "jack")
|
||||||
|
self.add_module_depend([
|
||||||
|
'uuid'
|
||||||
|
])
|
||||||
|
self.add_header_file([
|
||||||
|
"/usr/include/jack/*",
|
||||||
|
],
|
||||||
|
destination_path="jack",
|
||||||
|
recursive=True)
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,8 +22,34 @@ class System(system.System):
|
|||||||
if not os.path.isfile("/usr/include/pulse/pulseaudio.h"):
|
if not os.path.isfile("/usr/include/pulse/pulseaudio.h"):
|
||||||
# we did not find the library reqiested (just return) (automaticly set at false)
|
# we did not find the library reqiested (just return) (automaticly set at false)
|
||||||
return;
|
return;
|
||||||
|
dst_data = tools.file_read_data("/usr/include/pulse/version.h")
|
||||||
|
lines = dst_data.split("\n")
|
||||||
|
patern = "#define pa_get_headers_version() (\""
|
||||||
|
version = None
|
||||||
|
for line in lines:
|
||||||
|
if line[:len(patern)] == patern:
|
||||||
|
#Find the version line
|
||||||
|
version = line[len(patern)]
|
||||||
|
version2 = line[len(patern)+2]
|
||||||
|
debug.verbose("detect version '" + version + "'")
|
||||||
|
break;
|
||||||
|
if version == None:
|
||||||
|
debug.warning("Can not det version of Pulseaudio ... ==> remove it")
|
||||||
|
return
|
||||||
|
self.set_version([int(version),int(version2)])
|
||||||
self.valid = True
|
self.valid = True
|
||||||
# todo : create a searcher of the presence of the library:
|
# todo : create a searcher of the presence of the library:
|
||||||
self.add_export_flag("link-lib", ["pulse-simple", "pulse"])
|
self.add_export_flag("link-lib", [
|
||||||
|
"pulsecommon-" + version + ".0",
|
||||||
|
"pulse-mainloop-glib",
|
||||||
|
"pulse-simple",
|
||||||
|
"pulse"
|
||||||
|
])
|
||||||
|
self.add_export_flag("link", "-L/usr/lib/pulseaudio")
|
||||||
|
self.add_header_file([
|
||||||
|
"/usr/include/pulse/*",
|
||||||
|
],
|
||||||
|
destination_path="pulse",
|
||||||
|
recursive=True)
|
||||||
|
|
||||||
|
|
||||||
|
33
lutin/z_system/lutinSystem_Linux_rpc.py
Normal file
33
lutin/z_system/lutinSystem_Linux_rpc.py
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
##
|
||||||
|
## @author Edouard DUPIN
|
||||||
|
##
|
||||||
|
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||||
|
##
|
||||||
|
## @license APACHE v2.0 (see license file)
|
||||||
|
##
|
||||||
|
|
||||||
|
from lutin import debug
|
||||||
|
from lutin import system
|
||||||
|
from lutin import tools
|
||||||
|
import os
|
||||||
|
|
||||||
|
class System(system.System):
|
||||||
|
def __init__(self, target):
|
||||||
|
system.System.__init__(self)
|
||||||
|
# create some HELP:
|
||||||
|
self.help="rpc : generic RPC library (developed by oracle)"
|
||||||
|
# No check ==> on the basic std libs:
|
||||||
|
self.valid = True
|
||||||
|
# todo : create a searcher of the presence of the library:
|
||||||
|
self.add_export_flag("link-lib", "rpcsvc")
|
||||||
|
self.add_header_file([
|
||||||
|
"/usr/include/rpc/*"
|
||||||
|
],
|
||||||
|
destination_path="rpc",
|
||||||
|
recursive=True)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
34
lutin/z_system/lutinSystem_Linux_uuid.py
Normal file
34
lutin/z_system/lutinSystem_Linux_uuid.py
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
##
|
||||||
|
## @author Edouard DUPIN
|
||||||
|
##
|
||||||
|
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||||
|
##
|
||||||
|
## @license APACHE v2.0 (see license file)
|
||||||
|
##
|
||||||
|
|
||||||
|
from lutin import debug
|
||||||
|
from lutin import system
|
||||||
|
from lutin import tools
|
||||||
|
import os
|
||||||
|
|
||||||
|
class System(system.System):
|
||||||
|
def __init__(self, target):
|
||||||
|
system.System.__init__(self)
|
||||||
|
# create some HELP:
|
||||||
|
self.help="uuid: Unique ID library"
|
||||||
|
# check if the library exist:
|
||||||
|
if not os.path.isfile("/usr/include/uuid/uuid.h"):
|
||||||
|
# we did not find the library reqiested (just return) (automaticly set at false)
|
||||||
|
return;
|
||||||
|
self.valid = True
|
||||||
|
# todo : create a searcher of the presence of the library:
|
||||||
|
self.add_export_flag("link-lib", "uuid")
|
||||||
|
self.add_header_file([
|
||||||
|
"/usr/include/uuid/*",
|
||||||
|
],
|
||||||
|
destination_path="uuid",
|
||||||
|
recursive=True)
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user