Skip to content

Commit

Permalink
libcue-static 2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mistydemeo committed May 6, 2018
1 parent e2952ac commit e667fea
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions libcue-static.rb
@@ -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

0 comments on commit e667fea

Please sign in to comment.