Skip to content

Commit 5643fa4

Browse files
committed
Merge pull request kivy#206 from LogicalDash/master
Repeatable and prebuild-worthy igraph recipe
2 parents c1cb694 + 2ee34a9 commit 5643fa4

File tree

2 files changed

+23
-14
lines changed

2 files changed

+23
-14
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-
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+
fi
49+
50+
4451
try $MAKE
4552
try $MAKE install
4653

recipes/igraph/recipe.sh

Lines changed: 6 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,11 @@ 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+
fi
2226
}
2327

2428
function shouldbuild_igraph() {
@@ -29,8 +33,6 @@ function shouldbuild_igraph() {
2933

3034
function build_igraph() {
3135
cd $BUILD_igraph
32-
patch setup.py $RECIPE_igraph/setup.py.patch
33-
patch setup.cfg $RECIPE_igraph/setup.cfg.patch
3436
push_arm
3537

3638
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)