[Python-modules-commits] r28083 - in packages/pycxx/trunk/debian (7 files)

jtaylor-guest at users.alioth.debian.org jtaylor-guest at users.alioth.debian.org
Sun Mar 9 16:09:30 UTC 2014


    Date: Sunday, March 9, 2014 @ 16:09:29
  Author: jtaylor-guest
Revision: 28083

install files into /usr/src/PyCXX and /usr/include/PyCXX

Provide a PyCXX.pc pkg-config file to expose those folders to the users.
This aligns us with fedora and is also how matplotlib expects to find
pycxx.

Added:
  packages/pycxx/trunk/debian/PyCXX.pc
  packages/pycxx/trunk/debian/README.Debian
Modified:
  packages/pycxx/trunk/debian/changelog
  packages/pycxx/trunk/debian/control
  packages/pycxx/trunk/debian/rules
  packages/pycxx/trunk/debian/tests/buildtest
  packages/pycxx/trunk/debian/tests/control

Added: packages/pycxx/trunk/debian/PyCXX.pc
===================================================================
--- packages/pycxx/trunk/debian/PyCXX.pc	                        (rev 0)
+++ packages/pycxx/trunk/debian/PyCXX.pc	2014-03-09 16:09:29 UTC (rev 28083)
@@ -0,0 +1,9 @@
+prefix=/usr
+exec_prefix=/usr
+includedir=/usr/include/CXX
+srcdir=/usr/src/CXX
+
+Name: PyCXX
+Description: Write Python extensions in C++
+Version: 6.2.5
+Cflags: -I${includedir}

Added: packages/pycxx/trunk/debian/README.Debian
===================================================================
--- packages/pycxx/trunk/debian/README.Debian	                        (rev 0)
+++ packages/pycxx/trunk/debian/README.Debian	2014-03-09 16:09:29 UTC (rev 28083)
@@ -0,0 +1,20 @@
+PyCXX does not offer a shared library,  it is intended users of this package
+compile the sources into their extensions.
+The Debian (and Fedora) package offers a pkg-config file named PyCXX.pc which
+exports the installed location of the headers and sources required to build, do
+not hardcode the path into your files.
+
+Example:
+Copy /usr/share/doc/python-cxx-dev/examples/ into a writeable area from there
+you can compile an example by executing these commands:
+
+CFLAGS="$(pkg-config --cflags PyCXX) $(python-config --cflags)"
+SRC="$(pkg-config --variable=srcdir PyCXX)"
+
+g++ -fPIC $CFLAGS simple.cxx \
+    $SRC/cxxextensions.c $SRC/cxx_extensions.cxx \
+    $SRC/cxxsupport.cxx \
+    $SRC/IndirectPythonInterface.cxx \
+    -shared -o simple.so
+python test_simple.py
+

Modified: packages/pycxx/trunk/debian/changelog
===================================================================
--- packages/pycxx/trunk/debian/changelog	2014-03-09 14:17:30 UTC (rev 28082)
+++ packages/pycxx/trunk/debian/changelog	2014-03-09 16:09:29 UTC (rev 28083)
@@ -4,6 +4,9 @@
     - drop upstream applied 02_fix_indentation.patch
     - add fix-version.patch to fix setup.py version number
     - fix-example-crash.patch: fix crash of example with python3.4-dbg
