[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Package for multiple Python versions



On 07/22/2011 09:57 AM, Mitar wrote:
> I now saw that my Orange package is build just for Python 2.6.
> 
> http://orange.biolab.si/debian/dists/squeeze/main/source/
> 
> How can I make it be build also for 2.7?

  1. Get a list of requested Python versions with pyversions(1)
  2. Perform build with each of the requested Python versions

Ad 1: You're using pyversions already, but only to get the default
Python version. Use -vr instead of -vd to get a list of requested Python
versions.

Ad 2: I'm not entirely clear on the structure of your program or how the
build process works -- there's a setup.py, but in debian/rules you
build/install manually -- but something like this should work:

debian/rules
============
build:
	# Get the supported Python versions
	PYVERS = $(shell pyversions -r -v)

	set -e -x;\
	for py in $(PYVERS); do \
                PYTHON=python$$py make -C source;
        done

source/*/Makefile:
=========
Substitute python with $(PYTHON) where appropriate


Again, I didn't look into your build process in detail, so adjust the
above to your needs. For example, the above really performs the entire
build process twice. If Python is involved in only a subset of the
steps, it would be better to iterate there instead.


Christian


Reply to: