[57018] trunk/dports/databases/oracle-instantclient/Portfile
ryandesign at macports.org
ryandesign at macports.org
Fri Sep 4 13:44:23 PDT 2009
Revision: 57018
http://trac.macports.org/changeset/57018
Author: ryandesign at macports.org
Date: 2009-09-04 13:44:22 -0700 (Fri, 04 Sep 2009)
Log Message:
-----------
oracle-instantclient: respect build_arch and allow x86_64/i386 universal builds; see #19413
Modified Paths:
--------------
trunk/dports/databases/oracle-instantclient/Portfile
Modified: trunk/dports/databases/oracle-instantclient/Portfile
===================================================================
--- trunk/dports/databases/oracle-instantclient/Portfile 2009-09-04 20:02:31 UTC (rev 57017)
+++ trunk/dports/databases/oracle-instantclient/Portfile 2009-09-04 20:44:22 UTC (rev 57018)
@@ -3,14 +3,18 @@
PortSystem 1.0
name oracle-instantclient
-version 10.1.0.3
+version 10.2.0.4.0
+revision 3
+set intel_version ${version}
+set powerpc_version 10.1.0.3
categories databases
platforms macosx
maintainers ryandesign
homepage http://www.oracle.com/technology/software/tech/oci/instantclient/
+master_sites http://download.oracle.com/otn/mac/instantclient/:powerpc \
+ http://download.oracle.com/otn/mac/instantclient/[join [lrange [split ${intel_version} .] 0 3] ""]/:intel
use_zip yes
use_parallel_build no
-set weird_prefix ""
description \
Oracle database connection libraries
@@ -18,73 +22,101 @@
long_description \
Oracle Instant Client allows you to run your applications without installing the standard Oracle client or having an ORACLE_HOME.
-platform powerpc {
- worksrcdir instantclient[join [lrange [split ${version} .] 0 1] _]
- set weird_prefix /b/729
-
- master_sites \
- http://download.oracle.com/otn/mac/instantclient/
-
- distfiles \
- instantclient-basic-macosx-${version}${extract.suffix} \
- instantclient-sdk-macosx-${version}${extract.suffix}
-
- checksums \
- instantclient-basic-macosx-${version}${extract.suffix} \
- md5 5b38ab0565d6189d2069a4abe0bf2ab2 \
- sha1 2f3aa35e99228fd08b686b19eba84ec34db8277b \
- rmd160 d1f056f8f1b308c5493f4938b29b55fcb32452cf \
- instantclient-sdk-macosx-${version}${extract.suffix} \
- md5 79c7cb3f8afaff076fb20bad75b37cc9 \
- sha1 486fe1c9a6c5cfc32401e72728ff821a50a22cf9 \
- rmd160 c819db7f739b8ca468c8059dfbac31a6a6965938
+checksums \
+ [suffix instantclient-basic-macosx-${powerpc_version}] \
+ md5 5b38ab0565d6189d2069a4abe0bf2ab2 \
+ sha1 2f3aa35e99228fd08b686b19eba84ec34db8277b \
+ rmd160 d1f056f8f1b308c5493f4938b29b55fcb32452cf \
+ [suffix instantclient-sdk-macosx-${powerpc_version}] \
+ md5 79c7cb3f8afaff076fb20bad75b37cc9 \
+ sha1 486fe1c9a6c5cfc32401e72728ff821a50a22cf9 \
+ rmd160 c819db7f739b8ca468c8059dfbac31a6a6965938 \
+ [suffix instantclient-basic-${intel_version}-macosx-x86] \
+ md5 75a7622f6852759294df19878106cd77 \
+ sha1 c5ea4ca3e55eb8f2ce83b48c268f51fbb48ff867 \
+ rmd160 3ce70104dfb4a53d2adda96e6ea20bb2cf43ee6f \
+ [suffix instantclient-sdk-${intel_version}-macosx-x86] \
+ md5 e8b5ca3b36a1849c2ca9fa3bf7979311 \
+ sha1 2505faea0e24d52d50b96dc0b22081584de714cb \
+ rmd160 4eb78290b0b44e1f80edbf5e7a84552cca70ac05 \
+ [suffix instantclient-basic-${intel_version}-macosx-x64] \
+ md5 b88c9133c61a2e6b5584879641541d68 \
+ sha1 1e9cd2d0f77c9d2212beb73cdf5876a538eb7e14 \
+ rmd160 05c727d57171381c201f92079074a7d907134c2d \
+ [suffix instantclient-sdk-${intel_version}-macosx-x64] \
+ md5 fc70b8e5a2f3324f3ab64c0564fd70e3 \
+ sha1 05968db004808c43b4cc90cea83b904e6618bc9c \
+ rmd160 61b6d7059598444be54e1dd43a2e765c3793554f
+
+# my_arch my_tag my_arch_version my_distname_format my_worksrcdir_format weird_prefix
+set my_arch_info "
+ ppc powerpc ${powerpc_version} instantclient-%s-macosx-%s instantclient%s /b/729
+ i386 intel ${intel_version} instantclient-%s-%s-macosx-x86 instantclient_%s /b/32_216
+ x86_64 intel ${intel_version} instantclient-%s-%s-macosx-x64 instantclient_%s /b/227
+"
+
+if {"powerpc" == ${os.arch}} {
+ universal_variant no
+} else {
+ variant universal {}
}
-platform i386 {
- # This is really awful. Oracle provides different version numbers of the
- # Instant Client library for PowerPC and Intel. You should not change the
- # version number of a port conditionally like this. But I don't know how \
- # else to handle this here. Hopefully Oracle will release a new version \
- # of the libraries with the same version number on both PowerPC and Intel.
- version 10.2.0.4.0
- revision 2
- worksrcdir instantclient_[join [lrange [split ${version} .] 0 1] _]
- set weird_prefix /b/32_216
-
- master_sites \
- http://download.oracle.com/otn/mac/instantclient/10204/
-
- distfiles \
- instantclient-basic-${version}-macosx-x86${extract.suffix} \
- instantclient-sdk-${version}-macosx-x86${extract.suffix}
-
- checksums \
- instantclient-basic-${version}-macosx-x86${extract.suffix} \
- md5 75a7622f6852759294df19878106cd77 \
- sha1 c5ea4ca3e55eb8f2ce83b48c268f51fbb48ff867 \
- rmd160 3ce70104dfb4a53d2adda96e6ea20bb2cf43ee6f \
- instantclient-sdk-${version}-macosx-x86${extract.suffix} \
- md5 e8b5ca3b36a1849c2ca9fa3bf7979311 \
- sha1 2505faea0e24d52d50b96dc0b22081584de714cb \
- rmd160 4eb78290b0b44e1f80edbf5e7a84552cca70ac05
-
- livecheck.url ${homepage}htdocs/intel_macsoft.html
- livecheck.regex instantclient-basic-(\[0-9.\]+)-macosx-x86\\.zip
+if {[variant_isset universal]} {
+# set my_requested_archs ${configure.universal_archs}
+ set my_requested_archs {x86_64 i386}
+} else {
+ set my_requested_archs ${configure.build_arch}
}
-pre-fetch {
- if {[variant_isset i386]} {
- if {${os.major} < 9} {
- return -code error "${name} on Intel requires Mac OS X 10.5 or greater."
+distfiles
+foreach my_requested_arch ${my_requested_archs} {
+ set found 0
+ foreach {my_arch my_tag my_arch_version my_distname_format my_worksrcdir_format weird_prefix} ${my_arch_info} {
+ if {${my_arch} == ${my_requested_arch}} {
+ set found 1
+ foreach my_distfile_type {basic sdk} {
+ distfiles-append [suffix [format ${my_distname_format} ${my_distfile_type} ${my_arch_version}]]:${my_tag}
+ }
}
}
- if {![file exists ${distpath}/[lindex ${distfiles} 0]] || ![file exists ${distpath}/[lindex ${distfiles} 1]]} {
- ui_warn "MacPorts may not be able to download the necessary distfiles for ${name}. If you get a checksum error, please download [join ${distfiles} " and "] manually from ${livecheck.url} and place them in ${distpath}"
+ if {0 == ${found}} {
+ return -code error "${name} is not available for ${my_requested_arch}"
}
}
+pre-fetch {
+ if {"darwin" != ${os.platform}} {
+ ui_error "${name} requires Mac OS X."
+ return -code error "incompatible operating system"
+ }
+ if {"i386" == ${os.arch} && ${os.major} < 9} {
+ ui_error "${name} on Intel requires Mac OS X 10.5 or greater."
+ return -code error "incompatible Mac OS X version"
+ }
+ ui_warn "MacPorts may not be able to download the necessary distfiles for ${name}."
+ ui_warn "If you get a checksum error, please visit ${homepage}"
+ ui_warn "and download these files manually and place them in ${distpath}"
+ foreach distfile ${distfiles} {
+ ui_msg " * [strsed ${distfile} {/:.*$//}]"
+ }
+}
+
+extract {
+ set my_build_dir ${extract.dir}/build
+ xinstall -d ${my_build_dir}
+ foreach my_requested_arch ${my_requested_archs} {
+ foreach {my_arch my_tag my_arch_version my_distname_format my_worksrcdir_format weird_prefix} ${my_arch_info} {
+ if {${my_arch} == ${my_requested_arch}} {
+ foreach my_distfile_type {basic sdk} {
+ system "${extract.cmd} ${extract.pre_args} ${extract.post_args} ${distpath}/[suffix [format ${my_distname_format} ${my_distfile_type} ${my_arch_version}]]"
+ }
+ move ${extract.dir}/[format ${my_worksrcdir_format} [join [lrange [split ${my_arch_version} .] 0 1] "_"]] ${my_build_dir}/${my_arch}
+ }
+ }
+ }
+}
+
use_configure no
-universal_variant no
set lib_dir ${prefix}/lib/oracle
@@ -92,38 +124,52 @@
# The pre-built libraries use weird prefixes and Oracle recommends setting
# DYLD_LIBRARY_PATH to deal with this. I would rather fix the paths in the
# libraries at install time.
-
- # For each dylib in the distribution, change the directory of its own
- # "soname" to our ${lib_dir}.
- foreach lib [glob -directory ${worksrcpath} *.dylib*] {
- system "install_name_tool -id ${lib_dir}/[strsed ${lib} /^.*\\///] ${lib}"
-
- # Then for each dependent dylib with a weird path that this dylib
- # references, fix the reference to use our ${lib_dir}.
- foreach dep [exec otool -L ${lib}] {
- if [string match "${weird_prefix}/*" ${dep}] {
- system "install_name_tool -change ${dep} ${lib_dir}/[strsed ${dep} /^.*\\///] ${lib}"
+ foreach my_requested_arch ${my_requested_archs} {
+ foreach {my_arch my_tag my_arch_version my_distname_format my_worksrcdir_format weird_prefix} ${my_arch_info} {
+ if {${my_arch} == ${my_requested_arch}} {
+ # For each dylib in the distribution, change the directory of its own
+ # "soname" to ${lib_dir}.
+ foreach lib [glob -directory ${workpath}/build/${my_arch} *.dylib*] {
+ system "install_name_tool -id ${lib_dir}/[strsed ${lib} /^.*\\///] ${lib}"
+
+ # Then for each dependent dylib with a weird path that this dylib
+ # references, fix the reference to use ${lib_dir}.
+ foreach dep [exec otool -L ${lib}] {
+ if [string match "${weird_prefix}/*" ${dep}] {
+ system "install_name_tool -change ${dep} ${lib_dir}/[strsed ${dep} /^.*\\///] ${lib}"
+ }
+ }
+ }
}
}
}
}
destroot {
- xinstall -d ${destroot}${lib_dir}
- eval xinstall \
- [glob -directory ${worksrcpath} *.dylib*] \
- [glob -directory ${worksrcpath} *.jar] \
- ${destroot}${lib_dir}
-
- # php5 +oracle complains without this symlink.
- ln -s libclntsh.dylib.10.1 ${destroot}${lib_dir}/libclntsh.dylib
-
- # You would think the includes should go in ${prefix}/include/oracle, but
- # the instantclient layout wants it in ${prefix}/lib/oracle/sdk/include
- xinstall -d ${destroot}${lib_dir}/sdk
- copy ${worksrcpath}/sdk/include ${destroot}${lib_dir}/sdk
+ foreach my_requested_arch ${my_requested_archs} {
+ foreach {my_arch my_tag my_arch_version my_distname_format my_worksrcdir_format weird_prefix} ${my_arch_info} {
+ if {${my_arch} == ${my_requested_arch}} {
+ set my_destroot ${workpath}/pre-dest/${my_arch}
+ set my_worksrcpath ${workpath}/build/${my_arch}
+ xinstall -d ${my_destroot}${lib_dir}
+ eval xinstall \
+ [glob -directory ${my_worksrcpath} *.dylib*] \
+ [glob -directory ${my_worksrcpath} *.jar] \
+ ${my_destroot}${lib_dir}
+
+ # php5 +oracle complains without this symlink.
+ ln -s libclntsh.dylib.10.1 ${my_destroot}${lib_dir}/libclntsh.dylib
+
+ # You would think the includes should go in ${prefix}/include/oracle, but
+ # the instantclient layout wants it in ${prefix}/lib/oracle/sdk/include
+ xinstall -d ${my_destroot}${lib_dir}/sdk
+ copy ${my_worksrcpath}/sdk/include ${my_destroot}${lib_dir}/sdk
+ }
+ }
+ }
+ merge ${workpath}/pre-dest
}
livecheck.check regex
-livecheck.url ${homepage}htdocs/macsoft.html
-livecheck.regex instantclient-basic-macosx-(\[0-9.\]+)\\.zip
+livecheck.url ${homepage}htdocs/intel_macsoft.html
+livecheck.regex instantclient-basic-(\[0-9.\]+)-macosx-x86\\.zip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090904/c1a983b7/attachment-0001.html>
More information about the macports-changes
mailing list