Skip to content

Commit 4442705

Browse files
committed
rename configure.sh to distribute.sh, and start to code the distribution part.
1 parent a834d4e commit 4442705

36 files changed

+13429
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ build
55
src/obj
66
src/local.properties
77
src/default.properties
8+
dist

configure.sh renamed to distribute.sh

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ LIBS_PATH="$ROOT_PATH/build/libs"
1717
PACKAGES_PATH="$BUILD_PATH/packages"
1818
SRC_PATH="$ROOT_PATH/src"
1919
JNI_PATH="$SRC_PATH/jni"
20+
DIST_PATH="$ROOT_PATH/dist"
2021

2122
# Internals
2223
CRED="\x1b[31;01m"
@@ -368,6 +369,62 @@ function run_postbuild() {
368369
done
369370
}
370371

372+
function run_distribute() {
373+
info "Run distribute"
374+
375+
if [ -e $DIST_PATH ]; then
376+
debug "Remove old distribution"
377+
try rm -rf $DIST_PATH
378+
fi
379+
380+
debug "Create new distribution at $DIST_PATH"
381+
try mkdir -p $DIST_PATH
382+
cd $DIST_PATH
383+
384+
debug "Create initial layout"
385+
try mkdir assets bin gen obj private res templates
386+
387+
debug "Copy default files"
388+
try cp -a $SRC_PATH/default.properties .
389+
try cp -a $SRC_PATH/local.properties .
390+
try cp -a $SRC_PATH/build.py .
391+
try cp -a $SRC_PATH/buildlib .
392+
try cp -a $SRC_PATH/src .
393+
try cp -a $SRC_PATH/templates .
394+
try cp -a $SRC_PATH/res .
395+
396+
debug "Copy python distribution"
397+
try cp -a $BUILD_PATH/python-install .
398+
399+
debug "Copy libs"
400+
try mkdir -p libs/$ARCH
401+
try cp -a $BUILD_PATH/libs/* libs/$ARCH/
402+
403+
debug "Fill private directory"
404+
try cp -a python-install/lib/python* private/lib
405+
try mv private/lib/lib-dynload/*.so private/
406+
407+
debug "Reduce private directory from unwanted files"
408+
cd $DIST_PATH/private/lib
409+
try find . | grep -E '*\.(py|pyc|so\.o|so\.a|so\.libs)$' | xargs rm
410+
try rm -rf test
411+
try rm -rf ctypes
412+
try rm -rf lib2to3
413+
try rm -rf lib-tk
414+
try rm -rf idlelib
415+
try rm -rf unittest/test
416+
try rm -rf lib-dynload
417+
try rm -rf json/tests
418+
try rm -rf distutils/tests
419+
try rm -rf email/test
420+
try rm -rf bsddb/test
421+
try rm -rf distutils
422+
try rm -rf config/libpython*.a
423+
try rm -rf config/python.o
424+
try rm -rf curses
425+
426+
}
427+
371428
function run() {
372429
run_prepare
373430
run_source_modules
@@ -376,6 +433,7 @@ function run() {
376433
run_prebuild
377434
run_build
378435
run_postbuild
436+
run_distribute
379437
info "All done !"
380438
}
381439

recipes/kivy/recipe.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ function prebuild_kivy() {
2222
function build_kivy() {
2323
cd $BUILD_kivy
2424

25+
# if the last step have been done, avoid all
26+
if [ -f .done ]; then
27+
return
28+
fi
29+
2530
push_arm
2631

2732
export LDFLAGS="$LDFLAGS -L$LIBS_PATH"
@@ -33,6 +38,9 @@ function build_kivy() {
3338
try find build/lib.* -name "*.o" -exec $STRIP {} \;
3439
try $BUILD_PATH/python-install/bin/python.host setup.py install -O2
3540

41+
try rm -rf $BUILD_PATH/python-install/lib/python*/site-packages/kivy/tools
42+
43+
touch .done
3644
pop_arm
3745
}
3846

recipes/pygame/recipe.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ function build_pygame() {
3838
try $BUILD_PATH/python-install/bin/python.host setup.py install
3939
try find build/lib.* -name "*.o" -exec $STRIP {} \;
4040

41+
try rm -rf $BUILD_PATH/python-install/lib/python*/site-packages/pygame/docs
42+
try rm -rf $BUILD_PATH/python-install/lib/python*/site-packages/pygame/examples
43+
try rm -rf $BUILD_PATH/python-install/lib/python*/site-packages/pygame/tests
44+
try rm -rf $BUILD_PATH/python-install/lib/python*/site-packages/pygame/gp2x
45+
4146
pop_arm
4247
}
4348

0 commit comments

Comments
 (0)