Created
July 27, 2011 07:06
-
-
Save atnan/1108832 to your computer and use it in GitHub Desktop.
Install a minimal development toolchain
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env bash | |
packages=( | |
DevSDK.pkg | |
DeveloperToolsCLI.pkg | |
DeveloperToolsSystemSupport.pkg | |
gcc4.2.pkg | |
llvm-gcc4.2.pkg | |
clang.pkg | |
) | |
hdiutil create -size 1G -type SPARSEBUNDLE -fs HFSX -layout none -uid 0 -gid 0 -volname MinimalToolchain /tmp/minimal_toolchain.sparsebundle | |
hdiutil attach -noverify "/path/to/xcode_4.1_for_lion__gm_seed.dmg" | |
hdiutil attach -noverify "/tmp/minimal_toolchain.sparsebundle" | |
for package in ${packages[@]}; do | |
installer -verbose -pkg "/Volumes/Xcode/Packages/$package" -target /Volumes/MinimalToolchain | |
done | |
mkdir /Developer | |
mv /Volumes/MinimalToolchain/* /Developer/ | |
hdiutil detach /Volumes/MinimalToolchain | |
rm -R /tmp/minimal_toolchain.sparsebundle | |
hdiutil detach /Volumes/Xcode |
@dsturnbull The main reason for doing this was frustration on @lachlanhardy's part and curiosity on my own. But yes, installing will be much quicker because you're installing ~800MB, not 3.5GB. Might be more appropriate if all you're after is a Homebrew-ready toolchain.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cool. Saves a bunch of time, presumably?