Changeset 97746 for trunk/dports/java


Ignore:
Timestamp:
Sep 14, 2012, 6:54:20 AM (7 years ago)
Author:
hum@…
Message:

hadoop: fix to build libraries; rename patchfiles; support universal build; see #35902 comment:6.

Location:
trunk/dports/java/hadoop
Files:
5 added
5 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/java/hadoop/Portfile

    r97554 r97746  
    66name                hadoop
    77version             1.0.3
    8 revision            3
     8revision            4
    99categories          java devel science
    1010maintainers         hum openmaintainer
     
    2323                    sha256  716ab51f75ffb70343c3cca02f7ba4722f42376edb67eecbd42a426a054e6423
    2424
    25 patchfiles          patch-hadoop-env.sh.diff \
    26                     patch-native.diff \
    27                     patch-c++.diff
     25patchfiles          patch-conf-hadoop-env.sh.diff \
     26                    patch-src-native.diff \
     27                    patch-src-c++.diff
    2828
    2929depends_build       bin:ant:apache-ant
     
    5151}
    5252
    53 universal_variant   no
     53variant universal {}
    5454
    5555use_configure       no
    5656
    57 # Build native and c++ libraries.
     57set java_include    -I/System/Library/Frameworks/JavaVM.framework/Headers
     58set cflags          "${configure.cflags} [get_canonical_archflags]"
     59set cxxflags        "${configure.cxxflags} [get_canonical_archflags cxx]"
     60set ldflags         "${configure.ldflags} [get_canonical_archflags] -framework JavaVM"
     61set cppflags        "${configure.cppflags} ${java_include}"
     62
     63# Set configure args to build native and c++-libhdfs.
     64post-patch {
     65    set libs  "-ldl -lz -lsnappy"
     66    reinplace "s|@cc@|${configure.cc}|g"      ${worksrcpath}/build.xml
     67    reinplace "s|@cflags@|${cflags}|g"        ${worksrcpath}/build.xml
     68    reinplace "s|@cxx@|${configure.cxx}|g"    ${worksrcpath}/build.xml
     69    reinplace "s|@cxxflags@|${cxxflags}|g"    ${worksrcpath}/build.xml
     70    reinplace "s|@ldflags@|${ldflags}|g"      ${worksrcpath}/build.xml
     71    reinplace "s|@libs@|${libs}|g"            ${worksrcpath}/build.xml
     72    reinplace "s|@cppflags@|${cppflags}|g"    ${worksrcpath}/build.xml
     73    reinplace "s|@args@|--prefix=${prefix}|g" ${worksrcpath}/build.xml
     74}
     75
     76# Build native and c++-libhdfs.
    5877build.cmd           ant
    5978build.args          -Dcompile.native=true \
     
    6483
    6584# Fix install_name of dylib.
    66 post-build {
     85pre-destroot {
    6786    foreach file [glob ${worksrcpath}/build/native/**/lib/*.dylib \
    6887                       ${worksrcpath}/build/c++/**/lib/*.dylib] {
     
    98117    depends_lib-append port:fuse4x
    99118
    100     patchfiles-append  patch-fusedfs.diff
    101 
    102     post-patch {
    103         set cppflags "-I${prefix}/include -I/System/Library/Frameworks/JavaVM.framework/Headers"
    104         set ldflags  "-L${prefix}/lib -L$@"
    105         reinplace "s|configure|configure CPPFLAGS=\"${cppflags}\" LDFLAGS=\"${ldflags}\"|" \
    106             ${worksrcpath}/src/contrib/fuse-dfs/bootstrap.sh
    107     }
    108 
     119    patchfiles-append  patch-src-contrib-fusedfs.diff
     120
     121    # libhdfs.dylib must be built before configuring fuse-dfs.
    109122    post-build {
     123        set libs  "-lfuse -lhdfs"
     124        # "$@" is replaced with "${hadoop.root}/build/c++/${build.platform}/lib".
     125        # See files/patch-src-contrib-fusedfs.diff.
     126        set args  "--prefix=${prefix} \
     127                   CC=${configure.cc} \
     128                   CFLAGS=\"${cflags}\" \
     129                   LDFLAGS=\"${ldflags} -L$@\" \
     130                   LIBS=\"${libs}\" \
     131                   CPPFLAGS=\"${cppflags}\""
     132        set sh ${worksrcpath}/src/contrib/fuse-dfs/bootstrap.sh
     133        reinplace "s|\./configure|\./configure ${args}|" ${sh}
     134        # Build fusedfs.
    110135        system -W ${worksrcpath} "ant compile-contrib -Dlibhdfs=1 -Dfusedfs=1"
    111136    }
     
    115140            ${worksrcpath}/build/contrib/fuse-dfs/fuse_dfs \
    116141            ${destroot}${prefix}/bin
     142        # Fix install_name in fuse_dfs.
     143        set bin ${destroot}${prefix}/bin/fuse_dfs
     144        regexp {(\S+\/libhdfs\S+dylib)} [exec otool -L ${bin}] path
     145        system "install_name_tool -change ${path} ${prefix}/lib/libhdfs.dylib ${bin}"
    117146        # Install fuse_dfs_wrapper.sh.
    118147        xinstall -m 755 ${filespath}/fuse_dfs_wrapper.sh ${destroot}${hadoop_home}/bin
     
    194223
    195224variant pseudo description {Run on a single-node in a pseudo-distributed mode} {
    196     patchfiles-append  patch-conf.diff
     225    patchfiles-append  patch-pseudo.diff
    197226
    198227    post-destroot {
Note: See TracChangeset for help on using the changeset viewer.