From 3179d636a96a16af06bc8b717ade438d494f6039 Mon Sep 17 00:00:00 2001 From: LogicalDash Date: Wed, 6 Nov 2013 20:13:08 -0500 Subject: [PATCH 1/7] Update build.py --- src/build.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/build.py b/src/build.py index 6c995ee8be..b6cb370153 100755 --- a/src/build.py +++ b/src/build.py @@ -1,6 +1,6 @@ #!/usr/bin/env python2.7 -from os.path import dirname, join, isfile, realpath, relpath, split +from os.path import basename, dirname, join, isfile, realpath, relpath, split from zipfile import ZipFile import sys sys.path.insert(0, 'buildlib/jinja2.egg') @@ -164,7 +164,17 @@ def select(fn): for sd in source_dirs: sd = realpath(sd) compile_dir(sd) - files += [(x, relpath(realpath(x), sd)) for x in listfiles(sd) if select(x)] + for x in listdir(sd): + if select(x): + # symbolic links should go in the archive by the name of the link, not the name of what they point to + try: + realbase = os.readlink(x) + linkbase = basename(x) + realp = realpath(x).replace(realbase, linkbase) + nufile = (x, relpath(realp, sd)) + except OSError: + nufile = (x, relpath(realpath(x), sd)) + files.append(nufile) # create tar.gz of thoses files tf = tarfile.open(tfn, 'w:gz') From 38d424abf48d1762658823b610dd0e7ac6d8466c Mon Sep 17 00:00:00 2001 From: Zachary Spector Date: Fri, 8 Nov 2013 06:57:42 -0500 Subject: [PATCH 2/7] Recipes for igraph, a hi-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 7e3709b4c9a5d746951de45f08eb5e9d0297de15 Mon Sep 17 00:00:00 2001 From: Zachary Spector Date: Mon, 11 Nov 2013 11:40:13 -0500 Subject: [PATCH 3/7] New approach: build everything at once. --- recipes/c_igraph/recipe.sh | 19 +++++-------- recipes/igraph/Makefile.am.patch | 47 +++++++++++++++++++++++++++++++ recipes/igraph/config.h.in.patch | 2 ++ recipes/igraph/config.h.patch | 13 ++------- recipes/igraph/configure.ac.patch | 4 +++ recipes/igraph/get_platform.py | 3 ++ recipes/igraph/recipe.sh | 38 ++++++++++++++++++++----- 7 files changed, 96 insertions(+), 30 deletions(-) create mode 100644 recipes/igraph/Makefile.am.patch create mode 100644 recipes/igraph/config.h.in.patch create mode 100644 recipes/igraph/configure.ac.patch create mode 100644 recipes/igraph/get_platform.py diff --git a/recipes/c_igraph/recipe.sh b/recipes/c_igraph/recipe.sh index d88f52d48b..11a454a140 100644 --- a/recipes/c_igraph/recipe.sh +++ b/recipes/c_igraph/recipe.sh @@ -22,19 +22,14 @@ 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 - +function shouldbuild_c_igraph() { + false +} - pop_arm +function build_c_igraph() { + # I'm not even going to make anything here! + # I'll let the main igraph recipe do that. + true } function postbuild_c_igraph() { 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 index 45c30fe258..005059cad6 100644 --- a/recipes/igraph/config.h.patch +++ b/recipes/igraph/config.h.patch @@ -1,11 +1,2 @@ ---- 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 +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 index a6a29d1c8d..133ae9fa2c 100644 --- a/recipes/igraph/recipe.sh +++ b/recipes/igraph/recipe.sh @@ -6,7 +6,7 @@ VERSION_igraph=${VERSION_igraph:0.6.5} -DEPS_igraph=(python c_igraph) +DEPS_igraph=(c_igraph python) URL_igraph=http://pypi.python.org/packages/source/p/python-igraph/python-igraph-0.6.5.tar.gz @@ -21,16 +21,40 @@ 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 + export CMD="rename 's/attributes/pyattributes/' src/attributes*" + echo $CMD + try $CMD + export CMD="rename 's/random/pyrandom/' src/random*" + echo $CMD + try $CMD + export CMD="cp src/* $BUILD_c_igraph/src/" + echo $CMD + try $CMD + cd $BUILD_c_igraph + try patch src/Makefile.am $RECIPE_igraph/Makefile.am.patch + export CMD="sed -i s{BUILD_PATH{$BUILD_PATH{g src/Makefile.am" + echo $CMD + try $CMD + 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" + export CFLAGS="-I$BUILD_PATH/python-install/include/python2.7 -L$BUILD_PATH/python-install/lib" + try ./configure --prefix="$BUILD_c_igraph" --host=arm-gnueabi --with-external-f2c + try $MAKE + try $MAKE install + cd $BUILD_igraph + export BUILDDIR="build/lib.`python $RECIPE_igraph/get_platform.py`" + export CMD="mkdir -p $BUILDDIR" + echo $CMD + try $CMD + export CMD="cp $BUILD_c_igraph/lib/libigraph.so.0.0.0 $BUILDDIR/_igraph.so" + echo $CMD + try $CMD + cd $BUILD_igraph + try $HOSTPYTHON setup.py build_scripts + try $HOSTPYTHON setup.py install --skip-build --no-pkg-config --root $BUILD_PATH/python-install pop_arm } From 37ec2a84bcf4691f00fa00ece1b89e4999148448 Mon Sep 17 00:00:00 2001 From: Zachary Spector Date: Mon, 11 Nov 2013 12:44:45 -0500 Subject: [PATCH 4/7] completely ruined --- src/build.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/build.py b/src/build.py index b6cb370153..6c995ee8be 100755 --- a/src/build.py +++ b/src/build.py @@ -1,6 +1,6 @@ #!/usr/bin/env python2.7 -from os.path import basename, dirname, join, isfile, realpath, relpath, split +from os.path import dirname, join, isfile, realpath, relpath, split from zipfile import ZipFile import sys sys.path.insert(0, 'buildlib/jinja2.egg') @@ -164,17 +164,7 @@ def select(fn): for sd in source_dirs: sd = realpath(sd) compile_dir(sd) - for x in listdir(sd): - if select(x): - # symbolic links should go in the archive by the name of the link, not the name of what they point to - try: - realbase = os.readlink(x) - linkbase = basename(x) - realp = realpath(x).replace(realbase, linkbase) - nufile = (x, relpath(realp, sd)) - except OSError: - nufile = (x, relpath(realpath(x), sd)) - files.append(nufile) + files += [(x, relpath(realpath(x), sd)) for x in listfiles(sd) if select(x)] # create tar.gz of thoses files tf = tarfile.open(tfn, 'w:gz') From d930da624c3be57cb1a7106daa8de15692b43ac2 Mon Sep 17 00:00:00 2001 From: Zachary Spector Date: Tue, 12 Nov 2013 13:26:29 -0500 Subject: [PATCH 5/7] try it the old way? --- recipes/igraph/recipe.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/igraph/recipe.sh b/recipes/igraph/recipe.sh index a6a29d1c8d..045202dbd5 100644 --- a/recipes/igraph/recipe.sh +++ b/recipes/igraph/recipe.sh @@ -30,7 +30,7 @@ function 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 + try $HOSTPYTHON setup.py build_ext -p arm-gnueabi -L "$BUILD_PATH/libs" -I "$BUILD_PATH/python-install/include/igraph/" install --root $BUILD_PATH/python-install --install-platlib $BUILD_PATH/python-install/lib/python2.7/lib-dynload pop_arm } From 8bc284872a40aa07de9d107ac33f505202df2413 Mon Sep 17 00:00:00 2001 From: Zachary Spector Date: Wed, 13 Nov 2013 13:59:57 -0500 Subject: [PATCH 6/7] You can now build the igraph library with distribute.sh. --- recipes/c_igraph/Makefile.am.patch | 6 ++++++ recipes/c_igraph/arith.h | 6 ++++++ recipes/c_igraph/makefile.u.patch | 12 ++++++++++++ recipes/c_igraph/recipe.sh | 19 +++++++++++++++---- recipes/c_igraph/sysdep1.h.patch | 7 +++++++ recipes/c_igraph/uninit.c.patch | 23 +++++++++++++++++++++++ recipes/igraph/recipe.sh | 10 ++++++---- src/build.py | 14 ++------------ 8 files changed, 77 insertions(+), 20 deletions(-) create mode 100644 recipes/c_igraph/Makefile.am.patch create mode 100644 recipes/c_igraph/arith.h create mode 100644 recipes/c_igraph/makefile.u.patch create mode 100644 recipes/c_igraph/sysdep1.h.patch create mode 100644 recipes/c_igraph/uninit.c.patch 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/makefile.u.patch b/recipes/c_igraph/makefile.u.patch new file mode 100644 index 0000000000..1ba42627a9 --- /dev/null +++ b/recipes/c_igraph/makefile.u.patch @@ -0,0 +1,12 @@ +16d15 +< CC = cc +18c17,19 +< CFLAGS = -O +--- +> CC = $(ANDROIDNDK)/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc +> LD = $(ANDROIDNDK)/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld +> CFLAGS = -DNO_ISATTY -DANDROID -mandroid -I$(ANDROIDNDK)/platforms/android-14/arch-arm/usr/include -L$(ANDROIDNDK)/platforms/android-14/arch-arm/usr/lib -O -fomit-frame-pointer --sysroot $(ANDROIDNDK)/platforms/android-14/arch-arm +23c24 +< ld -r -x -o $*.xxx $*.o +--- +> $(LD) -E -r -o $*.xxx $*.o diff --git a/recipes/c_igraph/recipe.sh b/recipes/c_igraph/recipe.sh index d88f52d48b..02697b8e5d 100644 --- a/recipes/c_igraph/recipe.sh +++ b/recipes/c_igraph/recipe.sh @@ -22,19 +22,30 @@ 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 - - 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/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() { 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/recipe.sh b/recipes/igraph/recipe.sh index 045202dbd5..9036417e59 100644 --- a/recipes/igraph/recipe.sh +++ b/recipes/igraph/recipe.sh @@ -18,21 +18,23 @@ RECIPE_igraph=$RECIPES_PATH/igraph function prebuild_igraph() { - true + patch setup.py $RECIPE_igraph/setup.py.patch } function shouldbuild_igraph() { - true + if [ -e $BUILD_igraph/.built ]; then + export DO_BUILD=0; + fi } 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 --root $BUILD_PATH/python-install --install-platlib $BUILD_PATH/python-install/lib/python2.7/lib-dynload + 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() { diff --git a/src/build.py b/src/build.py index b6cb370153..6c995ee8be 100755 --- a/src/build.py +++ b/src/build.py @@ -1,6 +1,6 @@ #!/usr/bin/env python2.7 -from os.path import basename, dirname, join, isfile, realpath, relpath, split +from os.path import dirname, join, isfile, realpath, relpath, split from zipfile import ZipFile import sys sys.path.insert(0, 'buildlib/jinja2.egg') @@ -164,17 +164,7 @@ def select(fn): for sd in source_dirs: sd = realpath(sd) compile_dir(sd) - for x in listdir(sd): - if select(x): - # symbolic links should go in the archive by the name of the link, not the name of what they point to - try: - realbase = os.readlink(x) - linkbase = basename(x) - realp = realpath(x).replace(realbase, linkbase) - nufile = (x, relpath(realp, sd)) - except OSError: - nufile = (x, relpath(realpath(x), sd)) - files.append(nufile) + files += [(x, relpath(realpath(x), sd)) for x in listfiles(sd) if select(x)] # create tar.gz of thoses files tf = tarfile.open(tfn, 'w:gz') From 6a85278c67ac49e18be1bceaaf124e3e002950c8 Mon Sep 17 00:00:00 2001 From: Zachary Spector Date: Wed, 13 Nov 2013 14:01:37 -0500 Subject: [PATCH 7/7] That one was useful when I was trying to build with an external f2c instead of patching the internal one. --- recipes/c_igraph/makefile.u.patch | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 recipes/c_igraph/makefile.u.patch diff --git a/recipes/c_igraph/makefile.u.patch b/recipes/c_igraph/makefile.u.patch deleted file mode 100644 index 1ba42627a9..0000000000 --- a/recipes/c_igraph/makefile.u.patch +++ /dev/null @@ -1,12 +0,0 @@ -16d15 -< CC = cc -18c17,19 -< CFLAGS = -O ---- -> CC = $(ANDROIDNDK)/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc -> LD = $(ANDROIDNDK)/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld -> CFLAGS = -DNO_ISATTY -DANDROID -mandroid -I$(ANDROIDNDK)/platforms/android-14/arch-arm/usr/include -L$(ANDROIDNDK)/platforms/android-14/arch-arm/usr/lib -O -fomit-frame-pointer --sysroot $(ANDROIDNDK)/platforms/android-14/arch-arm -23c24 -< ld -r -x -o $*.xxx $*.o ---- -> $(LD) -E -r -o $*.xxx $*.o