Skip to content

Commit d521097

Browse files
committed
Recipes for igraph, a high-performance graph algorithms library http://igraph.org/
1 parent 3179d63 commit d521097

File tree

5 files changed

+154
-0
lines changed

5 files changed

+154
-0
lines changed

recipes/c_igraph/config.h.patch

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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

recipes/c_igraph/recipe.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
3+
# Recipe for igraph, a high performance graph library in C: http://igraph.org
4+
#
5+
# Written by Zachary Spector: https://github.com/LogicalDash/
6+
#
7+
#
8+
9+
VERSION_c_igraph=${VERSION_c_igraph:0.6.5}
10+
11+
DEPS_c_igraph=()
12+
13+
URL_c_igraph=http://downloads.sourceforge.net/project/igraph/C%20library/0.6.5/igraph-0.6.5.tar.gz
14+
15+
MD5_c_igraph=5f9562263ba78b31c564d6897ff5a110
16+
17+
BUILD_c_igraph=$BUILD_PATH/c_igraph/$(get_directory $URL_c_igraph)
18+
19+
RECIPE_c_igraph=$RECIPES_PATH/c_igraph
20+
21+
function prebuild_c_igraph() {
22+
true
23+
}
24+
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+
36+
37+
pop_arm
38+
}
39+
40+
function postbuild_c_igraph() {
41+
true
42+
}

recipes/igraph/config.h.patch

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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

recipes/igraph/recipe.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
3+
# Recipe for the Python interface to igraph, a high-performance graph library in C: http://igraph.org/
4+
#
5+
# Written by Zachary Spector: https://github.com/LogicalDash/
6+
7+
VERSION_igraph=${VERSION_igraph:0.6.5}
8+
9+
DEPS_igraph=(python c_igraph)
10+
11+
URL_igraph=http://pypi.python.org/packages/source/p/python-igraph/python-igraph-0.6.5.tar.gz
12+
13+
MD5_igraph=c626585baf003af855c0dc4eec0c9baa
14+
15+
BUILD_igraph=$BUILD_PATH/igraph/$(get_directory $URL_igraph)
16+
17+
RECIPE_igraph=$RECIPES_PATH/igraph
18+
19+
20+
function prebuild_igraph() {
21+
true
22+
}
23+
24+
function shouldbuild_igraph() {
25+
true
26+
}
27+
28+
function build_igraph() {
29+
cd $BUILD_igraph
30+
push_arm
31+
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
34+
35+
pop_arm
36+
}
37+
38+
function postbuild_igraph() {
39+
true
40+
}

recipes/igraph/setup.py.patch

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
--- /home/sanotehu/Downloads/python-igraph-0.6.5/setup.py 2013-02-27 06:04:09.000000000 -0500
2+
+++ build/igraph/python-igraph-0.6.5/setup.py 2013-11-06 08:54:17.944200143 -0500
3+
@@ -19,7 +19,7 @@
4+
from shutil import copy2
5+
from subprocess import Popen, PIPE
6+
7+
-LIBIGRAPH_FALLBACK_INCLUDE_DIRS = ['/usr/include/igraph', '/usr/local/include/igraph']
8+
+LIBIGRAPH_FALLBACK_INCLUDE_DIRS = ['../../python-install/include/igraph', '../../python-install/include/python2.7']
9+
LIBIGRAPH_FALLBACK_LIBRARIES = ['igraph']
10+
LIBIGRAPH_FALLBACK_LIBRARY_DIRS = []
11+
12+
@@ -40,26 +40,15 @@
13+
14+
def detect_igraph_include_dirs(default = LIBIGRAPH_FALLBACK_INCLUDE_DIRS):
15+
"""Tries to detect the igraph include directory"""
16+
- line, exit_code = get_output("pkg-config igraph --cflags")
17+
- if exit_code > 0 or len(line) == 0:
18+
- return default
19+
- opts=line.split()
20+
- return [opt[2:] for opt in opts if opt.startswith("-I")]
21+
+ return default
22+
23+
def detect_igraph_libraries(default = LIBIGRAPH_FALLBACK_LIBRARIES):
24+
"""Tries to detect the libraries that igraph uses"""
25+
- line, exit_code = get_output("pkg-config igraph --libs")
26+
- if exit_code>0 or len(line) == 0:
27+
- return default
28+
- opts=line.split()
29+
- return [opt[2:] for opt in opts if opt.startswith("-l")]
30+
+ return default
31+
32+
def detect_igraph_library_dirs(default = LIBIGRAPH_FALLBACK_LIBRARY_DIRS):
33+
"""Tries to detect the igraph library directory"""
34+
- line, exit_code = get_output("pkg-config igraph --libs")
35+
- if exit_code>0 or len(line) == 0: return default
36+
- opts=line.split()
37+
- return [opt[2:] for opt in opts if opt[0:2]=="-L"]
38+
+ return default
39+
40+
sources=glob.glob(os.path.join('src', '*.c'))
41+
include_dirs=[]
42+
@@ -113,7 +102,7 @@
43+
Many thanks to the maintainers of this page!
44+
"""
45+
46+
-plat = get_platform()
47+
+plat = 'arm-gnueabi'
48+
options = dict(
49+
name = 'python-igraph',
50+
version = '0.6.5',

0 commit comments

Comments
 (0)