Ticket #31826: 0002-android-update-to-r15-internal-changes.patch

File 0002-android-update-to-r15-internal-changes.patch, 9.4 KB (added by ecronin (Eric Cronin), 13 years ago)
  • dports/java/android/Portfile

    From 2cbea6836a35da4f9926e16496a74739c6b98637 Mon Sep 17 00:00:00 2001
    From: Eric Cronin <ecronin@macports.org>
    Date: Sat, 29 Oct 2011 15:49:48 -0400
    Subject: [PATCH 2/2] android: update to r15, internal changes
    
    * Set license and supported architecture
    * Updated to rmd160/sha256 checksums
    * Installs the platform-tools package, containing 'adb'
    ** infrastructure to do this also allows installing SDKs/docs/examples
       as variants, but that's an extra 15-20 minutes of maintainer burden
       per release so I didn't include it in this patch
    * Places symlinks to the tools into ${prefix}/bin
    * Moved all the macosx app bundle code into the platform block
    ---
     dports/java/android/Portfile |  144 +++++++++++++++++++++++++++++------------
     1 files changed, 102 insertions(+), 42 deletions(-)
    
    diff --git a/dports/java/android/Portfile b/dports/java/android/Portfile
    index da9624d..b631cec 100644
    a b  
    44PortSystem 1.0
    55
    66name                android
    7 version             14
     7version             15
    88categories          java devel emulators
    99maintainers         openmaintainer krischik
    1010platforms           darwin
     11# Precompiled binaries are x86 only
     12supported_archs     i386
     13license             Restrictive
     14homepage            http://developer.${name}.com/
    1115description         Android SDK
    1216long_description                                                        \
    1317    The Android SDK allows development for the Android mobile platform.
    1418
    15 set patchversion    86202
    16 set appbundles      ${name}-appbundles-r${patchversion}.tar.gz
    17 set prog            ${name}-sdk_r${version}-macosx.zip
    18 
    19 homepage            http://developer.${name}.com/
    20 master_sites        http://dl.google.com/${name}:prog                   \
     19master_sites        https://dl.google.com/${name}:prog                  \
     20                    https://dl.google.com/${name}/repository:packages   \
    2121                    macports:${name}:appbundles
    22 distfiles           ${prog}:prog                                        \
    23                     ${appbundles}:appbundles
    24 distname            ${name}-sdk-mac_x86
    25 worksrcdir          ${name}-sdk-macosx
    26 extract.only        ${appbundles}
    27 
    28 checksums           ${prog}                                             \
    29                         md5 812887018435382de8486f3bb26a5db4            \
    30                         sha1 51a21a1045a69def46561bbf6759d67369362d90   \
    31                         rmd160 d71f04888fb3f82b2bb86ed8e0f0983ccf41cc95 \
    32                     ${appbundles}                                       \
    33                         md5 297ca0750c6cea42dd238063d15ae374            \
    34                         sha1 4fb441d14c0a019ac1fe8428c1ddbafa8392c1d6   \
    35                         rmd160 6d6b3086a2499bd675489aa816dcbb1e6216a177
    3622
    37 use_configure       no
    38 build.cmd           true
     23distname            ${name}-sdk_r${version}-macosx
     24worksrcdir          ${name}-sdk-macosx
     25set installdir      ${name}-sdk-mac_x86
     26
     27# Filenames (and sha1 hashes) for current SDK packages can be found inside
     28# https://dl-ssl.google.com/android/repository/repository.xml
     29# https://dl-ssl.google.com/android/repository/repository-5.xml
     30# The second argument for each pkg is the directory (inside $worksrcdir)
     31# where the package contents should be installed
     32set pkg_plat-tools  {platform-tools_r09-macosx.zip  platform-tools}
     33
     34# Install the main package plus platform-tools by default
     35distfiles           ${distname}.zip:prog                                \
     36                    [lindex ${pkg_plat-tools} 0]:packages
     37
     38checksums                                                               \
     39    ${distname}.zip                                                     \
     40        rmd160 609af2a2133d4caa50d75d43b4857dce92656330                 \
     41        sha256 da5326b9305c4e490dc9e372ce46df4884c00cdbe831c980f776d7f3c9f52383 \
     42    [lindex ${pkg_plat-tools} 0]                                        \
     43        sha1 a096a71678932466560d1d81b83a6b88ecc5e573
     44
     45# The various tool/doc/SDK packages unzip to unpredictable and
     46# annoying directory names...  This helper globs its way to the files
     47# and then moves them to their final destination
     48proc extractpkg thepkg {
     49    global workpath worksrcpath distpath
     50    set myzip [lindex ${thepkg} 0]
     51    set mytarget [lindex ${thepkg} 1]
     52    set mytmpdir ${workpath}/tmp
     53
     54    file mkdir ${mytmpdir}
     55
     56    system "unzip -qn ${distpath}/${myzip} -d ${mytmpdir}"
     57
     58    xinstall -d ${worksrcpath}/${mytarget}
     59    eval move [glob ${mytmpdir}/*/*] ${worksrcpath}/${mytarget}
     60
     61    file delete -force ${mytmpdir}
     62}
    3963
    40 destroot.keepdirs                                                       \
    41     ${destroot}${prefix}/share/java/${worksrcdir}/add-ons               \
    42     ${destroot}${prefix}/share/java/${worksrcdir}/docs                  \
    43     ${destroot}${prefix}/share/java/${worksrcdir}/platforms             \
    44     ${destroot}${prefix}/share/java/${worksrcdir}/samples               \
    45     ${destroot}${prefix}/share/java/${worksrcdir}/temp
     64# Handle extraction manually
     65extract.only
    4666
    4767post-extract {
    48     system "unzip -q ${distpath}/${prog} -d ${workpath}"
     68    system "unzip -q ${distpath}/${distname}.zip -d ${workpath}"
     69    extractpkg ${pkg_plat-tools}
    4970}
    5071
    51 destroot {
    52     xinstall -m 755 -d ${destroot}${prefix}/share/java/${distname}
     72# pre-built binaries
     73use_configure   no
     74build           {}
    5375
    54     # file copy can not copy with rename and directory tree.
    55     system "cp -r ${worksrcpath}/. ${destroot}${prefix}/share/java/${distname}/."
     76# Unfortunately the .turd file in platforms breaks some of the Android
     77# tools, but if we don't create the empty dir they also break...
     78destroot.keepdirs                                                       \
     79    ${destroot}${prefix}/share/java/${installdir}/add-ons               \
     80    ${destroot}${prefix}/share/java/${installdir}/docs                  \
     81    ${destroot}${prefix}/share/java/${installdir}/platforms             \
     82    ${destroot}${prefix}/share/java/${installdir}/samples               \
     83    ${destroot}${prefix}/share/java/${installdir}/temp
    5684
    57     xinstall -m 770 -d ${destroot}${prefix}/share/java/${distname}/docs
    58     xinstall -m 770 -d ${destroot}${prefix}/share/java/${distname}/samples
    59     xinstall -m 770 -d ${destroot}${prefix}/share/java/${distname}/temp
     85destroot {
     86    xinstall -m 755 -d ${destroot}${prefix}/share/java
     87    copy ${worksrcpath} ${destroot}${prefix}/share/java/${installdir}
     88
     89    xinstall -m 770 -d ${destroot}${prefix}/share/java/${installdir}/docs
     90    xinstall -m 770 -d ${destroot}${prefix}/share/java/${installdir}/samples
     91    xinstall -m 770 -d ${destroot}${prefix}/share/java/${installdir}/temp
    6092
    6193    system "
    62         chgrp -R _developer ${destroot}${prefix}/share/java/${distname};
    63         chmod -R g+w ${destroot}${prefix}/share/java/${distname}/add-ons;
    64         chmod -R g+w ${destroot}${prefix}/share/java/${distname}/platforms;
    65         chmod -R g-w ${destroot}${prefix}/share/java/${distname}/tools;
     94        chgrp -R _developer ${destroot}${prefix}/share/java/${installdir};
     95        chmod -R g+w ${destroot}${prefix}/share/java/${installdir}/add-ons;
     96        chmod -R g+w ${destroot}${prefix}/share/java/${installdir}/platforms;
     97        chmod -R g-w ${destroot}${prefix}/share/java/${installdir}/tools;
    6698    "
    6799
     100    # Put links to the common CLI tools into the MacPorts bin dir
     101    # TODO: 'emulator' is pretty generic, does this conflict with any
     102    # other ports?
     103    set tools { android apkbuilder ddms dmtracedump draw9patch emulator \
     104        emulator-arm emulator-x86 etc1tool hierarchyviewer hprof-conv   \
     105        layoutopt mksdcard monkeyrunner traceview zipalign }
     106    set plattools { aapt adb dexdump dx }
     107    foreach f ${tools} {
     108        ln -s ${prefix}/share/java/${installdir}/tools/${f}             \
     109            ${destroot}${prefix}/bin/${f}
     110    }
     111    foreach f ${plattools} {
     112        ln -s ${prefix}/share/java/${installdir}/platform-tools/${f}    \
     113            ${destroot}${prefix}/bin/${f}
     114    }
     115
    68116    ui_info "####################################################################"
    69117    ui_info "# add-ons, docs, platforms, samples and temp have been made        #"
    70118    ui_info "# group _developer writable. You need to be member of the          #"
    destroot { 
    76124}
    77125
    78126platform macosx {
     127    set appbundlesvers 86202
     128    set appbundles      ${name}-appbundles-r${appbundlesvers}.tar.gz
     129
     130    distfiles-append    ${appbundles}:appbundles
     131
     132    checksums-append                                                    \
     133        ${appbundles}                                                   \
     134            rmd160 6d6b3086a2499bd675489aa816dcbb1e6216a177             \
     135            sha256 485e88d36b2fd3fa7041acdca964e3665021d8c5d09434f995ce9a869a5ef238
     136
     137    extract.only-append ${appbundles}
     138
    79139    post-destroot {
    80140        xinstall -m 755 -d ${destroot}${applications_dir}/Developer
    81141
    platform macosx { 
    83143
    84144        foreach comp { Android-DDMS Android-Draw9Patch Android-Emulator Android-Hierarchyviewer Android-Manager } {
    85145            copy                                                        \
    86                 ${workpath}/appbundles-r${patchversion}/${comp}.app     \
     146                ${workpath}/appbundles-r${appbundlesvers}/${comp}.app   \
    87147                ${destroot}${applications_dir}/Developer
    88148            reinplace s|@PREFIX@|${prefix}|g                            \
    89149                ${destroot}${applications_dir}/Developer/${comp}.app/Contents/MacOS/Start.command