Compare commits
35 Commits
Author | SHA1 | Date | |
---|---|---|---|
058c425feb | |||
7e6f391dbf | |||
e25ceee5a8 | |||
42e3deed44 | |||
f0690cd75a | |||
acc69912a0 | |||
73a230826b | |||
da8233d34e | |||
27f6a95d41 | |||
71e0f242bf | |||
092843cd02 | |||
3b37e78dd3 | |||
94d8b82321 | |||
4c883f177c | |||
b6a5f7e539 | |||
fb4b03a441 | |||
ed3a26a638 | |||
2a9f3feed7 | |||
e148a7e204 | |||
13e6d98ac4 | |||
45bd6e6213 | |||
82e8946227 | |||
aa96a415b5 | |||
52729c3c71 | |||
62d084b351 | |||
1c76227b27 | |||
f46c5116b1 | |||
1cf731910d | |||
a2fdd6eef9 | |||
9c9809c359 | |||
3bea09cfc2 | |||
cc397679bb | |||
33688801bb | |||
6440dc6309 | |||
e1e896fcc1 |
@@ -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("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("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")
|
||||
@@ -323,7 +323,7 @@ lutin.init()
|
||||
#available target : Linux / MacOs / Windows / Android ...
|
||||
targetName = host.OS
|
||||
config = {
|
||||
"compilator":"gcc",
|
||||
"compilator":lutinHost.HOST_DEFAULT_COMPILATOR,
|
||||
"mode":"release",
|
||||
"bus-size":"auto",
|
||||
"arch":"auto",
|
||||
@@ -364,7 +364,7 @@ for argument in localArgument:
|
||||
debug.debug("change target ==> '" + targetName + "' & reset mode : gcc&release")
|
||||
#reset properties by defauult:
|
||||
config = {
|
||||
"compilator":"gcc",
|
||||
"compilator":lutinHost.HOST_DEFAULT_COMPILATOR,
|
||||
"mode":"release",
|
||||
"bus-size":"auto",
|
||||
"arch":"auto",
|
||||
|
@@ -7,7 +7,7 @@ Lutin permit simply to compile applications and library.
|
||||
|
||||
To simply understand the use, we will use a simple library:
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
git clone http://github.con/atria-soft/etk.git
|
||||
```
|
||||
|
||||
@@ -17,7 +17,7 @@ compile a module: {#lutin_use_compile}
|
||||
|
||||
It is really simple:
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
lutin yourModuleName
|
||||
#example:
|
||||
lutin etk
|
||||
@@ -47,7 +47,7 @@ Display help: {#lutin_use_options_help}
|
||||
|
||||
Availlable everywhere ...
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
lutin -h
|
||||
lutin --help
|
||||
```
|
||||
@@ -61,7 +61,7 @@ At the end of the help you an see an help about the etk librery with the associa
|
||||
Build in color: {#lutin_use_options_color}
|
||||
---------------
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
lutin -C
|
||||
lutin --color
|
||||
```
|
||||
@@ -70,19 +70,19 @@ Display build line in pretty print mode: {#lutin_u
|
||||
----------------------------------------
|
||||
|
||||
when an error apear, the gcc or clang compile line can be really unreadable:
|
||||
```bash
|
||||
```{.sh}
|
||||
g++ -o /home/heero/dev/plop/out/Linux_x86_64/release/build/gcc/etk/obj/etk/Color.cpp.o -I/home/heero/dev/plop/etk -std=c++11 -D__CPP_VERSION__=2011 -D__TARGET_OS__Linux -D__TARGET_ARCH__x86 -D__TARGET_ADDR__64BITS -D_REENTRANT -DNDEBUG -O3 -fpic -D__STDCPP_GNU__ -Wall -Wsign-compare -Wreturn-type -Wno-write-strings -Woverloaded-virtual -Wnon-virtual-dtor -Wno-unused-variable -DMODE_RELEASE -c -MMD -MP /home/heero/dev/plop/etk/etk/Color.cpp
|
||||
```
|
||||
|
||||
whith this option you can transform this not obvious line in a readable line:
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
lutin -P
|
||||
lutin --pretty
|
||||
```
|
||||
|
||||
result:
|
||||
```bash
|
||||
```{.sh}
|
||||
g++ \
|
||||
-o /home/XXX/dev/out/Linux_x86_64/release/build/gcc/etk/obj/etk/Color.cpp.o \
|
||||
-I/home/XXX/dev/etk \
|
||||
@@ -115,7 +115,7 @@ lutin log: {#lutin_use_options_log}
|
||||
|
||||
Lutin have an internal log system. To enable or disable it just select your debug level with the option:
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
lutin -v4
|
||||
lutin --verbose 4
|
||||
```
|
||||
@@ -134,7 +134,7 @@ Select the number of CPU core used: {#lutin_use_op
|
||||
|
||||
By default lutin manage only 1 CPU core (faster to debug) but for speed requirement you can use use multiple core:
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
#for 5 core
|
||||
lutin -j5
|
||||
lutin --jobs 5
|
||||
@@ -145,7 +145,7 @@ Force rebuild all: {#lutin_use_options_rebuild_for
|
||||
|
||||
Sometime it is needed to rebuild all the program, just do:
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
lutin -B
|
||||
lutin --force-build
|
||||
# or remove the build directory
|
||||
@@ -157,7 +157,7 @@ Force strip all library and programs: {#lutin_use_
|
||||
|
||||
Force strip of output binary (remove symboles)
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
lutin -s
|
||||
lutin --force-strip
|
||||
```
|
||||
@@ -169,7 +169,7 @@ The main objective of lutin is managing the cross compilation to build from linu
|
||||
|
||||
For android you can use:
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
lutin -t Android your-module
|
||||
lutin -t Windows your-module
|
||||
```
|
||||
@@ -179,14 +179,14 @@ Build in debug mode: {#lutin_use_options_debug_rel
|
||||
|
||||
To developp it is fasted with debug tools
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
lutin -m debug your-module
|
||||
lutin -m release your-module
|
||||
```
|
||||
|
||||
You can desire to have compilation optimisation when you build in debug mode:
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
lutin -m debug --force-optimisation your-module
|
||||
```
|
||||
|
||||
@@ -212,7 +212,7 @@ Install your program after building it: {#lutin_us
|
||||
|
||||
You can install your build module:
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
lutin -m debug your-module?build?install
|
||||
```
|
||||
|
||||
|
@@ -9,7 +9,7 @@ Base of the module file: {#lutin_module_base_file}
|
||||
|
||||
To create a new module you will use a generic naming:
|
||||
|
||||
```
|
||||
```{.sh}
|
||||
lutin_module-name.py
|
||||
```
|
||||
|
||||
@@ -17,7 +17,7 @@ Replace your ``module-name`` with the delivery you want. The name can contain [a
|
||||
|
||||
In the module name you must define some values:
|
||||
|
||||
```python
|
||||
```{.py}
|
||||
#!/usr/bin/python
|
||||
import lutin.module as module
|
||||
import lutin.tools as tools
|
||||
@@ -82,11 +82,12 @@ def get_version():
|
||||
|
||||
# create the module
|
||||
# @param[in] target reference on the Target that is currently build
|
||||
# @param[in] module_name Name of the module that is extract from the file name (to be generic)
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name, get_type())
|
||||
# @param[in] my_module Module handle that migh be configured
|
||||
# @return True The module is welled configure
|
||||
# @return False The module is Not availlable (for this target or ...)
|
||||
def configure(target, my_module):
|
||||
...
|
||||
return my_module
|
||||
return True
|
||||
```
|
||||
|
||||
Thes it is simple to specify build for:
|
||||
@@ -95,7 +96,7 @@ Create a new Module (LIBRARY): {#lutin_module_libr
|
||||
==============================
|
||||
|
||||
What to change:
|
||||
```python
|
||||
```{.py}
|
||||
def get_type():
|
||||
return "LIBRARY"
|
||||
```
|
||||
@@ -112,7 +113,7 @@ Generic Binary: {#lutin_module_binar
|
||||
---------------
|
||||
|
||||
What to change:
|
||||
```python
|
||||
```{.py}
|
||||
def get_type():
|
||||
return "BINARY"
|
||||
```
|
||||
@@ -126,7 +127,7 @@ Create a new Module (TEST-BINARY / TOOL-BINARY): {#lutin_module_binar
|
||||
Two binary are really usefull in developpement, the tools and the test-unit, This is the reason why we specify for this 2 cases.
|
||||
|
||||
Add the subElement description:
|
||||
```python
|
||||
```{.py}
|
||||
def get_type():
|
||||
return "BINARY"
|
||||
|
||||
@@ -134,7 +135,7 @@ def get_sub_type():
|
||||
return "TEST"
|
||||
```
|
||||
or:
|
||||
```python
|
||||
```{.py}
|
||||
def get_type():
|
||||
return "BINARY"
|
||||
|
||||
@@ -149,7 +150,7 @@ Create a new Module (DATA): {#lutin_module_data
|
||||
This pode permit to only copy data and no dependency with compilling system
|
||||
|
||||
What to change:
|
||||
```python
|
||||
```{.py}
|
||||
def get_type():
|
||||
return "DATA"
|
||||
```
|
||||
@@ -163,8 +164,8 @@ Add file to compile: {#lutin_module_int
|
||||
|
||||
This is simple: (you just need to specify all the file to compile)
|
||||
|
||||
```python
|
||||
def create(target, module_name):
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
|
||||
# add the file to compile:
|
||||
@@ -186,8 +187,8 @@ The developper must isolate the external include and internal include, then luti
|
||||
This permit to check error inclusion directly in developpement and separate the ```#include "XXX.h"``` and the ```#include <lib-xxx/XXX.h>```
|
||||
|
||||
Add file to external include:
|
||||
```python
|
||||
def create(target, module_name):
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
|
||||
my_module.add_header_file([
|
||||
@@ -199,8 +200,8 @@ def create(target, module_name):
|
||||
```
|
||||
|
||||
You can add a path to your local include:
|
||||
```python
|
||||
def create(target, module_name):
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
|
||||
my_module.add_path(os.path.join(tools.get_current_path(__file__), "lib-name"))
|
||||
@@ -213,32 +214,32 @@ Add Sub-dependency: {#lutin_module_int
|
||||
-------------------
|
||||
|
||||
All library need to add at minimum of a simple library (C lib) and other if needed. To do it jus call:
|
||||
```python
|
||||
def create(target, module_name):
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
|
||||
# add dependency of the generic C library:
|
||||
my_module.add_module_depend('c')
|
||||
my_module.add_depend('c')
|
||||
# add dependency of the generic C++ library:
|
||||
my_module.add_module_depend('cxx')
|
||||
my_module.add_depend('cxx')
|
||||
# add dependency of the generic math library:
|
||||
my_module.add_module_depend('m')
|
||||
my_module.add_depend('m')
|
||||
# or other user lib:
|
||||
my_module.add_module_depend('lib-name')
|
||||
my_module.add_depend('lib-name')
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
The system can have optinnal sub-library, then if you just want to add an optionnal dependency:
|
||||
```python
|
||||
def create(target, module_name):
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
|
||||
# Add an optionnal dependency (set flag in CPP build if the subLib exist) ==> flag is locally set
|
||||
my_module.add_optionnal_module_depend('z', ["c++", "-DLIB_NAME_BUILD_ZLIB"])
|
||||
my_module.add_optionnal_depend('z', ["c++", "-DLIB_NAME_BUILD_ZLIB"])
|
||||
|
||||
# Add an optionnal dependency (set flag in CPP build if the subLib exist) ==> flag is exported in external upper build
|
||||
my_module.add_optionnal_module_depend('z', ["c++", "-DLIB_NAME_BUILD_ZLIB"], export=True)
|
||||
my_module.add_optionnal_depend('z', ["c++", "-DLIB_NAME_BUILD_ZLIB"], export=True)
|
||||
|
||||
...
|
||||
```
|
||||
@@ -247,8 +248,8 @@ Compilation adn link flags/libs: {#lutin_module_int
|
||||
--------------------------------
|
||||
|
||||
It is possible to define local and external flags (external are set internal too):
|
||||
```python
|
||||
def create(target, module_name):
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
# external flags:
|
||||
my_module.add_flag('link-lib', "pthread", export=True)
|
||||
@@ -263,8 +264,8 @@ build mode (release/debug): {#lutin_module_int
|
||||
---------------------------
|
||||
|
||||
To add somes element dependent of the build mode:
|
||||
```python
|
||||
def create(target, module_name):
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
|
||||
if target.get_mode() == "release":
|
||||
@@ -280,8 +281,8 @@ build type target: {#lutin_module_int
|
||||
|
||||
To add somes element dependent of the target type:
|
||||
|
||||
```python
|
||||
def create(target, module_name):
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
|
||||
if "Windows" in target.get_type():
|
||||
@@ -308,8 +309,8 @@ Add some data in the install path (share path): {#lutin_module_in
|
||||
|
||||
You can install a simple file:
|
||||
|
||||
```python
|
||||
def create(target, module_name):
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
|
||||
# copy file in the share/binanyName/ path (no sub path)
|
||||
@@ -320,8 +321,8 @@ def create(target, module_name):
|
||||
|
||||
Copy multiple files (change path)
|
||||
|
||||
```python
|
||||
def create(target, module_name):
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
|
||||
my_module.copy_path('data/*', 'destinationPath')
|
||||
@@ -333,7 +334,7 @@ display some debug to help writing code: {#lutin_module_in
|
||||
----------------------------------------
|
||||
|
||||
|
||||
```python
|
||||
```{.py}
|
||||
import lutin.debug as debug
|
||||
|
||||
def function(...):
|
||||
@@ -350,12 +351,12 @@ A Full template: {#lutin_module_fu
|
||||
================
|
||||
|
||||
Create the file:
|
||||
```
|
||||
```{.sh}
|
||||
lutin_module-name.py
|
||||
```
|
||||
|
||||
With:
|
||||
```python
|
||||
```{.py}
|
||||
#!/usr/bin/python
|
||||
import lutin.module as module
|
||||
import lutin.tools as tools
|
||||
@@ -414,17 +415,20 @@ def get_compagny_name():
|
||||
# Note: this fucntion is optionnal.
|
||||
def get_maintainer():
|
||||
return ["Mr NAME SurName <my-email@group.com>"]
|
||||
# return "authors.txt"
|
||||
|
||||
# Version of the library
|
||||
# Note: this fucntion is optionnal.
|
||||
def get_version():
|
||||
return [0,1,"dev"]
|
||||
# return "version.txt"
|
||||
|
||||
# create the module
|
||||
# @param[in] target reference on the Target that is currently build
|
||||
# @param[in] module_name Name of the module that is extract from the file name (to be generic)
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name, get_type())
|
||||
# @param[in] my_module Module handle that migh be configured
|
||||
# @return True The module is welled configure
|
||||
# @return False The module is Not availlable (for this target or ...)
|
||||
def configure(target, my_module):
|
||||
|
||||
# add the file to compile:
|
||||
my_module.add_src_file([
|
||||
@@ -441,28 +445,28 @@ def create(target, module_name):
|
||||
my_module.add_path(os.path.join(tools.get_current_path(__file__), "lib-name"))
|
||||
|
||||
# add dependency of the generic C library:
|
||||
my_module.add_module_depend('c')
|
||||
my_module.add_depend('c')
|
||||
# add dependency of the generic C++ library:
|
||||
my_module.add_module_depend('cxx')
|
||||
my_module.add_depend('cxx')
|
||||
# add dependency of the generic math library:
|
||||
my_module.add_module_depend('m')
|
||||
my_module.add_depend('m')
|
||||
# or other user lib:
|
||||
my_module.add_module_depend([
|
||||
my_module.add_depend([
|
||||
'lib-name1',
|
||||
'lib-name2'
|
||||
])
|
||||
|
||||
# Add an optionnal dependency (set flag in CPP build if the subLib exist) ==> flag is locally set
|
||||
my_module.add_optionnal_module_depend('z', ["c++", "-DLIB_NAME_BUILD_ZLIB"])
|
||||
my_module.add_optionnal_depend('z', ["c++", "-DLIB_NAME_BUILD_ZLIB"])
|
||||
|
||||
# Add an optionnal dependency (set flag in CPP build if the subLib exist) ==> flag is exported in external upper build
|
||||
my_module.add_optionnal_module_depend('z', ["c++", "-DLIB_NAME_BUILD_ZLIB"], export=True)
|
||||
my_module.add_optionnal_depend('z', ["c++", "-DLIB_NAME_BUILD_ZLIB"], export=True)
|
||||
|
||||
# external flags:
|
||||
my_module.add_flag('link-lib', "pthread", export=True)
|
||||
my_module.add_flag('c++', "-DHELLO_FLAG=\"kljlkj\"", export=True)
|
||||
# internal flags:
|
||||
my_module.add_flags('c', "-DMODE_RELEASE")
|
||||
my_module.add_flag('c', "-DMODE_RELEASE")
|
||||
|
||||
if target.get_mode() == "release":
|
||||
pass
|
||||
@@ -485,7 +489,8 @@ def create(target, module_name):
|
||||
|
||||
my_module.copy_path('data/*', 'destinationPath')
|
||||
|
||||
return my_module
|
||||
# Return True if the module is compatible with the target or ...
|
||||
return True
|
||||
```
|
||||
|
||||
|
||||
|
112
doc/100_Use_on_Ios.md
Normal file
112
doc/100_Use_on_Ios.md
Normal file
@@ -0,0 +1,112 @@
|
||||
Build and deploy for IOS {#lutin_ios}
|
||||
========================
|
||||
|
||||
@tableofcontents
|
||||
|
||||
Deploy on IOs is a little complicated, due to the fact Apple demand a developper licence.
|
||||
|
||||
To deploy you need to buy a [developper licence](https://developer.apple.com/account) nearly 99€ / year
|
||||
|
||||
Step 1: deploy your application with Xcode {#lutin_ios_xcode}
|
||||
==========================================
|
||||
|
||||
it can be conplicated to do the first deploy (register tablette:watch ... or user ...)
|
||||
Then the best way is now to create your first game sample application with XCode and deploy it on your device ...
|
||||
|
||||
|
||||
when all your problem are solved, I can help you...
|
||||
|
||||
**Note:**
|
||||
|
||||
```
|
||||
To add a device, in xcode select your top project, and in the section "signing" select "automatic manage signing", select your team and activate your device ...
|
||||
```
|
||||
|
||||
|
||||
step 2: Build for IOs {#lutin_ios_build}
|
||||
=====================
|
||||
|
||||
This step is simpliest... All is integrated:
|
||||
|
||||
Select the target IOs
|
||||
|
||||
```{.sh}
|
||||
lutin -C -D -tIOs yourApplication?build
|
||||
```
|
||||
|
||||
This is done .... now deploy ...
|
||||
|
||||
|
||||
|
||||
step 3: Deploy {#lutin_ios_deploy}
|
||||
==============
|
||||
|
||||
Do it ... it does not work ...
|
||||
|
||||
```{.sh}
|
||||
lutin -C -D -tIOs yourApplication?install
|
||||
```
|
||||
|
||||
Appliocation ID
|
||||
---------------
|
||||
|
||||
It miss some things to do:
|
||||
|
||||
create a reference of you application in [apple interface](https://developer.apple.com/account/ios/identifier/bundle/create)
|
||||
|
||||
|
||||
your application id is:
|
||||
|
||||
```{.py}
|
||||
get_compagny_type() + "." + get_compagny_name() + "." + module.get_name()
|
||||
```
|
||||
|
||||
For example if you module is named: ```lutin_application.py```
|
||||
|
||||
And you set description:
|
||||
|
||||
```{.py}
|
||||
def get_compagny_type():
|
||||
return "com"
|
||||
|
||||
def get_compagny_name():
|
||||
return "compagny NAME"
|
||||
|
||||
```
|
||||
|
||||
your id is: ```com.compagnyname.application```
|
||||
|
||||
|
||||
When you have create the application, it will generate for you a unique ID, you can see it on the webpage, it is like: ```DFGDSFGSDFGS.com.compagnyname.application```
|
||||
|
||||
In your module definition you need to add:
|
||||
```{.py}
|
||||
my_module.set_pkg("APPLE_APPLICATION_IOS_ID", "DFGDSFGSDFGS");
|
||||
```
|
||||
|
||||
Team signing ID
|
||||
---------------
|
||||
|
||||
the second point to do is creating the file: ```.iosKey.txt``` in you root path of your workspace (where you execute lutin)
|
||||
|
||||
it will contain sothing like:
|
||||
```
|
||||
'iPhone Developer: Francis DUGENOUX (YRRQE5KGTH)'
|
||||
|
||||
```
|
||||
|
||||
you can optain it with executing:
|
||||
```{.sh}
|
||||
certtool y | grep "Developer"
|
||||
```
|
||||
|
||||
|
||||
|
||||
Install:
|
||||
--------
|
||||
|
||||
Now it works ...
|
||||
|
||||
```{.sh}
|
||||
lutin -C -D -tIOs yourApplication?build
|
||||
```
|
@@ -63,7 +63,7 @@ Install lutin:
|
||||
--------------
|
||||
|
||||
Just run:
|
||||
```bash
|
||||
```{.sh}
|
||||
pip install lutin
|
||||
```
|
||||
|
||||
@@ -71,24 +71,24 @@ Install pip:
|
||||
------------
|
||||
|
||||
Install pip on debian/ubuntu:
|
||||
```bash
|
||||
```{.sh}
|
||||
sudo apt-get install pip
|
||||
```
|
||||
|
||||
Install pip on ARCH-linux:
|
||||
```bash
|
||||
```{.sh}
|
||||
sudo pacman -S pip
|
||||
```
|
||||
|
||||
Install pip on MacOs:
|
||||
```bash
|
||||
```{.sh}
|
||||
sudo easy_install pip
|
||||
```
|
||||
|
||||
Install from sources:
|
||||
---------------------
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
git clone http://github.com/HeeroYui/lutin.git
|
||||
cd lutin
|
||||
sudo ./setup.py install
|
||||
@@ -105,6 +105,7 @@ Tutorals: {#lutin_mainpage_tutorial}
|
||||
- @ref lutin_concept
|
||||
- @ref lutin_use
|
||||
- @ref lutin_module
|
||||
- @ref lutin_ios
|
||||
|
||||
|
||||
License (APACHE v2.0) {#lutin_mainpage_licence}
|
||||
@@ -138,3 +139,6 @@ Some other problem example:
|
||||
- none is really simple to write.
|
||||
|
||||
Then I create a simple interface that manage all I need. and written in python to permit to be faster on every platform.
|
||||
|
||||
|
||||
[link macos account developper](https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppStoreDistributionTutorial/AddingYourAccounttoXcode/AddingYourAccounttoXcode.html)
|
||||
|
@@ -6,7 +6,7 @@ import doxy.tools as tools
|
||||
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name)
|
||||
my_module.set_version([2.0.0])
|
||||
my_module.set_version([2,2,0])
|
||||
my_module.set_title("lutin: build system and packager")
|
||||
my_module.set_website("http://HeeroYui.github.io/" + module_name)
|
||||
my_module.set_website_sources("http://github.com/HeeroYui/" + module_name)
|
||||
|
@@ -15,10 +15,13 @@ from . import debug
|
||||
# print os.name # ==> 'posix'
|
||||
if platform.system() == "Linux":
|
||||
OS = "Linux"
|
||||
HOST_DEFAULT_COMPILATOR = "gcc"
|
||||
elif platform.system() == "Windows":
|
||||
OS = "Windows"
|
||||
HOST_DEFAULT_COMPILATOR = "gcc"
|
||||
elif platform.system() == "Darwin":
|
||||
OS = "MacOs"
|
||||
HOST_DEFAULT_COMPILATOR = "clang"
|
||||
else:
|
||||
debug.error("Unknow the Host OS ... '" + platform.system() + "'")
|
||||
|
||||
|
232
lutin/module.py
232
lutin/module.py
@@ -244,7 +244,14 @@ class Module:
|
||||
if sizeX > 0:
|
||||
debug.verbose("Image file : " + display_source + " ==> " + destination + " resize=(" + str(sizeX) + "," + str(sizeY) + ")")
|
||||
fileName, fileExtension = os.path.splitext(os.path.join(self._origin_path,source))
|
||||
image.resize(source, os.path.join(target.get_build_path_data(self._name), destination), sizeX, sizeY, file_cmd)
|
||||
# Create the resized file in a temporary path to auto-copy when needed
|
||||
temporary_file = os.path.join(target.get_build_path_temporary_generate(self._name), "image_generation", destination)
|
||||
image.resize(source, temporary_file, sizeX, sizeY, file_cmd)
|
||||
# Copy file in statndard mode
|
||||
tools.copy_file(temporary_file,
|
||||
os.path.join(target.get_build_path_data(self._name), destination),
|
||||
file_cmd,
|
||||
in_list=copy_list)
|
||||
else:
|
||||
debug.verbose("Might copy file : " + display_source + " ==> " + destination)
|
||||
tools.copy_file(source,
|
||||
@@ -521,17 +528,14 @@ class Module:
|
||||
list_sub_file_needed_to_build = []
|
||||
self._sub_heritage_list = heritage.HeritageList()
|
||||
# optionnal dependency :
|
||||
for dep, option, export in self._depends_optionnal:
|
||||
for dep, option, export, src_file, header_file in self._depends_optionnal:
|
||||
debug.verbose("try find optionnal dependency: '" + str(dep) + "'")
|
||||
inherit_list, isBuilt = target.build(dep, True)
|
||||
if isBuilt == True:
|
||||
self._local_heritage.add_depends(dep);
|
||||
# TODO : Add optionnal Flags ...
|
||||
# ==> do it really better ...
|
||||
if export == False:
|
||||
self.add_flag(option[0], option[1]);
|
||||
else:
|
||||
self.add_flag(option[0], option[1], export=True);
|
||||
self.add_flag(option[0], option[1], export=export);
|
||||
self.add_src_file(src_file)
|
||||
self.add_header_file(header_file)
|
||||
# add at the heritage list :
|
||||
self._sub_heritage_list.add_heritage_list(inherit_list)
|
||||
for dep in self._depends:
|
||||
@@ -599,7 +603,7 @@ class Module:
|
||||
if elem_generate["install"] == True:
|
||||
have_only_generate_file = True
|
||||
if have_only_generate_file == True:
|
||||
self.add_path(generate_path)
|
||||
self._add_path(generate_path)
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# -- install header (do it first for extern lib and gcov better interface) --
|
||||
@@ -625,7 +629,7 @@ class Module:
|
||||
# remove unneded files (NOT folder ...)
|
||||
tools.clean_directory(include_path, copy_list)
|
||||
# add the pat to the usable dirrectory
|
||||
self.add_path(include_path)
|
||||
self._add_path(include_path)
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# -- Sources compilation --
|
||||
@@ -656,7 +660,7 @@ class Module:
|
||||
if res_file["action"] == "add":
|
||||
list_sub_file_needed_to_build.append(res_file["file"])
|
||||
elif res_file["action"] == "path":
|
||||
self.add_path(res_file["path"], type='c')
|
||||
self._add_path(res_file["path"], type='c')
|
||||
else:
|
||||
debug.error("an not do action for : " + str(res_file))
|
||||
except ValueError:
|
||||
@@ -685,7 +689,7 @@ class Module:
|
||||
if res_file["action"] == "add":
|
||||
list_sub_file_needed_to_build.append(res_file["file"])
|
||||
elif res_file["action"] == "path":
|
||||
self.add_path(res_file["path"], type='c')
|
||||
self._add_path(res_file["path"], type='c')
|
||||
else:
|
||||
debug.error("an not do action for : " + str(res_file))
|
||||
except ValueError:
|
||||
@@ -860,7 +864,7 @@ class Module:
|
||||
# ----------------------------------------------------
|
||||
debug.debug("install datas")
|
||||
copy_list={}
|
||||
self.image_to_build(target, copy_list) # TODO : When file is resized, the final file is not removed if the file is not needed anymore
|
||||
self.image_to_build(target, copy_list)
|
||||
self.files_to_build(target, copy_list)
|
||||
self.paths_to_build(target, copy_list)
|
||||
#real copy files
|
||||
@@ -939,49 +943,81 @@ class Module:
|
||||
def add_depend(self, list):
|
||||
tools.list_append_to(self._depends, list, True)
|
||||
|
||||
## @brief deprecated ...
|
||||
## @return None
|
||||
def add_module_depend(self, list):
|
||||
debug.warning("[" + self._name + "] add_module_depend is deprecated ==> use add_depend(...)")
|
||||
self.add_depend(list)
|
||||
|
||||
##
|
||||
## @brief Add an optionnal dependency on this module
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] module_name (string) Name of the optionnal dependency
|
||||
## @param[in] compilation_flags ([string,string]) flag to add if dependency if find.
|
||||
## @param[in] export (bool) export the flat that has been requested to add if module is present.
|
||||
## @param[in] src_file ([string,...]) File to compile if the dependecy if found.
|
||||
## @param[in] header_file ([string,...]) File to add in header if the dependecy if found.
|
||||
## @return None
|
||||
##
|
||||
def add_optionnal_depend(self, module_name, compilation_flags=["", ""], export=False):
|
||||
tools.list_append_and_check(self._depends_optionnal, [module_name, compilation_flags, export], True)
|
||||
|
||||
## @brief deprecated ...
|
||||
## @return None
|
||||
def add_optionnal_module_depend(self, module_name, compilation_flags=["", ""], export=False):
|
||||
debug.warning("[" + self._name + "] add_optionnal_module_depend is deprecated ==> use add_optionnal_depend(...)")
|
||||
self.add_optionnal_depend(module_name, compilation_flags, export)
|
||||
def add_optionnal_depend(self, module_name, compilation_flags=["", ""], export=False, src_file=[], header_file=[]):
|
||||
tools.list_append_and_check(self._depends_optionnal, [module_name, compilation_flags, export, src_file, header_file], True)
|
||||
|
||||
##
|
||||
## @brief Add a path to include when build
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] list ([string,...] or string) List of path to include
|
||||
## @param[in] list ([string,...] or string) List of path to include (default: local path) only relative path...
|
||||
## @param[in] type (string) inclusion group name 'c', 'c++', 'java' ...
|
||||
## @param[in] export (bool) export the include path.
|
||||
## @return None
|
||||
##
|
||||
def add_path(self, list, type='c', export=False):
|
||||
def add_path(self, list=".", type='c', export=False):
|
||||
if tools.get_type_string(list) == "list":
|
||||
add_list = []
|
||||
for elem in list:
|
||||
if len(elem) > 1 \
|
||||
and elem[0] == '/':
|
||||
# unix case
|
||||
debug.warning(" add_path(" + list + ")")
|
||||
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)
|
||||
elif len(elem) > 2 \
|
||||
and elem[1] == ':':
|
||||
# windows case :
|
||||
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 2.x)")
|
||||
add_list.append(elem)
|
||||
if elem == ".":
|
||||
add_list.append(tools.get_current_path(self._origin_file))
|
||||
else:
|
||||
add_list.append(os.path.join(tools.get_current_path(self._origin_file), elem))
|
||||
else:
|
||||
if len(list) > 1 \
|
||||
and list[0] == '/':
|
||||
# unix case
|
||||
debug.warning(" add_path(" + list + ")")
|
||||
debug.warning("[" + self._name + "] Not permited to add a path that start in / directory (only relative path) (compatibility until 2.x)")
|
||||
add_list = list
|
||||
elif len(list) > 2 \
|
||||
and list[1] == ':':
|
||||
# windows case :
|
||||
debug.warning(" add_path(" + list + ")")
|
||||
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 = list
|
||||
elif list == ".":
|
||||
add_list = tools.get_current_path(self._origin_file)
|
||||
else:
|
||||
add_list = os.path.join(tools.get_current_path(self._origin_file), list)
|
||||
debug.verbose("Convert path : " + str(list) + " in " + str(add_list))
|
||||
self._add_path(add_list, type, export)
|
||||
|
||||
##
|
||||
## @brief (INTERNAL API) Add a path to include when build
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] list ([string,...] or string) List of path to include (default: local path)
|
||||
## @param[in] type (string) inclusion group name 'c', 'c++', 'java' ...
|
||||
## @param[in] export (bool) export the include path.
|
||||
## @return None
|
||||
##
|
||||
def _add_path(self, list=".", type='c', export=False):
|
||||
if export == True:
|
||||
tools.list_append_to_2(self._path["export"], type, list)
|
||||
else:
|
||||
tools.list_append_to_2(self._path["local"], type, list)
|
||||
|
||||
## @brief deprecated ...
|
||||
## @return None
|
||||
def add_export_path(self, list, type='c'):
|
||||
debug.warning("[" + self._name + "] add_export_path is deprecated ==> use add_path(xxx, yyy, export=True)")
|
||||
self.add_path(list, type, export=True)
|
||||
|
||||
##
|
||||
## @brief Add compilation flags
|
||||
## @param[in] self (handle) Class handle
|
||||
@@ -996,18 +1032,6 @@ class Module:
|
||||
else:
|
||||
tools.list_append_to_2(self._flags["local"], type, list)
|
||||
|
||||
## @brief deprecated ...
|
||||
## @return None
|
||||
def add_export_flag(self, type, list):
|
||||
debug.warning("[" + self._name + "] add_export_flag is deprecated ==> use add_flag(xxx, yyy, export=True)")
|
||||
self.add_flag(type, list, export=True)
|
||||
|
||||
## @brief deprecated ...
|
||||
## @return None
|
||||
def compile_flags(self, type, list):
|
||||
debug.warning("[" + self._name + "] compile_flags is deprecated ==> use add_flag(xxx, yyy)")
|
||||
self.add_flag(type, list)
|
||||
|
||||
##
|
||||
## @brief Set the compilation version of the
|
||||
## @param[in] self (handle) Class handle
|
||||
@@ -1022,7 +1046,7 @@ class Module:
|
||||
or compilator_type == "C++":
|
||||
cpp_version_list = [1999, 2003, 2011, 2014, 2017]
|
||||
if version not in cpp_version_list:
|
||||
debug.error("can not select CPP version : " + str(version) + " not in " + str(cpp_version_list))
|
||||
debug.error("[" + self._name + "] Can not select CPP version : " + str(version) + " not in " + str(cpp_version_list))
|
||||
# select API version:
|
||||
api_version = 1999
|
||||
if same_as_api == True:
|
||||
@@ -1032,12 +1056,12 @@ class Module:
|
||||
}
|
||||
self._flags["export"]["c++-version"] = api_version
|
||||
if gnu == True and same_as_api == True:
|
||||
debug.warning("Can not propagate the gnu extention of the CPP vesion for API");
|
||||
debug.debug("[" + self._name + "] Can not propagate the gnu extention of the CPP vesion for API");
|
||||
elif compilator_type == "c" \
|
||||
or compilator_type == "C":
|
||||
c_version_list = [1989, 1990, 1999, 2011]
|
||||
if version not in c_version_list:
|
||||
debug.error("can not select C version : " + str(version) + " not in " + str(c_version_list))
|
||||
debug.error("[" + self._name + "] Can not select C version : " + str(version) + " not in " + str(c_version_list))
|
||||
# select API version:
|
||||
api_version = 1999
|
||||
if same_as_api == True:
|
||||
@@ -1047,9 +1071,9 @@ class Module:
|
||||
}
|
||||
self._flags["export"]["c-version"] = api_version
|
||||
if gnu == True and same_as_api == True:
|
||||
debug.warning("Can not propagate the gnu extention of the C vesion for API");
|
||||
debug.debug("[" + self._name + "] Can not propagate the gnu extention of the C vesion for API");
|
||||
else:
|
||||
debug.warning("Can not set version of compilator:" + str(compilator_type));
|
||||
debug.warning("[" + self._name + "] Can not set version of compilator:" + str(compilator_type));
|
||||
|
||||
##
|
||||
## @brief Add source file to compile
|
||||
@@ -1109,7 +1133,7 @@ class Module:
|
||||
if destination_path != None:
|
||||
debug.verbose("Change destination PATH: '" + str(destination_path) + "'")
|
||||
new_list = []
|
||||
if type(list) == str:
|
||||
if tools.get_type_string(list) == "string":
|
||||
list = [list]
|
||||
for elem in list:
|
||||
base = os.path.basename(elem)
|
||||
@@ -1215,7 +1239,7 @@ class Module:
|
||||
## @return None
|
||||
##
|
||||
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:
|
||||
print(' ' + str(description))
|
||||
for elem in input_list:
|
||||
@@ -1258,6 +1282,8 @@ class Module:
|
||||
for element in self._path["export"]:
|
||||
value = self._path["export"][element]
|
||||
self._print_list('export path "' + str(element) + '" ' + str(len(value)), value)
|
||||
print('-----------------------------------------------')
|
||||
return True
|
||||
|
||||
##
|
||||
## @brief Get packaging property variable
|
||||
@@ -1270,9 +1296,6 @@ class Module:
|
||||
return copy.deepcopy(self._package_prop[name])
|
||||
return None
|
||||
|
||||
def pkg_set(self, variable, value):
|
||||
debug.warning("[" + self._name + "] DEPRECATED : pkg_set(...) replaced by set_pkg(...)")
|
||||
self.set_pkg(variable, value)
|
||||
##
|
||||
## @brief Set packaging variables
|
||||
## @param[in] self (handle) Class handle
|
||||
@@ -1305,7 +1328,20 @@ class Module:
|
||||
self._package_prop["COMPAGNY_NAME2"] = val2
|
||||
self._package_prop_default["COMPAGNY_NAME2"] = False
|
||||
elif "ICON" == variable:
|
||||
self._package_prop[variable] = value
|
||||
if len(value) > 1 \
|
||||
and value[0] == '/':
|
||||
# unix case
|
||||
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 2.x)")
|
||||
self._package_prop[variable] = value
|
||||
elif len(value) > 2 \
|
||||
and value[1] == ':':
|
||||
# windows case :
|
||||
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 2.x)")
|
||||
self._package_prop[variable] = value
|
||||
else:
|
||||
self._package_prop[variable] = os.path.join(tools.get_current_path(self._origin_file), value)
|
||||
self._package_prop_default[variable] = False
|
||||
elif "MAINTAINER" == variable:
|
||||
self._package_prop[variable] = value
|
||||
@@ -1331,6 +1367,22 @@ class Module:
|
||||
else:
|
||||
self._package_prop[variable] = value
|
||||
self._package_prop_default[variable] = False
|
||||
elif "ANDROID_SIGN" == variable:
|
||||
if len(value) > 1 \
|
||||
and value[0] == '/':
|
||||
# unix case
|
||||
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 2.x)")
|
||||
self._package_prop[variable] = value
|
||||
elif len(value) > 2 \
|
||||
and value[1] == ':':
|
||||
# windows case :
|
||||
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 2.x)")
|
||||
self._package_prop[variable] = value
|
||||
else:
|
||||
self._package_prop[variable] = os.path.join(tools.get_current_path(self._origin_file), value)
|
||||
self._package_prop_default[variable] = False
|
||||
elif variable in ["DESCRIPTION",
|
||||
"VERSION",
|
||||
"VERSION_CODE",
|
||||
@@ -1342,8 +1394,7 @@ class Module:
|
||||
"ANDROID_APPL_TYPE",
|
||||
"ADMOD_ID",
|
||||
"APPLE_APPLICATION_IOS_ID",
|
||||
"LICENSE",
|
||||
"ANDROID_SIGN"]:
|
||||
"LICENSE"]:
|
||||
self._package_prop[variable] = value
|
||||
self._package_prop_default[variable] = False
|
||||
elif "ADMOD_POSITION" == variable:
|
||||
@@ -1366,9 +1417,6 @@ class Module:
|
||||
if self._package_prop_default[variable] == True:
|
||||
self.set_pkg(variable, value)
|
||||
|
||||
def pkg_add(self, variable, value):
|
||||
debug.warning("[" + self._name + "] DEPRECATED : pkg_add(...) replaced by add_pkg(...)")
|
||||
self.add_pkg(variable, value)
|
||||
##
|
||||
## @brief add an element in tha package property
|
||||
## @param[in] self (handle) Class handle
|
||||
@@ -1443,26 +1491,31 @@ def load_module(target, name):
|
||||
the_module_file = mod[1]
|
||||
the_module = __import__(env.get_build_system_base_name() + __start_module_name + name)
|
||||
# get basic module properties:
|
||||
property = get_module_option(the_module, name)
|
||||
property = get_module_option(os.path.dirname(mod[1]), the_module, name)
|
||||
# configure the module:
|
||||
if "create" in dir(the_module):
|
||||
tmp_element = the_module.create(target, name)
|
||||
if tmp_element != None:
|
||||
# overwrite some package default property (if not set by user)
|
||||
if property["compagny-type"] != None:
|
||||
tmp_element._pkg_set_if_default("COMPAGNY_TYPE", property["compagny-type"])
|
||||
if property["compagny-name"] != None:
|
||||
tmp_element._pkg_set_if_default("COMPAGNY_NAME", property["compagny-name"])
|
||||
if property["maintainer"] != None:
|
||||
tmp_element._pkg_set_if_default("MAINTAINER", property["maintainer"])
|
||||
if property["name"] != None:
|
||||
tmp_element._pkg_set_if_default("NAME", property["name"])
|
||||
if property["description"] != None:
|
||||
tmp_element._pkg_set_if_default("DESCRIPTION", property["description"])
|
||||
if property["license"] != None:
|
||||
tmp_element._pkg_set_if_default("LICENSE", property["license"])
|
||||
if property["version"] != None:
|
||||
tmp_element._pkg_set_if_default("VERSION", property["version"])
|
||||
if "configure" in dir(the_module):
|
||||
# create the module:
|
||||
tmp_element = Module(the_module_file, name, property["type"])
|
||||
# overwrite some package default property (if not set by user)
|
||||
if property["compagny-type"] != None:
|
||||
tmp_element._pkg_set_if_default("COMPAGNY_TYPE", property["compagny-type"])
|
||||
if property["compagny-name"] != None:
|
||||
tmp_element._pkg_set_if_default("COMPAGNY_NAME", property["compagny-name"])
|
||||
if property["maintainer"] != None:
|
||||
tmp_element._pkg_set_if_default("MAINTAINER", property["maintainer"])
|
||||
if property["name"] != None:
|
||||
tmp_element._pkg_set_if_default("NAME", property["name"])
|
||||
if property["description"] != None:
|
||||
tmp_element._pkg_set_if_default("DESCRIPTION", property["description"])
|
||||
if property["license"] != None:
|
||||
tmp_element._pkg_set_if_default("LICENSE", property["license"])
|
||||
if property["version"] != None:
|
||||
tmp_element._pkg_set_if_default("VERSION", property["version"])
|
||||
# call user to configure it:
|
||||
ret = the_module.configure(target, tmp_element)
|
||||
if ret == False:
|
||||
# the user request remove the capabilities of this module for this platform
|
||||
tmp_element = None
|
||||
else:
|
||||
debug.warning(" no function 'create' in the module : " + mod[0] + " from:'" + mod[1] + "'")
|
||||
continue
|
||||
@@ -1505,21 +1558,22 @@ def list_all_module():
|
||||
##
|
||||
def list_all_module_with_desc():
|
||||
global __module_list
|
||||
tmpList = []
|
||||
tmp_list = []
|
||||
for mod in __module_list:
|
||||
sys.path.append(os.path.dirname(mod[1]))
|
||||
the_module = __import__(env.get_build_system_base_name() + __start_module_name + mod[0])
|
||||
tmpList.append(get_module_option(the_module, mod[0]))
|
||||
return tmpList
|
||||
tmp_list.append(get_module_option(os.path.dirname(mod[1]), the_module, mod[0]))
|
||||
return tmp_list
|
||||
|
||||
|
||||
##
|
||||
## @brief Get a specific module options
|
||||
## @param[in] path (string) Pathof the module
|
||||
## @param[in] the_module (handle) @ref Module handle
|
||||
## @param[in] name (string) Name of the module
|
||||
## @return a Map with the keys: "name", "description", "type", "sub-type", "license", "compagny-type", "compagny-name", "maintainer", "version", "version-id"
|
||||
##
|
||||
def get_module_option(the_module, name):
|
||||
def get_module_option(path, the_module, name):
|
||||
type = None
|
||||
sub_type = None
|
||||
description = None
|
||||
@@ -1535,7 +1589,7 @@ def get_module_option(the_module, name):
|
||||
if "get_type" in list_of_function_in_factory:
|
||||
type = the_module.get_type()
|
||||
else:
|
||||
debug.debug(" function get_type() must be provided in the module: " + name)
|
||||
debug.error(" function get_type() must be provided in the module: " + name)
|
||||
|
||||
if "get_sub_type" in list_of_function_in_factory:
|
||||
sub_type = the_module.get_sub_type()
|
||||
@@ -1564,10 +1618,10 @@ def get_module_option(the_module, name):
|
||||
compagny_name = the_module.get_compagny_name()
|
||||
|
||||
if "get_maintainer" in list_of_function_in_factory:
|
||||
maintainer = the_module.get_maintainer()
|
||||
maintainer = tools.get_maintainer_from_file_or_direct(path, the_module.get_maintainer())
|
||||
|
||||
if "get_version" in list_of_function_in_factory:
|
||||
version = the_module.get_version()
|
||||
version = tools.get_version_from_file_or_direct(path, the_module.get_version())
|
||||
|
||||
if "get_version_id" in list_of_function_in_factory:
|
||||
version_id = the_module.get_version_id()
|
||||
|
@@ -55,8 +55,9 @@ def run_command_no_lock_out(cmd_line):
|
||||
p = subprocess.Popen(args)
|
||||
except subprocess.CalledProcessError as e:
|
||||
debug.error("subprocess.CalledProcessError : " + str(args))
|
||||
except:
|
||||
debug.error("Exception on : " + str(args))
|
||||
return
|
||||
#except:
|
||||
# debug.error("Exception on : " + str(args))
|
||||
# launch the subprocess:
|
||||
p.communicate()
|
||||
|
||||
|
@@ -155,11 +155,15 @@ class System:
|
||||
debug.verbose("add element :" + str(elem) + " elems=" + str(self._export_flags[elem]))
|
||||
module.add_flag(elem, self._export_flags[elem], export=True)
|
||||
# add module dependency
|
||||
module.add_depend(self._export_depends)
|
||||
if self._export_depends != []:
|
||||
module.add_depend(self._export_depends)
|
||||
# add exporting sources
|
||||
module.add_src_file(self._export_src)
|
||||
if self._export_src != []:
|
||||
module.add_src_file(self._export_src)
|
||||
# add export path
|
||||
module.add_path(self._export_path, export=True)
|
||||
if self._export_path != []:
|
||||
# no control on API
|
||||
module._add_path(self._export_path, export=True)
|
||||
# Export all actions ...
|
||||
for elem in self._action_on_state:
|
||||
level, name, action = self._action_on_state[elem]
|
||||
@@ -250,52 +254,67 @@ def display():
|
||||
##
|
||||
## @brief Check if a system Module is availlable for a specific target
|
||||
## @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
|
||||
## @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
|
||||
debug.verbose("exist= " + lib_name + " in " + target_name)
|
||||
if target_name not in __system_list:
|
||||
debug.verbose("exist= " + lib_name + " in " + str(list_target_name))
|
||||
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
|
||||
for data in __system_list[target_name]:
|
||||
if data["name"] == lib_name:
|
||||
# we find it in the List ==> need to check if it is present in the system :
|
||||
if data["loaded"] == False:
|
||||
debug.verbose("add to path: '" + os.path.dirname(data["path"]) + "'")
|
||||
sys.path.append(os.path.dirname(data["path"]))
|
||||
debug.verbose("import system : '" + data["name"] + "'")
|
||||
the_system = __import__(env.get_build_system_base_name() + __start_system_name + target_name + "_" + data["name"])
|
||||
#create the system module
|
||||
debug.verbose("SYSTEM: request: " + str(data["name"]))
|
||||
if "System" in dir(the_system):
|
||||
data["system"] = the_system.System(target)
|
||||
data["exist"] = data["system"].get_valid()
|
||||
else:
|
||||
debug.warning("Not find: '" + data["name"] + "' ==> get exception")
|
||||
return data["exist"]
|
||||
for target_name in reversed(list_target_name):
|
||||
if target_name not in __system_list:
|
||||
continue
|
||||
for data in __system_list[target_name]:
|
||||
if data["name"] == lib_name:
|
||||
# we find it in the List ==> need to check if it is present in the system :
|
||||
if data["loaded"] == False:
|
||||
debug.verbose("add to path: '" + os.path.dirname(data["path"]) + "'")
|
||||
sys.path.append(os.path.dirname(data["path"]))
|
||||
debug.verbose("import system : '" + data["name"] + "'")
|
||||
the_system = __import__(env.get_build_system_base_name() + __start_system_name + target_name + "_" + data["name"])
|
||||
#create the system module
|
||||
debug.verbose("SYSTEM: request: " + str(data["name"]))
|
||||
if "System" in dir(the_system):
|
||||
data["system"] = the_system.System(target)
|
||||
data["exist"] = data["system"].get_valid()
|
||||
else:
|
||||
debug.warning("Not find: '" + data["name"] + "' ==> get exception")
|
||||
return data["exist"]
|
||||
return False
|
||||
|
||||
##
|
||||
## @brief Load a system Module for a specific target
|
||||
## @param[in] target (handle) Handle on the @ref Target build engine
|
||||
## @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
|
||||
##
|
||||
def load(target, lib_name, target_name):
|
||||
def load(target, lib_name, list_target_name):
|
||||
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!")
|
||||
for data in __system_list[target_name]:
|
||||
if data["name"] == lib_name:
|
||||
if data["exist"] == False:
|
||||
debug.error("you must call this function after checking of the system exist() !2!")
|
||||
if data["module"] == None:
|
||||
# create a module from the system interface...
|
||||
data["module"] = create_module_from_system(target, data)
|
||||
data["loaded"] = True
|
||||
target.add_module(data["module"])
|
||||
return
|
||||
return
|
||||
for target_name in reversed(list_target_name):
|
||||
if target_name not in __system_list:
|
||||
continue
|
||||
for data in __system_list[target_name]:
|
||||
if data["name"] == lib_name:
|
||||
if data["exist"] == False:
|
||||
debug.error("you must call this function after checking of the system exist() !2!")
|
||||
if data["module"] == None:
|
||||
# create a module from the system interface...
|
||||
data["module"] = create_module_from_system(target, data)
|
||||
data["loaded"] = True
|
||||
target.add_module(data["module"])
|
||||
return
|
||||
|
||||
|
101
lutin/target.py
101
lutin/target.py
@@ -27,11 +27,15 @@ from . import env
|
||||
class Target:
|
||||
##
|
||||
## @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] arch (string) specific parameter for gcc -arch element
|
||||
##
|
||||
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
|
||||
self.config = config
|
||||
|
||||
@@ -48,10 +52,11 @@ class Target:
|
||||
|
||||
self.end_generate_package = config["generate-package"]
|
||||
# todo : remove this :
|
||||
self._name = name
|
||||
self._config_based_on = [name]
|
||||
self._name = name[-1]
|
||||
self._config_based_on = name
|
||||
debug.info("=================================");
|
||||
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("=================================");
|
||||
|
||||
self.set_cross_base()
|
||||
@@ -78,8 +83,9 @@ class Target:
|
||||
self.path_generate_code="/generate_header"
|
||||
self.path_arch = "/" + self._name
|
||||
|
||||
for elem in self._config_based_on:
|
||||
self.add_flag("c", '-D__TARGET_OS__' + elem)
|
||||
self.add_flag("c", [
|
||||
'-D__TARGET_OS__' + self._name,
|
||||
'-D__TARGET_ARCH__' + self.config["arch"],
|
||||
'-D__TARGET_ADDR__' + self.config["bus-size"] + 'BITS',
|
||||
'-D_REENTRANT'
|
||||
@@ -206,15 +212,38 @@ class Target:
|
||||
def get_simulation(self):
|
||||
return self.config["simulation"]
|
||||
|
||||
##
|
||||
## @brief Get compilator name (clang / gcc)
|
||||
## @param[in] self (handle) Class handle
|
||||
## @return (bool) name of the compilator requested
|
||||
##
|
||||
def get_compilator(self):
|
||||
return self.config["compilator"]
|
||||
|
||||
##
|
||||
## @brief Get architecture name (x86 / arm / ...)
|
||||
## @param[in] self (handle) Class handle
|
||||
## @return (bool) name of the arch requested
|
||||
##
|
||||
def get_arch(self):
|
||||
return self.config["arch"]
|
||||
##
|
||||
## @brief Get architecture name (x86 / arm / ...)
|
||||
## @param[in] self (handle) Class handle
|
||||
## @return (bool) name of the arch requested
|
||||
##
|
||||
def get_bus_size(self):
|
||||
return self.config["bus-size"]
|
||||
|
||||
##
|
||||
## @brief Add global target flags
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] type (string) inclusion group name 'c', 'c++', 'java' ...
|
||||
## @param[in] list ([string,...] or string) List of path to include
|
||||
## @param[in] in_list ([string,...] or string) List of path to include
|
||||
## @return None
|
||||
##
|
||||
def add_flag(self, type, list):
|
||||
tools.list_append_to_2(self.global_flags, type, list)
|
||||
def add_flag(self, in_type, in_list):
|
||||
tools.list_append_to_2(self.global_flags, in_type, in_list)
|
||||
|
||||
##
|
||||
## @brief Update basic tree path positions on the build tree
|
||||
@@ -225,6 +254,7 @@ class Target:
|
||||
self.path_out = os.path.join("out", self._name + "_" + self.config["arch"] + "_" + self.config["bus-size"], self.config["mode"])
|
||||
self.path_final = os.path.join("final", self.config["compilator"])
|
||||
self.path_staging = os.path.join("staging", self.config["compilator"])
|
||||
self.path_staging_tmp = os.path.join("staging_tmp", self.config["compilator"])
|
||||
self.path_build = os.path.join("build", self.config["compilator"])
|
||||
|
||||
# TODO: Remove this from here ==> this is a tools
|
||||
@@ -361,8 +391,11 @@ class Target:
|
||||
## @param[in] name (string) Name of the module
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_staging_path(self, name):
|
||||
return os.path.join(tools.get_run_path(), self.path_out, self.path_staging, name)
|
||||
def get_staging_path(self, name, tmp=False):
|
||||
if tmp == False:
|
||||
return os.path.join(tools.get_run_path(), self.path_out, self.path_staging, name)
|
||||
else:
|
||||
return os.path.join(tools.get_run_path(), self.path_out, self.path_staging_tmp, name)
|
||||
|
||||
##
|
||||
## @brief Get the build path ==> dependency file, object files, cmdlines files, generate files, local install headers ...
|
||||
@@ -461,8 +494,8 @@ class Target:
|
||||
## @param[in] name (string) Name of the package
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_staging_path_bin(self, name):
|
||||
return os.path.join(self.get_staging_path(name), self.path_bin)
|
||||
def get_staging_path_bin(self, name, tmp=False):
|
||||
return os.path.join(self.get_staging_path(name, tmp), self.path_bin)
|
||||
|
||||
##
|
||||
## @brief Get the lib path for staging step
|
||||
@@ -470,8 +503,8 @@ class Target:
|
||||
## @param[in] name (string) Name of the package
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_staging_path_lib(self, name):
|
||||
return os.path.join(self.get_staging_path(name), self.path_lib, name)
|
||||
def get_staging_path_lib(self, name, tmp=False):
|
||||
return os.path.join(self.get_staging_path(name, tmp), self.path_lib, name)
|
||||
|
||||
##
|
||||
## @brief Get the data path for staging step
|
||||
@@ -479,8 +512,8 @@ class Target:
|
||||
## @param[in] name (string) Name of the package
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_staging_path_data(self, name):
|
||||
return os.path.join(self.get_staging_path(name), self.path_data, name)
|
||||
def get_staging_path_data(self, name, tmp=False):
|
||||
return os.path.join(self.get_staging_path(name, tmp), self.path_data, name)
|
||||
|
||||
##
|
||||
## @brief Get the include path for staging step
|
||||
@@ -575,9 +608,9 @@ class Target:
|
||||
module.load_module(self, name)
|
||||
return True;
|
||||
# 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:
|
||||
system.load(self, name, self._name)
|
||||
system.load(self, name, self._config_based_on)
|
||||
return True;
|
||||
# we did not find the module ...
|
||||
return False;
|
||||
@@ -766,6 +799,7 @@ class Target:
|
||||
## @param[in] static The package is build in static mode
|
||||
##
|
||||
def make_package(self, pkg_name, pkg_properties, base_pkg_path, heritage_list):
|
||||
debug.debug("make_package [START]")
|
||||
#The package generated depend of the type of the element:
|
||||
end_point_module_name = heritage_list.list_heritage[-1].name
|
||||
module = self.get_module(end_point_module_name)
|
||||
@@ -787,6 +821,7 @@ class Target:
|
||||
if module.get_type() == 'PACKAGE':
|
||||
debug.info("Can not create package for package");
|
||||
return
|
||||
debug.debug("make_package [STOP]")
|
||||
return
|
||||
|
||||
##
|
||||
@@ -799,6 +834,7 @@ class Target:
|
||||
## @return False Nothing has been copied
|
||||
##
|
||||
def make_package_binary_data(self, path_package, pkg_name, base_pkg_path, heritage_list, static):
|
||||
debug.debug("make_package_binary_data [START]")
|
||||
target_shared_path = os.path.join(path_package, self.pkg_path_data)
|
||||
if static == True:
|
||||
path_package_data = os.path.join(target_shared_path, pkg_name)
|
||||
@@ -833,6 +869,7 @@ class Target:
|
||||
ret_copy = tools.copy_list(copy_list)
|
||||
# remove unneded files (NOT folder ...)
|
||||
ret_remove = tools.clean_directory(target_shared_path, copy_list)
|
||||
debug.debug("make_package_binary_data [STOP]")
|
||||
return ret_copy or ret_remove
|
||||
|
||||
##
|
||||
@@ -845,6 +882,7 @@ class Target:
|
||||
## @return False Nothing has been copied
|
||||
##
|
||||
def make_package_binary_bin(self, path_package, pkg_name, base_pkg_path, heritage_list, static):
|
||||
debug.debug("make_package_binary_bin [START]")
|
||||
copy_list={}
|
||||
path_package_bin = os.path.join(path_package, self.pkg_path_bin)
|
||||
tools.create_directory_of_file(path_package_bin)
|
||||
@@ -860,6 +898,7 @@ class Target:
|
||||
if self.pkg_path_bin != "":
|
||||
# remove unneded files (NOT folder ...)
|
||||
ret_remove = tools.clean_directory(path_package_bin, copy_list)
|
||||
debug.debug("make_package_binary_bin [STOP]")
|
||||
return ret_copy or ret_remove
|
||||
|
||||
##
|
||||
@@ -872,6 +911,7 @@ class Target:
|
||||
## @return False Nothing has been copied
|
||||
##
|
||||
def make_package_binary_lib(self, path_package, pkg_name, base_pkg_path, heritage_list, static):
|
||||
debug.debug("make_package_binary_lib [START]")
|
||||
copy_list={}
|
||||
path_package_lib = os.path.join(path_package, self.pkg_path_lib)
|
||||
if static == False:
|
||||
@@ -895,10 +935,12 @@ class Target:
|
||||
if self.pkg_path_lib != "":
|
||||
# remove unneded files (NOT folder ...)
|
||||
ret_remove = tools.clean_directory(path_package_lib, copy_list)
|
||||
debug.debug("make_package_binary_lib [STOP]")
|
||||
return ret_copy or ret_remove
|
||||
|
||||
|
||||
def make_package_generic_files(self, path_package, pkg_properties, pkg_name, base_pkg_path, heritage_list, static):
|
||||
debug.debug("make_package_generic_files [START]")
|
||||
## Create version file:
|
||||
ret_version = tools.file_write_data(os.path.join(path_package, self.pkg_path_version_file),
|
||||
tools.version_to_string(pkg_properties["VERSION"]),
|
||||
@@ -959,6 +1001,7 @@ class Target:
|
||||
ret_changelog = tools.file_write_data(change_log_file_dest,
|
||||
"No changelog data " + pkg_name + "\n",
|
||||
only_if_new=True)
|
||||
debug.debug("make_package_generic_files [STOP]")
|
||||
return ret_version \
|
||||
or ret_maintainer \
|
||||
or ret_appl_name \
|
||||
@@ -966,6 +1009,30 @@ class Target:
|
||||
or ret_readme \
|
||||
or ret_changelog
|
||||
|
||||
def install_package(self, pkg_name):
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.info("-- Install package '" + pkg_name + "'")
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.error("action not implemented ...")
|
||||
|
||||
def un_install_package(self, pkg_name):
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.info("-- Un-Install package '" + pkg_name + "'")
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.error("action not implemented ...")
|
||||
|
||||
def run(self, pkg_name, option_list):
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.info("-- Run package '" + pkg_name + "' + option: " + str(option_list))
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.error("action not implemented ...")
|
||||
|
||||
def show_log(self, pkg_name):
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.info("-- Show log logcat '" + pkg_name + "'")
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.error("action not implemented ...")
|
||||
|
||||
##
|
||||
## @brief convert a s list of string in a string separated by a ","
|
||||
## @param[in] list List of element to transform
|
||||
|
103
lutin/tools.py
103
lutin/tools.py
@@ -316,6 +316,14 @@ def store_warning(file, output, err):
|
||||
file2.flush()
|
||||
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:
|
||||
def list_append_and_check(listout, newElement, order):
|
||||
@@ -339,13 +347,100 @@ def list_append_to(out_list, in_list, order=False):
|
||||
else:
|
||||
debug.warning("can not add in list other than {list/dict/str} : " + str(type(in_list)))
|
||||
|
||||
def list_append_to_2(listout, module, list, order=False):
|
||||
def list_append_to_2(listout, module, in_list, order=False):
|
||||
# sepcial cse of bool
|
||||
if type(list) == bool:
|
||||
listout[module] = list
|
||||
if type(in_list) == bool:
|
||||
listout[module] = in_list
|
||||
return
|
||||
# add list in the Map
|
||||
if module not in listout:
|
||||
listout[module] = []
|
||||
# add elements...
|
||||
list_append_to(listout[module], list, order)
|
||||
list_append_to(listout[module], in_list, order)
|
||||
|
||||
|
||||
##
|
||||
## @brief The vertion number can be set in an external file to permit to have a singe position to change when create a vew version
|
||||
## @param[in] path_module (string) Path of the module position
|
||||
## @param[in] filename_or_version (string or list) Path of the version or the real version lint parameter
|
||||
## @return (list) List of version number
|
||||
##
|
||||
def get_version_from_file_or_direct(path_module, filename_or_version):
|
||||
# check case of iser set the version directly
|
||||
if type(filename_or_version) == list:
|
||||
return filename_or_version
|
||||
# this use a version file
|
||||
file_data = file_read_data(os.path.join(path_module, filename_or_version))
|
||||
if len(file_data) == 0:
|
||||
debug.warning("not enought data in the file version size=0 " + path_module + " / " + filename_or_version)
|
||||
return [0,0,0]
|
||||
lines = file_data.split("\n")
|
||||
if len(lines) != 1:
|
||||
debug.warning("More thatn one line in the file version ==> bas case use mode: 'XX', XX.YYY', 'XX.Y.ZZZ' or 'XX.Y-dev' : " + path_module + " / " + filename_or_version)
|
||||
return [0,0,0]
|
||||
line = lines[0]
|
||||
debug.debug("Parse line: '" + line + "'")
|
||||
#check if we have "-dev"
|
||||
dev_mode = False
|
||||
if line[-4:] == "-dev":
|
||||
dev_mode = True
|
||||
line = line[:-4]
|
||||
out = []
|
||||
list_elem = line.split('.')
|
||||
for elem in list_elem:
|
||||
out.append(int(elem))
|
||||
if dev_mode == True:
|
||||
out.append("dev")
|
||||
debug.debug(" ==> " + str(out))
|
||||
return out
|
||||
|
||||
##
|
||||
## @brief Get the list of the authors frim an input list or a file
|
||||
## @param[in] path_module (string) Path of the module position
|
||||
## @param[in] filename_or_version (string or list) Path of the author file or the real list of authors
|
||||
## @return (list) List of authors
|
||||
##
|
||||
def get_maintainer_from_file_or_direct(path_module, filename_or_author):
|
||||
# check case of iser set the version directly
|
||||
if type(filename_or_author) == list:
|
||||
return filename_or_author
|
||||
# this use a version file
|
||||
file_data = file_read_data(os.path.join(path_module, filename_or_author))
|
||||
if len(file_data) == 0:
|
||||
debug.warning("not enought data in the file author size=0 " + path_module + " / " + filename_or_author)
|
||||
return []
|
||||
# One user by line and # for comment line
|
||||
out = []
|
||||
for elem in file_data.split('\n'):
|
||||
if len(elem) == 0:
|
||||
continue
|
||||
if elem[0] == "#":
|
||||
# comment ...
|
||||
continue
|
||||
out.append(elem)
|
||||
return out
|
||||
|
||||
|
||||
|
||||
def remove_element(data, to_remove):
|
||||
base_data = []
|
||||
for elem in data:
|
||||
if type(elem) == list:
|
||||
for elem2 in elem:
|
||||
base_data.append(elem2)
|
||||
else:
|
||||
base_data.append(elem)
|
||||
base_remove = []
|
||||
for elem in to_remove:
|
||||
if type(elem) == list:
|
||||
for elem2 in elem:
|
||||
base_remove.append(elem2)
|
||||
else:
|
||||
base_remove.append(elem)
|
||||
out = []
|
||||
for elem in base_data:
|
||||
if elem not in base_remove:
|
||||
out.append(elem)
|
||||
return out;
|
||||
|
||||
|
||||
|
@@ -85,19 +85,30 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
|
||||
cmd.append(get_version_compilation_flags(flags, depancy.flags))
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
cmd.append(target.global_flags["c"])
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
cmd.append(depancy.flags["c"])
|
||||
except:
|
||||
pass
|
||||
list_flags = [];
|
||||
if "c" in target.global_flags:
|
||||
list_flags.append(target.global_flags["c"])
|
||||
if "c" in depancy.flags:
|
||||
list_flags.append(depancy.flags["c"])
|
||||
for view in ["local", "export"]:
|
||||
try:
|
||||
cmd.append(flags[view]["c"])
|
||||
except:
|
||||
pass
|
||||
if view in flags:
|
||||
if "c" in flags[view]:
|
||||
list_flags.append(flags[view]["c"])
|
||||
# get blacklist of flags
|
||||
list_flags_blacklist = [];
|
||||
if "c-remove" in target.global_flags:
|
||||
list_flags_blacklist.append(target.global_flags["c-remove"])
|
||||
if "c-remove" in depancy.flags:
|
||||
list_flags_blacklist.append(depancy.flags["c-remove"])
|
||||
for view in ["local", "export"]:
|
||||
if view in flags:
|
||||
if "c-remove" in flags[view]:
|
||||
list_flags_blacklist.append(flags[view]["c-remove"])
|
||||
# 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")
|
||||
cmd.append("-MMD")
|
||||
cmd.append("-MP")
|
||||
|
@@ -54,12 +54,6 @@ def get_output_type():
|
||||
def get_support_multithreading():
|
||||
return True
|
||||
|
||||
def remove_element(data, to_remove):
|
||||
out = []
|
||||
for elem in data:
|
||||
if elem not in to_remove:
|
||||
out.append(elem)
|
||||
return out;
|
||||
|
||||
##
|
||||
## @brief Commands for running gcc to compile a C++ file in object file.
|
||||
@@ -94,48 +88,36 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
|
||||
except:
|
||||
pass
|
||||
list_flags = [];
|
||||
try:
|
||||
if "c" in target.global_flags:
|
||||
list_flags.append(target.global_flags["c"])
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
if "c++" in target.global_flags:
|
||||
list_flags.append(target.global_flags["c++"])
|
||||
except:
|
||||
pass
|
||||
for type in ["c", "c++"]:
|
||||
try:
|
||||
if type in depancy.flags:
|
||||
list_flags.append(depancy.flags[type])
|
||||
except:
|
||||
pass
|
||||
for view in ["local", "export"]:
|
||||
for type in ["c", "c++"]:
|
||||
try:
|
||||
list_flags.append(flags[view][type])
|
||||
except:
|
||||
pass
|
||||
if view in flags:
|
||||
for type in ["c", "c++"]:
|
||||
if type in flags[view]:
|
||||
list_flags.append(flags[view][type])
|
||||
# get blacklist of flags
|
||||
list_flags_blacklist = [];
|
||||
try:
|
||||
if "c-remove" in target.global_flags:
|
||||
list_flags_blacklist.append(target.global_flags["c-remove"])
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
if "c++-remove" in target.global_flags:
|
||||
list_flags_blacklist.append(target.global_flags["c++-remove"])
|
||||
except:
|
||||
pass
|
||||
for type in ["c-remove", "c++-remove"]:
|
||||
try:
|
||||
if type in depancy.flags:
|
||||
list_flags_blacklist.append(depancy.flags[type])
|
||||
except:
|
||||
pass
|
||||
for view in ["local", "export"]:
|
||||
for type in ["c-remove", "c++-remove"]:
|
||||
try:
|
||||
list_flags_blacklist.append(flags[view][type])
|
||||
except:
|
||||
pass
|
||||
if view in flags:
|
||||
for type in ["c-remove", "c++-remove"]:
|
||||
if type in flags[view]:
|
||||
list_flags_blacklist.append(flags[view][type])
|
||||
# apply blacklisting of data and add it on the cmdLine
|
||||
cmd.append(remove_element(list_flags, list_flags_blacklist));
|
||||
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(file_src)
|
||||
# Create cmd line
|
||||
|
@@ -165,7 +165,7 @@ def link(file, binary, target, depancy, flags, name, basic_path, static=False):
|
||||
# get the file size of the non strip file
|
||||
originSize = tools.file_size(file_dst);
|
||||
debug.print_element("SharedLib(strip)", name, "", "")
|
||||
if target.name == "MacOs":
|
||||
if "MacOs" in target.get_type():
|
||||
cmdLineStrip=tools.list_to_str([
|
||||
target.strip,
|
||||
"-u",
|
||||
|
@@ -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))
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
cmd.append(target.global_flags["c"])
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
cmd.append(target.global_flags["m"])
|
||||
except:
|
||||
pass
|
||||
list_flags = [];
|
||||
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"])
|
||||
for type in ["c", "m"]:
|
||||
try:
|
||||
cmd.append(depancy.flags[type])
|
||||
except:
|
||||
pass
|
||||
if type in depancy.flags:
|
||||
list_flags.append(depancy.flags[type])
|
||||
for view in ["local", "export"]:
|
||||
for type in ["c", "m"]:
|
||||
try:
|
||||
cmd.append(flags[view][type])
|
||||
except:
|
||||
pass
|
||||
if view in flags:
|
||||
for type in ["c", "m"]:
|
||||
if type in flags[view]:
|
||||
list_flags.append(flags[view][type])
|
||||
# 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("-x objective-c")
|
||||
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))
|
||||
except:
|
||||
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"]:
|
||||
try:
|
||||
cmd.append(target.global_flags[type])
|
||||
except:
|
||||
pass
|
||||
for type in ["c", "c++", "m", "mm"]:
|
||||
try:
|
||||
cmd.append(depancy.flags[type])
|
||||
except:
|
||||
pass
|
||||
for view in ["export", "local"]:
|
||||
for type in ["c", "c++", "m", "mm"]:
|
||||
try:
|
||||
cmd.append(flags[view][type])
|
||||
except:
|
||||
pass
|
||||
if type in depancy.flags:
|
||||
list_flags.append(depancy.flags[type])
|
||||
for view in ["local", "export"]:
|
||||
if view in flags:
|
||||
for type in ["c", "c++", "m", "mm"]:
|
||||
if type in flags[view]:
|
||||
list_flags.append(flags[view][type])
|
||||
# get blacklist of flags
|
||||
list_flags_blacklist = [];
|
||||
if "c-remove" in target.global_flags:
|
||||
list_flags_blacklist.append(target.global_flags["c-remove"])
|
||||
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"])
|
||||
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("-x objective-c++")
|
||||
cmd.append(file_src)
|
||||
|
27
lutin/z_system/lutinSystem_IOs_CoreGraphics.py
Normal file
27
lutin/z_system/lutinSystem_IOs_CoreGraphics.py
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("CoreAudio : Ios interface for core graphic (all time present, just system interface)")
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link", "-framework CoreGraphics")
|
||||
self.add_depend("UIKit")
|
||||
|
||||
|
27
lutin/z_system/lutinSystem_IOs_Foundation.py
Normal file
27
lutin/z_system/lutinSystem_IOs_Foundation.py
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("CoreAudio : Ios interface for fundation (all time present, just system interface)")
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link", "-framework Foundation")
|
||||
self.add_depend("QuartzCore")
|
||||
|
||||
|
27
lutin/z_system/lutinSystem_IOs_GLKit.py
Normal file
27
lutin/z_system/lutinSystem_IOs_GLKit.py
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("CoreAudio : Ios interface for openGL (all time present, just system interface)")
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link", "-framework GLKit")
|
||||
self.add_depend("Foundation")
|
||||
|
||||
|
26
lutin/z_system/lutinSystem_IOs_QuartzCore.py
Normal file
26
lutin/z_system/lutinSystem_IOs_QuartzCore.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("CoreAudio : Ios interface for core application (all time present, just system interface)")
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link", "-framework QuartzCore")
|
||||
|
||||
|
27
lutin/z_system/lutinSystem_IOs_UIKit.py
Normal file
27
lutin/z_system/lutinSystem_IOs_UIKit.py
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("CoreAudio : Ios interface for graphic UX (all time present, just system interface)")
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link", "-framework UIKit")
|
||||
self.add_depend("GLKit")
|
||||
|
||||
|
24
lutin/z_system/lutinSystem_IOs_c.py
Normal file
24
lutin/z_system/lutinSystem_IOs_c.py
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("C: Generic C library")
|
||||
self.add_flag("c-remove","-nodefaultlibs")
|
||||
self.set_valid(True)
|
||||
|
30
lutin/z_system/lutinSystem_IOs_opengl.py
Normal file
30
lutin/z_system/lutinSystem_IOs_opengl.py
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
self.add_flag('link', [
|
||||
"-framework OpenGLES"])
|
||||
|
||||
|
44
lutin/z_system/lutinSystem_IOs_pthread.py
Normal file
44
lutin/z_system/lutinSystem_IOs_pthread.py
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("pthread : Generic multithreading system\n Can be install with the package:\n - pthread-dev")
|
||||
# check if the library exist:
|
||||
"""
|
||||
if not os.path.isfile("/usr/include/pthread.h"):
|
||||
# we did not find the library reqiested (just return) (automaticly set at false)
|
||||
return;
|
||||
"""
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link-lib", "pthread")
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
"""
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/sched.h",
|
||||
"/usr/include/pthread.h"
|
||||
],
|
||||
clip_path="/usr/include/")
|
||||
"""
|
||||
|
||||
|
||||
|
44
lutin/z_system/lutinSystem_Linux_SDL.py
Normal file
44
lutin/z_system/lutinSystem_Linux_SDL.py
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("SDL: SDL Gui abstraction")
|
||||
# check if the library exist:
|
||||
if not os.path.isfile("/usr/include/SDL/SDL.h"):
|
||||
# we did not find the library reqiested (just return) (automaticly set at false)
|
||||
return;
|
||||
self.set_valid(True)
|
||||
self.add_depend([
|
||||
'opengl',
|
||||
'c'
|
||||
])
|
||||
self.add_flag("link-lib", "SDL")
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/SDL/*",
|
||||
],
|
||||
destination_path="SDL",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/SDL/*",
|
||||
],
|
||||
destination_path="",
|
||||
recursive=True)
|
||||
|
||||
|
@@ -27,28 +27,11 @@ class System(system.System):
|
||||
])
|
||||
self.add_flag('link-lib', 'GL')
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
self.add_header_file([
|
||||
"/usr/include/GL/*"
|
||||
],
|
||||
destination_path="GL",
|
||||
recursive=True)
|
||||
|
||||
"""
|
||||
if target.name=="Linux":
|
||||
|
||||
elif target.name=="Android":
|
||||
my_module.add_flag('link-lib', "GLESv2")
|
||||
elif target.name=="Windows":
|
||||
my_module.add_depend([
|
||||
"glew"
|
||||
])
|
||||
elif target.name=="MacOs":
|
||||
my_module.add_flag('link', [
|
||||
"-framework OpenGL"])
|
||||
elif target.name=="IOs":
|
||||
my_module.add_flag('link', [
|
||||
"-framework OpenGLES"
|
||||
])
|
||||
"""
|
||||
|
||||
|
||||
|
||||
|
42
lutin/z_system/lutinSystem_Linux_va.py
Normal file
42
lutin/z_system/lutinSystem_Linux_va.py
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("va : Video Acceleration")
|
||||
# check if the library exist:
|
||||
if not os.path.isfile("/usr/include/va/va.h"):
|
||||
# we did not find the library reqiested (just return) (automaticly set at false)
|
||||
return;
|
||||
# No check ==> on the basic std libs:
|
||||
self.set_valid(True)
|
||||
self.add_depend([
|
||||
'X11'
|
||||
])
|
||||
self.add_flag("link-lib", ["va", "va-drm", "va-x11"])
|
||||
if env.get_isolate_system() == True:
|
||||
#self.add_flag("link-lib", "xns")
|
||||
self.add_header_file([
|
||||
"/usr/include/va/*"
|
||||
],
|
||||
destination_path="va",
|
||||
recursive=True)
|
||||
|
||||
|
||||
|
||||
|
41
lutin/z_system/lutinSystem_Linux_vdpau.py
Normal file
41
lutin/z_system/lutinSystem_Linux_vdpau.py
Normal file
@@ -0,0 +1,41 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("vdpau : Video decaudatge hardware Acceleration")
|
||||
# check if the library exist:
|
||||
if not os.path.isfile("/usr/include/vdpau/vdpau.h"):
|
||||
# we did not find the library reqiested (just return) (automaticly set at false)
|
||||
return;
|
||||
# No check ==> on the basic std libs:
|
||||
self.set_valid(True)
|
||||
self.add_flag("link-lib", "vdpau")
|
||||
self.add_depend([
|
||||
'X11'
|
||||
])
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/vdpau/*"
|
||||
],
|
||||
destination_path="vdpau",
|
||||
recursive=True)
|
||||
|
||||
|
||||
|
||||
|
32
lutin/z_system/lutinSystem_MacOs_AVFoundation.py
Normal file
32
lutin/z_system/lutinSystem_MacOs_AVFoundation.py
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
self.add_flag('link', [
|
||||
"-framework AVFoundation"
|
||||
])
|
||||
|
||||
|
||||
|
25
lutin/z_system/lutinSystem_MacOs_AppKit.py
Normal file
25
lutin/z_system/lutinSystem_MacOs_AppKit.py
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("CoreAudio : MacOs interface for application builder kit (all time present, just system interface)")
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link", "-framework AppKit")
|
||||
|
26
lutin/z_system/lutinSystem_MacOs_Cocoa.py
Normal file
26
lutin/z_system/lutinSystem_MacOs_Cocoa.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("CoreAudio : MacOs interface for basic cocoa graphic (all time present, just system interface)")
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link", "-framework Cocoa")
|
||||
self.add_depend("QuartzCore")
|
||||
|
32
lutin/z_system/lutinSystem_MacOs_CoreGraphics.py
Normal file
32
lutin/z_system/lutinSystem_MacOs_CoreGraphics.py
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
self.add_flag('link', [
|
||||
"-framework CoreGraphics"
|
||||
])
|
||||
|
||||
|
||||
|
32
lutin/z_system/lutinSystem_MacOs_CoreMedia.py
Normal file
32
lutin/z_system/lutinSystem_MacOs_CoreMedia.py
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
self.add_flag('link', [
|
||||
"-framework CoreMedia"
|
||||
])
|
||||
|
||||
|
||||
|
32
lutin/z_system/lutinSystem_MacOs_CoreServices.py
Normal file
32
lutin/z_system/lutinSystem_MacOs_CoreServices.py
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
self.add_flag('link', [
|
||||
"-framework CoreServices"
|
||||
])
|
||||
|
||||
|
||||
|
32
lutin/z_system/lutinSystem_MacOs_CoreVideo.py
Normal file
32
lutin/z_system/lutinSystem_MacOs_CoreVideo.py
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
self.add_flag('link', [
|
||||
"-framework CoreVideo"
|
||||
])
|
||||
|
||||
|
||||
|
27
lutin/z_system/lutinSystem_MacOs_Foundation.py
Normal file
27
lutin/z_system/lutinSystem_MacOs_Foundation.py
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("CoreAudio : Ios interface for fundation (all time present, just system interface)")
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link", "-framework Foundation")
|
||||
self.add_depend("QuartzCore")
|
||||
|
||||
|
26
lutin/z_system/lutinSystem_MacOs_QuartzCore.py
Normal file
26
lutin/z_system/lutinSystem_MacOs_QuartzCore.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("QuartzCore : MacOs interface for base application (all time present, just system interface)")
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link", "-framework QuartzCore")
|
||||
self.add_depend("AppKit")
|
||||
|
32
lutin/z_system/lutinSystem_MacOs_VideoDecodeAcceleration.py
Normal file
32
lutin/z_system/lutinSystem_MacOs_VideoDecodeAcceleration.py
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
self.add_flag('link', [
|
||||
"-framework VideoDecodeAcceleration"
|
||||
])
|
||||
|
||||
|
||||
|
24
lutin/z_system/lutinSystem_MacOs_c.py
Normal file
24
lutin/z_system/lutinSystem_MacOs_c.py
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("C: Generic C library")
|
||||
self.add_flag("c-remove","-nodefaultlibs")
|
||||
self.set_valid(True)
|
||||
|
@@ -21,6 +21,7 @@ class System(system.System):
|
||||
self.set_help("CXX: Generic C++ library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend("c")
|
||||
self.add_flag("c++","-D__STDCPP_LLVM__")
|
||||
self.add_flag("c++-remove","-nostdlib")
|
||||
self.add_flag("need-libstdc++", True)
|
||||
|
32
lutin/z_system/lutinSystem_MacOs_opengl.py
Normal file
32
lutin/z_system/lutinSystem_MacOs_opengl.py
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
self.add_flag('link', [
|
||||
"-framework OpenGL"
|
||||
])
|
||||
|
||||
|
||||
|
44
lutin/z_system/lutinSystem_MacOs_pthread.py
Normal file
44
lutin/z_system/lutinSystem_MacOs_pthread.py
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("pthread : Generic multithreading system\n Can be install with the package:\n - pthread-dev")
|
||||
# check if the library exist:
|
||||
"""
|
||||
if not os.path.isfile("/usr/include/pthread.h"):
|
||||
# we did not find the library reqiested (just return) (automaticly set at false)
|
||||
return;
|
||||
"""
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link-lib", "pthread")
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
"""
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/sched.h",
|
||||
"/usr/include/pthread.h"
|
||||
],
|
||||
clip_path="/usr/include/")
|
||||
"""
|
||||
|
||||
|
||||
|
26
lutin/z_system/lutinSystem_Windows_advapi.py
Normal file
26
lutin/z_system/lutinSystem_Windows_advapi.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("advapi interface")
|
||||
self.set_valid(True)
|
||||
self.add_flag('link-lib', 'advapi32')
|
||||
|
||||
|
||||
|
26
lutin/z_system/lutinSystem_Windows_avicap.py
Normal file
26
lutin/z_system/lutinSystem_Windows_avicap.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("avicap interface")
|
||||
self.set_valid(True)
|
||||
self.add_flag('link-lib', 'avicap32')
|
||||
|
||||
|
||||
|
23
lutin/z_system/lutinSystem_Windows_c.py
Normal file
23
lutin/z_system/lutinSystem_Windows_c.py
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("C: Generic C library")
|
||||
self.set_valid(True)
|
||||
|
26
lutin/z_system/lutinSystem_Windows_gdi.py
Normal file
26
lutin/z_system/lutinSystem_Windows_gdi.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
self.add_flag('link-lib', 'gdi32')
|
||||
|
||||
|
||||
|
26
lutin/z_system/lutinSystem_Windows_kernel.py
Normal file
26
lutin/z_system/lutinSystem_Windows_kernel.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
self.add_flag('link-lib', 'kernel32')
|
||||
|
||||
|
||||
|
26
lutin/z_system/lutinSystem_Windows_ole.py
Normal file
26
lutin/z_system/lutinSystem_Windows_ole.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("ole interface")
|
||||
self.set_valid(True)
|
||||
self.add_flag('link-lib', 'ole32')
|
||||
|
||||
|
||||
|
26
lutin/z_system/lutinSystem_Windows_oleaut.py
Normal file
26
lutin/z_system/lutinSystem_Windows_oleaut.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("oleaut interface")
|
||||
self.set_valid(True)
|
||||
self.add_flag('link-lib', 'oleaut32')
|
||||
|
||||
|
||||
|
34
lutin/z_system/lutinSystem_Windows_opengl.py
Normal file
34
lutin/z_system/lutinSystem_Windows_opengl.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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
self.add_flag('link-lib', 'opengl32')
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/" + target.base_path + "/include/GL/*"
|
||||
],
|
||||
destination_path="GL",
|
||||
recursive=True)
|
||||
|
||||
|
26
lutin/z_system/lutinSystem_Windows_psapi.py
Normal file
26
lutin/z_system/lutinSystem_Windows_psapi.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("psapi interface ")
|
||||
self.set_valid(True)
|
||||
self.add_flag('link-lib', 'psapi')
|
||||
|
||||
|
||||
|
43
lutin/z_system/lutinSystem_Windows_pthread.py
Normal file
43
lutin/z_system/lutinSystem_Windows_pthread.py
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("pthread : Generic multithreading system\n Can be install with the package:\n - pthread-dev")
|
||||
# check if the library exist:
|
||||
if not os.path.isfile("/usr/" + target.base_path + "/include/pthread.h"):
|
||||
# we did not find the library reqiested (just return) (automaticly set at false)
|
||||
return;
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link-lib", "pthread")
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/" + target.base_path + "/include/sched.h",
|
||||
"/usr/" + target.base_path + "/include/pthread_compat.h",
|
||||
"/usr/" + target.base_path + "/include/pthread.h",
|
||||
"/usr/" + target.base_path + "/include/pthread_signal.h",
|
||||
"/usr/" + target.base_path + "/include/pthread_time.h",
|
||||
"/usr/" + target.base_path + "/include/pthread_unistd.h"
|
||||
],
|
||||
clip_path="/usr/" + target.base_path + "/include/")
|
||||
|
||||
|
38
lutin/z_system/lutinSystem_Windows_rpc.py
Normal file
38
lutin/z_system/lutinSystem_Windows_rpc.py
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("rpc : generic RPC library (developed by oracle)")
|
||||
# No check ==> on the basic std libs:
|
||||
self.set_valid(True)
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link-lib", "rpcsvc")
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/" + target.base_path + "/include/rpc/*"
|
||||
],
|
||||
destination_path="rpc",
|
||||
recursive=True)
|
||||
|
||||
|
||||
|
||||
|
26
lutin/z_system/lutinSystem_Windows_shell.py
Normal file
26
lutin/z_system/lutinSystem_Windows_shell.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("shell interface")
|
||||
self.set_valid(True)
|
||||
self.add_flag('link-lib', 'shell32')
|
||||
|
||||
|
||||
|
26
lutin/z_system/lutinSystem_Windows_shlwapi.py
Normal file
26
lutin/z_system/lutinSystem_Windows_shlwapi.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("shlwapi interface")
|
||||
self.set_valid(True)
|
||||
self.add_flag('link-lib', 'shlwapi')
|
||||
|
||||
|
||||
|
28
lutin/z_system/lutinSystem_Windows_start-mode-gui.py
Normal file
28
lutin/z_system/lutinSystem_Windows_start-mode-gui.py
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
## With inluding this module you start your application in mode 'windows' instead of "console"
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("gui: this is not a library, this is a hook to enable graphic interface in windows (not console mode)")
|
||||
self.set_valid(True)
|
||||
self.add_flag('link', '-mwindows')
|
||||
# by default we have -mconsole then no need to remove -mconsole
|
||||
|
||||
|
||||
|
26
lutin/z_system/lutinSystem_Windows_strmiids.py
Normal file
26
lutin/z_system/lutinSystem_Windows_strmiids.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("strmiids interface")
|
||||
self.set_valid(True)
|
||||
self.add_flag('link-lib', 'strmiids')
|
||||
|
||||
|
||||
|
26
lutin/z_system/lutinSystem_Windows_user.py
Normal file
26
lutin/z_system/lutinSystem_Windows_user.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
self.add_flag('link-lib', 'user32')
|
||||
|
||||
|
||||
|
26
lutin/z_system/lutinSystem_Windows_uuid.py
Normal file
26
lutin/z_system/lutinSystem_Windows_uuid.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("uuid interface")
|
||||
self.set_valid(True)
|
||||
self.add_flag('link-lib', 'uuid')
|
||||
|
||||
|
||||
|
26
lutin/z_system/lutinSystem_Windows_ws2.py
Normal file
26
lutin/z_system/lutinSystem_Windows_ws2.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/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
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("Win socket interface v2.0")
|
||||
self.set_valid(True)
|
||||
self.add_flag('link-lib', 'ws2_32')
|
||||
|
||||
|
||||
|
@@ -14,11 +14,12 @@ from lutin import tools
|
||||
from lutin import image
|
||||
from lutin import multiprocess
|
||||
from lutin import host
|
||||
from lutin import depend
|
||||
import os
|
||||
import sys
|
||||
|
||||
class Target(target.Target):
|
||||
def __init__(self, config):
|
||||
def __init__(self, config, sub_name=[]):
|
||||
#processor type selection (auto/arm/ppc/x86)
|
||||
if config["arch"] == "auto":
|
||||
config["arch"] = "arm"
|
||||
@@ -26,7 +27,7 @@ class Target(target.Target):
|
||||
if config["bus-size"] == "auto":
|
||||
config["bus-size"] = "32"
|
||||
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":
|
||||
self.type_arch="armv7"
|
||||
@@ -153,6 +154,12 @@ class Target(target.Target):
|
||||
|
||||
self.sysroot = "--sysroot=" + os.path.join(self.path_ndk, "platforms", "android-" + str(self.board_id), "arch-arm")
|
||||
|
||||
if True:
|
||||
self._mode_arm = "thumb"
|
||||
else:
|
||||
self._mode_arm = "arm"
|
||||
|
||||
|
||||
self.add_flag("c", [
|
||||
"-D__ARM_ARCH_5__",
|
||||
"-D__ARM_ARCH_5T__",
|
||||
@@ -173,9 +180,12 @@ class Target(target.Target):
|
||||
# -- arm V7 (Neon) :
|
||||
# -----------------------
|
||||
self.add_flag("c", [
|
||||
"-m"+self._mode_arm,
|
||||
"-mfpu=neon",
|
||||
"-march=armv7-a",
|
||||
"-mtune=cortex-a8",
|
||||
"-mfloat-abi=softfp",
|
||||
"-mvectorize-with-neon-quad",
|
||||
"-D__ARM_ARCH_7__",
|
||||
"-D__ARM_NEON__"
|
||||
])
|
||||
@@ -184,9 +194,16 @@ class Target(target.Target):
|
||||
"-mfloat-abi=softfp",
|
||||
"-Wl,--fix-cortex-a8",
|
||||
])
|
||||
|
||||
"""
|
||||
self.add_flag("link-lib", [
|
||||
"dl"
|
||||
])
|
||||
self.add_flag("link", [
|
||||
"-rdynamic"
|
||||
])
|
||||
"""
|
||||
# the -mthumb must be set for all the android produc, some ot the not work coretly without this one ... (all android code is generated with this flags)
|
||||
self.add_flag("c", "-mthumb")
|
||||
#self.add_flag("c", "-mthumb")
|
||||
# -----------------------
|
||||
# -- Common flags :
|
||||
# -----------------------
|
||||
@@ -197,7 +214,7 @@ class Target(target.Target):
|
||||
"-funwind-tables",
|
||||
"-fstack-protector",
|
||||
"-Wno-psabi",
|
||||
"-mtune=xscale",
|
||||
#"-mtune=xscale",
|
||||
"-fomit-frame-pointer",
|
||||
"-fno-strict-aliasing"
|
||||
])
|
||||
@@ -207,6 +224,13 @@ class Target(target.Target):
|
||||
"-Wa,--noexecstack"
|
||||
])
|
||||
|
||||
##
|
||||
## @brief Get the arm mode that is build
|
||||
## @return "thumb" for thumb mode and "arm for normal mode
|
||||
##
|
||||
def get_arm_mode(self):
|
||||
return self._mode_arm
|
||||
|
||||
def convert_name_application(self, pkg_name):
|
||||
value = pkg_name.lower()
|
||||
value = value.replace(' ', '')
|
||||
@@ -323,10 +347,10 @@ class Target(target.Target):
|
||||
debug.error("missing parameter 'ANDROID_MANIFEST' in the properties ... ")
|
||||
|
||||
#add properties on wallpaper :
|
||||
# myModule.pkg_add("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.pkg_add("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", ["list", key, title, summary, [["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.add_pkg("ANDROID_WALLPAPER_PROPERTIES", ["bool", key, title, summary, ["enable string", "disable String"])
|
||||
# myModule.add_pkg("ANDROID_WALLPAPER_PROPERTIES", ["bool", "movement", "Motion", "Apply movement to test pattern", ["Moving test pattern", "Still test pattern"]
|
||||
#copy needed resources :
|
||||
for res_source, res_dest in pkg_properties["ANDROID_RESOURCES"]:
|
||||
if res_source == "":
|
||||
@@ -514,6 +538,6 @@ class Target(target.Target):
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.info("cmd: " + 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)
|
||||
|
||||
|
||||
|
@@ -14,33 +14,14 @@ from lutin import tools
|
||||
import os
|
||||
import stat
|
||||
import re
|
||||
from lutin import depend
|
||||
from lutin import host
|
||||
from lutin import multiprocess
|
||||
import lutinTarget_Linux
|
||||
|
||||
class Target(target.Target):
|
||||
def __init__(self, config):
|
||||
#processor type selection (auto/arm/ppc/x86)
|
||||
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"
|
||||
class Target(lutinTarget_Linux.Target):
|
||||
def __init__(self, config, sub_name=[]):
|
||||
lutinTarget_Linux.Target.__init__(self, config, ["Debian"] + sub_name)
|
||||
|
||||
"""
|
||||
.local/application
|
||||
@@ -73,6 +54,8 @@ class Target(target.Target):
|
||||
*--> sources
|
||||
"""
|
||||
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.info("Generate generic '" + pkg_name + "' v" + tools.version_to_string(pkg_properties["VERSION"]))
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
@@ -81,108 +64,115 @@ class Target(target.Target):
|
||||
tools.create_directory_of_file(target_outpath)
|
||||
|
||||
## Create share datas:
|
||||
self.make_package_binary_data(target_outpath, pkg_name, base_pkg_path, heritage_list, static)
|
||||
ret_share = self.make_package_binary_data(target_outpath, pkg_name, base_pkg_path, heritage_list, static)
|
||||
|
||||
## copy binary files:
|
||||
self.make_package_binary_bin(target_outpath, pkg_name, base_pkg_path, heritage_list, static)
|
||||
ret_bin = self.make_package_binary_bin(target_outpath, pkg_name, base_pkg_path, heritage_list, static)
|
||||
|
||||
## Create libraries:
|
||||
self.make_package_binary_lib(target_outpath, pkg_name, base_pkg_path, heritage_list, static)
|
||||
ret_lib = self.make_package_binary_lib(target_outpath, pkg_name, base_pkg_path, heritage_list, static)
|
||||
|
||||
## Create generic files:
|
||||
self.make_package_generic_files(target_outpath, pkg_properties, pkg_name, base_pkg_path, heritage_list, static)
|
||||
ret_file = self.make_package_generic_files(target_outpath, pkg_properties, pkg_name, base_pkg_path, heritage_list, static)
|
||||
|
||||
## end of the package generation
|
||||
build_package_path_done = os.path.join(self.get_build_path(pkg_name), "generatePackageDone.txt")
|
||||
#Check date between the current file "list of action to generate package and the end of package generation
|
||||
need_generate_package = depend.need_re_package(build_package_path_done, [__file__], True)
|
||||
|
||||
## create the package:
|
||||
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")
|
||||
#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.copy_file(self.get_staging_path(pkg_name) + "/" + pkg_name + ".app.tar.gz", self.get_final_path() + "/" + pkg_name + ".app.gpkg")
|
||||
|
||||
|
||||
|
||||
|
||||
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)
|
||||
target_outpathDebian = self.get_staging_path(pkg_name) + "/DEBIAN/"
|
||||
finalFileControl = target_outpathDebian + "control"
|
||||
finalFilepostRm = target_outpathDebian + "postrm"
|
||||
# create the paths :
|
||||
tools.create_directory_of_file(finalFileControl)
|
||||
tools.create_directory_of_file(finalFilepostRm)
|
||||
## Create the control file
|
||||
tools.create_directory_of_file(finalFileControl)
|
||||
tmpFile = open(finalFileControl, 'w')
|
||||
tmpFile.write("Package: " + debianpkg_name + "\n")
|
||||
tmpFile.write("Version: " + pkg_properties["VERSION"] + "\n")
|
||||
tmpFile.write("Section: " + self.generate_list_separate_coma(pkg_properties["SECTION"]) + "\n")
|
||||
tmpFile.write("Priority: " + pkg_properties["PRIORITY"] + "\n")
|
||||
tmpFile.write("Architecture: all\n")
|
||||
tmpFile.write("Depends: bash\n")
|
||||
tmpFile.write("Maintainer: " + self.generate_list_separate_coma(pkg_properties["MAINTAINER"]) + "\n")
|
||||
tmpFile.write("Description: " + pkg_properties["DESCRIPTION"] + "\n")
|
||||
tmpFile.write("\n")
|
||||
tmpFile.flush()
|
||||
tmpFile.close()
|
||||
## Create the PostRm
|
||||
tmpFile = open(finalFilepostRm, 'w')
|
||||
tmpFile.write("#!/bin/bash\n")
|
||||
tmpFile.write("touch ~/." + pkg_name + "\n")
|
||||
if pkg_name != "":
|
||||
tmpFile.write("touch ~/.local/share/" + pkg_name + "\n")
|
||||
tmpFile.write("rm -r ~/.local/share/" + pkg_name + "\n")
|
||||
tmpFile.write("\n")
|
||||
tmpFile.flush()
|
||||
tmpFile.close()
|
||||
## Enable Execution in script
|
||||
os.chmod(finalFilepostRm, stat.S_IRWXU + stat.S_IRGRP + stat.S_IXGRP + stat.S_IROTH + stat.S_IXOTH);
|
||||
## Readme donumentation
|
||||
readmeFileDest = self.get_staging_path(pkg_name) + "/usr/share/doc/"+ debianpkg_name + "/README"
|
||||
tools.create_directory_of_file(readmeFileDest)
|
||||
if os.path.exists(base_pkg_path + "/os-Linux/README")==True:
|
||||
tools.copy_file(base_pkg_path + "/os-Linux/README", readmeFileDest)
|
||||
elif os.path.exists(base_pkg_path + "/README")==True:
|
||||
tools.copy_file(base_pkg_path + "/README", readmeFileDest)
|
||||
elif os.path.exists(base_pkg_path + "/README.md")==True:
|
||||
tools.copy_file(base_pkg_path + "/README.md", readmeFileDest)
|
||||
else:
|
||||
debug.info("no file 'README', 'README.md' or 'os-Linux/README' ==> generate an empty one")
|
||||
tmpFile = open(readmeFileDest, 'w')
|
||||
tmpFile.write("No documentation for " + pkg_name + "\n")
|
||||
if ret_share \
|
||||
or ret_bin \
|
||||
or ret_lib \
|
||||
or ret_file \
|
||||
or need_generate_package:
|
||||
"""
|
||||
## create the package:
|
||||
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")
|
||||
#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.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):
|
||||
"""
|
||||
self.get_staging_path(pkg_name)
|
||||
target_outpathDebian = self.get_staging_path(pkg_name) + "/DEBIAN/"
|
||||
finalFileControl = target_outpathDebian + "control"
|
||||
finalFilepostRm = target_outpathDebian + "postrm"
|
||||
# create the paths :
|
||||
tools.create_directory_of_file(finalFileControl)
|
||||
tools.create_directory_of_file(finalFilepostRm)
|
||||
## Create the control file
|
||||
tools.create_directory_of_file(finalFileControl)
|
||||
tmpFile = open(finalFileControl, 'w')
|
||||
tmpFile.write("Package: " + debianpkg_name + "\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("Priority: " + pkg_properties["PRIORITY"] + "\n")
|
||||
tmpFile.write("Architecture: all\n")
|
||||
tmpFile.write("Depends: bash\n")
|
||||
tmpFile.write("Maintainer: " + self.generate_list_separate_coma(pkg_properties["MAINTAINER"]) + "\n")
|
||||
tmpFile.write("Description: " + pkg_properties["DESCRIPTION"] + "\n")
|
||||
tmpFile.write("\n")
|
||||
tmpFile.flush()
|
||||
tmpFile.close()
|
||||
## licence file
|
||||
license_file_dest = self.get_staging_path(pkg_name) + "/usr/share/doc/"+ debianpkg_name + "/copyright"
|
||||
tools.create_directory_of_file(license_file_dest)
|
||||
if os.path.exists(base_pkg_path + "/license.txt")==True:
|
||||
tools.copy_file(base_pkg_path + "/license.txt", license_file_dest)
|
||||
else:
|
||||
debug.info("no file 'license.txt' ==> generate an empty one")
|
||||
tmpFile = open(license_file_dest, 'w')
|
||||
tmpFile.write("No license define by the developper for " + pkg_name + "\n")
|
||||
## Create the PostRm
|
||||
tmpFile = open(finalFilepostRm, 'w')
|
||||
tmpFile.write("#!/bin/bash\n")
|
||||
tmpFile.write("touch ~/." + pkg_name + "\n")
|
||||
if pkg_name != "":
|
||||
tmpFile.write("touch ~/.local/share/" + pkg_name + "\n")
|
||||
tmpFile.write("rm -r ~/.local/share/" + pkg_name + "\n")
|
||||
tmpFile.write("\n")
|
||||
tmpFile.flush()
|
||||
tmpFile.close()
|
||||
##changeLog file
|
||||
change_log_file_dest = self.get_staging_path(pkg_name) + "/usr/share/doc/"+ debianpkg_name + "/changelog"
|
||||
tools.create_directory_of_file(change_log_file_dest)
|
||||
if os.path.exists(base_pkg_path + "/changelog")==True:
|
||||
tools.copy_file(base_pkg_path + "/changelog", change_log_file_dest)
|
||||
else:
|
||||
debug.info("no file 'changelog' ==> generate an empty one")
|
||||
tmpFile = open(change_log_file_dest, 'w')
|
||||
tmpFile.write("No changelog data " + pkg_name + "\n")
|
||||
tmpFile.flush()
|
||||
tmpFile.close()
|
||||
## create the package :
|
||||
debug.debug("package : " + self.get_staging_path(pkg_name) + "/" + debianpkg_name + ".deb")
|
||||
os.system("cd " + self.get_staging_path("") + " ; dpkg-deb --build " + pkg_name)
|
||||
tools.create_directory_of_file(self.get_final_path())
|
||||
tools.copy_file(self.get_staging_path("") + "/" + pkg_name + self.suffix_package, self.get_final_path() + "/" + pkg_name + self.suffix_package)
|
||||
## Enable Execution in script
|
||||
os.chmod(finalFilepostRm, stat.S_IRWXU + stat.S_IRGRP + stat.S_IXGRP + stat.S_IROTH + stat.S_IXOTH);
|
||||
## Readme donumentation
|
||||
readmeFileDest = self.get_staging_path(pkg_name) + "/usr/share/doc/"+ debianpkg_name + "/README"
|
||||
tools.create_directory_of_file(readmeFileDest)
|
||||
if os.path.exists(base_pkg_path + "/os-Linux/README")==True:
|
||||
tools.copy_file(base_pkg_path + "/os-Linux/README", readmeFileDest)
|
||||
elif os.path.exists(base_pkg_path + "/README")==True:
|
||||
tools.copy_file(base_pkg_path + "/README", readmeFileDest)
|
||||
elif os.path.exists(base_pkg_path + "/README.md")==True:
|
||||
tools.copy_file(base_pkg_path + "/README.md", readmeFileDest)
|
||||
else:
|
||||
debug.info("no file 'README', 'README.md' or 'os-Linux/README' ==> generate an empty one")
|
||||
tmpFile = open(readmeFileDest, 'w')
|
||||
tmpFile.write("No documentation for " + pkg_name + "\n")
|
||||
tmpFile.flush()
|
||||
tmpFile.close()
|
||||
## licence file
|
||||
license_file_dest = self.get_staging_path(pkg_name) + "/usr/share/doc/"+ debianpkg_name + "/copyright"
|
||||
tools.create_directory_of_file(license_file_dest)
|
||||
if os.path.exists(base_pkg_path + "/license.txt")==True:
|
||||
tools.copy_file(base_pkg_path + "/license.txt", license_file_dest)
|
||||
else:
|
||||
debug.info("no file 'license.txt' ==> generate an empty one")
|
||||
tmpFile = open(license_file_dest, 'w')
|
||||
tmpFile.write("No license define by the developper for " + pkg_name + "\n")
|
||||
tmpFile.flush()
|
||||
tmpFile.close()
|
||||
##changeLog file
|
||||
change_log_file_dest = self.get_staging_path(pkg_name) + "/usr/share/doc/"+ debianpkg_name + "/changelog"
|
||||
tools.create_directory_of_file(change_log_file_dest)
|
||||
if os.path.exists(base_pkg_path + "/changelog")==True:
|
||||
tools.copy_file(base_pkg_path + "/changelog", change_log_file_dest)
|
||||
else:
|
||||
debug.info("no file 'changelog' ==> generate an empty one")
|
||||
tmpFile = open(change_log_file_dest, 'w')
|
||||
tmpFile.write("No changelog data " + pkg_name + "\n")
|
||||
tmpFile.flush()
|
||||
tmpFile.close()
|
||||
## create the package :
|
||||
debug.debug("package : " + self.get_staging_path(pkg_name) + "/" + debianpkg_name + ".deb")
|
||||
os.system("cd " + self.get_staging_path("") + " ; dpkg-deb --build " + pkg_name)
|
||||
tools.create_directory_of_file(self.get_final_path())
|
||||
tools.copy_file(self.get_staging_path("") + "/" + pkg_name + self.suffix_package, self.get_final_path() + "/" + pkg_name + self.suffix_package)
|
||||
|
||||
# package is done corectly ...
|
||||
tools.file_write_data(build_package_path_done, "done...")
|
||||
|
||||
def install_package(self, pkg_name):
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
|
@@ -16,11 +16,12 @@ import os
|
||||
import stat
|
||||
from lutin import multiprocess
|
||||
from lutin import host
|
||||
from lutin import depend
|
||||
import random
|
||||
import re
|
||||
|
||||
class Target(target.Target):
|
||||
def __init__(self, config):
|
||||
def __init__(self, config, sub_name=[]):
|
||||
if config["compilator"] == "gcc":
|
||||
debug.info("compile only with clang for IOs");
|
||||
config["compilator"] = "clang"
|
||||
@@ -30,6 +31,9 @@ class Target(target.Target):
|
||||
#bus size selection (auto/32/64)
|
||||
if config["bus-size"] == "auto":
|
||||
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://devs.openttd.org/~truebrain/compile-farm/apple-darwin9.txt
|
||||
@@ -38,7 +42,7 @@ class Target(target.Target):
|
||||
else:
|
||||
arch="arm64" # for ipad air
|
||||
#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:
|
||||
self.set_cross_base("/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/")
|
||||
else:
|
||||
@@ -55,7 +59,7 @@ class Target(target.Target):
|
||||
#self.suffix_binary=''
|
||||
#self.suffix_package=''
|
||||
|
||||
if self.sumulator == True:
|
||||
if self.get_simulation() == True:
|
||||
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("c", "-mios-simulator-version-min=8.0")
|
||||
@@ -69,7 +73,7 @@ class Target(target.Target):
|
||||
"-objc_abi_version",
|
||||
"-Xlinker 2",
|
||||
"-Xlinker",
|
||||
"-no_implicit_dylibs",
|
||||
#"-no_implicit_dylibs",
|
||||
"-stdlib=libc++",
|
||||
"-fobjc-arc",
|
||||
"-fobjc-link-runtime"
|
||||
@@ -85,6 +89,13 @@ class Target(target.Target):
|
||||
|
||||
# Disable capabiliteis to compile in shared mode
|
||||
self.support_dynamic_link = False
|
||||
|
||||
self.add_flag("link-lib", [
|
||||
"dl"
|
||||
])
|
||||
self.add_flag("link", [
|
||||
"-rdynamic"
|
||||
])
|
||||
|
||||
def make_package_binary(self, pkg_name, pkg_properties, base_pkg_path, heritage_list, static):
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
@@ -95,264 +106,277 @@ class Target(target.Target):
|
||||
tools.create_directory_of_file(target_outpath)
|
||||
|
||||
## Create share datas:
|
||||
self.make_package_binary_data(target_outpath, pkg_name, base_pkg_path, heritage_list, static)
|
||||
ret_share = self.make_package_binary_data(target_outpath, pkg_name, base_pkg_path, heritage_list, static)
|
||||
|
||||
## copy binary files:
|
||||
self.make_package_binary_bin(target_outpath, pkg_name, base_pkg_path, heritage_list, static)
|
||||
ret_bin = self.make_package_binary_bin(target_outpath, pkg_name, base_pkg_path, heritage_list, static)
|
||||
|
||||
## Create libraries:
|
||||
self.make_package_binary_lib(target_outpath, pkg_name, base_pkg_path, heritage_list, static)
|
||||
ret_lib = self.make_package_binary_lib(target_outpath, pkg_name, base_pkg_path, heritage_list, static)
|
||||
|
||||
## Create generic files:
|
||||
self.make_package_generic_files(target_outpath, pkg_properties, pkg_name, base_pkg_path, heritage_list, static)
|
||||
ret_file = self.make_package_generic_files(target_outpath, pkg_properties, pkg_name, base_pkg_path, heritage_list, static)
|
||||
|
||||
## Create icon:
|
||||
if "ICON" in pkg_properties.keys() \
|
||||
and pkg_properties["ICON"] != "":
|
||||
# Resize all icon needed for Ios ...
|
||||
# TODO : Do not regenerate if source resource is not availlable
|
||||
# TODO : Add a colored background ...
|
||||
debug.print_element("pkg", os.path.relpath(pkg_properties["ICON"]), "==>", "iTunesArtwork.png")
|
||||
image.resize(pkg_properties["ICON"], os.path.join(target_outpath, "iTunesArtwork.png"), 512, 512)
|
||||
debug.print_element("pkg", os.path.relpath(pkg_properties["ICON"]), "==>", "iTunesArtwork@2x.png")
|
||||
image.resize(pkg_properties["ICON"], os.path.join(target_outpath, "iTunesArtwork@2x.png"), 1024, 1024)
|
||||
debug.print_element("pkg", os.path.relpath(pkg_properties["ICON"]), "==>", "Icon-60@2x.png")
|
||||
image.resize(pkg_properties["ICON"], os.path.join(target_outpath, "Icon-60@2x.png"), 120, 120)
|
||||
debug.print_element("pkg", os.path.relpath(pkg_properties["ICON"]), "==>", "Icon-76.png")
|
||||
image.resize(pkg_properties["ICON"], os.path.join(target_outpath, "Icon-76.png"), 76, 76)
|
||||
debug.print_element("pkg", os.path.relpath(pkg_properties["ICON"]), "==>", "Icon-76@2x.png")
|
||||
image.resize(pkg_properties["ICON"], os.path.join(target_outpath, "Icon-76@2x.png"), 152, 152)
|
||||
debug.print_element("pkg", os.path.relpath(pkg_properties["ICON"]), "==>", "Icon-Small-40.png")
|
||||
image.resize(pkg_properties["ICON"], os.path.join(target_outpath, "Icon-Small-40.png"), 40, 40)
|
||||
debug.print_element("pkg", os.path.relpath(pkg_properties["ICON"]), "==>", "Icon-Small-40@2x.png")
|
||||
image.resize(pkg_properties["ICON"], os.path.join(target_outpath, "Icon-Small-40@2x.png"), 80, 80)
|
||||
debug.print_element("pkg", os.path.relpath(pkg_properties["ICON"]), "==>", "Icon-Small.png")
|
||||
image.resize(pkg_properties["ICON"], os.path.join(target_outpath, "Icon-Small.png"), 29, 29)
|
||||
debug.print_element("pkg", os.path.relpath(pkg_properties["ICON"]), "==>", "Icon-Small@2x.png")
|
||||
image.resize(pkg_properties["ICON"], os.path.join(target_outpath, "Icon-Small@2x.png"), 58, 58)
|
||||
## end of the package generation
|
||||
build_package_path_done = os.path.join(self.get_build_path(pkg_name), "generatePackageDone.txt")
|
||||
#Check date between the current file "list of action to generate package and the end of package generation
|
||||
need_generate_package = depend.need_re_package(build_package_path_done, [__file__], True)
|
||||
|
||||
## Create the info file:
|
||||
debug.print_element("pkg", "PkgInfo", "<==", "APPL????")
|
||||
tools.file_write_data(os.path.join(target_outpath, "PkgInfo"),
|
||||
"APPL????",
|
||||
only_if_new=True)
|
||||
|
||||
## Create Info.plist (in XML mode)
|
||||
debug.print_element("pkg", "Info.plist", "<==", "Package properties")
|
||||
# http://www.sandroid.org/imcross/#Deployment
|
||||
data_file = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
data_file += "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n"
|
||||
data_file += "<plist version=\"1.0\">\n"
|
||||
data_file += " <dict>\n"
|
||||
data_file += " <key>CFBundleDevelopmentRegion</key>\n"
|
||||
data_file += " <string>en</string>\n"
|
||||
data_file += " <key>CFBundleDisplayName</key>\n"
|
||||
data_file += " <string>" + pkg_properties["NAME"] + "</string>\n"
|
||||
data_file += " <key>CFBundleExecutable</key>\n"
|
||||
data_file += " <string>" + pkg_name + "</string>\n"
|
||||
data_file += " <key>CFBundleIdentifier</key>\n"
|
||||
data_file += " <string>com." + pkg_properties["COMPAGNY_NAME2"] + "." + pkg_name + "</string>\n"
|
||||
|
||||
data_file += " <key>CFBundleIconFiles</key>\n"
|
||||
data_file += " <array>\n"
|
||||
data_file += " <string>Icon-60@2x.png</string>\n"
|
||||
data_file += " <string>Icon-76.png</string>\n"
|
||||
data_file += " <string>Icon-76@2x.png</string>\n"
|
||||
data_file += " <string>Icon-Small-40.png</string>\n"
|
||||
data_file += " <string>Icon-Small-40@2x.png</string>\n"
|
||||
data_file += " <string>Icon-Small.png</string>\n"
|
||||
data_file += " <string>Icon-Small@2x.png</string>\n"
|
||||
data_file += " <string>iTunesArtwork.png</string>\n"
|
||||
data_file += " <string>iTunesArtwork@2x.png</string>\n"
|
||||
data_file += " </array>\n"
|
||||
|
||||
data_file += " <key>CFBundleInfoDictionaryVersion</key>\n"
|
||||
data_file += " <string>6.0</string>\n"
|
||||
data_file += " <key>CFBundleName</key>\n"
|
||||
data_file += " <string>" + pkg_name + "</string>\n"
|
||||
data_file += " <key>CFBundlePackageType</key>\n"
|
||||
data_file += " <string>APPL</string>\n"
|
||||
data_file += " <key>CFBundleSignature</key>\n"
|
||||
data_file += " <string>????</string>\n"
|
||||
data_file += " <key>CFBundleSupportedPlatforms</key>\n"
|
||||
data_file += " <array>\n"
|
||||
data_file += " <string>iPhoneSimulator</string>\n"
|
||||
data_file += " </array>\n"
|
||||
data_file += " \n"
|
||||
data_file += " <key>CFBundleShortVersionString</key>\n"
|
||||
data_file += " <string>"+tools.version_to_string(pkg_properties["VERSION"])+"</string>\n"
|
||||
data_file += " <key>CFBundleVersion</key>\n"
|
||||
data_file += " <string>"+str(pkg_properties["VERSION_CODE"])+"</string>\n"
|
||||
data_file += " \n"
|
||||
data_file += " <key>CFBundleResourceSpecification</key>\n"
|
||||
data_file += " <string>ResourceRules.plist</string>\n"
|
||||
if self.sumulator == False:
|
||||
data_file += " <key>LSRequiresIPhoneOS</key>\n"
|
||||
## create the package:
|
||||
if ret_share \
|
||||
or ret_bin \
|
||||
or ret_lib \
|
||||
or ret_file \
|
||||
or need_generate_package:
|
||||
## Create icon:
|
||||
if "ICON" in pkg_properties.keys() \
|
||||
and pkg_properties["ICON"] != "":
|
||||
# Resize all icon needed for Ios ...
|
||||
# TODO : Do not regenerate if source resource is not availlable
|
||||
# TODO : Add a colored background ...
|
||||
debug.print_element("pkg", os.path.relpath(pkg_properties["ICON"]), "==>", "iTunesArtwork.png")
|
||||
image.resize(pkg_properties["ICON"], os.path.join(target_outpath, "iTunesArtwork.png"), 512, 512)
|
||||
debug.print_element("pkg", os.path.relpath(pkg_properties["ICON"]), "==>", "iTunesArtwork@2x.png")
|
||||
image.resize(pkg_properties["ICON"], os.path.join(target_outpath, "iTunesArtwork@2x.png"), 1024, 1024)
|
||||
debug.print_element("pkg", os.path.relpath(pkg_properties["ICON"]), "==>", "Icon-60@2x.png")
|
||||
image.resize(pkg_properties["ICON"], os.path.join(target_outpath, "Icon-60@2x.png"), 120, 120)
|
||||
debug.print_element("pkg", os.path.relpath(pkg_properties["ICON"]), "==>", "Icon-76.png")
|
||||
image.resize(pkg_properties["ICON"], os.path.join(target_outpath, "Icon-76.png"), 76, 76)
|
||||
debug.print_element("pkg", os.path.relpath(pkg_properties["ICON"]), "==>", "Icon-76@2x.png")
|
||||
image.resize(pkg_properties["ICON"], os.path.join(target_outpath, "Icon-76@2x.png"), 152, 152)
|
||||
debug.print_element("pkg", os.path.relpath(pkg_properties["ICON"]), "==>", "Icon-Small-40.png")
|
||||
image.resize(pkg_properties["ICON"], os.path.join(target_outpath, "Icon-Small-40.png"), 40, 40)
|
||||
debug.print_element("pkg", os.path.relpath(pkg_properties["ICON"]), "==>", "Icon-Small-40@2x.png")
|
||||
image.resize(pkg_properties["ICON"], os.path.join(target_outpath, "Icon-Small-40@2x.png"), 80, 80)
|
||||
debug.print_element("pkg", os.path.relpath(pkg_properties["ICON"]), "==>", "Icon-Small.png")
|
||||
image.resize(pkg_properties["ICON"], os.path.join(target_outpath, "Icon-Small.png"), 29, 29)
|
||||
debug.print_element("pkg", os.path.relpath(pkg_properties["ICON"]), "==>", "Icon-Small@2x.png")
|
||||
image.resize(pkg_properties["ICON"], os.path.join(target_outpath, "Icon-Small@2x.png"), 58, 58)
|
||||
|
||||
## Create the info file:
|
||||
debug.print_element("pkg", "PkgInfo", "<==", "APPL????")
|
||||
tools.file_write_data(os.path.join(target_outpath, "PkgInfo"),
|
||||
"APPL????",
|
||||
only_if_new=True)
|
||||
|
||||
## Create Info.plist (in XML mode)
|
||||
debug.print_element("pkg", "Info.plist", "<==", "Package properties")
|
||||
# http://www.sandroid.org/imcross/#Deployment
|
||||
data_file = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
data_file += "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n"
|
||||
data_file += "<plist version=\"1.0\">\n"
|
||||
data_file += " <dict>\n"
|
||||
data_file += " <key>CFBundleDevelopmentRegion</key>\n"
|
||||
data_file += " <string>en</string>\n"
|
||||
data_file += " <key>CFBundleDisplayName</key>\n"
|
||||
data_file += " <string>" + pkg_properties["NAME"] + "</string>\n"
|
||||
data_file += " <key>CFBundleExecutable</key>\n"
|
||||
data_file += " <string>" + pkg_name + "</string>\n"
|
||||
data_file += " <key>CFBundleIdentifier</key>\n"
|
||||
data_file += " <string>com." + pkg_properties["COMPAGNY_NAME2"] + "." + pkg_name + "</string>\n"
|
||||
|
||||
data_file += " <key>CFBundleIconFiles</key>\n"
|
||||
data_file += " <array>\n"
|
||||
data_file += " <string>Icon-60@2x.png</string>\n"
|
||||
data_file += " <string>Icon-76.png</string>\n"
|
||||
data_file += " <string>Icon-76@2x.png</string>\n"
|
||||
data_file += " <string>Icon-Small-40.png</string>\n"
|
||||
data_file += " <string>Icon-Small-40@2x.png</string>\n"
|
||||
data_file += " <string>Icon-Small.png</string>\n"
|
||||
data_file += " <string>Icon-Small@2x.png</string>\n"
|
||||
data_file += " <string>iTunesArtwork.png</string>\n"
|
||||
data_file += " <string>iTunesArtwork@2x.png</string>\n"
|
||||
data_file += " </array>\n"
|
||||
|
||||
data_file += " <key>CFBundleInfoDictionaryVersion</key>\n"
|
||||
data_file += " <string>6.0</string>\n"
|
||||
data_file += " <key>CFBundleName</key>\n"
|
||||
data_file += " <string>" + pkg_name + "</string>\n"
|
||||
data_file += " <key>CFBundlePackageType</key>\n"
|
||||
data_file += " <string>APPL</string>\n"
|
||||
data_file += " <key>CFBundleSignature</key>\n"
|
||||
data_file += " <string>????</string>\n"
|
||||
data_file += " <key>CFBundleSupportedPlatforms</key>\n"
|
||||
data_file += " <array>\n"
|
||||
data_file += " <string>iPhoneSimulator</string>\n"
|
||||
data_file += " </array>\n"
|
||||
data_file += " \n"
|
||||
data_file += " <key>CFBundleShortVersionString</key>\n"
|
||||
data_file += " <string>"+tools.version_to_string(pkg_properties["VERSION"])+"</string>\n"
|
||||
data_file += " <key>CFBundleVersion</key>\n"
|
||||
data_file += " <string>"+str(pkg_properties["VERSION_CODE"])+"</string>\n"
|
||||
data_file += " \n"
|
||||
data_file += " <key>CFBundleResourceSpecification</key>\n"
|
||||
data_file += " <string>ResourceRules.plist</string>\n"
|
||||
if self.get_simulation() == False:
|
||||
data_file += " <key>LSRequiresIPhoneOS</key>\n"
|
||||
data_file += " <true/>\n"
|
||||
else:
|
||||
data_file += " <key>DTPlatformName</key>\n"
|
||||
data_file += " <string>iphonesimulator</string>\n"
|
||||
data_file += " <key>DTSDKName</key>\n"
|
||||
data_file += " <string>iphonesimulator7.0</string>\n"
|
||||
data_file += " \n"
|
||||
data_file += " <key>UIDeviceFamily</key>\n"
|
||||
data_file += " <array>\n"
|
||||
data_file += " <integer>1</integer>\n"
|
||||
data_file += " <integer>2</integer>\n"
|
||||
data_file += " </array>\n"
|
||||
data_file += " <key>UIRequiredDeviceCapabilities</key>\n"
|
||||
data_file += " <array>\n"
|
||||
data_file += " <string>armv7</string>\n"
|
||||
data_file += " </array>\n"
|
||||
data_file += " <key>UIStatusBarHidden</key>\n"
|
||||
data_file += " <true/>\n"
|
||||
else:
|
||||
data_file += " <key>DTPlatformName</key>\n"
|
||||
data_file += " <string>iphonesimulator</string>\n"
|
||||
data_file += " <key>DTSDKName</key>\n"
|
||||
data_file += " <string>iphonesimulator7.0</string>\n"
|
||||
data_file += " \n"
|
||||
data_file += " <key>UIDeviceFamily</key>\n"
|
||||
data_file += " <array>\n"
|
||||
data_file += " <integer>1</integer>\n"
|
||||
data_file += " <integer>2</integer>\n"
|
||||
data_file += " </array>\n"
|
||||
data_file += " <key>UIRequiredDeviceCapabilities</key>\n"
|
||||
data_file += " <array>\n"
|
||||
data_file += " <string>armv7</string>\n"
|
||||
data_file += " </array>\n"
|
||||
data_file += " <key>UIStatusBarHidden</key>\n"
|
||||
data_file += " <true/>\n"
|
||||
data_file += " <key>UISupportedInterfaceOrientations</key>\n"
|
||||
data_file += " <array>\n"
|
||||
data_file += " <string>UIInterfaceOrientationPortrait</string>\n"
|
||||
data_file += " <string>UIInterfaceOrientationPortraitUpsideDown</string>\n"
|
||||
data_file += " <string>UIInterfaceOrientationLandscapeLeft</string>\n"
|
||||
data_file += " <string>UIInterfaceOrientationLandscapeRight</string>\n"
|
||||
data_file += " </array>\n"
|
||||
data_file += " <key>UISupportedInterfaceOrientations~ipad</key>\n"
|
||||
data_file += " <array>\n"
|
||||
data_file += " <string>UIInterfaceOrientationPortrait</string>\n"
|
||||
data_file += " <string>UIInterfaceOrientationPortraitUpsideDown</string>\n"
|
||||
data_file += " <string>UIInterfaceOrientationLandscapeLeft</string>\n"
|
||||
data_file += " <string>UIInterfaceOrientationLandscapeRight</string>\n"
|
||||
data_file += " </array>\n"
|
||||
data_file += " </dict>\n"
|
||||
data_file += "</plist>\n"
|
||||
data_file += "\n\n"
|
||||
tools.file_write_data(os.path.join(target_outpath, "Info.plist"),
|
||||
data_file,
|
||||
only_if_new=True)
|
||||
|
||||
"""
|
||||
infoFile = self.get_staging_path(pkg_name) + "/" + pkg_name + "-Info.plist"
|
||||
# Create the info file
|
||||
tmpFile = open(infoFile, 'w')
|
||||
tmpFile.write(data_file)
|
||||
tmpFile.flush()
|
||||
tmpFile.close()
|
||||
cmdLine = "builtin-infoPlistUtility "
|
||||
cmdLine += " " + self.get_staging_path(pkg_name) + "/" + pkg_name + "-Info.plist "
|
||||
cmdLine += " -genpkginfo " + self.get_staging_path(pkg_name) + "/PkgInfo"
|
||||
cmdLine += " -expandbuildsettings "
|
||||
cmdLine += " -format binary "
|
||||
if self.sumulator == False:
|
||||
cmdLine += " -platform iphonesimulator "
|
||||
else:
|
||||
cmdLine += " -platform iphoneos "
|
||||
cmdLine += " -o " + self.get_staging_path(pkg_name) + "/" + "Info.plist"
|
||||
multiprocess.run_command(cmdLine)
|
||||
"""
|
||||
"""
|
||||
|
||||
/Users/edouarddupin/dev/exampleProjectXcode/projectName/projectName/projectName-Info.plist
|
||||
-genpkginfo
|
||||
/Users/edouarddupin/Library/Developer/Xcode/DerivedData/projectName-gwycnyyzohokcmalgodeucqppxro/Build/Products/Debug-iphonesimulator/projectName.app/PkgInfo
|
||||
-expandbuildsettings
|
||||
-format binary
|
||||
-platform iphonesimulator
|
||||
-additionalcontentfile /Users/edouarddupin/Library/Developer/Xcode/DerivedData/projectName-gwycnyyzohokcmalgodeucqppxro/Build/Intermediates/projectName.build/Debug-iphonesimulator/projectName.build/assetcatalog_generated_info.plist
|
||||
-o /Users/edouarddupin/Library/Developer/Xcode/DerivedData/projectName-gwycnyyzohokcmalgodeucqppxro/Build/Products/Debug-iphonesimulator/projectName.app/Info.plist
|
||||
-additionalcontentfile /Users/edouarddupin/Library/Developer/Xcode/DerivedData/zdzdzd-bjuyukzpzhnyerdmxohjyuxfdllv/Build/Intermediates/zdzdzd.build/Debug-iphoneos/zdzdzd.build/assetcatalog_generated_info.plist -o /Users/edouarddupin/Library/Developer/Xcode/DerivedData/zdzdzd-bjuyukzpzhnyerdmxohjyuxfdllv/Build/Products/Debug-iphoneos/zdzdzd.app/Info.plist
|
||||
data_file += " <key>UISupportedInterfaceOrientations</key>\n"
|
||||
data_file += " <array>\n"
|
||||
data_file += " <string>UIInterfaceOrientationPortrait</string>\n"
|
||||
data_file += " <string>UIInterfaceOrientationPortraitUpsideDown</string>\n"
|
||||
data_file += " <string>UIInterfaceOrientationLandscapeLeft</string>\n"
|
||||
data_file += " <string>UIInterfaceOrientationLandscapeRight</string>\n"
|
||||
data_file += " </array>\n"
|
||||
data_file += " <key>UISupportedInterfaceOrientations~ipad</key>\n"
|
||||
data_file += " <array>\n"
|
||||
data_file += " <string>UIInterfaceOrientationPortrait</string>\n"
|
||||
data_file += " <string>UIInterfaceOrientationPortraitUpsideDown</string>\n"
|
||||
data_file += " <string>UIInterfaceOrientationLandscapeLeft</string>\n"
|
||||
data_file += " <string>UIInterfaceOrientationLandscapeRight</string>\n"
|
||||
data_file += " </array>\n"
|
||||
data_file += " </dict>\n"
|
||||
data_file += "</plist>\n"
|
||||
data_file += "\n\n"
|
||||
tools.file_write_data(os.path.join(target_outpath, "Info.plist"),
|
||||
data_file,
|
||||
only_if_new=True)
|
||||
|
||||
"""
|
||||
#/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil /Users/edouarddupin/Library/Developer/Xcode/DerivedData/projectName-gwycnyyzohokcmalgodeucqppxro/Build/Products/Debug-iphonesimulator/projectName.app/projectName -o /Users/edouarddupin/Library/Developer/Xcode/DerivedData/projectName-gwycnyyzohokcmalgodeucqppxro/Build/Products/Debug-iphonesimulator/projectName.app.dSYM
|
||||
|
||||
debug.print_element("pkg", "ResourceRules.plist", "<==", "Resources autorisation")
|
||||
data_file = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
data_file += "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n"
|
||||
data_file += "<plist version=\"1.0\">\n"
|
||||
data_file += " <dict>\n"
|
||||
data_file += " <key>rules</key>\n"
|
||||
data_file += " <dict>\n"
|
||||
data_file += " <key>.*</key>\n"
|
||||
data_file += " <true/>\n"
|
||||
data_file += " <key>Info.plist</key>\n"
|
||||
data_file += " <dict>\n"
|
||||
data_file += " <key>omit</key>\n"
|
||||
data_file += " <true/>\n"
|
||||
data_file += " <key>weight</key>\n"
|
||||
data_file += " <real>10</real>\n"
|
||||
data_file += " </dict>\n"
|
||||
data_file += " <key>ResourceRules.plist</key>\n"
|
||||
data_file += " <dict>\n"
|
||||
data_file += " <key>omit</key>\n"
|
||||
data_file += " <true/>\n"
|
||||
data_file += " <key>weight</key>\n"
|
||||
data_file += " <real>100</real>\n"
|
||||
data_file += " </dict>\n"
|
||||
data_file += " </dict>\n"
|
||||
data_file += " </dict>\n"
|
||||
data_file += "</plist>\n"
|
||||
data_file += "\n\n"
|
||||
tools.file_write_data(os.path.join(target_outpath, "ResourceRules.plist"),
|
||||
data_file,
|
||||
only_if_new=True)
|
||||
|
||||
debug.print_element("pkg", "Entitlements.plist", "<==", "application mode")
|
||||
data_file = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
data_file += "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n"
|
||||
data_file += "<plist version=\"1.0\">\n"
|
||||
data_file += " <dict>\n"
|
||||
data_file += " <key>get-task-allow</key>\n"
|
||||
data_file += " <true/>\n"
|
||||
data_file += " </dict>\n"
|
||||
data_file += "</plist>\n"
|
||||
data_file += "\n\n"
|
||||
tools.file_write_data(os.path.join(target_outpath, "Entitlements.plist"),
|
||||
data_file,
|
||||
only_if_new=True)
|
||||
|
||||
# Simulateur path :
|
||||
#~/Library/Application\ Support/iPhone\ Simulator/7.0.3/Applications/
|
||||
# must have a 'uuidgen' UID generate value with this elemennt ...
|
||||
# get the bundle path : ==> maybe usefull in MocOS ...
|
||||
# NSLog(@"%@",[[NSBundle mainBundle] bundlePath]);
|
||||
|
||||
# Must create the tarball of the application
|
||||
#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
|
||||
if self.sumulator == False:
|
||||
if "APPLE_APPLICATION_IOS_ID" not in pkg_properties:
|
||||
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 ..." )
|
||||
infoFile = self.get_staging_path(pkg_name) + "/" + pkg_name + "-Info.plist"
|
||||
# Create the info file
|
||||
tmpFile = open(os.path.join(target_outpath, pkg_name + ".xcent"), 'w')
|
||||
tmpFile.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
|
||||
tmpFile.write("<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n")
|
||||
tmpFile.write("<plist version=\"1.0\">\n")
|
||||
tmpFile.write(" <dict>\n")
|
||||
tmpFile.write(" <key>application-identifier</key>\n")
|
||||
tmpFile.write(" <string>" + pkg_properties["APPLE_APPLICATION_IOS_ID"] + "." + pkg_properties["COMPAGNY_TYPE"] + "." + pkg_properties["COMPAGNY_NAME2"] + "." + pkg_name + "</string>\n")
|
||||
tmpFile.write(" <key>get-task-allow</key>\n")
|
||||
tmpFile.write(" <true/>\n")
|
||||
tmpFile.write(" <key>keychain-access-groups</key>\n")
|
||||
tmpFile.write(" <array>\n")
|
||||
tmpFile.write(" <string>" + pkg_properties["APPLE_APPLICATION_IOS_ID"] + "." + pkg_properties["COMPAGNY_TYPE"] + "." + pkg_properties["COMPAGNY_NAME2"] + "." + pkg_name + "</string>\n")
|
||||
tmpFile.write(" </array>\n")
|
||||
tmpFile.write(" </dict>\n")
|
||||
tmpFile.write("</plist>\n")
|
||||
tmpFile = open(infoFile, 'w')
|
||||
tmpFile.write(data_file)
|
||||
tmpFile.flush()
|
||||
tmpFile.close()
|
||||
# application signing :
|
||||
debug.print_element("pkg(signed)", "pkg", "<==", "Signing application")
|
||||
iosDevelopperKeyFile = ".iosKey.txt"
|
||||
if tools.file_size(iosDevelopperKeyFile) < 10:
|
||||
debug.warning("To sign an application we need to have a signing key in the file '" + iosDevelopperKeyFile + "' \n it is represented like: 'iPhone Developer: Francis DUGENOUX (YRRQE5KGTH)'\n you can obtain it with : 'certtool y | grep \"Developer\"'")
|
||||
debug.warning("Can not be install ... not runnable")
|
||||
cmdLine = "builtin-infoPlistUtility "
|
||||
cmdLine += " " + self.get_staging_path(pkg_name) + "/" + pkg_name + "-Info.plist "
|
||||
cmdLine += " -genpkginfo " + self.get_staging_path(pkg_name) + "/PkgInfo"
|
||||
cmdLine += " -expandbuildsettings "
|
||||
cmdLine += " -format binary "
|
||||
if self.get_simulation() == False:
|
||||
cmdLine += " -platform iphonesimulator "
|
||||
else:
|
||||
signatureKey = tools.file_read_data(iosDevelopperKeyFile)
|
||||
signatureKey = re.sub('\n', '', signatureKey)
|
||||
cmdLine = 'codesign --force --sign '
|
||||
# to get this key ; certtool y | grep "Developer"
|
||||
cmdLine += ' "' + signatureKey + '" '
|
||||
cmdLine += ' --entitlements ' + self.get_build_path(pkg_name) + '/worddown.xcent'
|
||||
cmdLine += ' ' + self.get_staging_path(pkg_name)
|
||||
multiprocess.run_command(cmdLine)
|
||||
|
||||
cmdLine += " -platform iphoneos "
|
||||
cmdLine += " -o " + self.get_staging_path(pkg_name) + "/" + "Info.plist"
|
||||
multiprocess.run_command(cmdLine)
|
||||
"""
|
||||
"""
|
||||
|
||||
/Users/edouarddupin/dev/exampleProjectXcode/projectName/projectName/projectName-Info.plist
|
||||
-genpkginfo
|
||||
/Users/edouarddupin/Library/Developer/Xcode/DerivedData/projectName-gwycnyyzohokcmalgodeucqppxro/Build/Products/Debug-iphonesimulator/projectName.app/PkgInfo
|
||||
-expandbuildsettings
|
||||
-format binary
|
||||
-platform iphonesimulator
|
||||
-additionalcontentfile /Users/edouarddupin/Library/Developer/Xcode/DerivedData/projectName-gwycnyyzohokcmalgodeucqppxro/Build/Intermediates/projectName.build/Debug-iphonesimulator/projectName.build/assetcatalog_generated_info.plist
|
||||
-o /Users/edouarddupin/Library/Developer/Xcode/DerivedData/projectName-gwycnyyzohokcmalgodeucqppxro/Build/Products/Debug-iphonesimulator/projectName.app/Info.plist
|
||||
-additionalcontentfile /Users/edouarddupin/Library/Developer/Xcode/DerivedData/zdzdzd-bjuyukzpzhnyerdmxohjyuxfdllv/Build/Intermediates/zdzdzd.build/Debug-iphoneos/zdzdzd.build/assetcatalog_generated_info.plist -o /Users/edouarddupin/Library/Developer/Xcode/DerivedData/zdzdzd-bjuyukzpzhnyerdmxohjyuxfdllv/Build/Products/Debug-iphoneos/zdzdzd.app/Info.plist
|
||||
|
||||
"""
|
||||
#/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil /Users/edouarddupin/Library/Developer/Xcode/DerivedData/projectName-gwycnyyzohokcmalgodeucqppxro/Build/Products/Debug-iphonesimulator/projectName.app/projectName -o /Users/edouarddupin/Library/Developer/Xcode/DerivedData/projectName-gwycnyyzohokcmalgodeucqppxro/Build/Products/Debug-iphonesimulator/projectName.app.dSYM
|
||||
|
||||
debug.print_element("pkg", "ResourceRules.plist", "<==", "Resources autorisation")
|
||||
data_file = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
data_file += "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n"
|
||||
data_file += "<plist version=\"1.0\">\n"
|
||||
data_file += " <dict>\n"
|
||||
data_file += " <key>rules</key>\n"
|
||||
data_file += " <dict>\n"
|
||||
data_file += " <key>.*</key>\n"
|
||||
data_file += " <true/>\n"
|
||||
data_file += " <key>Info.plist</key>\n"
|
||||
data_file += " <dict>\n"
|
||||
data_file += " <key>omit</key>\n"
|
||||
data_file += " <true/>\n"
|
||||
data_file += " <key>weight</key>\n"
|
||||
data_file += " <real>10</real>\n"
|
||||
data_file += " </dict>\n"
|
||||
data_file += " <key>ResourceRules.plist</key>\n"
|
||||
data_file += " <dict>\n"
|
||||
data_file += " <key>omit</key>\n"
|
||||
data_file += " <true/>\n"
|
||||
data_file += " <key>weight</key>\n"
|
||||
data_file += " <real>100</real>\n"
|
||||
data_file += " </dict>\n"
|
||||
data_file += " </dict>\n"
|
||||
data_file += " </dict>\n"
|
||||
data_file += "</plist>\n"
|
||||
data_file += "\n\n"
|
||||
tools.file_write_data(os.path.join(target_outpath, "ResourceRules.plist"),
|
||||
data_file,
|
||||
only_if_new=True)
|
||||
|
||||
debug.print_element("pkg", "Entitlements.plist", "<==", "application mode")
|
||||
data_file = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
data_file += "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n"
|
||||
data_file += "<plist version=\"1.0\">\n"
|
||||
data_file += " <dict>\n"
|
||||
data_file += " <key>get-task-allow</key>\n"
|
||||
data_file += " <true/>\n"
|
||||
data_file += " </dict>\n"
|
||||
data_file += "</plist>\n"
|
||||
data_file += "\n\n"
|
||||
tools.file_write_data(os.path.join(target_outpath, "Entitlements.plist"),
|
||||
data_file,
|
||||
only_if_new=True)
|
||||
|
||||
# Simulateur path :
|
||||
#~/Library/Application\ Support/iPhone\ Simulator/7.0.3/Applications/
|
||||
# must have a 'uuidgen' UID generate value with this elemennt ...
|
||||
# get the bundle path : ==> maybe usefull in MocOS ...
|
||||
# NSLog(@"%@",[[NSBundle mainBundle] bundlePath]);
|
||||
|
||||
# Must create the tarball of the application
|
||||
#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
|
||||
if self.get_simulation() == False:
|
||||
if "APPLE_APPLICATION_IOS_ID" not in pkg_properties:
|
||||
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 ..." )
|
||||
# Create the info file
|
||||
tmpFile = open(os.path.join(self.get_build_path(pkg_name), pkg_name + ".xcent"), 'w')
|
||||
tmpFile.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
|
||||
tmpFile.write("<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n")
|
||||
tmpFile.write("<plist version=\"1.0\">\n")
|
||||
tmpFile.write(" <dict>\n")
|
||||
tmpFile.write(" <key>application-identifier</key>\n")
|
||||
tmpFile.write(" <string>" + pkg_properties["APPLE_APPLICATION_IOS_ID"] + "." + pkg_properties["COMPAGNY_TYPE"] + "." + pkg_properties["COMPAGNY_NAME2"] + "." + pkg_name + "</string>\n")
|
||||
tmpFile.write(" <key>get-task-allow</key>\n")
|
||||
tmpFile.write(" <true/>\n")
|
||||
tmpFile.write(" <key>keychain-access-groups</key>\n")
|
||||
tmpFile.write(" <array>\n")
|
||||
tmpFile.write(" <string>" + pkg_properties["APPLE_APPLICATION_IOS_ID"] + "." + pkg_properties["COMPAGNY_TYPE"] + "." + pkg_properties["COMPAGNY_NAME2"] + "." + pkg_name + "</string>\n")
|
||||
tmpFile.write(" </array>\n")
|
||||
tmpFile.write(" </dict>\n")
|
||||
tmpFile.write("</plist>\n")
|
||||
tmpFile.flush()
|
||||
tmpFile.close()
|
||||
# application signing :
|
||||
debug.print_element("pkg(signed)", "pkg", "<==", "Signing application")
|
||||
iosDevelopperKeyFile = ".iosKey.txt"
|
||||
if tools.file_size(iosDevelopperKeyFile) < 10:
|
||||
debug.warning("To sign an application we need to have a signing key in the file '" + iosDevelopperKeyFile + "' \n it is represented like: 'iPhone Developer: Francis DUGENOUX (YRRQE5KGTH)'\n you can obtain it with : 'certtool y | grep \"Developer\"'")
|
||||
debug.warning("Can not be install ... not runnable")
|
||||
else:
|
||||
signatureKey = tools.file_read_data(iosDevelopperKeyFile)
|
||||
signatureKey = re.sub('\n', '', signatureKey)
|
||||
cmdLine = 'codesign --force --sign '
|
||||
# to get this key ; certtool y | grep "Developer"
|
||||
cmdLine += ' "' + signatureKey + '" '
|
||||
cmdLine += ' --entitlements ' + os.path.join(self.get_build_path(pkg_name), pkg_name + ".xcent")
|
||||
cmdLine += ' ' + os.path.join(self.get_staging_path(pkg_name), pkg_name + ".app")
|
||||
multiprocess.run_command(cmdLine)
|
||||
# package is done corectly ...
|
||||
tools.file_write_data(build_package_path_done, "done...")
|
||||
|
||||
def create_random_number(self, len):
|
||||
out = ""
|
||||
for iii in range(0,len):
|
||||
@@ -363,16 +387,16 @@ class Target(target.Target):
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.info("Install package '" + pkg_name + "'")
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
if self.sumulator == False:
|
||||
if tools.file_size("ewol/ios-deploy/ios-deploy") == 0:
|
||||
if self.get_simulation() == False:
|
||||
if tools.file_size("framework/tools/ios-deploy/build/Release/ios-deploy") == 0:
|
||||
debug.print_element("tool", "ios-deploy", "<==", "external sources")
|
||||
cmdLine = 'cd ewol/ios-deploy ; make ; cd ../.. '
|
||||
multiprocess.run_command(cmdLine)
|
||||
if tools.file_size("ewol/ios-deploy/ios-deploy") == 0:
|
||||
cmdLine = 'cd framework/tools/ios-deploy ; xcodemake ; cd ../.. '
|
||||
multiprocess.run_command_no_lock_out(cmdLine)
|
||||
if tools.file_size("framework/tools/ios-deploy/build/Release/ios-deploy") == 0:
|
||||
debug.error("Can not create ios-deploy external software ...")
|
||||
debug.print_element("deploy", "iphone/ipad", "<==", "aplication")
|
||||
cmdLine = './ewol/ios-deploy/ios-deploy --bundle ' + self.get_staging_path(pkg_name)
|
||||
multiprocess.run_command(cmdLine)
|
||||
cmdLine = './framework/tools/ios-deploy/ios-deploy --bundle ' + os.path.join(self.get_staging_path(pkg_name),pkg_name + ".app")
|
||||
multiprocess.run_command_no_lock_out(cmdLine)
|
||||
else:
|
||||
simulatorIdFile = ".iosSimutatorId_" + pkg_name + ".txt"
|
||||
if tools.file_size(simulatorIdFile) < 10:
|
||||
@@ -397,9 +421,9 @@ class Target(target.Target):
|
||||
debug.info("install in simulator : " + destinationpath)
|
||||
tools.create_directory_of_file(destinationpath + "/plop.txt")
|
||||
cmdLine = "cp -rf " + self.get_staging_path(pkg_name) + " " + destinationpath2
|
||||
multiprocess.run_command(cmdLine)
|
||||
multiprocess.run_command_no_lock_out(cmdLine)
|
||||
cmdLine = "touch " + destinationpathBase
|
||||
multiprocess.run_command(cmdLine)
|
||||
multiprocess.run_command_no_lock_out(cmdLine)
|
||||
|
||||
#sudo dpkg -i $(TARGET_OUT_FINAL)/$(PROJECT_NAME) + self.suffix_package
|
||||
|
||||
@@ -407,7 +431,7 @@ class Target(target.Target):
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.info("Un-Install package '" + pkg_name + "'")
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
if self.sumulator == False:
|
||||
if self.get_simulation() == False:
|
||||
debug.warning("not implemented")
|
||||
else:
|
||||
simulatorIdFile = ".iosSimutatorId_" + pkg_name + ".txt"
|
||||
@@ -416,24 +440,44 @@ class Target(target.Target):
|
||||
|
||||
#sudo dpkg -r $(TARGET_OUT_FINAL)/$(PROJECT_NAME) + self.suffix_package
|
||||
|
||||
def Log(self, pkg_name):
|
||||
def show_log(self, pkg_name):
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.info("log of iOs board")
|
||||
debug.info("-- log of iOs board")
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
if self.sumulator == False:
|
||||
if tools.file_size("ewol/ios-deploy/ios-deploy") == 0:
|
||||
if self.get_simulation() == False:
|
||||
if tools.file_size("framework/tools/ios-deploy/ios-deploy") == 0:
|
||||
debug.print_element("tool", "ios-deploy", "<==", "external sources")
|
||||
cmdLine = 'cd ewol/ios-deploy ; make ; cd ../.. '
|
||||
multiprocess.run_command(cmdLine)
|
||||
if tools.file_size("ewol/ios-deploy/ios-deploy") == 0:
|
||||
cmdLine = 'cd framework/tools/ios-deploy ; xcodebuild ; cd ../.. '
|
||||
multiprocess.run_command_no_lock_out(cmdLine)
|
||||
if tools.file_size("framework/tools/ios-deploy/build/Release/ios-deploy") == 0:
|
||||
debug.error("Can not create ios-deploy external software ...")
|
||||
debug.print_element("deploy", "iphone/ipad", "<==", "aplication")
|
||||
cmdLine = './ewol/ios-deploy/ios-deploy --debug --bundle ' + self.get_staging_path(pkg_name)
|
||||
multiprocess.run_command(cmdLine)
|
||||
debug.print_element("LOG", "iphone/ipad", "<==", "aplication")
|
||||
cmdLine = './framework/tools/ios-deploy/build/Release/ios-deploy --noinstall --debug --bundle ' + os.path.join(self.get_staging_path(pkg_name),pkg_name + ".app")
|
||||
multiprocess.run_command_no_lock_out(cmdLine)
|
||||
else:
|
||||
cmdLine = "tail -f ~/Library/Logs/iOS\ Simulator/7.1/system.log"
|
||||
multiprocess.run_command(cmdLine)
|
||||
|
||||
|
||||
|
||||
multiprocess.run_command_no_lock_out(cmdLine)
|
||||
|
||||
def run(self, pkg_name, option_list):
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.info("-- Run package '" + pkg_name + "' + option: " + str(option_list))
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
if self.get_simulation() == True:
|
||||
debug.error (" can not run in simulation mode ....")
|
||||
return
|
||||
if tools.file_size("framework/tools/ios-deploy/ios-deploy") == 0:
|
||||
debug.print_element("tool", "ios-deploy", "<==", "external sources")
|
||||
cmdLine = 'cd framework/tools/ios-deploy ; xcodebuild ; cd ../.. '
|
||||
multiprocess.run_command_no_lock_out(cmdLine)
|
||||
if tools.file_size("framework/tools/ios-deploy/build/Release/ios-deploy") == 0:
|
||||
debug.error("Can not create ios-deploy external software ...")
|
||||
debug.print_element("run", "iphone/ipad", "<==", "aplication")
|
||||
cmd = './framework/tools/ios-deploy/build/Release/ios-deploy --noinstall --debug --bundle ' + os.path.join(self.get_staging_path(pkg_name),pkg_name + ".app --args ")
|
||||
for elem in option_list:
|
||||
cmd += elem + " "
|
||||
multiprocess.run_command_no_lock_out(cmd)
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.info("-- Run package '" + pkg_name + "' Finished")
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
|
||||
|
||||
|
@@ -16,17 +16,18 @@ import os
|
||||
import stat
|
||||
import re
|
||||
from lutin import host
|
||||
from lutin import depend
|
||||
from lutin import multiprocess
|
||||
|
||||
class Target(target.Target):
|
||||
def __init__(self, config):
|
||||
def __init__(self, config, sub_name=[]):
|
||||
#processor type selection (auto/arm/ppc/x86)
|
||||
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, "")
|
||||
target.Target.__init__(self, ["Linux"] + sub_name, config, "")
|
||||
if self.config["bus-size"] == "64":
|
||||
# 64 bits
|
||||
if host.BUS_SIZE != 64:
|
||||
@@ -36,7 +37,7 @@ class Target(target.Target):
|
||||
if host.BUS_SIZE != 32:
|
||||
self.add_flag("c", "-m32")
|
||||
|
||||
self.add_flag("c", "-fpic")
|
||||
self.add_flag("c", "-fPIC")
|
||||
|
||||
self.pkg_path_data = "share"
|
||||
self.pkg_path_bin = "bin"
|
||||
@@ -46,6 +47,12 @@ class Target(target.Target):
|
||||
if env.get_isolate_system() == True:
|
||||
self.sysroot = "--sysroot=/aDirectoryThatDoesNotExist/"
|
||||
|
||||
self.add_flag("link-lib", [
|
||||
"dl"
|
||||
])
|
||||
self.add_flag("link", [
|
||||
"-rdynamic"
|
||||
])
|
||||
|
||||
"""
|
||||
.local/application
|
||||
@@ -97,16 +104,24 @@ class Target(target.Target):
|
||||
## Create generic files:
|
||||
ret_file = self.make_package_generic_files(target_outpath, pkg_properties, pkg_name, base_pkg_path, heritage_list, static)
|
||||
|
||||
## end of the package generation
|
||||
build_package_path_done = os.path.join(self.get_build_path(pkg_name), "generatePackageDone.txt")
|
||||
#Check date between the current file "list of action to generate package and the end of package generation
|
||||
need_generate_package = depend.need_re_package(build_package_path_done, [__file__], True)
|
||||
|
||||
## create the package:
|
||||
if ret_share \
|
||||
or ret_bin \
|
||||
or ret_lib \
|
||||
or ret_file:
|
||||
or ret_file \
|
||||
or need_generate_package:
|
||||
debug.debug("package : " + os.path.join(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")
|
||||
#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.copy_file(os.path.join(self.get_staging_path(pkg_name), pkg_name + ".app.tar.gz"), os.path.join(self.get_final_path(), pkg_name + ".app.gpkg"))
|
||||
# package is done corectly ...
|
||||
tools.file_write_data(build_package_path_done, "done...")
|
||||
|
||||
def install_package(self, pkg_name):
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
|
@@ -13,21 +13,26 @@ from lutin import target
|
||||
from lutin import tools
|
||||
from lutin import host
|
||||
from lutin import multiprocess
|
||||
from lutin import depend
|
||||
import os
|
||||
import stat
|
||||
import shutil
|
||||
|
||||
class Target(target.Target):
|
||||
def __init__(self, config):
|
||||
def __init__(self, config, sub_name=[]):
|
||||
#processor type selection (auto/arm/ppc/x86)
|
||||
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)
|
||||
#config["bus-size"] = str(32)
|
||||
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://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_lib="lib"
|
||||
@@ -44,6 +49,13 @@ class Target(target.Target):
|
||||
self.pkg_path_lib = "lib"
|
||||
self.pkg_path_license = "license"
|
||||
|
||||
self.add_flag("link-lib", [
|
||||
"dl"
|
||||
])
|
||||
self.add_flag("link", [
|
||||
"-rdynamic"
|
||||
])
|
||||
|
||||
"""
|
||||
def get_staging_path(self, binary_name):
|
||||
return tools.get_run_path() + self.path_out + self.path_staging + "/" + binary_name + ".app/Contents/"
|
||||
@@ -61,83 +73,96 @@ class Target(target.Target):
|
||||
tools.create_directory_of_file(target_outpath)
|
||||
|
||||
## Create share datas:
|
||||
self.make_package_binary_data(target_outpath, pkg_name, base_pkg_path, heritage_list, static)
|
||||
ret_share = self.make_package_binary_data(target_outpath, pkg_name, base_pkg_path, heritage_list, static)
|
||||
|
||||
## copy binary files:
|
||||
self.make_package_binary_bin(target_outpath, pkg_name, base_pkg_path, heritage_list, static)
|
||||
ret_bin = self.make_package_binary_bin(target_outpath, pkg_name, base_pkg_path, heritage_list, static)
|
||||
|
||||
## Create libraries:
|
||||
self.make_package_binary_lib(target_outpath, pkg_name, base_pkg_path, heritage_list, static)
|
||||
ret_lib = self.make_package_binary_lib(target_outpath, pkg_name, base_pkg_path, heritage_list, static)
|
||||
|
||||
## Create generic files:
|
||||
self.make_package_generic_files(target_outpath, pkg_properties, pkg_name, base_pkg_path, heritage_list, static)
|
||||
ret_file = self.make_package_generic_files(target_outpath, pkg_properties, pkg_name, base_pkg_path, heritage_list, static)
|
||||
|
||||
## Create icon (no convertion ==> TODO: must test if png is now supported):
|
||||
if "ICON" in pkg_properties.keys() \
|
||||
and pkg_properties["ICON"] != "":
|
||||
tools.copy_file(pkg_properties["ICON"], os.path.join(target_outpath, "icon.icns"), force=True)
|
||||
## end of the package generation
|
||||
build_package_path_done = os.path.join(self.get_build_path(pkg_name), "generatePackageDone.txt")
|
||||
#Check date between the current file "list of action to generate package and the end of package generation
|
||||
need_generate_package = depend.need_re_package(build_package_path_done, [__file__], True)
|
||||
|
||||
## Create info.plist file:
|
||||
# http://www.sandroid.org/imcross/#Deployment
|
||||
data_file = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
data_file += "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n"
|
||||
data_file += "<plist version=\"1.0\">\n"
|
||||
data_file += " <dict>\n"
|
||||
data_file += " <key>CFBundleExecutableFile</key>\n"
|
||||
data_file += " <string>"+pkg_name+"</string>\n"
|
||||
data_file += " <key>CFBundleName</key>\n"
|
||||
data_file += " <string>"+pkg_name+"</string>\n"
|
||||
data_file += " <key>CFBundleIdentifier</key>\n"
|
||||
data_file += " <string>" + pkg_properties["COMPAGNY_TYPE"] + "." + pkg_properties["COMPAGNY_NAME2"] + "." + pkg_name + "</string>\n"
|
||||
data_file += " <key>CFBundleSignature</key>\n"
|
||||
data_file += " <string>????</string>\n"
|
||||
data_file += " <key>CFBundleIconFile</key>\n"
|
||||
data_file += " <string>icon.icns</string>\n"
|
||||
data_file += " </dict>\n"
|
||||
data_file += "</plist>\n"
|
||||
data_file += "\n\n"
|
||||
tools.file_write_data(os.path.join(target_outpath, "Info.plist"),
|
||||
data_file,
|
||||
only_if_new=True)
|
||||
|
||||
## Create PkgInfo file:
|
||||
tools.file_write_data(os.path.join(target_outpath, "PkgInfo"),
|
||||
"APPL????",
|
||||
only_if_new=True)
|
||||
|
||||
## Create a simple interface to localy install the aplication for the shell (a shell command line interface):
|
||||
data_file = "#!/bin/bash\n"
|
||||
data_file += "# Simply open the real application in the correct way (a link does not work ...)\n"
|
||||
data_file += "/Applications/" + pkg_name + ".app/Contents/MacOS/" + pkg_name + " $*\n"
|
||||
tools.file_write_data(os.path.join(target_outpath, "shell", pkg_name),
|
||||
data_file,
|
||||
only_if_new=True)
|
||||
|
||||
## Create the disk image of the application:
|
||||
debug.info("Generate disk image for '" + pkg_name + "'")
|
||||
output_file_name = os.path.join(self.get_final_path(), pkg_name + ".dmg")
|
||||
cmd = "hdiutil create -volname "
|
||||
cmd += pkg_name + " -srcpath "
|
||||
cmd += os.path.join(tools.get_run_path(), self.path_out, self.path_staging, pkg_name + ".app")
|
||||
cmd += " -ov -format UDZO "
|
||||
cmd += output_file_name
|
||||
tools.create_directory_of_file(output_file_name)
|
||||
multiprocess.run_command_direct(cmd)
|
||||
debug.info("disk image: " + output_file_name)
|
||||
|
||||
## user information:
|
||||
#debug.info("You can have an shell interface by executing : ")
|
||||
#debug.info(" sudo cp " + shell_file_name + " /usr/local/bin")
|
||||
## create the package:
|
||||
if ret_share \
|
||||
or ret_bin \
|
||||
or ret_lib \
|
||||
or ret_file \
|
||||
or need_generate_package:
|
||||
|
||||
## Create icon (no convertion ==> TODO: must test if png is now supported):
|
||||
if "ICON" in pkg_properties.keys() \
|
||||
and pkg_properties["ICON"] != "":
|
||||
tools.copy_file(pkg_properties["ICON"], os.path.join(target_outpath, "icon.icns"), force=True)
|
||||
|
||||
## Create info.plist file:
|
||||
# http://www.sandroid.org/imcross/#Deployment
|
||||
data_file = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
data_file += "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n"
|
||||
data_file += "<plist version=\"1.0\">\n"
|
||||
data_file += " <dict>\n"
|
||||
data_file += " <key>CFBundleExecutableFile</key>\n"
|
||||
data_file += " <string>"+pkg_name+"</string>\n"
|
||||
data_file += " <key>CFBundleName</key>\n"
|
||||
data_file += " <string>"+pkg_name+"</string>\n"
|
||||
data_file += " <key>CFBundleIdentifier</key>\n"
|
||||
data_file += " <string>" + pkg_properties["COMPAGNY_TYPE"] + "." + pkg_properties["COMPAGNY_NAME2"] + "." + pkg_name + "</string>\n"
|
||||
data_file += " <key>CFBundleSignature</key>\n"
|
||||
data_file += " <string>????</string>\n"
|
||||
data_file += " <key>CFBundleIconFile</key>\n"
|
||||
data_file += " <string>icon.icns</string>\n"
|
||||
data_file += " </dict>\n"
|
||||
data_file += "</plist>\n"
|
||||
data_file += "\n\n"
|
||||
tools.file_write_data(os.path.join(target_outpath, "Info.plist"),
|
||||
data_file,
|
||||
only_if_new=True)
|
||||
|
||||
## Create PkgInfo file:
|
||||
tools.file_write_data(os.path.join(target_outpath, "PkgInfo"),
|
||||
"APPL????",
|
||||
only_if_new=True)
|
||||
|
||||
## Create a simple interface to localy install the aplication for the shell (a shell command line interface):
|
||||
data_file = "#!/bin/bash\n"
|
||||
data_file += "# Simply open the real application in the correct way (a link does not work ...)\n"
|
||||
data_file += "/Applications/" + pkg_name + ".app/Contents/MacOS/" + pkg_name + " $*\n"
|
||||
tools.file_write_data(os.path.join(target_outpath, "shell", pkg_name),
|
||||
data_file,
|
||||
only_if_new=True)
|
||||
|
||||
## Create the disk image of the application:
|
||||
debug.info("Generate disk image for '" + pkg_name + "'")
|
||||
output_file_name = os.path.join(self.get_final_path(), pkg_name + ".dmg")
|
||||
cmd = "hdiutil create -volname "
|
||||
cmd += pkg_name + " -srcpath "
|
||||
cmd += os.path.join(tools.get_run_path(), self.path_out, self.path_staging, pkg_name + ".app")
|
||||
cmd += " -ov -format UDZO "
|
||||
cmd += output_file_name
|
||||
tools.create_directory_of_file(output_file_name)
|
||||
multiprocess.run_command_direct(cmd)
|
||||
debug.info("disk image: " + output_file_name)
|
||||
|
||||
## user information:
|
||||
#debug.info("You can have an shell interface by executing : ")
|
||||
#debug.info(" sudo cp " + shell_file_name + " /usr/local/bin")
|
||||
tools.file_write_data(build_package_path_done, "done...")
|
||||
|
||||
def install_package(self, pkg_name):
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.info("Install package '" + pkg_name + "'")
|
||||
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:
|
||||
shutil.rmtree("/Applications/" + pkg_name + ".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):
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
@@ -152,7 +177,8 @@ class Target(target.Target):
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.info("-- Run package '" + pkg_name + "'")
|
||||
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 + " "
|
||||
for elem in option_list:
|
||||
cmd += elem + " "
|
||||
|
@@ -12,13 +12,15 @@ from lutin import debug
|
||||
from lutin import target
|
||||
from lutin import tools
|
||||
from lutin import host
|
||||
from lutin import depend
|
||||
import os
|
||||
import stat
|
||||
import sys
|
||||
from lutin import zip
|
||||
from lutin import multiprocess
|
||||
|
||||
class Target(target.Target):
|
||||
def __init__(self, config):
|
||||
def __init__(self, config, sub_name=[]):
|
||||
if config["compilator"] != "gcc":
|
||||
debug.error("Windows does not support '" + config["compilator"] + "' compilator ... availlable : [gcc]")
|
||||
config["compilator"] = "gcc"
|
||||
@@ -30,7 +32,7 @@ class Target(target.Target):
|
||||
if config["bus-size"] == "auto":
|
||||
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
|
||||
# TODO : get external PATH for the minGW path
|
||||
@@ -43,30 +45,42 @@ class Target(target.Target):
|
||||
if self.config["bus-size"] == "64":
|
||||
# 64 bits
|
||||
self.set_cross_base("x86_64-w64-mingw32-")
|
||||
self.base_path = "x86_64-w64-mingw32"
|
||||
else:
|
||||
# 32 bits
|
||||
self.set_cross_base("i686-w64-mingw32-")
|
||||
self.base_path = "i686-w64-mingw32"
|
||||
self.add_flag("c", [
|
||||
"-DWIN32=1"
|
||||
])
|
||||
"""
|
||||
self.add_flag("link-lib", [
|
||||
"dl"
|
||||
])
|
||||
"""
|
||||
|
||||
self.pkg_path_data = "data"
|
||||
self.pkg_path_bin = ""
|
||||
self.pkg_path_lib = "lib"
|
||||
self.pkg_path_license = "license"
|
||||
|
||||
self.suffix_lib_static='.a'
|
||||
self.suffix_lib_dynamic='.dll'
|
||||
self.suffix_binary='.exe'
|
||||
#self.suffix_package=''
|
||||
self.suffix_lib_static = '.a'
|
||||
self.suffix_lib_dynamic = '.dll'
|
||||
self.suffix_binary = '.exe'
|
||||
#self.suffix_package = ''
|
||||
# TODO : Remove this ==> pb with openSSL shared lib ...
|
||||
self.support_dynamic_link = False
|
||||
|
||||
|
||||
def get_staging_path_data(self, binary_name, heritage_list):
|
||||
return self.get_staging_path(binary_name) + self.path_data
|
||||
def get_staging_path_data(self, binary_name, tmp=False):
|
||||
return os.path.join(self.get_staging_path(binary_name, tmp), binary_name + ".app", self.pkg_path_data)
|
||||
|
||||
def make_package_binary(self, pkg_name, pkg_properties, base_pkg_path, heritage_list, static):
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.debug("Generate package '" + pkg_name + "' v" + tools.version_to_string(pkg_properties["VERSION"]))
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
#output path
|
||||
target_outpath = os.path.join(self.get_staging_path(pkg_name), pkg_name + ".app")
|
||||
target_outpath = os.path.join(self.get_staging_path(pkg_name, tmp=True), pkg_name + ".app")
|
||||
tools.create_directory_of_file(target_outpath)
|
||||
|
||||
## Create share datas:
|
||||
@@ -79,14 +93,41 @@ class Target(target.Target):
|
||||
ret_lib = self.make_package_binary_lib(target_outpath, pkg_name, base_pkg_path, heritage_list, static)
|
||||
|
||||
## Create generic files:
|
||||
ret_file = self.make_package_generic_files(target_outpath, pkg_properties, pkg_name, base_pkg_path, heritage_list, static)
|
||||
ret_file = self.make_package_generic_files(target_outpath+"/pkg", pkg_properties, pkg_name, base_pkg_path, heritage_list, static)
|
||||
|
||||
build_package_path_done = os.path.join(self.get_build_path(pkg_name), "generatePackageDone.txt")
|
||||
#Check date between the current file "list of action to generate package and the end of package generation
|
||||
need_generate_package = depend.need_re_package(build_package_path_done, [__file__], True)
|
||||
## create the package:
|
||||
if ret_share \
|
||||
or ret_bin \
|
||||
or ret_lib \
|
||||
or ret_file:
|
||||
debug.info("TODO: create a windows pkg ...")
|
||||
or ret_file \
|
||||
or need_generate_package:
|
||||
# Zip the data
|
||||
debug.print_element("zip", "data.zip", "<==", self.get_staging_path_data(pkg_name, tmp=True) + "/*")
|
||||
zip_path = os.path.join(self.get_staging_path(pkg_name), pkg_name + ".app", "data.zip")
|
||||
zip.create_zip([
|
||||
self.get_staging_path_data(pkg_name, tmp=True),
|
||||
target_outpath+"/pkg"
|
||||
], zip_path)
|
||||
# copy if needed the binary:
|
||||
tools.copy_file(
|
||||
os.path.join(self.get_staging_path(pkg_name, tmp=True), pkg_name + ".app", pkg_name + self.suffix_binary),
|
||||
os.path.join(self.get_staging_path(pkg_name), pkg_name + ".app", pkg_name + self.suffix_binary),
|
||||
force_identical=True)
|
||||
|
||||
zip_path_final = os.path.join(self.get_final_path(), pkg_name + ".zip")
|
||||
# generate deployed zip (for user)
|
||||
debug.print_element("zip", pkg_name + ".zip", "<==", self.get_staging_path(pkg_name), pkg_name + ".app")
|
||||
zip.create_zip_file([
|
||||
zip_path,
|
||||
os.path.join(self.get_staging_path(pkg_name), pkg_name + ".app", pkg_name + self.suffix_binary)
|
||||
],
|
||||
pkg_name + ".app",
|
||||
zip_path_final)
|
||||
|
||||
tools.file_write_data(build_package_path_done, "done...")
|
||||
|
||||
def make_package_single_file(self, pkg_name, pkg_properties, base_pkg_path, heritage_list):
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
@@ -154,4 +195,21 @@ class Target(target.Target):
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.warning(" ==> TODO")
|
||||
#sudo dpkg -r $(TARGET_OUT_FINAL)/$(PROJECT_NAME) + self.suffix_package
|
||||
|
||||
def run(self, pkg_name, option_list):
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.info("-- Run package '" + pkg_name + "' + option: " + str(option_list))
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
if host.OS == "Windows":
|
||||
debug.error("action not implemented ...")
|
||||
return
|
||||
debug.debug(" think to configure your wine : 'winecfg' : https://www.winehq.org/docs/wineusr-guide/config-wine-main")
|
||||
appl_path = os.path.join(self.get_staging_path(pkg_name), pkg_name + ".app", pkg_name + self.suffix_binary)
|
||||
cmd = "wine " + appl_path + " "
|
||||
for elem in option_list:
|
||||
cmd += elem + " "
|
||||
multiprocess.run_command_no_lock_out(cmd)
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.info("-- Run package '" + pkg_name + "' Finished")
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
|
||||
|
32
lutin/zip.py
32
lutin/zip.py
@@ -18,15 +18,31 @@ from . import tools
|
||||
|
||||
def create_zip(path, outputFile):
|
||||
debug.debug("Create Zip : '" + outputFile + "'")
|
||||
debug.debug(" from '" + path + "'")
|
||||
basePathlen = len(path)
|
||||
tools.create_directory_of_file(outputFile)
|
||||
debug.debug(" from '" + str(path) + "'")
|
||||
if tools.get_type_string(path) == "string":
|
||||
path = [path]
|
||||
zf = zipfile.ZipFile(outputFile, mode='w')
|
||||
for root, dirnames, filenames in os.walk(path):
|
||||
# List all files :
|
||||
for filename in filenames:
|
||||
file = os.path.join(root, filename)
|
||||
debug.verbose(" ADD zip = " + str(file))
|
||||
zf.write(file, file[basePathlen:])
|
||||
for elem in path:
|
||||
basePathlen = len(elem)
|
||||
for root, dirnames, filenames in os.walk(elem):
|
||||
# List all files :
|
||||
for filename in filenames:
|
||||
file = os.path.join(root, filename)
|
||||
debug.verbose(" ADD zip = " + str(file) + " ==> " +file[basePathlen:])
|
||||
zf.write(file, file[basePathlen:])
|
||||
zf.close()
|
||||
|
||||
def create_zip_file(files, base_output, outputFile):
|
||||
debug.debug("Create Zip : '" + outputFile + "'")
|
||||
tools.create_directory_of_file(outputFile)
|
||||
debug.debug(" from '" + str(files) + "'")
|
||||
if tools.get_type_string(files) == "string":
|
||||
files = [files]
|
||||
zf = zipfile.ZipFile(outputFile, mode='w')
|
||||
for elem in files:
|
||||
debug.verbose(" ADD zip = " + str(elem) + " ==> " + base_output + "/" + elem[len(os.path.dirname(elem)):])
|
||||
zf.write(elem, base_output + "/" + elem[len(os.path.dirname(elem)):])
|
||||
zf.close()
|
||||
|
||||
|
||||
|
2
setup.py
2
setup.py
@@ -16,7 +16,7 @@ def readme():
|
||||
|
||||
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
|
||||
setup(name='lutin',
|
||||
version='2.0.0',
|
||||
version='2.2.0',
|
||||
description='Lutin generic builder (might replace makefile, CMake ...)',
|
||||
long_description=readme(),
|
||||
url='http://github.com/HeeroYui/lutin',
|
||||
|
@@ -1,5 +1,4 @@
|
||||
#!/usr/bin/python
|
||||
import lutin.module as module
|
||||
import lutin.tools as tools
|
||||
import lutin.debug as debug
|
||||
import os
|
||||
@@ -8,10 +7,9 @@ def get_type():
|
||||
return "BINARY"
|
||||
|
||||
def get_desc():
|
||||
return "Text C compilation"
|
||||
return "Test C compilation"
|
||||
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name, get_type())
|
||||
def configure(target, my_module):
|
||||
my_module.add_extra_compile_flags()
|
||||
my_module.add_src_file([
|
||||
'test.c'
|
||||
|
Reference in New Issue
Block a user