diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..897549a --- /dev/null +++ b/.github/workflows/build.yml @@ -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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index eb7a78d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -language: c -os: osx -osx_image: xcode10.1 - -before_install: - - brew unlink python@2 - - brew update >/dev/null - - curl -O http://swdownloads.analog.com/cse/travis_builds/master_latest_libiio-darwin-10.13.6.pkg - - sudo installer -store -verbose -pkg master_latest_libiio-darwin-10.13.6.pkg -target / - - curl -O http://swdownloads.analog.com/cse/travis_builds/master_latest_libad9361-iio-osx_10.12.pkg - - sudo installer -store -verbose -pkg master_latest_libad9361-iio-osx_10.12.pkg -target / - -jobs: - include: - - stage: "Tests" - name: "Release" - script: brew install -v --build-from-source ./i-i-o-oscilloscope.rb - - stage: "Tests" - name: "Master" - script: brew install -v --HEAD --build-from-source ./i-i-o-oscilloscope.rb diff --git a/i-i-o-oscilloscope.rb b/i-i-o-oscilloscope.rb deleted file mode 100644 index 1dd89d2..0000000 --- a/i-i-o-oscilloscope.rb +++ /dev/null @@ -1,45 +0,0 @@ - -class IIOOscilloscope < Formula - - desc "IIO Oscilloscope" - homepage "https://github.com/analogdevicesinc/iio-oscilloscope/wiki" - url "https://github.com/analogdevicesinc/iio-oscilloscope/archive/v0.10-master.tar.gz" - sha256 "45feffd087f2bb53b9b9d1e2fa00e7423e94f024c8adc5cedc8f145ff3afb4ea" - head "https://github.com/analogdevicesinc/iio-oscilloscope.git" - - depends_on "libusb" - depends_on "cmake" => :build - depends_on "gtk+" => :build - depends_on "glib" => :build - depends_on "cairo" => :build - depends_on "pixman" => :build - depends_on "fontconfig" => :build - depends_on "freetype" => :build - depends_on "libpng" => :build - depends_on "pango" => :build - depends_on "fribidi" => :build - depends_on "atk" => :build - depends_on "gdk-pixbuf" => :build - depends_on "gtkdatabox" => :build - depends_on "fftw" => :build - depends_on "curl" => :build - depends_on "jansson" => :build - depends_on "libxml2" => :build - depends_on "pkg-config" => :build - depends_on "libmatio" => :build - depends_on "gettext" => :build - depends_on "harfbuzz" => :build - depends_on "graphite2" => :build - depends_on "libffi" => :build - - def install - ENV.deparallelize - system "cmake ./CMakeLists.txt -DCMAKE_INSTALL_PREFIX='#{prefix}'" - system "make", "install" - end - - test do - system "false" - end - -end diff --git a/iio-oscilloscope.rb b/iio-oscilloscope.rb new file mode 100644 index 0000000..469d225 --- /dev/null +++ b/iio-oscilloscope.rb @@ -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 diff --git a/libad9361-iio.rb b/libad9361-iio.rb index 7a860a0..e26bd06 100644 --- a/libad9361-iio.rb +++ b/libad9361-iio.rb @@ -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 diff --git a/libiio.rb b/libiio.rb index d3a4534..82cc672 100644 --- a/libiio.rb +++ b/libiio.rb @@ -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