Skip to content

Instantly share code, notes, and snippets.

@ryankurte
Last active August 29, 2015 14:20
Show Gist options
  • Save ryankurte/7e1b7f9be525877f57b7 to your computer and use it in GitHub Desktop.
Save ryankurte/7e1b7f9be525877f57b7 to your computer and use it in GitHub Desktop.
Homebrew formula for precompiled gcc-arm-none-eabi from launchpad
class GccArmNoneEabi < Formula
homepage "https://launchpad.net/gcc-arm-embedded/"
version "4.9-2015-q1"
url "https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q1-update/+download/gcc-arm-none-eabi-4_9-2015q1-20150306-mac.tar.bz2"
sha1 "da07fd4edc09da8748b3a61252eed793059c138f"
revision 1
def install
binaries = [
'bin/arm-none-eabi-addr2line',
'bin/arm-none-eabi-gcc-4.9.3',
'bin/arm-none-eabi-ld.bfd',
'bin/arm-none-eabi-ar',
'bin/arm-none-eabi-gcc-ar',
'bin/arm-none-eabi-nm',
'bin/arm-none-eabi-as',
'bin/arm-none-eabi-gcc-nm',
'bin/arm-none-eabi-objcopy',
'bin/arm-none-eabi-c++',
'bin/arm-none-eabi-gcc-ranlib',
'bin/arm-none-eabi-objdump',
'bin/arm-none-eabi-c++filt',
'bin/arm-none-eabi-gcov',
'bin/arm-none-eabi-ranlib',
'bin/arm-none-eabi-cpp',
'bin/arm-none-eabi-gdb',
'bin/arm-none-eabi-readelf',
'bin/arm-none-eabi-elfedit',
'bin/arm-none-eabi-gdb-py',
'bin/arm-none-eabi-size',
'bin/arm-none-eabi-g++',
'bin/arm-none-eabi-gprof',
'bin/arm-none-eabi-strings',
'bin/arm-none-eabi-gcc',
'bin/arm-none-eabi-ld',
'bin/arm-none-eabi-strip'
]
docs = [
'share/doc/gcc-arm-none-eabi/license.txt',
'share/doc/gcc-arm-none-eabi/readme.txt ',
'share/doc/gcc-arm-none-eabi/release.txt'
]
bin.install binaries
#lib.install 'lib/*'
#doc.install docs
man1.install Dir['share/doc/gcc-arm-none-eabi/man/man1/*']
man5.install Dir['share/doc/gcc-arm-none-eabi/man/man5/*']
man7.install Dir['share/doc/gcc-arm-none-eabi/man/man7/*']
end
test do
(testpath/"hello-c.c").write <<-EOS.undent
#include <stdio.h>
int main()
{
puts("Hello, world!");
return 0;
}
EOS
system "#{bin}/arm-none-eabi-gcc-#{version_suffix}", "-o", "hello-c", "hello-c.c"
assert_equal "Hello, world!\n", `./hello-c`
(testpath/"hello-cc.cc").write <<-EOS.undent
#include <iostream>
int main()
{
std::cout << "Hello, world!" << std::endl;
return 0;
}
EOS
system "#{bin}/arm-none-eabi-g++-#{version_suffix}", "-o", "hello-cc", "hello-cc.cc"
assert_equal "Hello, world!\n", `./hello-cc`
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment