Merge pull request #207020 from Homebrew/bump-qpdf-11.10.0
[Homebrew/homebrew-core.git] / Formula / t / toxcore.rb
blobc9212290c921e815e2118fc95d343008536af421
1 class Toxcore < Formula
2   desc "C library implementing the Tox peer to peer network protocol"
3   homepage "https://tox.chat/"
4   # This repo is a fork, but it is the source used by Debian, Fedora, and Arch,
5   # and is the repo linked in the homepage.
6   url "https://github.com/TokTok/c-toxcore/releases/download/v0.2.20/c-toxcore-0.2.20.tar.gz"
7   sha256 "a9c89a8daea745d53e5d78e7aacb99c7b4792c4400a5a69c71238f45d6164f4c"
8   license "GPL-3.0-or-later"
9   head "https://github.com/TokTok/c-toxcore.git", branch: "master"
11   bottle do
12     sha256 cellar: :any,                 arm64_sequoia: "7e2a14e9598e599c0f311145c328d9d274b17c74f03fb4f795db32ac55c826a4"
13     sha256 cellar: :any,                 arm64_sonoma:  "a969319efbe57bc7657603eea87f56a0668d6ea1b042dad62f3f613f98d1b770"
14     sha256 cellar: :any,                 arm64_ventura: "1d9a839019b2ca24cea932c60127b4418cdf1dc7d0a94755799fff1d0c62db9f"
15     sha256 cellar: :any,                 sonoma:        "6466f7b075609f7980cba36ecc5bc35a96ae5558f88ae9f698613600809e591c"
16     sha256 cellar: :any,                 ventura:       "ae3dfbf4c1f8ffaa59cfe4391535180386be2fa811b91234870c7abfabd0272d"
17     sha256 cellar: :any_skip_relocation, x86_64_linux:  "a2443ece50296533188f88dc789916e6266a02253915cc56227d627ce41adc42"
18   end
20   depends_on "cmake" => :build
21   depends_on "pkgconf" => :build
22   depends_on "libconfig"
23   depends_on "libsodium"
24   depends_on "libvpx"
25   depends_on "opus"
27   def install
28     system "cmake", "-S", ".", "-B", "_build", *std_cmake_args
29     system "cmake", "--build", "_build"
30     system "cmake", "--install", "_build"
31   end
33   test do
34     (testpath/"test.c").write <<~C
35       #include <tox/tox.h>
36       int main() {
37         TOX_ERR_NEW err_new;
38         Tox *tox = tox_new(NULL, &err_new);
39         if (err_new != TOX_ERR_NEW_OK) {
40           return 1;
41         }
42         return 0;
43       }
44     C
45     system ENV.cc, "-I#{include}/toxcore", testpath/"test.c",
46                    "-L#{lib}", "-ltoxcore", "-o", "test"
47     system "./test"
48   end
49 end