Skip to content

Commit

Permalink
tmp 0.6.1 (new formula)
Browse files Browse the repository at this point in the history
tmp is a collection of RAII-wrappers for unique temporary files and directories that are deleted automatically for C++17 and later
  • Loading branch information
bugdea1er committed Apr 30, 2024
1 parent 39b1bfc commit e2d5ca2
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Formula/tmp.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
class Tmp < Formula
desc "RAII-wrappers for unique temporary files and directories for modern C++"
homepage "https://github.com/bugdea1er/tmp"
url "https://github.com/bugdea1er/tmp/archive/refs/tags/v0.6.1.tar.gz"
sha256 "fc8f9f08ff3b26df0ea8646903a69ce7a2b4fc1ecfbf981d2d47d74eca0538ef"
license "MIT"
head "https://github.com/bugdea1er/tmp.git", branch: "main"

depends_on "cmake" => :build

def install
system "cmake", "-S", ".", "-B", "build", "-DTMP_TEST=OFF", *std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"
end

test do
(testpath/"test.cpp").write <<~EOS
#include <iostream>
#include <tmp/file>
int main() {
std::cout << tmp::file().release().native();
}
EOS

system ENV.cxx, "test.cpp", "-std=c++17", "-o", "test",
"-I#{include}",
"-L#{lib}",
"-ltmp"
assert_predicate Pathname.new(shell_output("./test")), :exist?
end
end

0 comments on commit e2d5ca2

Please sign in to comment.