Compare commits

...

42 Commits
2.1.0 ... 2.2.2

Author SHA1 Message Date
0a536b5203 [RELEASE] release version 2.2.2 2016-11-10 21:56:36 +01:00
1c66efa105 [DEV] simplify naming of asset 2016-11-10 21:14:42 +01:00
edfe7a1c96 [DEV] add add_src_path and add_header_path 2016-11-09 23:33:38 +01:00
92a0e5198c [DEV] add base of emscripten build for firefox test 2016-11-04 22:54:25 +01:00
156abe3533 [CI] correct build CI 2016-10-28 00:31:06 +02:00
2992699ec5 [DEBUG] correct local simple C test 2016-10-28 00:08:46 +02:00
44dbcdd56d [DEV] add a dependency graph generator
lutin dependency:LD ; dot -Tsvg dependency.dot -o dependency.svg ; firefox dependency.svg
2016-10-28 00:06:05 +02:00
f2060d4c97 [RELEASE] release version 2.2.1 2016-10-27 21:13:24 +02:00
cfde4a549f [DEBUG] correct version number parsing 2016-10-27 21:13:24 +02:00
72e956f06a [DEBUG] correct ARM7 or ARM64 selection 2016-10-11 21:14:19 +02:00
058c425feb [RELEASE] new version 2.2.0 2016-10-23 13:59:54 +02:00
7e6f391dbf [DEV] remove deprecated 2016-10-23 13:58:35 +02:00
e25ceee5a8 (DEV) add some element of Mac OS framework 2016-10-11 21:14:19 +02:00
42e3deed44 [DEV] add better flag for android 2016-10-11 21:00:08 +02:00
f0690cd75a [DEV] add some include in windows platform 2016-10-10 21:18:17 +02:00
acc69912a0 [DEV] correct run api for IOs 2016-10-07 21:02:35 +02:00
73a230826b [DEBUG] missing depend in specific target interface 2016-10-06 22:51:40 +02:00
da8233d34e [DEV] add ws2 include support for windows 2016-09-28 23:41:41 +02:00
27f6a95d41 [DEBUG] correct basic path to create the zip file in Windows Target 2016-10-05 23:45:46 +02:00
71e0f242bf [DEV] zip data for windows and create a zip package for final output 2016-10-05 22:57:30 +02:00
092843cd02 [DEV] add support of heritage of target and better support of Debian distro 2016-10-05 21:17:12 +02:00
3b37e78dd3 [DEBUG] wrong deprecated version 2016-10-04 23:19:05 +02:00
94d8b82321 [API/DEV] set ICON and ANDROID_SIGN in relative only 2016-10-04 22:56:40 +02:00
4c883f177c [DEV] set relative path in add path 2016-10-04 22:42:54 +02:00
b6a5f7e539 [DEV] update build to support configure instead of create in module ==> permit to get back the version ... order issue 2016-10-04 21:08:06 +02:00
fb4b03a441 [DEV] add run on linux for windows 2016-09-29 21:29:29 +02:00
ed3a26a638 [DEV] add rpc for gtest and gui mode for graphic windows application 2016-09-28 23:41:41 +02:00
2a9f3feed7 [DEV] add many system support for MacOs, IOs and Windows.Correct the target flags 2016-09-28 23:39:14 +02:00
e148a7e204 [DEV] add ptherd for Windows cross compile 2016-09-27 23:16:41 +02:00
13e6d98ac4 [DEV] add prebuild SDL 2016-09-26 21:00:33 +02:00
45bd6e6213 [DEV] add get_compilator in target 2016-09-25 21:35:07 +02:00
82e8946227 [DOC] add help to deploy on IOs 2016-09-22 21:33:06 +02:00
aa96a415b5 [DEBUG] correct MacOS releae build 2016-09-21 21:35:13 +02:00
52729c3c71 [DEV/DEBUG] correct the build of IOs target and correct the resize installed image 2016-09-20 22:33:00 +02:00
62d084b351 [DEV/DOC] correct template of module, add API of set file with dependency availlable 2016-09-20 21:57:00 +02:00
1c76227b27 [DEBUG] write error when action on target does not exist 2016-09-18 22:49:56 +02:00
f46c5116b1 [DEBUG] Run / intall executable on MacOs 2016-09-18 22:40:01 +02:00
1cf731910d [DEBUG] build on MacOs 2016-09-16 23:06:51 +02:00
a2fdd6eef9 [DEV] update flags on MacOs 2016-09-15 23:19:57 +02:00
9c9809c359 [DEV] change warning in debug 2016-09-15 23:29:21 +02:00
3bea09cfc2 [DEBUG] set comiplation for Windows on Linux back 2016-09-14 23:53:22 +02:00
cc397679bb [DEV] wrong code specification 2016-09-13 23:56:20 +02:00
73 changed files with 3077 additions and 867 deletions

