Ticket #12624: trac-12624.patch

File trac-12624.patch, 3.8 KB (added by Snark, 8 years ago)

The promised patch for multiarch support

  • SPKG.txt

    # HG changeset patch
    # User Julien Puydt <julien.puydt@laposte.net>
    # Date 1330756823 -3600
    # Node ID bd7171f038f5117ac690b8a974f1de494bc8c7ed
    # Parent  f6c1b095cb85bfa7922069c44c83627dba249977
    Added support for debian multiarch
    
    diff -r f6c1b095cb85 -r bd7171f038f5 SPKG.txt
    a b  
    2525
    2626== Special Update/Build Instructions ==
    2727
     28 * debian-multiarch.patch (already applied to patches/Setup.py): adds support for multi-arch on debian-based distributions
     29
    2830 * Patch Setup.py: we link against libpng12 instead of libpng. There are also changes to the library handling on Cygwin, so this might need to be fixed.
    2931
    3032== Changelog ==
  • patches/Setup.py

    diff -r f6c1b095cb85 -r bd7171f038f5 patches/Setup.py
    a b  
    11# Setup for gdmodule 0.50 and later
    22
    33from distutils.core import setup, Extension
    4 import os, glob, sys, string
     4from distutils.spawn import find_executable
     5import os, glob, sys, string, subprocess
    56
    67# version of this gdmodule package
    78this_version = "0.56"
     
    3637        if lst[i] == itm:
    3738            del lst[i]
    3839
     40# Add multiarch paths
     41
     42mult_lib = []
     43mult_inc = []
     44
     45if find_executable('dpkg-architecture'):
     46    cmd = subprocess.Popen('dpkg-architecture -qDEB_HOST_MULTIARCH'.split(),
     47                           stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
     48    stdout, stderr = cmd.communicate()
     49    multiarch_path_component = stdout.strip()
     50    mult_lib = ['/usr/lib/'+multiarch_path_component]
     51    mult_inc = ['/usr/include/'+multiarch_path_component]
     52
    3953# library_dirs option is rather non-portable, but since I am targetting
    4054# Unixoid OS's I will just look for the usual suspects.
    4155
     
    4458    "/usr/local/lib", "/sw/lib", "/usr/lib",
    4559    "/usr/lib/X11", "/usr/X11R6/lib",
    4660    "/opt/gnome/lib",
    47 ])
     61]+mult_lib)
    4862
    4963
    5064# include_dirs are also non-portable; same trick here.
     
    5468    "/usr/local/include", "/sw/include", "/usr/include",
    5569    "/usr/include/X11", "/usr/X11R6/include",
    5670    "/opt/gnome/include",
    57 ])
     71]+mult_inc)
    5872
    5973# Try to identify our libraries
    6074
  • new file patches/debian-multiarch.patch

    diff -r f6c1b095cb85 -r bd7171f038f5 patches/debian-multiarch.patch
    - +  
     1--- Setup.py    2012-03-03 07:32:57.000000000 +0100
     2+++ Setup.py    2012-03-03 07:38:59.000000000 +0100
     3@@ -1,7 +1,8 @@
     4 # Setup for gdmodule 0.50 and later
     5 
     6 from distutils.core import setup, Extension
     7-import os, glob, sys, string
     8+from distutils.spawn import find_executable
     9+import os, glob, sys, string, subprocess
     10 
     11 # version of this gdmodule package
     12 this_version = "0.56"
     13@@ -36,6 +37,19 @@
     14         if lst[i] == itm:
     15             del lst[i]
     16 
     17+# Add multiarch paths
     18+
     19+mult_lib = []
     20+mult_inc = []
     21+
     22+if find_executable('dpkg-architecture'):
     23+    cmd = subprocess.Popen('dpkg-architecture -qDEB_HOST_MULTIARCH'.split(),
     24+                           stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
     25+    stdout, stderr = cmd.communicate()
     26+    multiarch_path_component = stdout.strip()
     27+    mult_lib = ['/usr/lib/'+multiarch_path_component]
     28+    mult_inc = ['/usr/include/'+multiarch_path_component]
     29+
     30 # library_dirs option is rather non-portable, but since I am targetting
     31 # Unixoid OS's I will just look for the usual suspects.
     32 
     33@@ -44,7 +58,7 @@
     34     "/usr/local/lib", "/sw/lib", "/usr/lib",
     35     "/usr/lib/X11", "/usr/X11R6/lib",
     36     "/opt/gnome/lib",
     37-])
     38+]+mult_lib)
     39 
     40 
     41 # include_dirs are also non-portable; same trick here.
     42@@ -54,7 +68,7 @@
     43     "/usr/local/include", "/sw/include", "/usr/include",
     44     "/usr/include/X11", "/usr/X11R6/include",
     45     "/opt/gnome/include",
     46-])
     47+]+mult_inc)
     48 
     49 # Try to identify our libraries
     50