-
-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lm4tools 0.1.3 (new formula) #25140
lm4tools 0.1.3 (new formula) #25140
Conversation
Formula/lm4tools.rb
Outdated
depends_on "libusb" | ||
|
||
def install | ||
cd "lm4flash" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a top-level makefile, so we could simply run:
system "make"
bin.install "lm4flash/lm4flash"
bin.install "lmicdiusb/lmicdi"
Also, could you open an issue with upstream asking that they add an install
target to their makefile? That way we could do make install PREFIX=...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no top-level makefile in v0.1.2 (the latest release). :( It's a later addition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upstream issue for the install
target: utzig/lm4tools#27
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a PR which adds the functionality (utzig/lm4tools#28), I tested on Linux only, would be glad if it looks OK and you can check with Homebrew before I merge. Btw, I could make a release 0.1.3
(or maybe 0.1.4
) afterwards...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change this once 0.1.3 or 0.1.4 is released. I'm fine with keeping this PR waiting until then.
Formula/lm4tools.rb
Outdated
end | ||
|
||
test do | ||
system "#{bin}/lm4flash", "-V" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are going to need a test that does more than that…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The software needs connected hardware to do anything useful. I can write a proper test, but that would break CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could also grep for the version, or even try flashing any file which should output "Unable to find any ICDI devices" when no device is connected (like in a CI). Of course, this would fail if run locally with an actual device connected...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try flashing any file which should output "Unable to find any ICDI devices" when no device is connected
This is good. Or flashing something that is an invalid file and check that it says so (if it does).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I implemented the suggested test. It will of course fail if a device is connected, but that is probably obvious if anyone runs the test and sees that "Unable to find any ICDI devices" didn't match the stderr.
Formula/lm4tools.rb
Outdated
end | ||
|
||
test do | ||
require "open3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's simply do:
output = shell_output("#{bin}/lm4flash - 2>&2")
assert_match "Unable to find any ICDI devices", output
aba3e07
to
c6f1ad7
Compare
This is ready for merge. Upstream made a new release and I've implemented the suggestions that came up in the review. |
Merged (with the HEAD removed, as we don't enable head builds for most formulas… let's wait and see how often this is used). Thanks @dancek for the pull request! |
brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingbrew install <formula>
)?Lm4tools is used for flashing and debugging TI ARM Cortex-M microcontrollers. I needed it and couldn't find a package so here's one.