View File

@@ -1,6 +1,8 @@
#language: python
language: cpp
sudo: false
#sudo: false
sudo: required
dist: trusty
branches:
only:
@@ -24,14 +26,14 @@ addons:
matrix:
include:
- os: linux
env: CONF=release BUILDER=gcc TARGET=Linux TAG=Linux
env: CONF=release BUILDER=gcc TARGET=Linux TAG=Linux COMPILATOR_OPTION="--compilator-version=4.9"
compiler: gcc
- os: linux
env: CONF=debug BUILDER=clang TARGET=Linux
compiler: clang
- os: linux
env: CONF=release BUILDER=gcc TARGET=Windows TAG=Mingw
compiler: gcc
compiler: x86_64-w64-mingw32-gcc
- os: linux
env: CONF=release BUILDER=gcc TARGET=Android TAG=Android DISABLE_PACKAGE=-p
compiler: gcc
@@ -43,6 +45,8 @@ matrix:
compiler: clang
install:
- ./setup.py build
- export PYTHONPATH=$PYTHONPATH:./lutin/build/lib.linux-x86_64-2.7/:./lutin/build/lib.linux-x86_64-2.7/lutin/:./lutin/build/lib:./lutin/build/lib/lutin/
- cd ..
# download NDK
- if [ "$TAG" == "Android" ]; then
@@ -53,15 +57,16 @@ install:
- cd -
before_script:
- ./setup.py build
- export PYTHONPATH=$PYTHONPATH:./lutin/build/lib.linux-x86_64-2.7/:./lutin/build/lib.linux-x86_64-2.7/lutin/:./lutin/build/lib:./lutin/build/lib/lutin/
- cd ..
- pwd
- ls -l *
- ls -l
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
export PATH=$PATH:/Users/travis/Library/Python/2.7/bin/;
fi
- ./ci/build_send.py --tag=$TAG --status=START;
script:
- ./lutin/build/scripts-2.7/lutin -w -j4 -C -P -t$TARGET -c $BUILDER $COMPILATOR_OPTION $BUS -m $CONF $GCOV $DISABLE_PACKAGE test-c; STATUS=$?
- ./lutin/build/scripts-2.7/lutin -w -j4 -C -P -t $TARGET -c $BUILDER $COMPILATOR_OPTION $BUS -m $CONF $GCOV $DISABLE_PACKAGE test-c; STATUS=$?
- ./ci/build_send.py --tag=$TAG --status="$STATUS";
notifications:

View File

