Ticket #39510: Portfile.py-oursql-2.diff
File Portfile.py-oursql-2.diff, 4.1 KB (added by stevecheckoway (Stephen Checkoway), 11 years ago) |
---|
-
Portfile
old new 1 # $Id$ 1 # -*- 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 expandtab 2 # $Id: Portfile 91979 2012-04-14 11:33:24Z jmr@macports.org $ 2 3 3 4 PortSystem 1.0 4 5 PortGroup python 1.0 5 6 6 7 name py-oursql 7 version 0.9.28 8 categories python devel databases 9 maintainers gmail.com:habnabit9 maintainers nomaintainer 10 10 description Python driver for MySQL 11 11 long_description oursql is a set of MySQL bindings for python with a focus \ 12 12 on wrapping the MYSQL_STMT API to provide real \ 13 13 parameterization and real server-side cursors. 14 14 platforms darwin 15 15 homepage https://launchpad.net/oursql 16 master_sites http://launchpad.net/oursql/trunk/${version}/+download/ 16 if {${python.version} >= 30} { 17 version 0.9.3 18 master_sites http://launchpad.net/oursql/py3k/py3k-${version}/+download/ 19 checksums rmd160 259fb68bebf901cee83ffcadfbb17da0ff72be64 \ 20 sha256 778ccbd1cfc80cf22a2245cd63cf715348aa8bbcf1d45fb91b4aa0dd3744dd6f 21 dist_subdir ${name}-py3k 22 use_zip yes 23 patchfiles patch-oursqlx-oursql.pyx.diff \ 24 patch-oursqlx-oursql.c.diff 25 } else { 26 version 0.9.3.1 27 master_sites http://launchpad.net/oursql/trunk/${version}/+download/ 28 checksums rmd160 e38d9566acb3abe513e0cfe92a533f128410db2c \ 29 sha256 a6d8044591b2ecb859b8bf72a1c535d0b33bd249f7fecdbe63d2173855b568b7 30 use_zip yes 31 } 17 32 distname oursql-${version} 18 use_bzip2 yes19 checksums sha1 d3d82bc5f6bf646f37853020171fed48e9920d9e \20 rmd160 0f38d57b34ce5194c8ad5a9717e5cf3fe2dcd7af21 33 22 python.versions 26 27 34 python.versions 26 27 31 32 33 23 35 python.default_version 27 24 36 25 variant mysql4 conflicts mysql5 description {Build with MySQL 4} { 26 if {$subport != $name} { 27 depends_lib-append port:mysql4 28 build.env MYSQL_CONFIG=mysql_config4 29 } 30 } 37 if {$subport != $name} { 38 set mysql_variants {mysql5 mysql51 mysql55 mysql56 mariadb percona} 31 39 32 variant mysql5 conflicts mysql4 description {Build with MySQL 5} { 33 if {$subport != $name} { 34 depends_lib-append path:bin/mysql_config5:mysql5 35 build.env MYSQL_CONFIG=mysql_config5 40 proc desc {name} { 41 switch -regexp -matchvar matchlst $name { 42 mysql([0-9])([0-9])? { 43 if {[llength $matchlst] == 2} { 44 return "Build with MySQL [lindex $matchlst 1]" 45 } 46 return "Build with MySQL [lindex $matchlst 1].[lindex $matchlst 2]" 47 } 48 mariadb { return "Build with MariaDB" } 49 percona { return "Build with Percona" } 50 } 36 51 } 37 }38 52 39 if {![variant_isset mysql4]} { 40 default_variants +mysql5 41 } 53 for {set i 0} {$i < [llength $mysql_variants]} {incr i} { 54 set var [lindex $mysql_variants $i] 55 set confs [lreplace $mysql_variants $i $i] 56 set cmd [concat variant $var conflicts $confs description] 57 lappend cmd [description $var] " 58 depends_lib-append port:$var 59 build.env MYSQL_CONFIG=$prefix/lib/$var/bin/mysql_config 60 " 61 eval $cmd 62 } 42 63 43 pre-fetch { 44 if {![variant_isset mysql4] && ![variant_isset mysql5]} { 45 return -code error "you must select either mysql4 or mysql5" 64 proc mysql_variant_isset {variants} { 65 foreach var $variants { 66 if {[variant_isset $var]} { 67 return true 68 } 69 } 70 return false 71 } 72 73 if ![mysql_variant_isset $mysql_variants] { 74 default_variants +mysql5 75 } 76 77 pre-fetch { 78 if ![mysql_variant_isset $mysql_variants] { 79 return -code error "You must select one of the following variants: $mysql_variants" 80 } 46 81 } 47 82 }