Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve formulae #9

Merged
merged 4 commits into from
Dec 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build

on: [push, pull_request]

jobs:
install:

strategy:
matrix:
os: [ macos-10.15 ]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Copy formulae
run: cp *.rb $(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/
- name: Install
# We install the IIO Oscilloscope package, which builds the others
# through dependency resolution.
run: brew install --verbose --build-from-source iio-oscilloscope
- name: Test
run: |
for formula in *.rb; do
brew test "${formula%.rb}"
done
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

45 changes: 0 additions & 45 deletions i-i-o-oscilloscope.rb

This file was deleted.

42 changes: 42 additions & 0 deletions iio-oscilloscope.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
class IioOscilloscope < Formula
desc "GTK+ based oscilloscope application for interfacing with various IIO devices"
homepage "https://wiki.analog.com/resources/tools-software/linux-software/iio_oscilloscope"
url "https://github.com/analogdevicesinc/iio-oscilloscope/archive/v0.11-master.tar.gz"
sha256 "df31ae208f806f8291c3d4fd53d57d2e54acff4ab65c5ae52c18730fc76c6e64"
license "GPL-2.0"
head "https://github.com/analogdevicesinc/iio-oscilloscope.git"

depends_on "cmake" => :build
depends_on "pkg-config" => :build

depends_on "atk"
depends_on "cairo"
depends_on "curl"
depends_on "fftw"
depends_on "gdk-pixbuf"
depends_on "gettext"
depends_on "glib"
depends_on "gtk+"
depends_on "gtkdatabox"
depends_on "harfbuzz"
depends_on "jansson"
depends_on "libad9361-iio"
depends_on "libiio"
depends_on "libmatio"
depends_on "libserialport"
depends_on "pango"

uses_from_macos "libxml2"

def install
mkdir "build" do
system "cmake", "..", *std_cmake_args
system "make", "install"
end
end

test do
assert_match "osc: the IIO visualization and control tool",
shell_output("#{bin}/osc --help", 255)
end
end
25 changes: 19 additions & 6 deletions libad9361-iio.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
class Libad9361Iio < Formula
desc ""
homepage ""
desc "IIO AD9361 library for filter design and handling, multi-chip sync, etc."
homepage "https://analogdevicesinc.github.io/libad9361-iio/"
url "https://github.com/analogdevicesinc/libad9361-iio/archive/v0.2.tar.gz"
sha256 "f0d935eb7f70fde8596d98e9eb1f311b408b87662fc1fff45ae3ed455697b747"
license "LGPL-2.1"
head "https://github.com/analogdevicesinc/libad9361-iio.git"

depends_on "cmake" => :build
depends_on "pkg-config" => :build

depends_on "libiio"

def install
# ENV.deparallelize # if your formula fails when building in parallel
system "cmake ./CMakeLists.txt -DCMAKE_INSTALL_PREFIX='#{prefix}'"
system "make", "install" # if this fails, try separate make/make install steps
mkdir "build" do
cmake_args = [
"-DOSX_PACKAGE=OFF",
]
system "cmake", "..", *cmake_args, *std_cmake_args
system "make"
system "make", "install"
end

# For some reason they install a framework in lib/
frameworks.install_symlink lib/"ad9361.framework"
end

test do
system "false"
assert_match "ad9361_fmcomms5_phase_sync",
shell_output("nm #{frameworks}/ad9361.framework/ad9361")
end
end
47 changes: 25 additions & 22 deletions libiio.rb
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@

class Libiio < Formula
desc "libIIO"
homepage "https://github.com/analogdevicesinc/iio-oscilloscope/wiki"
# head "https://github.com/analogdevicesinc/libiio.git"
url "https://github.com/analogdevicesinc/libiio/archive/v0.17.tar.gz"
desc "Library for interfacing with local and remote Linux IIO devices"
homepage "https://analogdevicesinc.github.io/libiio/"
url "https://github.com/analogdevicesinc/libiio/archive/v0.21.tar.gz"
sha256 "03d13165cbeb83b036743cbd9a10e336c728da162714f39d13250a3d94305cac"
license "LGPL-2.1"
head "https://github.com/analogdevicesinc/libiio.git"

# libusb libxml2
depends_on "cmake" => :build
# depends_on "gtk+" => :build
# depends_on "glib" => :build
# depends_on "libcdk5-dev" => :build
# depends_on "bison" => :build
# depends_on "flex" => :build
depends_on "doxygen" => build
depends_on "libxml2" => :build
depends_on "libusb" => :build

depends_on "libserialport"
depends_on "libusb"

uses_from_macos "libxml2"

def install
ENV.deparallelize # if your formula fails when building in parallel
system "mkdir build"
system "cd build"
system "pwd"
system "cmake .."
system "make"
#system "make","DESTDIR=#{prefix}","install-common-files"
mkdir "build" do
cmake_args = [
"-DOSX_INSTALL_FRAMEWORKSDIR=#{frameworks}",
"-DOSX_PACKAGE=OFF",
]
system "cmake", "..", *cmake_args, *std_cmake_args
system "make"
system "make", "install"
end

Dir.glob("#{frameworks}/iio.framework/Tools/*").each do |exec|
bin.install_symlink exec if File.executable?(exec)
end
end

test do
system "false"
system "#{bin}/iio_info", "--help"
end
end