Skip to content

Commit 8d48cac

Browse files
committed
libftdi: backport support for CMake 4
1 parent 733dbf2 commit 8d48cac

File tree

1 file changed

+30
-10
lines changed

1 file changed

+30
-10
lines changed

Formula/lib/libftdi.rb

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,37 @@ class Libftdi < Formula
4343
sha256 "db4c3e558e0788db00dcec37929f7da2c4ad684791977445d8516cc3e134a3c4"
4444
end
4545

46+
# Backport commits to increase to cmake 3.5 minimum needed by cmake 4
47+
patch do
48+
url "http://developer.intra2net.com/git/?p=libftdi;a=patch;h=3861e7dc9e83f2f6ff4e1579cf3bbf63a6827105"
49+
sha256 "ffe62563c3696f0e251acf2a23718b11e62d625e2e9826ba17fd1e83861775fb"
50+
end
51+
patch do
52+
url "http://developer.intra2net.com/git/?p=libftdi;a=patch;h=3dc444f99bbc780f06ee6115c086e30f2dda471a"
53+
sha256 "63b9eb4e4c12ea0ee7d314a1d50d38dc025f9433986cacfbbca443e7c2a004b8"
54+
end
55+
patch do
56+
url "http://developer.intra2net.com/git/?p=libftdi;a=patch;h=61a6bac98bbac623fb33b6153a063b6436f84721"
57+
sha256 "68dc235a70c8b3ea62fa1d498c8b13f290a32affa947119202f8655037bbfe37"
58+
end
59+
patch do
60+
url "http://developer.intra2net.com/git/?p=libftdi;a=patch;h=de9f01ece34d2fe6e842e0250a38f4b16eda2429"
61+
sha256 "3fe298c7f61a353160c4e1df74a06a4f7ed26e121b3608237b6fe68186208129"
62+
end
63+
4664
def install
47-
mkdir "libftdi-build" do
48-
system "cmake", "..", "-DPYTHON_BINDINGS=OFF",
49-
"-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON",
50-
"-DFTDIPP=ON",
51-
*std_cmake_args
52-
system "make", "install"
53-
pkgshare.install "../examples"
54-
(pkgshare/"examples/bin").install Dir["examples/*"] \
55-
- Dir["examples/{CMake*,Makefile,*.cmake}"]
56-
end
65+
system "cmake", "-S", ".", "-B", "build",
66+
"-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON",
67+
"-DCMAKE_CXX_STANDARD=11",
68+
"-DCMAKE_INSTALL_RPATH=#{rpath};#{rpath(source: pkgshare/"examples/bin")}",
69+
"-DFTDIPP=ON",
70+
"-DPYTHON_BINDINGS=OFF",
71+
*std_cmake_args
72+
system "cmake", "--build", "build"
73+
system "cmake", "--install", "build"
74+
75+
pkgshare.install "examples"
76+
(pkgshare/"examples/bin").install buildpath.glob("build/examples/*").select { |f| f.file? && f.executable? }
5777
end
5878

5979
test do

0 commit comments

Comments
 (0)