Skip to content

Commit

Permalink
rename configure.sh to distribute.sh, and start to code the distribut…
Browse files Browse the repository at this point in the history
…ion part.
  • Loading branch information
tito committed Jan 6, 2012
1 parent a834d4e commit 4442705
Show file tree
Hide file tree
Showing 36 changed files with 13,429 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ build
src/obj
src/local.properties
src/default.properties
dist
58 changes: 58 additions & 0 deletions configure.sh → distribute.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ LIBS_PATH="$ROOT_PATH/build/libs"
PACKAGES_PATH="$BUILD_PATH/packages"
SRC_PATH="$ROOT_PATH/src"
JNI_PATH="$SRC_PATH/jni"
DIST_PATH="$ROOT_PATH/dist"

# Internals
CRED="\x1b[31;01m"
Expand Down Expand Up @@ -368,6 +369,62 @@ function run_postbuild() {
done
}

function run_distribute() {
info "Run distribute"

if [ -e $DIST_PATH ]; then
debug "Remove old distribution"
try rm -rf $DIST_PATH
fi

debug "Create new distribution at $DIST_PATH"
try mkdir -p $DIST_PATH
cd $DIST_PATH

debug "Create initial layout"
try mkdir assets bin gen obj private res templates

debug "Copy default files"
try cp -a $SRC_PATH/default.properties .
try cp -a $SRC_PATH/local.properties .
try cp -a $SRC_PATH/build.py .
try cp -a $SRC_PATH/buildlib .
try cp -a $SRC_PATH/src .
try cp -a $SRC_PATH/templates .
try cp -a $SRC_PATH/res .

debug "Copy python distribution"
try cp -a $BUILD_PATH/python-install .

debug "Copy libs"
try mkdir -p libs/$ARCH
try cp -a $BUILD_PATH/libs/* libs/$ARCH/

debug "Fill private directory"
try cp -a python-install/lib/python* private/lib
try mv private/lib/lib-dynload/*.so private/

debug "Reduce private directory from unwanted files"
cd $DIST_PATH/private/lib
try find . | grep -E '*\.(py|pyc|so\.o|so\.a|so\.libs)$' | xargs rm
try rm -rf test
try rm -rf ctypes
try rm -rf lib2to3
try rm -rf lib-tk
try rm -rf idlelib
try rm -rf unittest/test
try rm -rf lib-dynload
try rm -rf json/tests
try rm -rf distutils/tests
try rm -rf email/test
try rm -rf bsddb/test
try rm -rf distutils
try rm -rf config/libpython*.a
try rm -rf config/python.o
try rm -rf curses

}

function run() {
run_prepare
run_source_modules
Expand All @@ -376,6 +433,7 @@ function run() {
run_prebuild
run_build
run_postbuild
run_distribute
info "All done !"
}

Expand Down
8 changes: 8 additions & 0 deletions recipes/kivy/recipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ function prebuild_kivy() {
function build_kivy() {
cd $BUILD_kivy

# if the last step have been done, avoid all
if [ -f .done ]; then
return
fi

push_arm

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

try rm -rf $BUILD_PATH/python-install/lib/python*/site-packages/kivy/tools

touch .done
pop_arm
}

Expand Down
5 changes: 5 additions & 0 deletions recipes/pygame/recipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ function build_pygame() {
try $BUILD_PATH/python-install/bin/python.host setup.py install
try find build/lib.* -name "*.o" -exec $STRIP {} \;

try rm -rf $BUILD_PATH/python-install/lib/python*/site-packages/pygame/docs
try rm -rf $BUILD_PATH/python-install/lib/python*/site-packages/pygame/examples
try rm -rf $BUILD_PATH/python-install/lib/python*/site-packages/pygame/tests
try rm -rf $BUILD_PATH/python-install/lib/python*/site-packages/pygame/gp2x

pop_arm
}

Expand Down
Loading

0 comments on commit 4442705

Please sign in to comment.