Ticket #32518: patch-subport-py-mysql.idff

File patch-subport-py-mysql.idff, 5.0 KB (added by pixilla (Bradley Giesbrecht), 13 years ago)
Line 
1Index: python/py-mysql/files/patch-site.cfg.diff
2===================================================================
3--- python/py-mysql/files/patch-site.cfg.diff   (revision 0)
4+++ python/py-mysql/files/patch-site.cfg.diff   (working copy)
5@@ -0,0 +1,11 @@
6+--- a/site.cfg 2011-12-12 12:05:40.000000000 -0800
7++++ b/site.cfg 2011-12-12 12:14:01.000000000 -0800
8+@@ -10,7 +10,7 @@
9+ # The path to mysql_config.
10+ # Only use this if mysql_config is not on your PATH, or you have some weird
11+ # setup that requires it.
12+-#mysql_config = /usr/local/bin/mysql_config
13++mysql_config = @PREFIX@/bin/mysql_config@MYSQL_SUFFIX@
14+
15+ # The Windows registry key for MySQL.
16+ # This has to be set for Windows builds to work.
17Index: python/py-mysql/files/patch-_mysql.c.diff
18===================================================================
19--- python/py-mysql/files/patch-_mysql.c.diff   (revision 87917)
20+++ python/py-mysql/files/patch-_mysql.c.diff   (working copy)
21@@ -1,23 +0,0 @@
22---- _mysql.c.orig      2007-02-27 18:35:56.000000000 -0800
23-+++ _mysql.c   2007-11-25 21:54:09.000000000 -0800
24-@@ -34,9 +34,6 @@
25- #else
26- #include "my_config.h"
27- #endif
28--#ifndef uint
29--#define uint unsigned int
30--#endif
31- #include "mysql.h"
32- #include "mysqld_error.h"
33- #include "errmsg.h"
34-@@ -481,8 +478,8 @@
35- #endif
36-       char *host = NULL, *user = NULL, *passwd = NULL,
37-               *db = NULL, *unix_socket = NULL;
38--      uint port = MYSQL_PORT;
39--      uint client_flag = 0;
40-+      unsigned int port = MYSQL_PORT;
41-+      unsigned int client_flag = 0;
42-       static char *kwlist[] = { "host", "user", "passwd", "db", "port",
43-                                 "unix_socket", "conv",
44-                                 "connect_timeout", "compress",
45Index: python/py-mysql/files/patch-setup_posix.py.diff
46===================================================================
47--- python/py-mysql/files/patch-setup_posix.py.diff     (revision 87917)
48+++ python/py-mysql/files/patch-setup_posix.py.diff     (working copy)
49@@ -1,11 +0,0 @@
50---- setup_posix.py.orig        2007-05-06 12:30:17.000000000 -0700
51-+++ setup_posix.py     2007-05-06 12:31:30.000000000 -0700
52-@@ -23,7 +23,7 @@
53-         if ret/256 > 1:
54-             raise EnvironmentError, "%s not found" % mysql_config.path
55-     return data
56--mysql_config.path = "mysql_config"
57-+mysql_config.path = "mysql_config5"
58-
59- def get_config():
60-     import os, sys
61Index: python/py-mysql/Portfile
62===================================================================
63--- python/py-mysql/Portfile    (revision 87917)
64+++ python/py-mysql/Portfile    (working copy)
65@@ -1,39 +1,65 @@
66+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
67 # $Id$
68 
69-PortSystem 1.0
70-PortGroup python24 1.0
71+PortSystem          1.0
72+PortGroup           python 1.0
73 
74 name                           py-mysql
75-version                                1.2.2
76+version             1.2.3
77 categories                     python devel databases
78-maintainers                    wilcoxd.com:rwilcox
79 description                    Python interface to mysql
80 long_description       A package containing a Python module that allows you to \
81-                                       connect to MySQL databases
82-platforms                      darwin
83+                    connect to MySQL databases
84 homepage                       http://sourceforge.net/projects/mysql-python/
85 master_sites           sourceforge:mysql-python
86+platforms                      darwin
87+license             GPL
88+maintainers                    wilcoxd.com:rwilcox openmaintainer
89+
90 distname                       MySQL-python-${version}
91-checksums                      md5 532268f02870bea18c1d465e88afff30
92-patchfiles                     patch-_mysql.c.diff
93 
94-depends_lib-append     port:py24-distribute
95+checksums           rmd160  e394e7bf08127068795aeebfbaea7dc3b2127c86 \
96+                    sha256  7de66fbbf923634e7c965aeaefa74642ba75ae20ee1cefcefc3009595b7a7e6e
97 
98+patch.pre_args      -p1
99+patchfiles          patch-site.cfg.diff
100+
101+python.versions     24 25 26 27
102+python.default_version 27
103+
104+pre-fetch {
105+    if {![variant_isset mysql4] && ![variant_isset mysql5]} {
106+        return -code error "you must select either mysql4 or mysql5"
107+    }
108+}
109+
110+if {$subport != $name} {
111+    depends_lib-append port:py${python.version}-distribute
112+    post-patch {
113+    reinplace "s|@PREFIX@|${prefix}|g" \
114+        ${worksrcpath}/site.cfg
115+    reinplace "s|@MYSQL_SUFFIX@|${mysql_suffix}|g" \
116+        ${worksrcpath}/site.cfg
117+    }
118+    post-destroot {
119+        xinstall -m 755 -d ${destroot}${prefix}/share/doc/${subport}
120+        xinstall -m 644 -W ${worksrcpath} \
121+            HISTORY README \
122+            ${destroot}${prefix}/share/doc/${subport}
123+    }
124+    livecheck.type      none
125+}
126+
127 variant mysql4 conflicts mysql5 description {Build with MySQL 4} {
128-       depends_lib-append      port:mysql4
129+depends_lib-append     port:mysql4
130 }
131 
132 variant mysql5 conflicts mysql4 description {Build with MySQL 5} {
133-       patchfiles-append       patch-setup_posix.py.diff
134-       depends_lib-append      path:bin/mysql_config5:mysql5
135+depends_lib-append     path:bin/mysql_config5:mysql5
136 }
137 
138+set mysql_suffix    {}
139 if {![variant_isset mysql4]} {
140-       default_variants +mysql5
141+set mysql_suffix 5
142+default_variants +mysql5
143 }
144-
145-pre-fetch {
146-       if {![variant_isset mysql4] && ![variant_isset mysql5]} {
147-               return -code error "you must select either mysql4 or mysql5"
148-       }
149-}