61 lines
1.7 KiB
Ruby
61 lines
1.7 KiB
Ruby
class Libsoxr < Formula
|
|
bottle do
|
|
root_url "https://homebrew.hyprnet/bottles"
|
|
rebuild 1
|
|
sha256 cellar: :any, arm64_sequoia: "164c5e70f213a0cdd5b9a764da773e79bc35753efc54d46e0710aee172de3640"
|
|
sha256 cellar: :any, arm64_tahoe: "6fd815529e1078139d7965e7bb7e92b4fa5680e74ca671357aaf4c0e1ea1dc95"
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "1753c0562a6494e1437dc79db88d4672bb4b2e2a2b9134ac85952b555baf8559"
|
|
end
|
|
desc "High quality, one-dimensional sample-rate conversion library"
|
|
homepage "https://sourceforge.net/projects/soxr/"
|
|
url "https://downloads.sourceforge.net/project/soxr/soxr-0.1.3-Source.tar.xz"
|
|
sha256 "b111c15fdc8c029989330ff559184198c161100a59312f5dc19ddeb9b5a15889"
|
|
license "LGPL-2.1-or-later"
|
|
compatibility_version 1
|
|
|
|
livecheck do
|
|
url :stable
|
|
regex(%r{url=.*?/soxr[._-]v?(\d+(?:\.\d+)+)(?:-Source)?\.t}i)
|
|
end
|
|
|
|
|
|
|
|
depends_on "cmake" => :build
|
|
|
|
# Fixes the build on 64-bit ARM macOS; the __arm__ define used in the
|
|
# code isn't defined on 64-bit Apple Silicon.
|
|
# Upstream pull request: https://sourceforge.net/p/soxr/code/merge-requests/5/
|
|
patch do
|
|
file "Patches/libsoxr/arm64_defines.patch"
|
|
end
|
|
|
|
def install
|
|
args = %w[
|
|
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
|
|
]
|
|
system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
|
|
system "cmake", "--build", "build"
|
|
system "cmake", "--install", "build"
|
|
end
|
|
|
|
test do
|
|
(testpath/"test.c").write <<~C
|
|
#include <soxr.h>
|
|
|
|
int main()
|
|
{
|
|
char const *version = 0;
|
|
version = soxr_version();
|
|
if (version == 0)
|
|
{
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
C
|
|
|
|
system ENV.cc, "-L#{lib}", "test.c", "-lsoxr", "-o", "test"
|
|
system "./test"
|
|
end
|
|
end
|