This repository was archived by the owner on Nov 27, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 295
/
Copy pathcrystax-ndk.rb
59 lines (47 loc) · 1.78 KB
/
crystax-ndk.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
class CrystaxNdk < Formula
desc "Drop-in replacement for Google's Android NDK"
homepage "https://www.crystax.net/android/ndk"
version "10.3.1"
if OS.linux?
url "https://www.crystax.net/download/crystax-ndk-#{version}-linux-x86_64.tar.xz"
sha256 "ebf4f55562bee27301954aac25d8a7ab03514f4aa20867a174950bf77ad2ba06"
elsif MacOS.prefer_64_bit?
url "https://www.crystax.net/download/crystax-ndk-#{version}-darwin-x86_64.tar.xz"
sha256 "6469c37e8fa107db51f9ada26fe3e27fddf3d6c3c51272a783fed36b110550ef"
else
url "https://www.crystax.net/download/crystax-ndk-#{version}-darwin-x86.tar.xz"
sha256 "a59218c0bfc477f0ef2dbd345f21cca4fb1f183b4e154ff7724ea0f6df8a7855"
end
bottle :unneeded
depends_on "android-sdk" => :recommended
conflicts_with "android-ndk",
:because => "both install `ndk-build`, `ndk-gdb`, `ndk-stack`, `ndk-depends` and `ndk-which` binaries"
def install
bin.mkpath
prefix.install Dir["*"]
# Create a dummy script to launch the ndk apps
ndk_exec = prefix+"ndk-exec.sh"
ndk_exec.write <<-EOS.undent
#!/bin/sh
BASENAME=`basename $0`
EXEC="#{prefix}/$BASENAME"
test -e "$EXEC" && exec "$EXEC" "$@"
EOS
ndk_exec.chmod 0755
%w[ndk-build ndk-gdb ndk-stack ndk-depends ndk-which].each { |app| bin.install_symlink ndk_exec => app }
end
def caveats; <<-EOS.undent
We agreed to the CrystaX NDK License Agreement for you by downloading the NDK.
If this is unacceptable you should uninstall.
License information at:
https://www.crystax.net/android/ndk#license
For more documentation on CrystaX NDK, please check:
#{homepage}
EOS
end
test do
system "#{bin}/ndk-build", "--version"
system "#{bin}/ndk-gdb", "--help"
system "#{bin}/ndk-depends", "--help"
end
end