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

Re: RFH: python-support and arch dependant file



On (03/09/06 12:13), James Westby wrote:
> On Sun, 03 Sep 2006 05:16:13 +0200
> "Adam Cécile (Le_Vert)" <gandalf@le-vert.net> wrote:
> 
> > Hi,
> > 
> > I'm working on Museek+ packaging and I have a problem.
> > There is an arch dependent file in python-museekd (mucipher.so) and it
> > should be built for python2.4 and 2.3.
> > 
> > But the package doesn't include a python 2.3 version of the file and
> > dependency is set to python >=2.4...
> > 
> 
> See the last section of /usr/share/doc/python-support/README.gz for
> details of how to handle public extensions. 
> 
> The difficulty is that the package build uses scons, and so it is hard
> to follow the instructions there. 
> 

Ok, so the trick is to modify the SConscripts of the relevant packages
to build for more than just the default python version.

Tha attached patch does this. You might wat to think about using
pyversions -s -v to make the patch handle new versions as well.

James

-- 
  James Westby   --    GPG Key ID: B577FE13    --     http://jameswestby.net/
  seccure key - (3+)k7|M*edCX/.A:n*N!>|&7U.L#9E)Tu)T0>AM - secp256r1/nistp256
only in patch2:
unchanged:
--- museek+-0.1.11.orig/pymuseekd/museek/SConscript
+++ museek+-0.1.11/pymuseekd/museek/SConscript
@@ -13,9 +13,12 @@
 """)
 
 import sys, os
-py_ver = str(sys.version_info[0]) + "." + str(sys.version_info[1])
-py_dest = env['DESTDIR'] + os.path.join(sys.prefix, "lib", "python" + py_ver, "site-packages", "museek")
+py_vers = ["2.3", "2.4"]
 
-install = env.Install(py_dest, files)
-env.Alias('install_pymuseekd', install)
-env.Alias('install', 'install_pymuseekd')
+for py_ver in py_vers:
+
+  py_dest = env['DESTDIR'] + os.path.join(sys.prefix, "lib", "python" + py_ver, "site-packages", "museek")
+
+  install = env.Install(py_dest, files)
+  env.Alias('install_pymuseekd', install)
+  env.Alias('install', 'install_pymuseekd')
only in patch2:
unchanged:
--- museek+-0.1.11.orig/Mucipher/python/SConscript
+++ museek+-0.1.11/Mucipher/python/SConscript
@@ -11,28 +11,30 @@
 def file_copy(target, source, env):
     open(str(target[0]), "w").write(open(str(source[0])).read())
 
-py_ver = str(sys.version_info[0]) + "." + str(sys.version_info[1])
-py_inc = os.path.join(sys.prefix, "include", "python" + py_ver)
+py_vers = ["2.3", "2.4"]
 
-if os.path.exists(os.path.join(py_inc, "Python.h")):
-    env_swigpy = Environment(tools = ['default', 'swig'])
-    env_swigpy.SConsignFile()
-    
-    env_swigpy.Append(CPPPATH = env['CPPPATH'] + [py_inc])
-    env_swigpy.Append(LIBPATH = env['LIBPATH_MUCIPHER'])
-    env_swigpy.Append(LIBS = ['ucipher'])
-    env_swigpy.Replace(SHLIBPREFIX='')
-
-    env_swigpy.Command("mucipher.i", "../mucipher.i", file_copy)
-    env_swigpy.Command("wraphelp.c", "../wraphelp.c", file_copy)
-
-    mucipherc = env_swigpy.SharedLibrary('_mucipherc', sources, SWIGFLAGS='-python')
-
-    py_dest = env['DESTDIR'] + os.path.join(sys.prefix, "lib", "python" + py_ver, "site-packages")
-
-    install = env.Install(py_dest, source = [ mucipherc, 'mucipherc.py',  'mucipher.py'])
-
-    env.Alias('install_mucipher',  install)
-    env.Alias('install', 'install_mucipher')
-else:
-	print "WARNING: Python.h include not found, please install Python's development packages"
+for py_ver in py_vers:
+  py_inc = os.path.join(sys.prefix, "include", "python" + py_ver)
+
+  if os.path.exists(os.path.join(py_inc, "Python.h")):
+      env_swigpy = Environment(tools = ['default', 'swig'])
+      env_swigpy.SConsignFile()
+      
+      env_swigpy.Append(CPPPATH = env['CPPPATH'] + [py_inc])
+      env_swigpy.Append(LIBPATH = env['LIBPATH_MUCIPHER'])
+      env_swigpy.Append(LIBS = ['ucipher'])
+      env_swigpy.Replace(SHLIBPREFIX='')
+
+      env_swigpy.Command("mucipher.i", "../mucipher.i", file_copy)
+      env_swigpy.Command("wraphelp.c", "../wraphelp.c", file_copy)
+
+      mucipherc = env_swigpy.SharedLibrary('_mucipherc', sources, SWIGFLAGS='-python')
+
+      py_dest = env['DESTDIR'] + os.path.join(sys.prefix, "lib", "python" + py_ver, "site-packages")
+
+      install = env.Install(py_dest, source = [ mucipherc, 'mucipherc.py',  'mucipher.py'])
+
+      env.Alias('install_mucipher',  install)
+      env.Alias('install', 'install_mucipher')
+  else:
+    print "WARNING: Python.h include not found, please install Python's development packages"
only in patch2:
unchanged:
--- museek+-0.1.11.orig/mucous/pymucous/SConscript
+++ museek+-0.1.11/mucous/pymucous/SConscript
@@ -7,9 +7,12 @@
 """)
 
 import sys, os
-py_ver = str(sys.version_info[0]) + "." + str(sys.version_info[1])
-py_dest = env['DESTDIR'] + os.path.join(sys.prefix, "lib", "python" + py_ver, "site-packages", "pymucous")
+py_vers = ["2.3", "2.4"]
 
-install = env.Install(py_dest, files)
-env.Alias('install_mucous', install)
-env.Alias('install', 'install_mucous')
+for py_ver in py_vers:
+
+  py_dest = env['DESTDIR'] + os.path.join(sys.prefix, "lib", "python" + py_ver, "site-packages", "pymucous")
+
+  install = env.Install(py_dest, files)
+  env.Alias('install_mucous', install)
+  env.Alias('install', 'install_mucous')

Attachment: signature.asc
Description: Digital signature


Reply to: