Skip to content

Commit

Permalink
Merge pull request #136839 from iMichka/lm4tools
Browse files Browse the repository at this point in the history
lm4tools: Fix build on Ventura
  • Loading branch information
BrewTestBot authored Jul 17, 2023
2 parents 455b465 + 1063180 commit 064fadb
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Formula/lm4tools.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,17 @@ class Lm4tools < Formula
depends_on "libusb"

def install
# Fix a hardcoded `/usr/local` reference that breaks the ARM build
inreplace "lmicdiusb/Makefile", "/usr/local", HOMEBREW_PREFIX
# Fix for https://github.com/utzig/lm4tools/issues/32
libusb = Formula["libusb"]
inreplace "lmicdiusb/Makefile",
"LIBUSB_CFLAGS := -I/usr/local/include/libusb-1.0",
"LIBUSB_CFLAGS := -I#{libusb.opt_include}/libusb-#{libusb.version.major_minor}"
inreplace "lmicdiusb/Makefile",
"LIBUSB_LIBDIR := /usr/local/lib",
"LIBUSB_LIBDIR := #{libusb.opt_lib}"
inreplace "lmicdiusb/Makefile",
"lmicdi: lmicdi.o socket.o gdb.o $(LIBUSB_LIBS)",
"lmicdi: lmicdi.o socket.o gdb.o #{libusb.opt_lib}/#{shared_library("libusb-1.0")}"
system "make", "install", "PREFIX=#{prefix}"
end

Expand Down

0 comments on commit 064fadb

Please sign in to comment.