@@ -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")
@@ -69,6 +69,15 @@ def usage(full=False):
print(" clean all (same as previous)")
print(" " + color['green'] + "dump" + color['default'])
print(" Dump all the module dependency and properties")
print(" " + color['green'] + "dependency" + color['default'])
print(" generate a file dependency.dot that represent all the dependency link")
print(" Select what in included: 'dependency:LPBDK'")
print(" L: Library")
print(" P: Pre-build")
print(" D: Data")
print(" B: Binary")
print(" K: Package")
print(" eg: lutin dependency:LD ; dot -Tsvg dependency.dot -o dependency.svg ; firefox dependency.svg")
print(" " + color['green'] + "gcov" + color['default'])
print(" Parse all the code of the library with the gcov resolution")
listOfAllModule = module.list_all_module_with_desc()
@@ -169,18 +178,18 @@ def check_boolean(value):
def parseGenericArg(argument, active):
debug.extreme_verbose("parse arg : " + argument.get_option_name() + " " + argument.get_arg() + " active=" + str(active))
if argument.get_option_name() == "help":
if active==False:
if active == False:
usage()
return True
if argument.get_option_name() == "HELP":
if active==False:
if active == False:
usage(True)
return True
if argument.get_option_name() == "list-module":
if active==False:
listOfModule = module.list_all_module()
if active == False:
list_of_module = module.list_all_module()
retValue = ""
for moduleName in listOfModule:
for moduleName in list_of_module:
if retValue != "":
retValue += " "
retValue += moduleName
@@ -188,10 +197,10 @@ def parseGenericArg(argument, active):
exit(0)
return True
if argument.get_option_name() == "list-target":
if active==False:
listOfTarget = target.list_all_target()
if active == False:
list_of_target = target.list_all_target()
retValue = ""
for targetName in listOfTarget:
for targetName in list_of_target:
if retValue != "":
retValue += " "
retValue += targetName
@@ -199,61 +208,61 @@ def parseGenericArg(argument, active):
exit(0)
return True
elif argument.get_option_name()=="jobs":
if active==True:
if active == True:
multiprocess.set_core_number(int(argument.get_arg()))
return True
elif argument.get_option_name()=="depth":
if active==True:
if active == True:
env.set_parse_depth(int(argument.get_arg()))
return True
elif argument.get_option_name() == "verbose":
if active==True:
if active == True:
debug.set_level(int(argument.get_arg()))
return True
elif argument.get_option_name() == "color":
if active==True:
if active == True:
if check_boolean(argument.get_arg()) == True:
debug.enable_color()
else:
debug.disable_color()
return True
elif argument.get_option_name() == "force-build":
if active==True:
if active == True:
if check_boolean(argument.get_arg()) == True:
env.set_force_mode(True)
else:
env.set_force_mode(False)
return True
elif argument.get_option_name() == "pretty":
if active==True:
if active == True:
if check_boolean(argument.get_arg()) == True:
env.set_print_pretty_mode(True)
else:
env.set_print_pretty_mode(False)
return True
elif argument.get_option_name() == "force-optimisation":
if active==True:
if active == True:
if check_boolean(argument.get_arg()) == True:
env.set_force_optimisation(True)
else:
env.set_force_optimisation(False)
return True
elif argument.get_option_name() == "isolate-system":
if active==True:
if active == True:
if check_boolean(argument.get_arg()) == True:
env.set_isolate_system(True)
else:
env.set_isolate_system(False)
return True
elif argument.get_option_name() == "force-strip":
if active==True:
if active == True:
if check_boolean(argument.get_arg()) == True:
env.set_force_strip_mode(True)
else:
env.set_force_strip_mode(False)
return True
elif argument.get_option_name() == "warning":
if active==True:
if active == True:
if check_boolean(argument.get_arg()) == True:
env.set_warning_mode(True)
else:
@@ -323,7 +332,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 +373,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",

View File

@@ -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
```

View File

@@ -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
View 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
```

View File

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

View File

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

View File

@@ -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() + "'")

View File

