Skip to content

Commit 7e3709b

Browse files
committed
New approach: build everything at once.
1 parent 38d424a commit 7e3709b

File tree

7 files changed

+96
-30
lines changed

7 files changed

+96
-30
lines changed

recipes/c_igraph/recipe.sh

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,14 @@ function prebuild_c_igraph() {
2222
true
2323
}
2424

25-
function build_c_igraph() {
26-
cd $BUILD_c_igraph
27-
28-
push_arm
29-
30-
export 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"
31-
try ./configure --prefix="$BUILD_PATH/python-install" --libdir="$BUILD_PATH/libs" --host=arm-gnueabi --with-sysroot="$ANDROIDNDK/sources/cxx-stl/stlport/" --with-external-f2c
32-
try patch $BUILD_c_igraph/config.h $RECIPE_c_igraph/config.h.patch
33-
try $MAKE
34-
try $MAKE install
35-
25+
function shouldbuild_c_igraph() {
26+
false
27+
}
3628

37-
pop_arm
29+
function build_c_igraph() {
30+
# I'm not even going to make anything here!
31+
# I'll let the main igraph recipe do that.
32+
true
3833
}
3934

4035
function postbuild_c_igraph() {

recipes/igraph/Makefile.am.patch

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
170c170,180
2+
< scg_headers.h igraph_hacks_internal.h
3+
---
4+
> scg_headers.h igraph_hacks_internal.h \
5+
> arpackobject.h \
6+
> pyattributes.h bfsiter.h \
7+
> common.h convert.h \
8+
> edgeobject.h edgeseqobject.h \
9+
> error.h filehandle.h \
10+
> graphobject.h igraphmodule_api.h \
11+
> indexing.h platform.h \
12+
> py2compat.h pyhelpers.h \
13+
> pyrandom.h vertexobject.h \
14+
> vertexseqobject.h
15+
260c270,287
16+
< qsort.c qsort_r.c types.c hacks.c
17+
---
18+
> qsort.c qsort_r.c types.c hacks.c \
19+
> arpackobject.c \
20+
> pyattributes.c \
21+
> bfsiter.c \
22+
> common.c \
23+
> convert.c \
24+
> edgeobject.c \
25+
> edgeseqobject.c \
26+
> error.c \
27+
> filehandle.c \
28+
> graphobject.c \
29+
> igraphmodule.c \
30+
> indexing.c \
31+
> py2compat.c \
32+
> pyhelpers.c \
33+
> pyrandom.c \
34+
> vertexobject.c \
35+
> vertexseqobject.c
36+
263,265c290,292
37+
< libigraph_la_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(WARNING_CFLAGS)
38+
< libigraph_la_CXXFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(WARNING_CFLAGS)
39+
< libigraph_la_LDFLAGS = -no-undefined
40+
---
41+
> libigraph_la_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(WARNING_CFLAGS) -IBUILD_PATH/python-install/include/python2.7
42+
> libigraph_la_CXXFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(WARNING_CFLAGS) -IBUILD_PATH/python-install/include/python2.7
43+
> libigraph_la_LDFLAGS = -no-undefined -LBUILD_PATH/python-install/lib -IBUILD_PATH/python-install/include/python2.7
44+
267c294
45+
< $(LAPACK_LIB) $(ARPACK_LIB) $(GLPK_LIB) $(PLFIT_LIB)
46+
---
47+
> $(LAPACK_LIB) $(ARPACK_LIB) $(GLPK_LIB) $(PLFIT_LIB) -lpython2.7

recipes/igraph/config.h.in.patch

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
1a2
2+
> #define HAVE_LOGBL 1

recipes/igraph/config.h.patch

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,2 @@
1-
--- build/c_igraph/igraph-0.6.5/config.h 2013-11-05 14:10:26.285433616 -0500
2-
+++ config.h 2013-11-05 14:12:36.431283045 -0500
3-
@@ -53,7 +53,7 @@
4-
/* #undef HAVE_LOG2 */
5-
6-
/* Define to 1 if you have the `logbl' function. */
7-
-/* #undef HAVE_LOGBL */
8-
+#define HAVE_LOGBL 1
9-
10-
/* Define to 1 if you have the <memory.h> header file. */
11-
#define HAVE_MEMORY_H 1
1+
2a3
2+
> #define HAVE_LOGBL 1

recipes/igraph/configure.ac.patch

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
43c43
2+
< AC_CHECK_FUNCS([expm1 rint rintf finite log2 logbl snprintf log1p round fabsl fmin strcasecmp isnan strdup _strdup ftruncate stpcpy])
3+
---
4+
> AC_CHECK_FUNCS([expm1 rint rintf finite log2 snprintf log1p round fabsl fmin strcasecmp isnan strdup _strdup ftruncate stpcpy])

recipes/igraph/get_platform.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from distutils.util import get_platform
2+
from sys import version
3+
print get_platform() + '-' + version[:3]

recipes/igraph/recipe.sh

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
VERSION_igraph=${VERSION_igraph:0.6.5}
88

9-
DEPS_igraph=(python c_igraph)
9+
DEPS_igraph=(c_igraph python)
1010

1111
URL_igraph=http://pypi.python.org/packages/source/p/python-igraph/python-igraph-0.6.5.tar.gz
1212

@@ -21,16 +21,40 @@ function prebuild_igraph() {
2121
true
2222
}
2323

24-
function shouldbuild_igraph() {
25-
true
26-
}
27-
2824
function build_igraph() {
2925
cd $BUILD_igraph
3026
push_arm
3127

32-
patch setup.py $RECIPE_igraph/setup.py.patch
33-
try $HOSTPYTHON setup.py build_ext -p arm-gnueabi -L "$BUILD_PATH/libs" -I "$BUILD_PATH/python-install/include/igraph/" install --no-pkg-config --root $BUILD_PATH/python-install
28+
export CMD="rename 's/attributes/pyattributes/' src/attributes*"
29+
echo $CMD
30+
try $CMD
31+
export CMD="rename 's/random/pyrandom/' src/random*"
32+
echo $CMD
33+
try $CMD
34+
export CMD="cp src/* $BUILD_c_igraph/src/"
35+
echo $CMD
36+
try $CMD
37+
cd $BUILD_c_igraph
38+
try patch src/Makefile.am $RECIPE_igraph/Makefile.am.patch
39+
export CMD="sed -i s{BUILD_PATH{$BUILD_PATH{g src/Makefile.am"
40+
echo $CMD
41+
try $CMD
42+
export 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 -DHAVE_LOGBL"
43+
export CFLAGS="-I$BUILD_PATH/python-install/include/python2.7 -L$BUILD_PATH/python-install/lib"
44+
try ./configure --prefix="$BUILD_c_igraph" --host=arm-gnueabi --with-external-f2c
45+
try $MAKE
46+
try $MAKE install
47+
cd $BUILD_igraph
48+
export BUILDDIR="build/lib.`python $RECIPE_igraph/get_platform.py`"
49+
export CMD="mkdir -p $BUILDDIR"
50+
echo $CMD
51+
try $CMD
52+
export CMD="cp $BUILD_c_igraph/lib/libigraph.so.0.0.0 $BUILDDIR/_igraph.so"
53+
echo $CMD
54+
try $CMD
55+
cd $BUILD_igraph
56+
try $HOSTPYTHON setup.py build_scripts
57+
try $HOSTPYTHON setup.py install --skip-build --no-pkg-config --root $BUILD_PATH/python-install
3458

3559
pop_arm
3660
}

0 commit comments

Comments
 (0)