From ade7e839c123c30047041cd00d1582a373afe9bc Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 20 Jun 2025 22:34:02 +0300 Subject: [PATCH] rnp 0.18.0 (new formula) Co-Authored-By: Rui Chen --- Formula/r/rnp.rb | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Formula/r/rnp.rb diff --git a/Formula/r/rnp.rb b/Formula/r/rnp.rb new file mode 100644 index 0000000000000..1c6e96d48246c --- /dev/null +++ b/Formula/r/rnp.rb @@ -0,0 +1,36 @@ +class Rnp < Formula + desc "High performance C++ OpenPGP library used by Mozilla Thunderbird" + homepage "https://github.com/rnpgp/rnp" + url "https://github.com/rnpgp/rnp/releases/download/v0.18.0/rnp-v0.18.0.tar.gz" + sha256 "a90e3ac5b185a149665147f9284c0201a78431e81924883899244522fd3f9240" + license all_of: ["MIT", "BSD-2-Clause", "BSD-3-Clause"] + head "https://github.com/rnpgp/rnp.git", branch: "main" + + livecheck do + url :stable + regex(/^v?(\d+(?:\.\d+)+)$/i) + end + depends_on "cmake" => :build + depends_on "botan" + depends_on "json-c" + uses_from_macos "bzip2" + uses_from_macos "zlib" + + def install + system "cmake", "-S", ".", "-B", "build", *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + end + + test do + (testpath/"message.txt").write "hello" + encr = testpath/"enc.rnp" + decr = testpath/"dec.rnp" + + system bin/"rnpkeys", "--generate-key", "--password=PASSWORD" + system bin/"rnp", "-c", "--password", "DUMMY", "--output", encr, "message.txt" + system bin/"rnp", "--decrypt", "--password", "DUMMY", "--output", decr, encr + + assert_equal "hello", decr.read + end +end