source: trunk/dports/math/octave-database/Portfile @ 135941

Last change on this file since 135941 was 135941, checked in by michaelld@…, 5 years ago

octave-database:
+ remove variants for legacy postgresql 8.[0-2], since they are not necessary;
+ add variant for postgresql 9.4, since it is supported.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.2 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
2# $Id: Portfile 135941 2015-05-07 15:50:49Z michaelld@macports.org $
3
4PortSystem          1.0
5PortGroup           octave 1.0
6
7octave.setup        database 2.3.2
8platforms           darwin
9license             GPL-3+
10maintainers         nomaintainer
11description         Interface to SQL databases, currently only \
12                    postgresql using libpq.
13long_description    ${description}
14
15checksums           rmd160 e0e58800e9f9906ef89afff7526bd70f608de713 \
16                    sha256 922e9c298da92f3ac9596ec4fb0db2acc0f5270aa707b67f0151c2529f658d79
17
18depends_lib-append  port:swig-octave \
19                    path:bin/mysql_config5:mysql5 \
20                    port:sqlite3 \
21                    port:unixODBC
22
23# set postgresql variants
24# versions < 8.3 removed as of 2.3.2.
25
26set postgresql_suffixes {83 84 90 91 92 93 94}
27set default_postgresql_suffix 92
28
29set postgresql_ports {}
30set postgresql_variants {}
31foreach s ${postgresql_suffixes} {
32    lappend postgresql_ports postgresql${s}
33    set postgresql_variants "${postgresql_variants} && !\[variant_isset postgresql${s}\]"
34}
35
36set postgresql_variants [string trimleft ${postgresql_variants} " && "]
37
38foreach s ${postgresql_suffixes} {
39    set p postgresql${s}
40    set v [join [split ${s} ""] "."]
41    set i [lsearch -exact ${postgresql_ports} ${p}]
42    set c [lreplace ${postgresql_ports} ${i} ${i}]
43    eval [subst {
44        variant ${p} description "Build ${name} using postgresql ${v}" \
45            conflicts ${c} {
46
47                depends_lib-append \
48                    port:postgresql${s}
49                configure.env \
50                    PATH=${prefix}/lib/postgresql${s}/bin:$env(PATH)
51
52            }
53    }]
54}
55
56eval [subst {
57    # postgresql is required; default to ${default_postgresql_suffix}.
58
59    if {${postgresql_variants}} {
60        default_variants +postgresql${default_postgresql_suffix}
61    }
62
63    # Make sure -postgresql${default_postgresql_suffix}
64    # was not specified alone
65
66    if {${postgresql_variants}} {
67        ui_error "${name} requires a postgresql to be selected; you cannot use -postgresql${default_postgresql_suffix} as a variant alone."
68        return -code error "Invalid variant selection"
69    }
70}]
Note: See TracBrowser for help on using the repository browser.