summaryrefslogtreecommitdiff
path: root/dev-python/gdmodule/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-python/gdmodule/files
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-python/gdmodule/files')
-rw-r--r--dev-python/gdmodule/files/gdmodule-0.56-fix-libs.patch116
1 files changed, 116 insertions, 0 deletions
diff --git a/dev-python/gdmodule/files/gdmodule-0.56-fix-libs.patch b/dev-python/gdmodule/files/gdmodule-0.56-fix-libs.patch
new file mode 100644
index 000000000000..bb46490986a9
--- /dev/null
+++ b/dev-python/gdmodule/files/gdmodule-0.56-fix-libs.patch
@@ -0,0 +1,116 @@
+--- Setup.py.orig 2005-03-11 04:29:59.000000000 +0000
++++ Setup.py 2010-12-06 07:15:26.332707178 +0000
+@@ -1,102 +1,11 @@
+ # Setup for gdmodule 0.50 and later
+
+ from distutils.core import setup, Extension
+-import os, glob, sys, string
+
+ # version of this gdmodule package
+ this_version = "0.56"
+
+-# directory existence tester
+-
+-def dirtest(lst):
+- rlst = []
+- for d in lst:
+- try:
+- if os.listdir(d):
+- rlst.append(d)
+- except:
+- pass
+- return rlst
+-
+-def filetest(path, names):
+- rlst = []
+- for d in path:
+- for i in range(len(names)):
+- found = glob.glob(os.path.join(d, "lib%s.*" % names[i]))
+- if found:
+- rlst.append(names[i])
+- names[i] = None
+- names = filter(None, names)
+- return rlst
+-
+-def remove(itm, lst):
+- r = range(len(lst))
+- r.reverse()
+- for i in r:
+- if lst[i] == itm:
+- del lst[i]
+-
+-# library_dirs option is rather non-portable, but since I am targetting
+-# Unixoid OS's I will just look for the usual suspects.
+-
+-libdirs = dirtest([
+- "/usr/local/lib", "/sw/lib", "/usr/lib",
+- "/usr/lib/X11", "/usr/X11R6/lib",
+- "/opt/gnome/lib",
+-])
+-
+-# include_dirs are also non-portable; same trick here.
+-
+-incdirs = dirtest([
+- "/usr/local/include", "/sw/include", "/usr/include",
+- "/usr/include/X11", "/usr/X11R6/include",
+- "/opt/gnome/include",
+-])
+-
+-# Try to identify our libraries
+-
+-want_libs = [
+- "gd",
+- "jpeg", "png", "gif", "z",
+- "X11", "Xpm",
+- "ttf", "freetype",
+-]
+-
+-libs = filetest(libdirs, want_libs)
+-
+-missing = []
+-
+-for l in want_libs:
+- if l and l not in libs:
+- missing.append(l)
+-
+-if missing:
+- print "WARNING: Missing", string.join(missing, ", "), "Libraries"
+-
+-# hand-clean the libs
+-
+-if "gd" not in libs:
+- print "Can't find GD library."
+- sys.exit(0)
+-
+-if "ttf" in libs and "freetype" in libs:
+- remove("ttf", libs)
+-
+-if "Xpm" in libs and "X11" not in libs:
+- remove("Xpm", libs)
+-
+-if "png" in libs and "z" not in libs:
+- remove("png", libs)
+-
+-if "z" in libs and "png" not in libs:
+- remove("png", libs)
+-
+-# build the macro list
+-
+-macros = []
+-
+-for l in libs:
+- macros.append(( "HAVE_LIB%s" % l.upper(), None ))
++libs = [ "gd" ]
+
+ # OK, now do it!
+
+@@ -111,8 +20,7 @@
+ py_modules=["gd"],
+ ext_modules=[
+ Extension("_gd", ["_gdmodule.c"],
+- include_dirs=incdirs, library_dirs=libdirs,
+- libraries=libs, define_macros=macros)],
++ libraries=libs)],
+ )
+
+ # end of file... I guess we're done.