forked from Sharpie/homebrew-science
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e2952ac
commit e667fea
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
class LibcueStatic < Formula | ||
desc "Statically-build version of libcue" | ||
homepage "https://github.com/lipnitsk/libcue" | ||
url "https://github.com/lipnitsk/libcue/archive/v2.2.0.tar.gz" | ||
sha256 "328f14b8ae0a6b8d4c96928b53b88a86d72a354b4da9d846343c78ba36022879" | ||
|
||
depends_on "cmake" => :build | ||
|
||
keg_only "Copy of libcue library" | ||
|
||
def install | ||
# Shared library is hardcoded | ||
inreplace "CMakeLists.txt", "ADD_LIBRARY(cue SHARED", "ADD_LIBRARY(cue STATIC" | ||
|
||
system "cmake", ".", *std_cmake_args | ||
system "make" | ||
(pkgshare/"tests").mkpath | ||
cp_r "t/.", pkgshare/"tests" | ||
system "make", "test" | ||
system "make", "install" | ||
end | ||
|
||
test do | ||
cp_r (pkgshare/"tests").children, testpath | ||
Dir["*.c"].each do |f| | ||
system ENV.cc, f, "-o", "test", "-L#{lib}", "-lcue", "-I#{include}" | ||
system "./test" | ||
rm "test" | ||
end | ||
end | ||
end |