Package: sip4-qt3
Version: 4.9-1
Severity: important
Tags: patch
User: debian-h...@lists.debian.org
Usertags: hurd

Hi,

currently[1] (the log refers to 4.8, but the error is the same) sip4-qt3 fails
to build on GNU/Hurd.

Basically, the problem lies in the patch 02 (siputils): one addition of it is
+                except OSError, e:
+                    if e.errno != 17:
+                        raise e
which means relying on the particular value (implementation dependent) of the
EEXIST errno. This is the same on Linux and kFreeBSD, but not on Hurd.
The easy fix is to use the errno Python module and its EEXIST constant.
The result is a compiling sip4-qt3 on GNU/Hurd and on current amd64 testing as
well.
Attached there is the fixed version of the patch 02_siputils.dpatch.

[1] 
http://buildd.debian-ports.org/fetch.php?&pkg=sip4-qt3&ver=4.8.2-1&arch=hurd-i386&stamp=1251535074&file=log&as=raw

Thanks,
-- 
Pino
#! /bin/sh /usr/share/dpatch/dpatch-run
## 02_siputils.dpatch by Torsten Marek <shlo...@debian.org>
##
## DP: Patch for siputils.py adding objectdir support

@DPATCH@
diff -urNad sip4-qt3-4.9~/siputils.py sip4-qt3-4.9/siputils.py
--- sip4-qt3-4.9~/siputils.py	2009-09-26 11:14:30.000000000 -0400
+++ sip4-qt3-4.9/siputils.py	2009-10-06 14:12:44.668507206 -0400
@@ -203,7 +203,7 @@
     def __init__(self, configuration, console=0, qt=0, opengl=0, python=0,
                  threaded=0, warnings=1, debug=0, dir=None,
                  makefile="Makefile", installs=None, universal=None,
-                 arch=None):
+                 topsrcdir=None, arch=None):
         """Initialise an instance of the target.  All the macros are left
         unchanged allowing scripts to manipulate them at will.
 
@@ -253,7 +253,14 @@
         self._python = python
         self._warnings = warnings
         self._debug = debug
-        self._dir = dir
+        if topsrcdir is not None:
+            self._dir = os.path.join(topsrcdir, dir)
+            self._objdir = dir
+            self._has_objdir = True
+        else:
+            self._dir = dir
+            self._has_objdir = False
+
         self._makefile = makefile
         self._installs = installs
 
@@ -323,6 +330,13 @@
         self.chkdir = self.optional_string("CHK_DIR_EXISTS", def_chk_dir_exists)
 
 
+    def srcPath(self, path):
+        if self._has_objdir:
+            return os.path.join(self._dir, path)
+        else:
+            return path
+
+
     def finalise(self):
         """Finalise the macros by doing any consolidation that isn't specific
         to a Makefile.
@@ -801,6 +815,10 @@
 
         rpaths is the cannonical list of rpaths.
         """
+        # Do not use any rpaths on Debian
+        # Changed by Torsten Marek <shlo...@gmx.net>
+        return []
+    
         flags = []
         prefix = self.optional_string("RPATH")
 
@@ -832,6 +850,15 @@
         clib is the library name in cannonical form.
         framework is set of the library is implemented as a MacOS framework.
         """
+        ##################################################################
+        # Generally, the linker is intelligent enough not to need this   #
+        # additional information!                                        #
+        # And Qt4's pkg-config and prl files are broken                  #
+        # Changed for Debian packaging, Torsten Marek <shlo...@gmx.net>  #
+        ##################################################################
+
+        return []
+        
         prl_libs = []
 
         if self.generator in ("MSVC", "MSVC.NET", "BMAKE"):
@@ -969,7 +996,10 @@
         self.ready()
 
         if self._dir:
-            mfname = os.path.join(self._dir, self._makefile)
+            if self._has_objdir:
+                mfname = os.path.join(self._objdir, self._makefile)
+            else:
+                mfname = os.path.join(self._dir, self._makefile)
         else:
             mfname = self._makefile
 
@@ -987,6 +1017,8 @@
                 self._installs = [self._installs]
 
             for src, dst in self._installs:
+                if self._dir is not None and self._has_objdir:
+                    src = [os.path.join(self._dir, sf) for sf in src]
                 self.install_file(mfile, src, dst)
 
         self.generate_target_clean(mfile)
@@ -1049,6 +1081,9 @@
         else:
             mfile.write(".SUFFIXES: .c .cpp .cc .cxx .C\n\n")
 