@@ -54,12 +54,25 @@ class Module:
def __init__(self, file, module_name, module_type):
## Remove all variable to prevent error of multiple deffinition of the module ...
debug.verbose("Create a new module : '" + module_name + "' TYPE=" + module_type)
self._origin_file=''
self._origin_path=''
self._origin_file = file;
self._origin_path = tools.get_current_path(self._origin_file)
# type of the module:
self._type='LIBRARY'
if module_type == 'BINARY' \
or module_type == 'BINARY_SHARED' \
or module_type == 'BINARY_STAND_ALONE' \
or module_type == 'LIBRARY' \
or module_type == 'LIBRARY_DYNAMIC' \
or module_type == 'LIBRARY_STATIC' \
or module_type == 'PACKAGE' \
or module_type == 'PREBUILD' \
or module_type == 'DATA':
self._type=module_type
else :
debug.error('for module "%s"' %module_name)
debug.error(' ==> error : "%s" ' %module_type)
raise 'Input value error'
# Name of the module
self._name=module_name
self._name = module_name
# Tools list:
self._tools = []
# Dependency list:
@@ -86,25 +99,9 @@ class Module:
self._paths = []
# The module has been already build ...
self._isbuild = False
## end of basic INIT ...
if module_type == 'BINARY' \
or module_type == 'BINARY_SHARED' \
or module_type == 'BINARY_STAND_ALONE' \
or module_type == 'LIBRARY' \
or module_type == 'LIBRARY_DYNAMIC' \
or module_type == 'LIBRARY_STATIC' \
or module_type == 'PACKAGE' \
or module_type == 'PREBUILD' \
or module_type == 'DATA':
self._type=module_type
else :
debug.error('for module "%s"' %module_name)
debug.error(' ==> error : "%s" ' %module_type)
raise 'Input value error'
self._origin_file = file;
self._origin_path = tools.get_current_path(self._origin_file)
# configure default heritage
self._local_heritage = None
# TODO : Do a better dynamic property system => not really versatil
# TODO : Do a better dynamic property system => not really versatile
self._package_prop = { "COMPAGNY_TYPE" : "",
"COMPAGNY_NAME" : "",
"COMPAGNY_NAME2" : "",
@@ -244,7 +241,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 +525,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 +600,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 +626,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 +657,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 +686,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 +861,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
@@ -884,7 +885,6 @@ class Module:
target.make_package(self._name, self._package_prop, os.path.join(self._origin_path, ".."), self._sub_heritage_list)
else:
target.make_package(self._name, self._package_prop, os.path.join(self._origin_path, ".."), self._sub_heritage_list)
# return local dependency ...
return copy.deepcopy(self._sub_heritage_list)
@@ -939,49 +939,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 +1028,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 +1042,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 +1052,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 +1067,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
@@ -1059,6 +1079,25 @@ class Module:
##
def add_src_file(self, list):
tools.list_append_to(self._src, list, True)
##
## @brief Add all files in a specific path as source file to compile
## @param[in] self (handle) Class handle
## @param[in] base_path (string) Path where to search files
## @param[in] regex (string) regular expression of the search
## @param[in] recursive (bool) Search in resursive mode
## @return None
##
def add_src_path(self, base_path, regex="*", recursive=False):
if len(base_path) == 0:
debug.error("[" + self.get_name() + "] ==> no path set for function add_src_path")
if base_path[0] == '/' \
or base_path[0] == '\\':
debug.error("[" + self.get_name() + "] ==> use relative path for function add_src_path")
list_of_file = tools.get_list_of_file_in_path(os.path.join(self._origin_path, base_path), regex=regex, recursive=recursive, remove_path=self._origin_path)
debug.debug("[" + self.get_name() + "] add " + str(len(list_of_file)) + " file(s)")
self.add_src_file(list_of_file)
##
## @brief An an header file in the install directory
## @param[in] self (handle) Class handle
@@ -1067,6 +1106,8 @@ class Module:
## @param[in] clip_path (string) Remove a part of the path set in the list and install data in generic include path
## @param[in] recursive (bool) when use regexp in file list ==> we can add recursive property
##
## @note see add_header_path for a simple integration
##
## @code
## my_module.add_header_file([
## 'include/ewol/widget.h',
@@ -1109,7 +1150,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)
@@ -1160,6 +1201,21 @@ class Module:
tools.list_append_to(self._header, new_list, True)
##
## @brief An an header path in the install directory
## @param[in] self (handle) Class handle
## @param[in] base_path (string) Path where to search files
## @param[in] regex (string) regular expression of the search
## @param[in] clip_path (string) Remove a part of the path set in the list and install data in generic include path
## @param[in] recursive (bool) Search in resursive mode
## @return None
##
def add_header_path(self, base_path, regex="*", clip_path=None, recursive=False):
if base_path[-1] == '/' \
or base_path[-1] == '\\':
self.add_header_file(base_path + regex, clip_path=clip_path, recursive=recursive)
else:
self.add_header_file(base_path + "/" + regex, clip_path=clip_path, recursive=recursive)
##
## @brief Many library need to generate dynamic file configuration, use this to generat your configuration and add it in the include path
## @param[in] self (handle) Class handle
## @param[in] data_file (string) Data of the file that is generated
@@ -1215,7 +1271,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 +1314,109 @@ 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
def check_rules(self, type, rules):
if ( ( type == 'LIBRARY' \
or type == 'LIBRARY_DYNAMIC' \
or type == 'LIBRARY_STATIC' ) \
and "L" not in rules ) \
or ( type == 'DATA' \
and "D" not in rules ) \
or ( type == 'PREBUILD'\
and "P" not in rules ) \
or ( type == 'PACKAGE'\
and "K" not in rules) \
or ( ( type == 'BINARY' \
or type == 'BINARY_SHARED' \
or type == 'BINARY_STAND_ALONE')\
and "B" not in rules ) :
return True
return False
# TODO: Add to simplify the display the possibility to check if an element already depend in dependency of an element ???
def dependency_generate(self, target, tmp_file, step, rules):
debug.print_element("dot", "dependency.dot", "<<<", self._name)
if self.check_rules(self._type, rules) == True:
return
if step == 1:
if self._type == 'DATA':
tmp_file.write(' node [\n');
tmp_file.write(' shape=Mdiamond;\n');
tmp_file.write(' style=filled;\n');
tmp_file.write(' color=red;\n');
tmp_file.write(' ];\n');
elif self._type == 'PREBUILD':
tmp_file.write(' node [\n');
tmp_file.write(' shape=square;\n');
tmp_file.write(' style=filled;\n');
tmp_file.write(' color=gray;\n');
tmp_file.write(' ];\n');
elif self._type == 'LIBRARY' \
or self._type == 'LIBRARY_DYNAMIC' \
or self._type == 'LIBRARY_STATIC':
tmp_file.write(' node [\n');
tmp_file.write(' shape=ellipse;\n');
tmp_file.write(' style=filled;\n');
tmp_file.write(' color=lightblue;\n');
tmp_file.write(' ];\n');
elif self._type == 'BINARY' \
or self._type == 'BINARY_SHARED' \
or self._type == 'BINARY_STAND_ALONE':
tmp_file.write(' node [\n');
tmp_file.write(' shape=rectangle;\n');
tmp_file.write(' style=filled;\n');
tmp_file.write(' color=green;\n');
tmp_file.write(' ];\n');
elif self._type == 'PACKAGE':
return
tmp_file.write(' ' + copy.deepcopy(self._name).replace('-','_')+ ';\n');
else:
for elem in self._depends:
debug.verbose("add depend on: " + elem);
tmp_module = None
try:
tmp_module = target.get_module(elem)
except:
target.load_if_needed(elem, optionnal=True)
try:
tmp_module = target.get_module(elem)
except:
debug.verbose(" ==> get error");
if tmp_module == None:
debug.verbose(" ==> notFound");
continue
if self.check_rules(tmp_module._type, rules) == True:
debug.verbose(" ==> not in rules");
continue
tmp_file.write(' ' + copy.deepcopy(self._name).replace('-','_') + ' -> ' + copy.deepcopy(elem).replace('-','_') + ';\n');
for elem in self._depends_optionnal:
elem = elem[0]
debug.verbose("add depend on: " + elem);
tmp_module = None
try:
tmp_module = target.get_module(elem)
except:
target.load_if_needed(elem, optionnal=True)
try:
tmp_module = target.get_module(elem)
except:
debug.verbose(" ==> get error");
if tmp_module == None:
debug.verbose(" ==> notFound");
continue
if self.check_rules(tmp_module._type, rules) == True:
debug.verbose(" ==> not in rules");
continue
tmp_file.write(' ' + copy.deepcopy(self._name).replace('-','_') + ' -> ' + copy.deepcopy(elem).replace('-','_') + ';\n');
"""
tmp_file.write(' module_' + self._name.replace('-','_') + ' {\n');
tmp_file.write(' style=filled;\n');
tmp_file.write(' color=blue;\n');
tmp_file.write(' label="' + self._name + '";\n');
tmp_file.write(' }\n');
"""
##
## @brief Get packaging property variable
@@ -1270,9 +1429,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 +1461,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 +1500,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 +1527,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 +1550,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
@@ -1445,24 +1626,29 @@ def load_module(target, name):
# get basic module properties:
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,12 +1691,12 @@ 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(os.path.dirname(mod[1]), the_module, mod[0]))
return tmpList
tmp_list.append(get_module_option(os.path.dirname(mod[1]), the_module, mod[0]))
return tmp_list
##
@@ -1536,7 +1722,7 @@ def get_module_option(path, 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()

View File

@@ -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()

View File

@@ -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

View File

@@ -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;
@@ -620,11 +653,42 @@ class Target:
for mod in self.module_list:
mod.display()
return
if name[:10] == "dependency":
if len(name) > 10:
rules = name.split(":")[1]
else:
rules = "LBDPK"
# L for library
# B for binary
# D for Data
# P for prebuild
# K for package
debug.print_element("dot", "", "---", "dependency.dot")
self.load_all()
tmp_file = open("dependency.dot", 'w')
tmp_file.write('digraph G {\n')
tmp_file.write(' rankdir=\"LR\";\n')
for mod in self.module_list:
mod.dependency_generate(self, tmp_file, 1, rules)
# TODO : do it better ==> system library hook (do a oad of all avillable system library)
tmp_file.write(' node [\n');
tmp_file.write(' shape=square;\n');
tmp_file.write(' style=filled;\n');
tmp_file.write(' color=gray;\n');
tmp_file.write(' ];\n');
# TODO : End hook
for mod in self.module_list:
mod.dependency_generate(self, tmp_file, 2, rules)
tmp_file.write('}\n')
tmp_file.flush()
tmp_file.close()
debug.print_element("dot", "", "---", "dependency.dot")
return
if name == "all":
debug.info("build all")
self.load_all()
for mod in self.module_list:
if self._name=="Android":
if self._name == "Android":
if mod.get_type() == "PACKAGE":
mod.build(self, None)
else:
@@ -766,6 +830,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 +852,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 +865,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 +900,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 +913,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)
@@ -854,12 +923,25 @@ class Target:
tools.copy_file(path_src,
path_dst,
in_list=copy_list)
try:
path_src = self.get_build_file_bin(pkg_name)
path_src = path_src[:len(path_src)-4] + "js"
path_dst = os.path.join(path_package_bin, pkg_name + self.suffix_binary2)
debug.verbose("path_dst: " + str(path_dst))
tools.copy_file(path_src,
path_dst,
in_list=copy_list)
except:
debug.extreme_verbose("can not find : " + path_src)
pass
#real copy files
ret_copy = tools.copy_list(copy_list)
ret_remove = False
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 +954,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 +978,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 +1044,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 +1052,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

