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 |
37 | | use_configure no |
38 | | build.cmd true |
| 23 | distname ${name}-sdk_r${version}-macosx |
| 24 | worksrcdir ${name}-sdk-macosx |
| 25 | set 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 |
| 32 | set pkg_plat-tools {platform-tools_r09-macosx.zip platform-tools} |
| 33 | |
| 34 | # Install the main package plus platform-tools by default |
| 35 | distfiles ${distname}.zip:prog \ |
| 36 | [lindex ${pkg_plat-tools} 0]:packages |
| 37 | |
| 38 | checksums \ |
| 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 |
| 48 | proc 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 | } |
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... |
| 78 | destroot.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 |
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 |
| 85 | destroot { |
| 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 |
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; |
| 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 | |