Skip to content

Commit 244e28b

Browse files
committed
Now you can run a distribute recipe involving igraph twice in a row without patch errors
1 parent c1cb694 commit 244e28b

File tree

2 files changed

+23
-14
lines changed

2 files changed

+23
-14
lines changed

recipes/c_igraph/recipe.sh

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@ BUILD_c_igraph=$BUILD_PATH/c_igraph/$(get_directory $URL_c_igraph)
1919
RECIPE_c_igraph=$RECIPES_PATH/c_igraph
2020

2121
function prebuild_c_igraph() {
22-
true
22+
if [ ! -e $BUILD_c_igraph/.patched ]; then {
23+
try patch $BUILD_c_igraph/src/Makefile.am $RECIPE_c_igraph/Makefile.am.patch;
24+
try cp -f $RECIPE_c_igraph/arith.h $BUILD_c_igraph/src/f2c/arith.h;
25+
try patch $BUILD_c_igraph/src/f2c/sysdep1.h $RECIPE_c_igraph/sysdep1.h.patch;
26+
try patch $BUILD_c_igraph/src/f2c/uninit.c $RECIPE_c_igraph/uninit.c.patch;
27+
touch $BUILD_c_igraph/.patched;
28+
}
29+
fi
2330
}
2431

2532
function shouldbuild_c_igraph() {
@@ -32,15 +39,14 @@ function build_c_igraph() {
3239
cd $BUILD_c_igraph
3340

3441
push_arm
35-
try patch $BUILD_c_igraph/src/Makefile.am $RECIPE_c_igraph/Makefile.am.patch
36-
export OLD_CPPFLAGS="$CPPFLAGS"
37-
export CPPFLAGS="$CPPFLAGS -I$ANDROIDNDK/sources/cxx-stl/gnu-libstdc++/4.4.3/include -I$ANDROIDNDK/sources/cxx-stl/gnu-libstdc++/4.4.3/libs/armeabi/include -L$ANDROIDNDK/platforms/android-$ANDROIDAPI/arch-arm/usr/lib"
38-
try ./configure --prefix="$BUILD_PATH/python-install" --build=i686-pc-linux-gnu --host=arm-linux-eabi
39-
export CPPFLAGS="$OLD_CPPFLAGS"
40-
try cp -f $RECIPE_c_igraph/arith.h $BUILD_c_igraph/src/f2c/arith.h
41-
try patch $BUILD_c_igraph/src/f2c/sysdep1.h $RECIPE_c_igraph/sysdep1.h.patch
42-
try patch $BUILD_c_igraph/src/f2c/uninit.c $RECIPE_c_igraph/uninit.c.patch
43-
try patch $BUILD_c_igraph/config.h $RECIPE_c_igraph/config.h.patch
42+
if [ ! -e $BUILD_c_igraph/config.h ]; then {
43+
export OLD_CPPFLAGS="$CPPFLAGS";
44+
export CPPFLAGS="$CPPFLAGS -I$ANDROIDNDK/sources/cxx-stl/gnu-libstdc++/4.4.3/include -I$ANDROIDNDK/sources/cxx-stl/gnu-libstdc++/4.4.3/libs/armeabi/include -L$ANDROIDNDK/platforms/android-$ANDROIDAPI/arch-arm/usr/lib";
45+
try ./configure --prefix="$BUILD_PATH/python-install" --build=i686-pc-linux-gnu --host=arm-linux-eabi;
46+
try patch $BUILD_c_igraph/config.h $RECIPE_c_igraph/config.h.patch;
47+
export CPPFLAGS="$OLD_CPPFLAGS";
48+
}
49+
fi
4450
try $MAKE
4551
try $MAKE install
4652

recipes/igraph/recipe.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
b#!/bin/bash
1+
#!/bin/bash
22

33
# Recipe for the Python interface to igraph, a high-performance graph library in C: http://igraph.org/
44
#
@@ -18,7 +18,12 @@ RECIPE_igraph=$RECIPES_PATH/igraph
1818

1919

2020
function prebuild_igraph() {
21-
true
21+
if [ ! -f "$BUILD_igraph/.patched" ]; then {
22+
try patch $BUILD_igraph/setup.py $RECIPE_igraph/setup.py.patch
23+
try patch $BUILD_igraph/setup.cfg $RECIPE_igraph/setup.cfg.patch
24+
touch $BUILD_igraph/.patched
25+
};
26+
fi
2227
}
2328

2429
function shouldbuild_igraph() {
@@ -29,8 +34,6 @@ function shouldbuild_igraph() {
2934

3035
function build_igraph() {
3136
cd $BUILD_igraph
32-
patch setup.py $RECIPE_igraph/setup.py.patch
33-
patch setup.cfg $RECIPE_igraph/setup.cfg.patch
3437
push_arm
3538

3639
try $HOSTPYTHON setup.py build_ext -I"$BUILD_PATH/python-install/include/igraph:$ANDROIDNDK/sources/cxx-stl/gnu-libstdc++/4.4.3/libs/armeabi/include" -L"$BUILD_PATH/python-install/lib:$ANDROIDNDK/sources/cxx-stl/gnu-libstdc++/4.4.3/libs/armeabi" -l gnustl_static -p arm-gnueabi install

0 commit comments

Comments
 (0)