aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorDevon Stewart2014-12-13 19:38:15 -0800
committerMike McQuaid2014-12-27 09:53:50 +0000
commitf2406893270b09f034de1a7e27d66a005b81d8a6 (patch)
tree47408d71a9752b6aa0e158b3f6cdb1accc57e681 /Library
parentf79bbd090d32693aac281f0c3e6080cbda4fbaa2 (diff)
downloadhomebrew-f2406893270b09f034de1a7e27d66a005b81d8a6.tar.bz2
vavrdiasm 3.1 (new formula)
Closes #35026.
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/vavrdiasm.rb63
1 files changed, 63 insertions, 0 deletions
diff --git a/Library/Formula/vavrdiasm.rb b/Library/Formula/vavrdiasm.rb
new file mode 100644
index 000000000..66323646d
--- /dev/null
+++ b/Library/Formula/vavrdiasm.rb
@@ -0,0 +1,63 @@
+class Vavrdiasm < Formula
+ homepage "https://github.com/vsergeev/vAVRdisasm"
+ url "https://github.com/vsergeev/vavrdisasm/archive/v3.1.tar.gz"
+ sha1 "8ac78c7ec26760ac76e25a1ff399cfc255b2bc52"
+
+ # Patch:
+ # - BSD `install(1)' does not have a GNU-compatible `-D' (create intermediate
+ # directories) flag. Switch to using `mkdir -p'.
+ # - Make `PREFIX' overridable
+ # https://github.com/vsergeev/vavrdisasm/pull/2
+ patch :DATA
+
+ def install
+ ENV["PREFIX"] = prefix
+ system "make"
+ system "make", "install"
+ end
+
+ test do
+ # Code to generate `file.hex':
+ ## .device ATmega88
+ ##
+ ## LDI R16, 0xfe
+ ## SER R17
+ #
+ # Compiled with avra:
+ ## avra file.S && mv file.S.hex file.hex
+
+ (testpath/"file.hex").write <<-EOS.undent
+ :020000020000FC
+ :040000000EEF1FEFF1
+ :00000001FF
+ EOS
+
+ output = `vavrdisasm file.hex`.lines.to_a
+
+ assert output[0].match(/ldi\s+R16,\s0xfe/).length == 1
+ assert output[1].match(/ser\s+R17/).length == 1
+ end
+end
+
+__END__
+diff --git a/Makefile b/Makefile
+index 3b61942..f1c94fc 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,5 +1,5 @@
+ PROGNAME = vavrdisasm
+-PREFIX = /usr
++PREFIX ?= /usr
+ BINDIR = $(PREFIX)/bin
+
+ ################################################################################
+@@ -35,7 +35,8 @@ test: $(PROGNAME)
+ python2 crazy_test.py
+
+ install: $(PROGNAME)
+- install -D -s -m 0755 $(PROGNAME) $(DESTDIR)$(BINDIR)/$(PROGNAME)
++ mkdir -p $(DESTDIR)$(BINDIR)
++ install -s -m 0755 $(PROGNAME) $(DESTDIR)$(BINDIR)/$(PROGNAME)
+
+ uninstall:
+ rm -f $(DESTDIR)$(BINDIR)/$(PROGNAME)