From 14839fc544df8f42b7fea64677caf918a9256fb7 Mon Sep 17 00:00:00 2001 From: Ontwikkelaar Date: Mon, 29 Jun 2015 14:40:35 +0200 Subject: [PATCH 1/2] Add libtribler recipe. --- recipes/libtribler/recipe.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 recipes/libtribler/recipe.sh diff --git a/recipes/libtribler/recipe.sh b/recipes/libtribler/recipe.sh new file mode 100644 index 0000000000..028ad06050 --- /dev/null +++ b/recipes/libtribler/recipe.sh @@ -0,0 +1,23 @@ +#!/bin/bash +DEPS_libtribler=(kivy python openssl m2crypto twisted sqlite3 pyasn1 apsw cherrypy netifaces libtorrent libnacl libsodium pil plyvel requests) +BUILD_libtribler=$BUILD_PATH/libtribler/tribler-git +RECIPE_libtribler=$RECIPES_PATH/libtribler + +function prebuild_libtribler() { + + # Clone repo so all submodules are included: + cd $BUILD_PATH/libtribler + git clone --recursive https://github.com/tribler/tribler.git tribler-git + +} + +function build_libtribler() { + cd $BUILD_libtribler + push_arm + try $HOSTPYTHON setup.py install + pop_arm +} + +function postbuild_libtribler() { + true +} From 1db0a4cb9a6097b3f406fbedf9a4b4c0f6bc6131 Mon Sep 17 00:00:00 2001 From: Ontwikkelaar Date: Wed, 1 Jul 2015 15:33:16 +0200 Subject: [PATCH 2/2] Only clone repo when needed, else fetch latest changes using git pull. Alsp stores a cache of libtribler in packages as well. --- recipes/libtribler/recipe.sh | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/recipes/libtribler/recipe.sh b/recipes/libtribler/recipe.sh index 028ad06050..cf184df101 100644 --- a/recipes/libtribler/recipe.sh +++ b/recipes/libtribler/recipe.sh @@ -1,18 +1,37 @@ #!/bin/bash +VERSION_libtribler=${VERSION_libtribler:-devel} DEPS_libtribler=(kivy python openssl m2crypto twisted sqlite3 pyasn1 apsw cherrypy netifaces libtorrent libnacl libsodium pil plyvel requests) -BUILD_libtribler=$BUILD_PATH/libtribler/tribler-git +BUILD_libtribler=$BUILD_PATH/libtribler RECIPE_libtribler=$RECIPES_PATH/libtribler function prebuild_libtribler() { - # Clone repo so all submodules are included: - cd $BUILD_PATH/libtribler - git clone --recursive https://github.com/tribler/tribler.git tribler-git + cd $PACKAGES_PATH/libtribler + LIBTRIBLER_CHANGED=1 + if [ ! -d ./tribler-git ]; then + # Clone repo so all submodules are included: + try git clone --recursive https://github.com/tribler/tribler.git tribler-git + else + # Pull latest changes and check whether anything changed at all: + pushd ./tribler-git + OLD_LATEST_COMMIT_HASH="$(git log -n 1 --pretty=format:'%H')" + try git pull origin $VERSION_libtribler + NEW_LATEST_COMMIT_HASH="$(git log -n 1 --pretty=format:'%H')" + if [ "$OLD_LATEST_COMMIT_HASH" == "$NEW_LATEST_COMMIT_HASH" ]; then + LIBTRIBLER_CHANGED=0 + fi + popd + fi + + # Copy repo to build folder when build folder is empty or libtribler has changed: + if [ ! -d ${BUILD_libtribler}/tribler-git ] || [ $LIBTRIBLER_CHANGED ]; then + try rsync -a ./tribler-git ${BUILD_libtribler} + fi } function build_libtribler() { - cd $BUILD_libtribler + cd ${BUILD_libtribler}/tribler-git push_arm try $HOSTPYTHON setup.py install pop_arm