diff --git a/recipes/c_igraph/Makefile.am.patch b/recipes/c_igraph/Makefile.am.patch new file mode 100644 index 0000000000..4ccd8f0a02 --- /dev/null +++ b/recipes/c_igraph/Makefile.am.patch @@ -0,0 +1,6 @@ +68,72d67 +< f2c/arith.h: f2c/arithchk.c +< $(CC) $(CFLAGS) -DNO_FPINIT f2c/arithchk.c -lm -o f2c/arith || \ +< $(CC) -DNO_LONG_LONG $(CFLAGS) -DNO_FPINIT f2c/arithchk.c \ +< $(WARNING_CFLAGS) -lm -o f2c/arith +< f2c/arith > f2c/arith.h diff --git a/recipes/c_igraph/arith.h b/recipes/c_igraph/arith.h new file mode 100644 index 0000000000..fe8212e61d --- /dev/null +++ b/recipes/c_igraph/arith.h @@ -0,0 +1,6 @@ +#define IEEE_8087 +#define Arith_Kind_ASL 1 +#define Double_Align +#define NANCHECK +#define QNaN0 0x0 +#define QNaN1 0x7ff80000 diff --git a/recipes/c_igraph/config.h.patch b/recipes/c_igraph/config.h.patch new file mode 100644 index 0000000000..45c30fe258 --- /dev/null +++ b/recipes/c_igraph/config.h.patch @@ -0,0 +1,11 @@ +--- build/c_igraph/igraph-0.6.5/config.h 2013-11-05 14:10:26.285433616 -0500 ++++ config.h 2013-11-05 14:12:36.431283045 -0500 +@@ -53,7 +53,7 @@ + /* #undef HAVE_LOG2 */ + + /* Define to 1 if you have the `logbl' function. */ +-/* #undef HAVE_LOGBL */ ++#define HAVE_LOGBL 1 + + /* Define to 1 if you have the header file. */ + #define HAVE_MEMORY_H 1 diff --git a/recipes/c_igraph/recipe.sh b/recipes/c_igraph/recipe.sh new file mode 100644 index 0000000000..02697b8e5d --- /dev/null +++ b/recipes/c_igraph/recipe.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +# Recipe for igraph, a high performance graph library in C: http://igraph.org +# +# Written by Zachary Spector: https://github.com/LogicalDash/ +# +# + +VERSION_c_igraph=${VERSION_c_igraph:0.6.5} + +DEPS_c_igraph=() + +URL_c_igraph=http://downloads.sourceforge.net/project/igraph/C%20library/0.6.5/igraph-0.6.5.tar.gz + +MD5_c_igraph=5f9562263ba78b31c564d6897ff5a110 + +BUILD_c_igraph=$BUILD_PATH/c_igraph/$(get_directory $URL_c_igraph) + +RECIPE_c_igraph=$RECIPES_PATH/c_igraph + +function prebuild_c_igraph() { + true +} + +function shouldbuild_c_igraph() { + if [ -e $BUILD_c_igraph/.built ]; then + export DO_BUILD=0; + fi +} + +function build_c_igraph() { + cd $BUILD_c_igraph + + push_arm + try patch $BUILD_c_igraph/src/Makefile.am $RECIPE_c_igraph/Makefile.am.patch + export OLD_CPPFLAGS="$CPPFLAGS" + 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" + try ./configure --prefix="$BUILD_PATH/python-install" --build=i686-pc-linux-gnu --host=arm-linux-eabi + export CPPFLAGS="$OLD_CPPFLAGS" + try cp -f $RECIPE_c_igraph/arith.h $BUILD_c_igraph/src/f2c/arith.h + try patch $BUILD_c_igraph/src/f2c/sysdep1.h $RECIPE_c_igraph/sysdep1.h.patch + try patch $BUILD_c_igraph/src/f2c/uninit.c $RECIPE_c_igraph/uninit.c.patch + try patch $BUILD_c_igraph/config.h $RECIPE_c_igraph/config.h.patch + try $MAKE + try $MAKE install + + pop_arm + touch .built +} + +function postbuild_c_igraph() { + true +} diff --git a/recipes/c_igraph/sysdep1.h.patch b/recipes/c_igraph/sysdep1.h.patch new file mode 100644 index 0000000000..91ad43a3de --- /dev/null +++ b/recipes/c_igraph/sysdep1.h.patch @@ -0,0 +1,7 @@ +16a17 +> /*android doesn't like these +18c19,20 +< #define OFF_T __off64_t +--- +> #define OFF_T __off64_t*/ +> #define OFF_T long diff --git a/recipes/c_igraph/uninit.c.patch b/recipes/c_igraph/uninit.c.patch new file mode 100644 index 0000000000..28fcd2e8b8 --- /dev/null +++ b/recipes/c_igraph/uninit.c.patch @@ -0,0 +1,23 @@ +276c276,277 +< #include +--- +> //doesn't exist on Android +> //#include +334a336 +> /* +336c338 +< #define RQD_FPU_MASK (_FPU_MASK_OM+_FPU_MASK_IM+_FPU_MASK_ZM) +--- +> #define RQD_FPU_MASK (_FPU_MASK_OM+_FPU_MASK_IM+_FPU_MASK_ZM)*/ +343a346 +> /* +345c348 +< #define RQD_FPU_MASK (_FPU_MASK_OM+_FPU_MASK_IM+_FPU_MASK_ZM) +--- +> #define RQD_FPU_MASK (_FPU_MASK_OM+_FPU_MASK_IM+_FPU_MASK_ZM)*/ +350a354 +> /* +352c356 +< #define RQD_FPU_MASK (_FPU_MASK_O+_FPU_MASK_V+_FPU_MASK_Z) +--- +> #define RQD_FPU_MASK (_FPU_MASK_O+_FPU_MASK_V+_FPU_MASK_Z)*/ diff --git a/recipes/igraph/Makefile.am.patch b/recipes/igraph/Makefile.am.patch new file mode 100644 index 0000000000..e858da8207 --- /dev/null +++ b/recipes/igraph/Makefile.am.patch @@ -0,0 +1,47 @@ +170c170,180 +< scg_headers.h igraph_hacks_internal.h +--- +> scg_headers.h igraph_hacks_internal.h \ +> arpackobject.h \ +> pyattributes.h bfsiter.h \ +> common.h convert.h \ +> edgeobject.h edgeseqobject.h \ +> error.h filehandle.h \ +> graphobject.h igraphmodule_api.h \ +> indexing.h platform.h \ +> py2compat.h pyhelpers.h \ +> pyrandom.h vertexobject.h \ +> vertexseqobject.h +260c270,287 +< qsort.c qsort_r.c types.c hacks.c +--- +> qsort.c qsort_r.c types.c hacks.c \ +> arpackobject.c \ +> pyattributes.c \ +> bfsiter.c \ +> common.c \ +> convert.c \ +> edgeobject.c \ +> edgeseqobject.c \ +> error.c \ +> filehandle.c \ +> graphobject.c \ +> igraphmodule.c \ +> indexing.c \ +> py2compat.c \ +> pyhelpers.c \ +> pyrandom.c \ +> vertexobject.c \ +> vertexseqobject.c +263,265c290,292 +< libigraph_la_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(WARNING_CFLAGS) +< libigraph_la_CXXFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(WARNING_CFLAGS) +< libigraph_la_LDFLAGS = -no-undefined +--- +> libigraph_la_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(WARNING_CFLAGS) -IBUILD_PATH/python-install/include/python2.7 +> libigraph_la_CXXFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(WARNING_CFLAGS) -IBUILD_PATH/python-install/include/python2.7 +> libigraph_la_LDFLAGS = -no-undefined -LBUILD_PATH/python-install/lib -IBUILD_PATH/python-install/include/python2.7 +267c294 +< $(LAPACK_LIB) $(ARPACK_LIB) $(GLPK_LIB) $(PLFIT_LIB) +--- +> $(LAPACK_LIB) $(ARPACK_LIB) $(GLPK_LIB) $(PLFIT_LIB) -lpython2.7 diff --git a/recipes/igraph/config.h.in.patch b/recipes/igraph/config.h.in.patch new file mode 100644 index 0000000000..74b2d0aa15 --- /dev/null +++ b/recipes/igraph/config.h.in.patch @@ -0,0 +1,2 @@ +1a2 +> #define HAVE_LOGBL 1 diff --git a/recipes/igraph/config.h.patch b/recipes/igraph/config.h.patch new file mode 100644 index 0000000000..005059cad6 --- /dev/null +++ b/recipes/igraph/config.h.patch @@ -0,0 +1,2 @@ +2a3 +> #define HAVE_LOGBL 1 diff --git a/recipes/igraph/configure.ac.patch b/recipes/igraph/configure.ac.patch new file mode 100644 index 0000000000..a6c774e994 --- /dev/null +++ b/recipes/igraph/configure.ac.patch @@ -0,0 +1,4 @@ +43c43 +< AC_CHECK_FUNCS([expm1 rint rintf finite log2 logbl snprintf log1p round fabsl fmin strcasecmp isnan strdup _strdup ftruncate stpcpy]) +--- +> AC_CHECK_FUNCS([expm1 rint rintf finite log2 snprintf log1p round fabsl fmin strcasecmp isnan strdup _strdup ftruncate stpcpy]) diff --git a/recipes/igraph/get_platform.py b/recipes/igraph/get_platform.py new file mode 100644 index 0000000000..c3614bf001 --- /dev/null +++ b/recipes/igraph/get_platform.py @@ -0,0 +1,3 @@ +from distutils.util import get_platform +from sys import version +print get_platform() + '-' + version[:3] diff --git a/recipes/igraph/recipe.sh b/recipes/igraph/recipe.sh new file mode 100644 index 0000000000..35662a028b --- /dev/null +++ b/recipes/igraph/recipe.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +# Recipe for the Python interface to igraph, a high-performance graph library in C: http://igraph.org/ +# +# Written by Zachary Spector: https://github.com/LogicalDash/ + +VERSION_igraph=${VERSION_igraph:0.6.5} + +DEPS_igraph=(c_igraph python) + +URL_igraph=http://pypi.python.org/packages/source/p/python-igraph/python-igraph-0.6.5.tar.gz + +MD5_igraph=c626585baf003af855c0dc4eec0c9baa + +BUILD_igraph=$BUILD_PATH/igraph/$(get_directory $URL_igraph) + +RECIPE_igraph=$RECIPES_PATH/igraph + + +function prebuild_igraph() { + patch setup.py $RECIPE_igraph/setup.py.patch +} + +function shouldbuild_igraph() { + if [ -e $BUILD_igraph/.built ]; then + export DO_BUILD=0; + fi +} + +function build_igraph() { + cd $BUILD_igraph + push_arm + + 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 + + pop_arm + touch .built +} + +function postbuild_igraph() { + true +} diff --git a/recipes/igraph/setup.py.patch b/recipes/igraph/setup.py.patch new file mode 100644 index 0000000000..17f11971a7 --- /dev/null +++ b/recipes/igraph/setup.py.patch @@ -0,0 +1,50 @@ +--- /home/sanotehu/Downloads/python-igraph-0.6.5/setup.py 2013-02-27 06:04:09.000000000 -0500 ++++ build/igraph/python-igraph-0.6.5/setup.py 2013-11-06 08:54:17.944200143 -0500 +@@ -19,7 +19,7 @@ + from shutil import copy2 + from subprocess import Popen, PIPE + +-LIBIGRAPH_FALLBACK_INCLUDE_DIRS = ['/usr/include/igraph', '/usr/local/include/igraph'] ++LIBIGRAPH_FALLBACK_INCLUDE_DIRS = ['../../python-install/include/igraph', '../../python-install/include/python2.7'] + LIBIGRAPH_FALLBACK_LIBRARIES = ['igraph'] + LIBIGRAPH_FALLBACK_LIBRARY_DIRS = [] + +@@ -40,26 +40,15 @@ + + def detect_igraph_include_dirs(default = LIBIGRAPH_FALLBACK_INCLUDE_DIRS): + """Tries to detect the igraph include directory""" +- line, exit_code = get_output("pkg-config igraph --cflags") +- if exit_code > 0 or len(line) == 0: +- return default +- opts=line.split() +- return [opt[2:] for opt in opts if opt.startswith("-I")] ++ return default + + def detect_igraph_libraries(default = LIBIGRAPH_FALLBACK_LIBRARIES): + """Tries to detect the libraries that igraph uses""" +- line, exit_code = get_output("pkg-config igraph --libs") +- if exit_code>0 or len(line) == 0: +- return default +- opts=line.split() +- return [opt[2:] for opt in opts if opt.startswith("-l")] ++ return default + + def detect_igraph_library_dirs(default = LIBIGRAPH_FALLBACK_LIBRARY_DIRS): + """Tries to detect the igraph library directory""" +- line, exit_code = get_output("pkg-config igraph --libs") +- if exit_code>0 or len(line) == 0: return default +- opts=line.split() +- return [opt[2:] for opt in opts if opt[0:2]=="-L"] ++ return default + + sources=glob.glob(os.path.join('src', '*.c')) + include_dirs=[] +@@ -113,7 +102,7 @@ + Many thanks to the maintainers of this page! + """ + +-plat = get_platform() ++plat = 'arm-gnueabi' + options = dict( + name = 'python-igraph', + version = '0.6.5',