Hi,

During the last week distutils2 sprint at Logilab, I have worked on a
patch for packaging rql with distutils2. Comparing to distutils, custom
Python scripts (like setup.py) should not be exectuted at installation.
As a consequence I had to move the integer calculation of the gecode
version to the C++ test.
The patch can be applied by:

    patch -p1 < distutils2_for_rql.patch

Then the steps for running current distutils2 commands are at the top
of setup.cfg.

Cheers,

André
diff -r 2e60c6578324 data/int_gecode_version.cc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/data/int_gecode_version.cc	Sun Jan 30 18:12:45 2011 +0100
@@ -0,0 +1,13 @@
+#include "gecode/support.hh"
+#include <stdio.h>
+
+#ifndef GECODE_VERSION
+#define GECODE_VERSION "2.1.2"
+#endif
+
+int main() {
+    int a, b, c;
+    sscanf(GECODE_VERSION, "%i.%i.%i", &a, &b, &c);
+    printf("%i", (a<<16) + (b<<8) + (c));
+    return 0;
+}
diff -r 2e60c6578324 setup.cfg
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/setup.cfg	Sun Jan 30 18:12:45 2011 +0100
@@ -0,0 +1,32 @@
+# Building extension in place:
+#   python -m distutils2.run build_ext -i
+# Building the package:
+#   python -m distutils2.run build
+# Installing the package:
+#   python -m distutils2.run install_dist --prefix=/tmp/dist2
+#
+[metadata]
+name = rql
+version = 0.28.0
+summary = relationship query language (RQL) utilities
+download_url = ftp://ftp.logilab.org/pub/rql
+home_page = http://www.logilab.org/project/rql
+author = Logilab
+author_email = [email protected]
+description = A library providing the base utilities to handle RQL queries,
+       |such as a parser, a type inferencer.
+       |
+
+[files]
+packages_root= ..
+packages = rql
+
+[extension=rql_solve]
+name = rql_solve
+sources = gecode_solver.cpp
+libraries = gecodeint gecodekernel gecodesearch -- sys.platform != 'win32'
+    GecodeInt-3-3-1-r-x86 GecodeKernel-3-3-1-r-x86 -- sys.platform == 'win32'
+    GecodeSearch-3-3-1-r-x86 GecodeSupport-3-3-1-r-x86 -- sys.platform == 'win32'
+
+extra_compile_args = "-DGE_VERSION=$(g++ -o gecode_version data/int_gecode_version.cc && ./gecode_version)" -- sys.platform != 'win32'
+"/DGE_VERSION=$(g++ -o gecode_version data/int_gecode_version.cc && ./gecode_version)" -- sys.platform == 'win32'
_______________________________________________
Python-Projects mailing list
[email protected]
http://lists.logilab.org/mailman/listinfo/python-projects

Reply via email to