forked from ghc-ios/ghc-ios-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstallGHCiOS.sh
executable file
·56 lines (46 loc) · 1.88 KB
/
installGHCiOS.sh
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
#!/bin/sh
cd /tmp
if [[ ! -f /usr/local/clang-3.0/bin/llc ]]; then
echo "Downloading LLVM 3.0..."
curl -O http://llvm.org/releases/3.0/clang+llvm-3.0-x86_64-apple-darwin11.tar.gz
tar xvf clang+llvm-3.0-x86_64-apple-darwin11.tar.gz
mv clang+llvm-3.0-x86_64-apple-darwin11 /usr/local/clang-3.0
rm clang+llvm-3.0-x86_64-apple-darwin11.tar.gz
fi
echo "Downloading GHC for iOS devices..."
curl -O https://www.haskell.org/ghc/dist/7.8.3/ghc-7.8.3-arm-apple-ios.tar.xz
tar xvf ghc-7.8.3-arm-apple-ios.tar.xz && mv ghc-7.8.3 ghc-7.8.3-arm
rm ghc-7.8.3-arm-apple-ios.tar.xz
cd ghc-7.8.3-arm
# Remove befuddling inclusion of my local paths
LC_CTYPE=C
LANG=C
find . -type f -not -name .DS_Store -print0 | xargs -0 sed -i '' 's|/Users/lukexi/Code/ghc-ios-scripts/||g'
./configure
# Fix the settings file to point to the right scripts and clang versions
sed -i '' 's|/usr/bin/gcc|arm-apple-darwin10-clang|g' settings
sed -i '' 's|/usr/bin/ld|arm-apple-darwin10-ld|g' settings
sed -i '' 's|"opt"|"/usr/local/clang-3.0/bin/opt"|g' settings
sed -i '' 's|"llc"|"/usr/local/clang-3.0/bin/llc"|g' settings
make install
cd ..
rm -r ghc-7.8.3-arm
echo "Downloading GHC for the iOS simulator..."
cd /tmp
curl -O https://www.haskell.org/ghc/dist/7.8.3/ghc-7.8.3-i386-apple-ios.tar.xz
tar xvf ghc-7.8.3-i386-apple-ios.tar.xz && mv ghc-7.8.3 ghc-7.8.3-i386
rm ghc-7.8.3-i386-apple-ios.tar.xz
cd ghc-7.8.3-i386
# ditto above
LC_CTYPE=C
LANG=C
find . -type f -not -name .DS_Store -print0 | xargs -0 sed -i '' 's|/Users/lukexi/Code/ghc-ios-scripts/||g'
./configure
# Fix the settings file to point to the right scripts and clang versions
sed -i '' 's|/usr/bin/gcc|i386-apple-darwin11-clang|g' settings
sed -i '' 's|/usr/bin/ld|i386-apple-darwin11-ld|g' settings
sed -i '' 's|"opt"|"/usr/local/clang-3.0/bin/opt"|g' settings
sed -i '' 's|"llc"|"/usr/local/clang-3.0/bin/llc"|g' settings
make install
cd ..
rm -r ghc-7.8.3-i386