57 lines
1.9 KiB
Ruby
57 lines
1.9 KiB
Ruby
class Volk < Formula
|
|
include Language::Python::Virtualenv
|
|
|
|
desc "Vector Optimized Library of Kernels"
|
|
homepage "https://libvolk.org"
|
|
url "https://github.com/gnuradio/volk.git",
|
|
tag: "v2.4.0",
|
|
revision: "99404d8f73172285bb299301f3aa778868f59f83"
|
|
license "GPL-3.0-or-later"
|
|
|
|
bottle do
|
|
sha256 "e554a50c7257d17453071ef6359819c5130079b59bafbded22888acb39057070" => :big_sur
|
|
sha256 "f34bc3e707bb18791f429d777ca2e4e8e4f0c6bd1b318778d2fde8492eaff4df" => :catalina
|
|
sha256 "7325e401a79b42a9146acd1e5c2c32346529530e579e1cafa8353d8bf6649ed0" => :mojave
|
|
end
|
|
|
|
depends_on "cmake" => :build
|
|
depends_on "pkg-config" => :build
|
|
depends_on "boost"
|
|
depends_on "orc"
|
|
depends_on "python@3.9"
|
|
|
|
resource "Mako" do
|
|
url "https://files.pythonhosted.org/packages/72/89/402d2b4589e120ca76a6aed8fee906a0f5ae204b50e455edd36eda6e778d/Mako-1.1.3.tar.gz"
|
|
sha256 "8195c8c1400ceb53496064314c6736719c6f25e7479cd24c77be3d9361cddc27"
|
|
end
|
|
|
|
def install
|
|
# Set up Mako
|
|
venv_root = libexec/"venv"
|
|
xy = Language::Python.major_minor_version "python3"
|
|
ENV.prepend_create_path "PYTHONPATH", "#{venv_root}/lib/python#{xy}/site-packages"
|
|
venv = virtualenv_create(venv_root, "python3")
|
|
venv.pip_install resource("Mako")
|
|
|
|
# Avoid references to the Homebrew shims directory
|
|
inreplace "lib/CMakeLists.txt" do |s|
|
|
s.gsub! "${CMAKE_C_COMPILER}", ENV.cc
|
|
s.gsub! "${CMAKE_CXX_COMPILER}", ENV.cxx
|
|
end
|
|
|
|
args = %W[-DPYTHON_EXECUTABLE=#{venv_root}/bin/python -DENABLE_TESTING=OFF]
|
|
system "cmake", ".", *std_cmake_args, *args
|
|
system "make", "install"
|
|
|
|
# Set up volk_modtool paths
|
|
site_packages = lib/"python#{xy}/site-packages"
|
|
pth_contents = "import site; site.addsitedir('#{site_packages}')\n"
|
|
(venv_root/"lib/python#{xy}/site-packages/homebrew-volk.pth").write pth_contents
|
|
end
|
|
|
|
test do
|
|
system "volk_modtool", "--help"
|
|
system "volk_profile", "--iter", "10"
|
|
end
|
|
end
|