[DEV] better isolation

This commit is contained in:
Edouard DUPIN 2016-08-08 22:23:27 +02:00
parent 3804de2078
commit 7e44373f79
10 changed files with 194 additions and 13 deletions

View File

@ -29,6 +29,7 @@ class System:
self.export_path=[]
self.action_on_state={}
self.headers=[]
self.version=None
def add_export_sources(self, list):
tools.list_append_to(self.export_src, list)
@ -43,6 +44,9 @@ class System:
def add_export_flag(self, 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):
if name_of_state not in self.action_on_add_src_filestate:
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"],
clip_path=elem["clip"],
recursive=elem["recursive"])
if dict["system"].version != None:
myModule.package_prop["VERSION"] = dict["system"].version
return myModule
@ -158,8 +164,8 @@ def exist(lib_name, target_name, target) :
debug.verbose("SYSTEM: request: " + data["name"])
data["system"] = theSystem.System(target)
data["exist"] = data["system"].valid
except:
debug.warning("Not find: '" + data["name"] + "' ==> get exception")
except Exception as e:
debug.warning("Not find: '" + data["name"] + "' ==> get exception:" + str(e))
return data["exist"]
return False

View File

@ -145,12 +145,20 @@ def link(file, binary, target, depancy, flags, name, basic_path, static = False)
for type in ["link-lib"]:
if type in flags[view]:
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"]:
if type in depancy.flags:
cmd.append([("-l" + sss).replace("-l/", "/") for sss in depancy.flags[type] ])
for type in ["link-lib"]:
if type in target.global_flags:
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)
# 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 \

View File

@ -26,5 +26,15 @@ class System(system.System):
self.valid = True
# todo : create a searcher of the presence of the library:
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)

View 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)

View File

@ -38,6 +38,7 @@ class System(system.System):
"/usr/include/setjmp.h*",
"/usr/include/signal.h*",
"/usr/include/string.h*",
"/usr/include/strings.h*",
"/usr/include/std*",
"/usr/include/tgmath.h*",
"/usr/include/time.h*",
@ -57,39 +58,59 @@ class System(system.System):
"/usr/include/getopt.h*",
"/usr/include/dirent.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)
self.add_header_file([
"/usr/include/sys/*",
],
destination_path="sys",
recursive=False)
recursive=True)
self.add_header_file([
"/usr/include/bits/*",
],
destination_path="bits",
recursive=False)
recursive=True)
self.add_header_file([
"/usr/include/gnu/*",
],
destination_path="gnu",
recursive=False)
recursive=True)
self.add_header_file([
"/usr/include/linux/*",
],
destination_path="linux",
recursive=False)
recursive=True)
self.add_header_file([
"/usr/include/asm/*",
],
destination_path="asm",
recursive=False)
recursive=True)
self.add_header_file([
"/usr/include/asm-generic/*",
],
destination_path="asm-generic",
recursive=False)
self.add_export_flag("link-bin", "/usr/lib/crti.o")
self.add_export_flag("link-bin", "/usr/lib/crt1.o")
recursive=True)
self.add_header_file([
"/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")

View File

@ -20,11 +20,13 @@ class System(system.System):
self.help = "CXX: Generic C++ library"
self.valid = True
# 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++-remove", "-nostdlib")
#self.add_export_flag("need-libstdc++", True)
self.add_export_flag("link-lib", "stdc++")
self.add_header_file([
"/usr/include/c++/6.1.1/*"
],

View File

@ -25,5 +25,13 @@ class System(system.System):
self.valid = True
# todo : create a searcher of the presence of the library:
self.add_export_flag("link-lib", "jack")
self.add_module_depend([
'uuid'
])
self.add_header_file([
"/usr/include/jack/*",
],
destination_path="jack",
recursive=True)

View File

@ -22,8 +22,34 @@ class System(system.System):
if not os.path.isfile("/usr/include/pulse/pulseaudio.h"):
# we did not find the library reqiested (just return) (automaticly set at false)
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
# 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)

View 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)

View 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)