forked from larsimmisch/homebrew-avr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathavr-libc.rb
29 lines (24 loc) · 888 Bytes
/
avr-libc.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
require 'formula'
class AvrLibc < Formula
url 'http://download.savannah.gnu.org/releases/avr-libc/avr-libc-1.8.1.tar.bz2'
homepage 'http://www.nongnu.org/avr-libc/'
sha256 'c3062a481b6b2c6959dc708571c00b0e26301897ba21171ed92acd0af7c4a969'
depends_on '0xPIT/avr/avr-gcc'
def install
# brew's build environment is in our way
ENV.delete 'CFLAGS'
ENV.delete 'CXXFLAGS'
ENV.delete 'LD'
ENV.delete 'CC'
ENV.delete 'CXX'
avr_gcc = Formula.factory('0xPIT/avr/avr-gcc')
build = `./config.guess`.chomp
system "./configure", "--build=#{build}", "--prefix=#{prefix}", "--host=avr"
system "make install"
avr = File.join prefix, 'avr'
# copy include and lib files where avr-gcc searches for them
# this wouldn't be necessary with a standard prefix
ohai "copying #{avr} -> #{avr_gcc.prefix}"
cp_r avr, avr_gcc.prefix
end
end