Skip to content

Commit 9f06245

Browse files
committed
Now you can run a distribute recipe involving igraph twice in a row without patch errors
1 parent c3b1f64 commit 9f06245

File tree

2 files changed

+24
-13
lines changed

2 files changed

+24
-13
lines changed

recipes/c_igraph/recipe.sh

Lines changed: 17 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,15 @@ function build_c_igraph() {
3239
cd $BUILD_c_igraph
3340

3441
push_arm
35-
patch -Nr - $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-
cp -f $RECIPE_c_igraph/arith.h $BUILD_c_igraph/src/f2c/arith.h
41-
patch -Nr - $BUILD_c_igraph/src/f2c/sysdep1.h $RECIPE_c_igraph/sysdep1.h.patch
42-
patch -Nr - $BUILD_c_igraph/src/f2c/uninit.c $RECIPE_c_igraph/uninit.c.patch
43-
patch -N $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
50+
4451
try $MAKE
4552
try $MAKE install
4653

recipes/igraph/recipe.sh

Lines changed: 7 additions & 3 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,8 +18,12 @@ RECIPE_igraph=$RECIPES_PATH/igraph
1818

1919

2020
function prebuild_igraph() {
21-
patch -Nr - $BUILD_igraph/setup.py $RECIPE_igraph/setup.py.patch
22-
patch -Nr - $BUILD_igraph/setup.cfg $RECIPE_igraph/setup.cfg.patch
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
2327
}
2428

2529
function shouldbuild_igraph() {

0 commit comments

Comments
 (0)