source: trunk/dports/databases/db46/Portfile

Last change on this file was 138309, checked in by jmr@…, 2 years ago

Make db_select into a stub that just cleans up the symlinks it formerly enabled, because actually using it caused breakage. (#47921) No rev bumps for db46 and db48; reinstalling them is neither necessary nor sufficient to fix the problem.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.9 KB
Line 
1# $Id: Portfile 138309 2015-07-05 13:03:32Z ryandesign@macports.org $
2
3PortSystem 1.0
4PortGroup  muniversal 1.0
5
6name            db46
7version         4.6.21
8#subport db46-java revision has been bumped, reset it on next version update
9revision        10
10set branch      [join [lrange [split ${version} .] 0 1] {}]
11categories      databases
12license         Sleepycat
13maintainers     blair openmaintainer
14platforms       darwin
15description     The Berkeley DB package, version 4.6
16long_description \
17    Version 4.6 of the Berkeley Data Base library which \
18    offers (key/value) storage with optional concurrent \
19    access or transactions interface.  This port will \
20    install the AES (American Encryption Standard) \
21    enabled version.
22
23homepage        http://www.oracle.com/us/products/database/berkeley-db/db/overview/index.html
24master_sites    http://download.oracle.com/berkeley-db/
25patch_sites     http://download.oracle.com/berkeley-db/patches/db/${version}/
26patchfiles      patch.${version}.1 \
27                patch.${version}.2 \
28                patch.${version}.3 \
29                patch.${version}.4
30
31distname        db-${version}
32dist_subdir     db4/${version}_6
33checksums       ${distname}${extract.suffix} \
34                md5     718082e7e35fc48478a2334b0bc4cd11 \
35                sha1    5be3beb82e42a78ff671a3f5a4c30e5652972119 \
36                rmd160  ccf9a4b85cc0464b2f3c2f2da29d99328fd4978e \
37                patch.${version}.1 \
38                md5     4878872edfc53c6ecb871b1062a4bdaf \
39                sha1    c7c155705687e4de03d06c2ea86940f573fdac0b \
40                rmd160  8c11e9b991ac6559f22ece2d93617b16126049e8 \
41                patch.${version}.2 \
42                md5     55074e53d3acae2dcbeae8322f96e522 \
43                sha1    a694b71088ba99b74042e7568f395fe467bb6590 \
44                rmd160  f8abf554552db668037e046dea54700ce3340bf8 \
45                patch.${version}.3 \
46                md5     7a6e11b54712caf752f9c4a52babe60c \
47                sha1    d52aa498943cfaa339ad6bf2cf7b836a40627701 \
48                rmd160  4e6b7ed1e1c69cba54351d76a0b8543107a655b8 \
49                patch.${version}.4 \
50                md5     ae7d3d587355fe85b512ef09b9a77d19 \
51                sha1    e2190185c667edb97e800495ce6eb4f95f43eb87 \
52                rmd160  f1d18e59c311fb4e1f00a3b6220269fca17df312
53
54# Generate libtool that understands -stdlib.
55use_autoreconf          yes
56autoreconf.dir          ${worksrcpath}/dist
57autoreconf.cmd          ${autoreconf.dir}/s_config
58autoreconf.args         --force --verbose --install \
59                        --include=${prefix}/share/aclocal \
60                        --include=${autoreconf.dir}/aclocal \
61                        --include=${autoreconf.dir}/aclocal_java \
62patchfiles-append       autoreconf-fix.patch
63depends_build-append    port:autoconf port:automake port:libtool
64
65configure.dir   ${worksrcpath}/build_unix
66build.dir       ${configure.dir}
67
68configure.cmd   ${worksrcpath}/dist/configure
69configure.args  --enable-cxx \
70                --includedir=\\\${prefix}/include/db${branch} \
71                --libdir=\\\${prefix}/lib/db${branch} \
72                --enable-dump185
73
74set cxx_stdlibflags {}
75if {[string match *clang* ${configure.cxx}]} {
76    set cxx_stdlibflags -stdlib=${configure.cxx_stdlib}
77}
78configure.cxx ${configure.cxx} ${cxx_stdlibflags}
79
80destroot.args-append \
81    docdir=${prefix}/share/doc/${name}
82
83pre-extract {
84    if {[file exists "/usr/local/include/db.h"]} {
85            ui_error "You have a conflicting install of Berkeley DB in /usr/local, please move it aside before building ${name}"
86            return -code error "Berkeley DB in /usr/local is in the way"
87    }
88}
89
90subport ${name}-java {
91    revision 10
92    depends_lib-append      port:${name}
93
94    # Compile BerkeleyDB's Java bindings with Java 1.5 as this is the
95    # oldest version of Java that the bindings are known to compile
96    # with.  This is done because ports that depend upon db46-java may
97    # be compiled with Apache Ant and Ant explicitly sets JAVA_HOME to
98    # /System/Library/Frameworks/JavaVM.framework/Home if JAVA_HOME is
99    # not already set.  If Oracle's JDK 7 is installed on the Mac and
100    # is set as the default Java version, then when BerkeleyDB's Java
101    # bindings are compiled the *.class files will be a newer format
102    # then the older Java in $JAVA_HOME can read.  So just compile
103    # BerkeleyDB with the oldest version of Java that can compile it.
104    # There is no harm in doing so as at application run time newer
105    # JVMs can read older class files and optimize them as if they
106    # were compiled with a newer version of Java.  The only
107    # performance loss may be a slightly longer class loading time,
108    # which is optimized in newer versions of Java.
109    configure.env   JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home
110    configure.args-append   --enable-java
111
112    build.env       JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home
113
114    platform macosx {
115        pre-configure {
116            if {![file isfile "/System/Library/Frameworks/JavaVM.framework/Headers/jni.h"]} {
117                ui_error "${subport} requires the Java for Mac OS X development headers."
118                if {${os.major} == 10} {
119                    ui_error "Download the Java Developer Package from: <https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20719>"
120                } elseif {${os.major} == 9} {
121                    ui_error "Download the Java Developer Package from: <https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20720>"
122                } else {
123                    ui_error "Make sure your Xcode installation is complete."
124                }
125                return -code error "missing Java headers"
126            }
127        }
128    }
129}
130
131if {$subport == $name} {
132
133    post-destroot {
134        foreach bin [glob -tails -directory ${destroot}${prefix}/bin/ db_*] {
135            set newbin [regsub {^db_} ${bin} "db${branch}_"]
136            move ${destroot}${prefix}/bin/${bin} \
137                ${destroot}${prefix}/bin/${newbin}
138        }
139
140        delete ${destroot}${prefix}/share/doc/${name}/java
141    }
142
143    # Delete this variant on or after 2013-10-08.
144    variant java description "Java API - moved to ${name}-java port" {
145        notes "${name}'s +java variant has been replaced with the ${name}-java port."
146    }
147
148    variant tcl description {build Tcl API} {
149        depends_lib-append      port:tcl
150        configure.args-append   --enable-tcl --with-tcl=${prefix}/lib
151    }
152
153    variant compat185 description {build with db185 compatibility mode} {
154        configure.args-append   --enable-compat185
155    }
156} else {
157    # There is no Java specific install target, so delete everything
158    # but the Java related files.
159    post-destroot {
160        set p ${destroot}${prefix}
161
162        delete ${p}/bin
163        delete ${p}/include
164
165        # Install the docs into the main ports's doc directory so that
166        # the link in index.html to java/index.html works.
167        foreach f [lsort [glob -tails -directory ${p}/share/doc/${name} *]] {
168            if {${f} != {java}} {
169                delete ${p}/share/doc/${name}/${f}
170            }
171        }
172        ln -s ${name} ${p}/share/doc/${subport}
173
174        foreach f [lsort [glob -tails -directory ${p}/lib/${name} *]] {
175            if {   ${f} != {db.jar}
176                && [string compare -length 10 {libdb_java} ${f}]} {
177                delete ${p}/lib/${name}/${f}
178            }
179        }
180    }
181}
182
183if { [variant_isset universal] } {
184    if {${os.arch} eq "i386"} {
185        if { ${os.major} >= 10 } {
186            set merger_configure_args(ppc) --with-mutex=Darwin/_spin_lock_try
187        }
188        set merger_configure_args(ppc64)   --with-mutex=Darwin/_spin_lock_try
189    } else {
190        set merger_configure_args(i386)    --with-mutex=x86/gcc-assembly
191        set merger_configure_args(x86_64)  --with-mutex=x86_64/gcc-assembly
192    }
193}
194
195livecheck.type  regex
196livecheck.url   http://www.oracle.com/technetwork/database/berkeleydb/downloads/index-082944.html
197livecheck.regex {(4\.6(?:\.\d+)*)\.tar\.gz}
Note: See TracBrowser for help on using the repository browser.