Skip to content

Instantly share code, notes, and snippets.

@atnan
Created July 27, 2011 07:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atnan/1108832 to your computer and use it in GitHub Desktop.
Save atnan/1108832 to your computer and use it in GitHub Desktop.
Install a minimal development toolchain
#!/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
Copy link

Cool. Saves a bunch of time, presumably?

@atnan
Copy link
Author

atnan commented Jul 28, 2011

@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