From d521097aa8bb9870c7048466e12ddb377c54a741 Mon Sep 17 00:00:00 2001 From: Zachary Spector Date: Fri, 8 Nov 2013 06:49:06 -0500 Subject: [PATCH 1/3] Recipes for igraph, a high-performance graph algorithms library http://igraph.org/ --- recipes/c_igraph/config.h.patch | 11 ++++++++ recipes/c_igraph/recipe.sh | 42 +++++++++++++++++++++++++++ recipes/igraph/config.h.patch | 11 ++++++++ recipes/igraph/recipe.sh | 40 ++++++++++++++++++++++++++ recipes/igraph/setup.py.patch | 50 +++++++++++++++++++++++++++++++++ 5 files changed, 154 insertions(+) create mode 100644 recipes/c_igraph/config.h.patch create mode 100644 recipes/c_igraph/recipe.sh create mode 100644 recipes/igraph/config.h.patch create mode 100644 recipes/igraph/recipe.sh create mode 100644 recipes/igraph/setup.py.patch 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..d88f52d48b --- /dev/null +++ b/recipes/c_igraph/recipe.sh @@ -0,0 +1,42 @@ +#!/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 build_c_igraph() { + cd $BUILD_c_igraph + + push_arm + + 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" + try ./configure --prefix="$BUILD_PATH/python-install" --libdir="$BUILD_PATH/libs" --host=arm-gnueabi --with-sysroot="$ANDROIDNDK/sources/cxx-stl/stlport/" --with-external-f2c + try patch $BUILD_c_igraph/config.h $RECIPE_c_igraph/config.h.patch + try $MAKE + try $MAKE install + + + pop_arm +} + +function postbuild_c_igraph() { + true +} diff --git a/recipes/igraph/config.h.patch b/recipes/igraph/config.h.patch new file mode 100644 index 0000000000..45c30fe258 --- /dev/null +++ b/recipes/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/igraph/recipe.sh b/recipes/igraph/recipe.sh new file mode 100644 index 0000000000..a6a29d1c8d --- /dev/null +++ b/recipes/igraph/recipe.sh @@ -0,0 +1,40 @@ +#!/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=(python c_igraph) + +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() { + true +} + +function shouldbuild_igraph() { + true +} + +function build_igraph() { + cd $BUILD_igraph + push_arm + + patch setup.py $RECIPE_igraph/setup.py.patch + 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 + + pop_arm +} + +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', From 495acf9c8ba127b97450c8de1742653042bb8cd6 Mon Sep 17 00:00:00 2001 From: Zachary Spector Date: Fri, 8 Nov 2013 06:59:31 -0500 Subject: [PATCH 2/3] wrong branch --- recipes/c_igraph/config.h.patch | 11 -------- recipes/c_igraph/recipe.sh | 42 --------------------------- recipes/igraph/config.h.patch | 11 -------- recipes/igraph/recipe.sh | 40 -------------------------- recipes/igraph/setup.py.patch | 50 --------------------------------- 5 files changed, 154 deletions(-) delete mode 100644 recipes/c_igraph/config.h.patch delete mode 100644 recipes/c_igraph/recipe.sh delete mode 100644 recipes/igraph/config.h.patch delete mode 100644 recipes/igraph/recipe.sh delete mode 100644 recipes/igraph/setup.py.patch diff --git a/recipes/c_igraph/config.h.patch b/recipes/c_igraph/config.h.patch deleted file mode 100644 index 45c30fe258..0000000000 --- a/recipes/c_igraph/config.h.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- 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 deleted file mode 100644 index d88f52d48b..0000000000 --- a/recipes/c_igraph/recipe.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/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 build_c_igraph() { - cd $BUILD_c_igraph - - push_arm - - 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" - try ./configure --prefix="$BUILD_PATH/python-install" --libdir="$BUILD_PATH/libs" --host=arm-gnueabi --with-sysroot="$ANDROIDNDK/sources/cxx-stl/stlport/" --with-external-f2c - try patch $BUILD_c_igraph/config.h $RECIPE_c_igraph/config.h.patch - try $MAKE - try $MAKE install - - - pop_arm -} - -function postbuild_c_igraph() { - true -} diff --git a/recipes/igraph/config.h.patch b/recipes/igraph/config.h.patch deleted file mode 100644 index 45c30fe258..0000000000 --- a/recipes/igraph/config.h.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- 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/igraph/recipe.sh b/recipes/igraph/recipe.sh deleted file mode 100644 index a6a29d1c8d..0000000000 --- a/recipes/igraph/recipe.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/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=(python c_igraph) - -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() { - true -} - -function shouldbuild_igraph() { - true -} - -function build_igraph() { - cd $BUILD_igraph - push_arm - - patch setup.py $RECIPE_igraph/setup.py.patch - 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 - - pop_arm -} - -function postbuild_igraph() { - true -} diff --git a/recipes/igraph/setup.py.patch b/recipes/igraph/setup.py.patch deleted file mode 100644 index 17f11971a7..0000000000 --- a/recipes/igraph/setup.py.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- /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', From 4e295fdd6c66dafcea80be4f3e45c27add50066c Mon Sep 17 00:00:00 2001 From: Zachary Spector Date: Fri, 29 Nov 2013 10:18:19 -0500 Subject: [PATCH 3/3] Fix error when the igraph library is installed on the build machine for a non-ARM achitecture. Also, get_platform.py was never really used. I thought I'd need to know exactly how distutils wanted me to write the architecture name, but I didn't really. --- recipes/igraph/get_platform.py | 3 --- recipes/igraph/recipe.sh | 6 ++++-- recipes/igraph/setup.cfg.patch | 6 ++++++ 3 files changed, 10 insertions(+), 5 deletions(-) delete mode 100644 recipes/igraph/get_platform.py create mode 100644 recipes/igraph/setup.cfg.patch diff --git a/recipes/igraph/get_platform.py b/recipes/igraph/get_platform.py deleted file mode 100644 index c3614bf001..0000000000 --- a/recipes/igraph/get_platform.py +++ /dev/null @@ -1,3 +0,0 @@ -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 index 35662a028b..942fe0a5fd 100644 --- a/recipes/igraph/recipe.sh +++ b/recipes/igraph/recipe.sh @@ -1,4 +1,4 @@ -#!/bin/bash +b#!/bin/bash # Recipe for the Python interface to igraph, a high-performance graph library in C: http://igraph.org/ # @@ -18,7 +18,7 @@ RECIPE_igraph=$RECIPES_PATH/igraph function prebuild_igraph() { - patch setup.py $RECIPE_igraph/setup.py.patch + true } function shouldbuild_igraph() { @@ -29,6 +29,8 @@ function shouldbuild_igraph() { function build_igraph() { cd $BUILD_igraph + patch setup.py $RECIPE_igraph/setup.py.patch + patch setup.cfg $RECIPE_igraph/setup.cfg.patch 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 diff --git a/recipes/igraph/setup.cfg.patch b/recipes/igraph/setup.cfg.patch new file mode 100644 index 0000000000..ae0c5f316f --- /dev/null +++ b/recipes/igraph/setup.cfg.patch @@ -0,0 +1,6 @@ +2,3c2,3 +< include_dirs = ../../build/include:../../include:/usr/local/include:/usr/include +< library_dirs = ../../build/src/.libs:../../src/.libs:/usr/local/lib:/usr/lib +--- +> include_dirs = ../../build/include:../../include +> library_dirs = ../../build/src/.libs:../../src/.libs