View File

@@ -170,6 +170,51 @@ def copy_file(src, dst, cmd_file=None, force=False, force_identical=False, in_li
"need_copy":True}
return True
##
## @brief Get list of all Files in a specific path (with a regex)
## @param[in] path (string) Full path of the machine to search files (start with / or x:)
## @param[in] regex (string) Regular expression to search data
## @param[in] recursive (bool) List file with recursive search
## @param[in] remove_path (string) Data to remove in the path
## @return (list) return files requested
##
def get_list_of_file_in_path(path, regex="*", recursive = False, remove_path=""):
out = []
debug.verbose(" List all in : '" + str(path) + "'")
if os.path.isdir(os.path.realpath(path)):
tmp_path = os.path.realpath(path)
tmp_rule = regex
else:
debug.error("path does not exist : '" + str(path) + "'")
debug.verbose(" " + str(tmp_path) + ":")
for root, dirnames, filenames in os.walk(tmp_path):
deltaRoot = root[len(tmp_path):]
while len(deltaRoot) > 0 \
and ( deltaRoot[0] == '/' \
or deltaRoot[0] == '\\' ):
deltaRoot = deltaRoot[1:]
if recursive == False \
and deltaRoot != "":
return
debug.verbose(" root='" + str(deltaRoot) + "'")
debug.extreme_verbose(" files=" + str(filenames))
tmpList = filenames
if len(tmp_rule) > 0:
tmpList = fnmatch.filter(filenames, tmp_rule)
# Import the module :
for cycleFile in tmpList:
#for cycleFile in filenames:
add_file = os.path.join(tmp_path, deltaRoot, cycleFile)
if len(remove_path) != 0:
if add_file[:len(remove_path)] != remove_path:
debug.error("Request remove start of a path that is not the same: '" + add_file[:len(remove_path)] + "' demand remove of '" + str(remove_path) + "'")
else:
add_file = add_file[len(remove_path)+1:]
debug.verbose(" '" + add_file + "'")
out.append(add_file)
return out;
##
## @brief Copy a compleate directory in a specific folder
## @param[in] src Input folder path
@@ -316,6 +361,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,16 +392,16 @@ 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)
##
@@ -373,16 +426,19 @@ def get_version_from_file_or_direct(path_module, filename_or_version):
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]
dev_mode = ""
list_tiret = line.split('-')
if len(list_tiret) > 2:
debug.warning("more than one '-' in version file " + str(filename_or_version) + " : '" + str(list_tiret) + "' in '" + path_module + "'")
if len(list_tiret) >= 2:
dev_mode = list_tiret[1]
line = list_tiret[0]
out = []
list_elem = line.split('.')
for elem in list_elem:
out.append(int(elem))
if dev_mode == True:
out.append("dev")
if dev_mode != "":
out.append(dev_mode)
debug.debug(" ==> " + str(out))
return out
@@ -410,4 +466,29 @@ def get_maintainer_from_file_or_direct(path_module, filename_or_author):
# comment ...
continue
out.append(elem)
return out
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;