+        if self._has_objdir:
+            mfile.write("VPATH = %s\n\n" % (self._dir))
+            
         if self.generator in ("MSVC", "MSVC.NET"):
             mfile.write("""
 {.}.cpp{}.obj::
@@ -1175,14 +1210,14 @@
     """The class that represents a parent Makefile.
     """
     def __init__(self, configuration, subdirs, dir=None, makefile="Makefile",
-                 installs=None):
+                 installs=None, has_objdir=False):
         """Initialise an instance of a parent Makefile.
 
         subdirs is the sequence of subdirectories.
         """
         Makefile.__init__(self, configuration, dir=dir, makefile=makefile, installs=installs)
-
         self._subdirs = subdirs
+        self._has_objdir = has_objdir
 
     def generate_macros_and_rules(self, mfile):
         """Generate the macros and rules.
@@ -1227,6 +1262,13 @@
         mfile.write("\n" + target + ":\n")
 
         for d in self._subdirs:
+            if self._has_objdir:
+                try:
+                    os.mkdir(d)
+                except OSError, e:
+                    import errno
+                    if e.errno != errno.EEXIST:
+                        raise e
             if self.generator == "MINGW":
                 mfile.write("\...@$(MAKE) -C %s%s\n" % (d, tname))
             elif self.generator == "UNIX":
@@ -1303,7 +1345,7 @@
     def __init__(self, configuration, build_file, install_dir=None, static=0,
                  console=0, qt=0, opengl=0, threaded=0, warnings=1, debug=0,
                  dir=None, makefile="Makefile", installs=None, strip=1,
-                 export_all=0, universal=None, arch=None):
+                 export_all=0, topsrcdir=None, universal=None, arch=None):
         """Initialise an instance of a module Makefile.
 
         build_file is the file containing the target specific information.  If
@@ -1317,11 +1358,10 @@
         increases the size of the module and slows down module load times but
         may avoid problems with modules that use exceptions.  The default is 0.
         """
-        Makefile.__init__(self, configuration, console, qt, opengl, 1, threaded, warnings, debug, dir, makefile, installs, universal, arch)
+        Makefile.__init__(self, configuration, console, qt, opengl, 1, threaded, warnings, debug, dir, makefile, installs, universal, topsrcdir, arch)
 
         self._build = self.parse_build_file(build_file)
         self._install_dir = install_dir
-        self._dir = dir
         self.static = static
 
         self._manifest = ("embed_manifest_dll" in self.optional_list("CONFIG"))
@@ -1522,7 +1563,7 @@
             cpp = "moc_" + root + ".cpp"
 
             mfile.write("\n%s: %s\n" % (cpp, mf))
-            mfile.write("\t$(MOC) -o %s %s\n" % (cpp, mf))
+            mfile.write("\t$(MOC) -o %s %s\n" % (cpp, self.srcPath(mf)))
 
         mfile.write("\n$(TARGET): $(OFILES)\n")
 
@@ -1634,14 +1675,14 @@
     def __init__(self, configuration, build_file=None, install_dir=None,
                  console=0, qt=0, opengl=0, python=0, threaded=0, warnings=1,
                  debug=0, dir=None, makefile="Makefile", installs=None,
-                 universal=None, arch=None):
+                 topsrcdir=None, universal=None, arch=None):
         """Initialise an instance of a program Makefile.
 
         build_file is the file containing the target specific information.  If
         it is a dictionary instead then its contents are validated.
         install_dir is the directory the target will be installed in.
         """
-        Makefile.__init__(self, configuration, console, qt, opengl, python, threaded, warnings, debug, dir, makefile, installs, universal, arch)
+        Makefile.__init__(self, configuration, console, qt, opengl, python, threaded, warnings, debug, dir, makefile, installs, universal, topsrcdir, arch)
 
         self._install_dir = install_dir
 
@@ -1792,7 +1833,7 @@
             cpp = "moc_" + root + ".cpp"
 
             mfile.write("\n%s: %s\n" % (cpp, mf))
-            mfile.write("\t$(MOC) -o %s %s\n" % (cpp, mf))
+            mfile.write("\t$(MOC) -o %s %s\n" % (cpp, self.srcPath(mf)))
 
         mfile.write("\n$(TARGET): $(OFILES)\n")
 
_______________________________________________
Python-modules-team mailing list
Python-modules-team@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/python-modules-team

Reply via email to