+  * additionally install sources into a folder independent of the python
+    version and provide PyCXX.pc to export its location
+  * add README.Debian documenting a way to use pycxx (Closes: #732120)
   * debian/rules: clean to allow build twice in a row (Closes: #671415)
   * Bump standard version to 3.9.5, no changes required
 

Modified: packages/pycxx/trunk/debian/control
===================================================================
--- packages/pycxx/trunk/debian/control	2014-03-09 14:17:30 UTC (rev 28082)
+++ packages/pycxx/trunk/debian/control	2014-03-09 16:09:29 UTC (rev 28083)
@@ -5,8 +5,8 @@
 Uploaders: Julian Taylor <jtaylor.debian at googlemail.com>
 Build-Depends: debhelper (>= 7.0.50~),
                python-all (>= 2.6.6-3~),
-               python3-all-dbg,
-               python3-all-dev (>= 3.1.2-10~)
+               python3-all,
+               python3-all-dbg
 X-Python-Version: >= 2.4
 X-Python3-Version: >= 3.0
 Standards-Version: 3.9.5
@@ -18,6 +18,7 @@
 Package: python-cxx-dev
 Architecture: all
 Depends: python-dev, ${misc:Depends}, ${python:Depends}
+Suggests: pkg-config
 Description: Set of facilities to extend Python with C++
  PyCXX is a set of C++ facilities to make it easier to write Python3
  extensions. The main advantage is that it greatly increases the
@@ -29,7 +30,8 @@
 
 Package: python3-cxx-dev
 Architecture: all
-Depends: python3-dev, ${misc:Depends}, ${python3:Depends}
+Depends: python-cxx-dev, python3-dev, ${misc:Depends}, ${python3:Depends}
+Suggests: pkg-config
 Description: Set of facilities to extend Python3 with C++
  PyCXX is a set of C++ facilities to make it easier to write Python3
  extensions. The main advantage is that it greatly increases the

Modified: packages/pycxx/trunk/debian/rules
===================================================================
--- packages/pycxx/trunk/debian/rules	2014-03-09 14:17:30 UTC (rev 28082)
+++ packages/pycxx/trunk/debian/rules	2014-03-09 16:09:29 UTC (rev 28083)
@@ -15,6 +15,15 @@
 	set -e && for i in $(PY3VERS); do $${i} setup.py build; done
 
 override_dh_auto_install:
+	dh_install -ppython-cxx-dev CXX/*.hxx        /usr/include/CXX/;
+	dh_install -ppython-cxx-dev CXX/*.h          /usr/include/CXX/;
+	dh_install -ppython-cxx-dev CXX/Python2/*    /usr/include/CXX/Python2;
+	dh_install -ppython3-cxx-dev CXX/Python3/*   /usr/include/CXX/Python3;
+	dh_install -ppython-cxx-dev Src/*.c          /usr/src/CXX/;
+	dh_install -ppython-cxx-dev Src/*.cxx        /usr/src/CXX/;
+	dh_install -ppython-cxx-dev Src/Python2/*    /usr/src/CXX/Python2;
+	dh_install -ppython3-cxx-dev Src/Python3/*   /usr/src/CXX/Python3;
+	dh_install debian/PyCXX.pc /usr/lib/pkgconfig/
 	#should symlink to a common folder, but dh_link takes no wildcards
 	# and replacing folders symlinks in upgrades is problematic (policy 6.5)
 	# => wasting a little space preferable to more complex logic
@@ -31,7 +40,7 @@
 		dh_install -ppython-cxx-dev usr/lib/python2*/dist-packages/CXX/__init__.py; \
 	done
 	set -e && for i in $(PY3VERS); do \
-	  	$${i} setup.py install --force --root=$(CURDIR)/debian/tmp --no-compile -O0 --install-layout=deb; \
+		$${i} setup.py install --force --root=$(CURDIR)/debian/tmp --no-compile -O0 --install-layout=deb; \
 		2to3 -w -n $(CURDIR)/debian/tmp/usr/lib; \
 		python_inc_dir=$$(readlink -f /usr/include/$$i); \
 		abitag=$$($${i}-dbg -c "import sys; print(sys.abiflags)"); \

Modified: packages/pycxx/trunk/debian/tests/buildtest
===================================================================
--- packages/pycxx/trunk/debian/tests/buildtest	2014-03-09 14:17:30 UTC (rev 28082)
+++ packages/pycxx/trunk/debian/tests/buildtest	2014-03-09 16:09:29 UTC (rev 28083)
@@ -10,6 +10,7 @@
 cd examples
 
 for py in $pys; do
+
   export PYTHONPATH=$PWD/local/lib/$py/site-packages/CXX
   $py setup.py build 2>&1
   $py setup.py install --prefix=$PWD/local 2>&1
@@ -17,6 +18,16 @@
   $py-dbg setup.py build 2>&1
   $py-dbg setup.py install --prefix=$PWD/local 2>&1
   $py-dbg test_example.py 2>&1
+
+  # matplotlib install method
+  rm -rf $PYTHONPATH
+  $py -c "import CXX" 2>&1
+  CFLAGS="$(pkg-config --cflags PyCXX) $($py-config --cflags)"
+  SRC="$(pkg-config --variable=srcdir PyCXX)"
+
+  g++ -fPIC $CFLAGS simple.cxx $SRC/cxxextensions.c $SRC/cxx_extensions.cxx $SRC/cxxsupport.cxx \
+      $SRC/IndirectPythonInterface.cxx -shared -o simple.so 2>&1
+  $py test_simple.py 2>&1
 done
 cd ..
 
@@ -31,5 +42,14 @@
   $py-dbg setup.py build 2>&1
   $py-dbg setup.py install --prefix=$PWD/local 2>&1
   $py-dbg test_example.py 2>&1
+
+  rm -rf $PYTHONPATH
+  # matplotlib install method
+  $py -c "import CXX" 2>&1
+  CFLAGS="$(pkg-config --cflags PyCXX) $($py-config --cflags)"
+  SRC="$(pkg-config --variable=srcdir PyCXX)"
+
+  g++ -fPIC $CFLAGS simple.cxx $SRC/cxxextensions.c $SRC/cxx_extensions.cxx $SRC/cxxsupport.cxx \
+      $SRC/IndirectPythonInterface.cxx -shared -o simple.so 2>&1
+  $py test_simple.py 2>&1
 done
-

Modified: packages/pycxx/trunk/debian/tests/control
===================================================================
--- packages/pycxx/trunk/debian/tests/control	2014-03-09 14:17:30 UTC (rev 28082)
+++ packages/pycxx/trunk/debian/tests/control	2014-03-09 16:09:29 UTC (rev 28083)
@@ -1,2 +1,2 @@
 Tests: buildtest
-Depends: python-cxx-dev, python3-cxx-dev, g++, python-all-dev, python3-all-dev, python-all-dbg, python3-all-dbg
+Depends: pkg-config, build-essential, python-cxx-dev, python3-cxx-dev, python-all-dev, python3-all-dev, python-all-dbg, python3-all-dbg




More information about the Python-modules-commits mailing list