View File

@@ -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")

View File

@@ -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

View File

@@ -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",

View File

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

View File

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

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

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

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

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

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

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

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

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

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

View File

@@ -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"
])
"""

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

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

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

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

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

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

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

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

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

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

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

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

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

View File

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

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

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

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

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

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

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

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

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

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

View File

@@ -0,0 +1,34 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
from lutin import debug
from lutin import system
from lutin import tools
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)

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

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

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

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

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

View 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

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

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

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

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

View File

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

View File

@@ -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("------------------------------------------------------------------------")

View File

@@ -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,15 +31,22 @@ 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
if config["simulation"] == True:
arch = "i386"
else:
arch="arm64" # for ipad air
#arch="armv7" # for Iphone 4
target.Target.__init__(self, "IOs", config, arch)
if config["bus-size"] == "32":
# for Iphone 4
arch="armv7"
else:
# for ipad air
arch="arm64"
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 +63,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 +77,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 +93,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 +110,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 +391,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 +425,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 +435,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 +444,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("------------------------------------------------------------------------")

View File

@@ -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("------------------------------------------------------------------------")

View File

@@ -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 + " "

View File

@@ -0,0 +1,229 @@
#!/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 target
from lutin import tools
from lutin import env
import os
import stat
import re
from lutin import host
from lutin import depend
from lutin import zip
from lutin import multiprocess
import lutinTarget_Linux
class Target(lutinTarget_Linux.Target):
def __init__(self, config, sub_name=[]):
lutinTarget_Linux.Target.__init__(self, config, ["Web"] + sub_name)
self.cross ="/home/heero/dev/perso/emsdk_portable/emscripten/master/em"
debug.debug("== Target='em'");
self.java = "javac"
self.javah = "javah"
self.jar = "jar"
self.ar = self.cross + "ar"
self.ranlib = self.cross + "ranlib"
self.cc = self.cross + "cc"
self.xx = self.cross + "++"
self.ar = self.cross + "ar"
self.xx_version = [0,0,0]
self.ld = self.cross + "ld"
self.nm = self.cross + "nm"
self.strip = ""#self.cross + "strip"
self.dlltool = self.cross + "dlltool"
self._update_path_tree()
self.stdlib_name_libgcc = ""
self.stdlib_name_libsupc = "";
self.suffix_binary = '.html'
self.suffix_binary2 = '.js'
self.pkg_path_bin = ""
# Disable capabiliteis to compile in shared mode
self.support_dynamic_link = False
# create temporary file:
self._file_data_tmp = "tmp_file_data.zip"
tools.file_write_data(os.path.join(self.get_build_path_temporary_generate(""), self._file_data_tmp), "coucou", only_if_new=True)
# add default file (need to generate a empty file to add it before loading:
self.add_flag("link", [
"--preload-file " + os.path.join(self.get_build_path_temporary_generate(""), self._file_data_tmp) + "@tmp_file_data.zip",
#" -s FULL_ES2=1 "
])
# in the output.js this generate a section '{"audio": 0, "start": 0, "crunched": 0, "end": 6, "filename": "tmp_file_data.zip"}], "remote_package_size": 6' ==> that will be replaced by the corretc data in the file 'module.data'
"""
.local/application
*--> applName -> applName.app/bin/applName
*--> applName.app
*--> appl_description.txt
*--> appl_name.txt
*--> changelog.txt
*--> copyright.txt
*--> readme.txt
*--> version.txt
*--> website.txt
*--> icon.png
*--> bin
* *--> applName
*--> doc
* *--> applName
*--> lib
* *--> XX.so
* *--> YY.so
*--> license
* *--> applName.txt
* *--> libXX.txt
* *--> libYY.txt
*--> man
*--> share
* *--> applName
* *--> XX
* *--> YY
*--> sources
"""
def make_package_binary(self, pkg_name, pkg_properties, base_pkg_path, heritage_list, static):
debug.debug("------------------------------------------------------------------------")
debug.debug("-- Generate generic '" + 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, tmp=True), pkg_name + ".app")
tools.create_directory_of_file(target_outpath)
## Create share datas:
ret_share = self.make_package_binary_data(target_outpath, "zz_generic_zz", base_pkg_path, heritage_list, static)
## copy binary files:
ret_bin = self.make_package_binary_bin(target_outpath, pkg_name, base_pkg_path, heritage_list, static)
## Create libraries:
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)
## 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 need_generate_package or True:
# Zip the data
debug.print_element("zip", "data.zip", "<==", os.path.join(self.get_staging_path(pkg_name, tmp=True), pkg_name + ".app/share/*"))
zip_path = os.path.join(self.get_staging_path(pkg_name), pkg_name + ".app", pkg_name + ".data")
zip.create_zip([
self.get_staging_path(pkg_name, tmp=True) + "/" + pkg_name + ".app/share/",
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)
# patch the .js file to update the new real data ...
js_file_data = tools.file_read_data(os.path.join(self.get_staging_path(pkg_name, tmp=True), pkg_name + ".app", pkg_name + self.suffix_binary2))
data_to_replace = '"end": 6, "filename": "/' + self._file_data_tmp + '"}], "remote_package_size": 6'
data_size = str(tools.file_size(zip_path))
replace_with = '"end": ' + data_size + ', "filename": "/data.zip"}], "remote_package_size": ' + data_size
debug.print_element("js", pkg_name + ".data", "<==", "correct zip name and data")
tools.file_write_data(os.path.join(self.get_staging_path(pkg_name), pkg_name + ".app", pkg_name + self.suffix_binary2),
js_file_data.replace(data_to_replace, replace_with),
only_if_new = True)
zip_path_final = os.path.join(self.get_final_path(), pkg_name + ".data")
# generate deployed zip (for user)
debug.print_element("zip", pkg_name + ".zip", "<==", self.get_staging_path(pkg_name), pkg_name + ".zip")
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...")
## create the package:
"""
if ret_share \
or ret_bin \
or ret_lib \
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("------------------------------------------------------------------------")
debug.info("-- Install package '" + pkg_name + "'")
debug.debug("------------------------------------------------------------------------")
# this is temporary ... Will call:
if False:
os.system("lutin-pkg -i " + os.path.join(self.get_final_path(), + pkg_name + ".app.gpkg"))
else:
#Copy directly from staging path:
appl_path = os.path.join(self.get_staging_path(pkg_name), pkg_name + ".app")
target_path = os.path.join(os.path.expanduser("~"), ".local", "application", pkg_name + ".app")
target_bin_path = os.path.join(os.path.expanduser("~"), ".local", "application", pkg_name + ".app", "bin", pkg_name)
target_bin_link = os.path.join(os.path.expanduser("~"), ".local", "application", pkg_name)
# remove output path:
tools.remove_path_and_sub_path(target_path)
# remove executable link version:
tools.remove_file(target_bin_link)
# copy result:
tools.copy_anything(appl_path, target_path, recursive=True)
# create synbolic link:
debug.info("kkk " + "ln -s " + target_bin_path + " " + target_bin_link)
os.symlink(target_bin_path, target_bin_link)
def un_install_package(self, pkg_name):
debug.debug("------------------------------------------------------------------------")
debug.info("-- Un-Install package '" + pkg_name + "'")
debug.debug("------------------------------------------------------------------------")
# this is temporary ... Will call:
if False:
os.system("lutin-pkg -r " + pkg_name)
else:
#Copy directly from staging path:
target_path = os.path.join(os.path.expanduser("~"), ".local", "application", pkg_name + ".app")
target_bin_link = os.path.join(os.path.expanduser("~"), ".local", "application", pkg_name)
# remove output path:
tools.remove_path_and_sub_path(target_path)
# remove executable link version:
tools.remove_file(target_bin_link)
def run(self, pkg_name, option_list):
debug.debug("------------------------------------------------------------------------")
debug.info("-- Run package '" + pkg_name + "' + option: " + str(option_list))
debug.debug("------------------------------------------------------------------------")
appl_path = os.path.join(self.get_staging_path(pkg_name), pkg_name + ".app", pkg_name + ".html")
cmd = "firefox " + 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("------------------------------------------------------------------------")

View File

@@ -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("------------------------------------------------------------------------")

View File

@@ -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()

View File

@@ -16,7 +16,7 @@ def readme():
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
setup(name='lutin',
version='2.0.1',
version='2.2.2',
description='Lutin generic builder (might replace makefile, CMake ...)',
long_description=readme(),
url='http://github.com/HeeroYui/lutin',

View File

@@ -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,15 +7,14 @@ 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())
my_module.add_extra_compile_flags()
def configure(target, my_module):
my_module.add_extra_flags()
my_module.add_src_file([
'test.c'
])
if target.name=="Android":
if "Android" in target.get_type():
my_module.compile_version("c", 1999)
return my_module