3 sha256 "7ec95a80d91cda7b4b69401d5c4a4c285fed729811fdf7ceba5739bc9d81e36b"
5 url "https://dl.google.com/android/repository/android-ndk-r#{version}-darwin.dmg",
6 verified: "dl.google.com/android/repository/"
8 desc "Toolset to implement parts of Android apps in native code"
9 homepage "https://developer.android.com/ndk/index.html"
12 url "https://developer.android.com/ndk/downloads"
13 regex(/Latest\b(?!\s+Beta|\s+Pre-Release).*?r(\d+[a-z]?)/i)
16 # shim script (https://github.com/Homebrew/homebrew-cask/issues/18809)
17 shimscript = "#{staged_path}/ndk_exec.sh"
19 Pathname.new("#{HOMEBREW_PREFIX}/share").mkpath
21 build = File.read("#{staged_path}/source.properties").match(/(?<=Pkg.Revision\s=\s\d\d.\d.)\d+/)
22 FileUtils.ln_sf("#{staged_path}/AndroidNDK#{build}.app/Contents/NDK", "#{HOMEBREW_PREFIX}/share/android-ndk")
24 File.write shimscript, <<~EOS
26 readonly executable="#{staged_path}/AndroidNDK#{build}.app/Contents/NDK/$(basename ${0})"
27 test -f "${executable}" && exec "${executable}" "${@}"
37 ].each { |link_name| binary shimscript, target: link_name }
39 uninstall delete: "#{HOMEBREW_PREFIX}/share/android-ndk"
41 # No zap stanza required
44 You may want to add to your profile:
45 'export ANDROID_NDK_HOME="#{HOMEBREW_PREFIX}/share/android-ndk"'