From 918011bdf5cb5db2d54252ffbc72c59e61ff92ab Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Fri, 8 Jan 2021 00:32:31 +0000 Subject: [PATCH] test rust 1.49 failures --- Formula/asuka@0.8.1.rb | 44 ++++++++ Formula/dartsim@6.9.5.rb | 53 ++++++++++ Formula/deno@1.6.0.rb | 53 ++++++++++ Formula/echoprint-codegen@4.12.rb | 23 +++++ Formula/gjs@1.66.1.rb | 130 +++++++++++++++++++++++ Formula/ktmpl@0.9.0.rb | 42 ++++++++ Formula/pcb2gcode@2.1.0.rb | 164 ++++++++++++++++++++++++++++++ Formula/rustscan@2.0.1.rb | 19 ++++ Formula/vice@3.5.rb | 63 ++++++++++++ Formula/visp@3.3.0.rb | 130 +++++++++++++++++++++++ Formula/websocat@1.6.0.rb | 27 +++++ Formula/zenith@0.11.0.rb | 28 +++++ 12 files changed, 776 insertions(+) create mode 100644 Formula/asuka@0.8.1.rb create mode 100644 Formula/dartsim@6.9.5.rb create mode 100644 Formula/deno@1.6.0.rb create mode 100644 Formula/echoprint-codegen@4.12.rb create mode 100644 Formula/gjs@1.66.1.rb create mode 100644 Formula/ktmpl@0.9.0.rb create mode 100644 Formula/pcb2gcode@2.1.0.rb create mode 100644 Formula/rustscan@2.0.1.rb create mode 100644 Formula/vice@3.5.rb create mode 100644 Formula/visp@3.3.0.rb create mode 100644 Formula/websocat@1.6.0.rb create mode 100644 Formula/zenith@0.11.0.rb diff --git a/Formula/asuka@0.8.1.rb b/Formula/asuka@0.8.1.rb new file mode 100644 index 0000000..ab9de6c --- /dev/null +++ b/Formula/asuka@0.8.1.rb @@ -0,0 +1,44 @@ +class AsukaAT081 < Formula + desc "Gemini Project client written in Rust with NCurses" + homepage "https://git.sr.ht/~julienxx/asuka" + url "https://git.sr.ht/~julienxx/asuka/archive/0.8.1.tar.gz" + sha256 "06b03e9595b5b84e46e860ea2cf1103b244b3908fabf30337fcdf1db2a06281e" + license "MIT" + + livecheck do + url :stable + regex(/^v?(\d+(?:\.\d+)+)$/i) + end + + depends_on "rust" => :build + + uses_from_macos "ncurses" + + on_linux do + depends_on "pkg-config" => :build + depends_on "openssl@1.1" + end + + def install + system "cargo", "install", *std_cargo_args + end + + test do + input, _, wait_thr = Open3.popen2 "script -q screenlog.txt" + input.puts "stty rows 80 cols 43" + input.puts "env LC_CTYPE=en_US.UTF-8 LANG=en_US.UTF-8 TERM=xterm #{bin}/asuka" + sleep 1 + input.putc "g" + sleep 1 + input.puts "gemini://gemini.circumlunar.space" + sleep 10 + input.putc "q" + input.puts "exit" + + screenlog = (testpath/"screenlog.txt").read + assert_match /# Project Gemini/, screenlog + assert_match /Gemini is a new internet protocol/, screenlog + ensure + Process.kill("TERM", wait_thr.pid) + end +end diff --git a/Formula/dartsim@6.9.5.rb b/Formula/dartsim@6.9.5.rb new file mode 100644 index 0000000..6a23ab7 --- /dev/null +++ b/Formula/dartsim@6.9.5.rb @@ -0,0 +1,53 @@ +class DartsimAT695 < Formula + desc "Dynamic Animation and Robotics Toolkit" + homepage "https://dartsim.github.io/" + url "https://github.com/dartsim/dart/archive/v6.9.5.tar.gz" + sha256 "624c00b65e3a753cba50de038620860c86e2ac47b1793ae51f9427a4bcb14c32" + license "BSD-2-Clause" + revision 3 + + depends_on "cmake" => :build + depends_on "pkg-config" => :build + depends_on "assimp" + depends_on "boost" + depends_on "bullet" + depends_on "eigen" + depends_on "fcl" + depends_on "flann" + depends_on "ipopt" + depends_on "libccd" + depends_on "nlopt" + depends_on "ode" + depends_on "open-scene-graph" + depends_on "tinyxml2" + depends_on "urdfdom" + + def install + ENV.cxx11 + + # Force to link to system GLUT (see: https://cmake.org/Bug/view.php?id=16045) + system "cmake", ".", "-DGLUT_glut_LIBRARY=/System/Library/Frameworks/GLUT.framework", + *std_cmake_args + system "make", "install" + + # Clean up the build file garbage that has been installed. + rm_r Dir["#{share}/doc/dart/**/CMakeFiles/"] + end + + test do + (testpath/"test.cpp").write <<~EOS + #include + int main() { + auto world = std::make_shared(); + assert(world != nullptr); + return 0; + } + EOS + system ENV.cxx, "test.cpp", "-I#{Formula["eigen"].include}/eigen3", + "-I#{include}", "-L#{lib}", "-ldart", + "-L#{Formula["assimp"].opt_lib}", "-lassimp", + "-L#{Formula["boost"].opt_lib}", "-lboost_system", + "-std=c++14", "-o", "test" + system "./test" + end +end diff --git a/Formula/deno@1.6.0.rb b/Formula/deno@1.6.0.rb new file mode 100644 index 0000000..786dcad --- /dev/null +++ b/Formula/deno@1.6.0.rb @@ -0,0 +1,53 @@ +class DenoAT160 < Formula + desc "Secure runtime for JavaScript and TypeScript" + homepage "https://deno.land/" + url "https://github.com/denoland/deno/releases/download/v1.6.0/deno_src.tar.gz" + sha256 "60491d842e04ce162face61bb8857bf18a41726afbcbcd9fa532055ace7431ae" + license "MIT" + + depends_on "llvm" => :build + depends_on "rust" => :build + depends_on xcode: ["10.0", :build] # required by v8 7.9+ + depends_on :macos # Due to Python 2 (see https://github.com/denoland/deno/issues/2893) + + uses_from_macos "xz" + + # Remove at next version bump. Check that new release includes: + # https://github.com/denoland/deno/pull/8718 + patch do + url "https://github.com/denoland/deno/commit/cea42bec3272a8020f1d94afcf1a4cd7e3985553.patch?full_index=1" + sha256 "640ece7aab8e7486ea0ec4bfd29ac7e980822a57d12123e802d022bdc7bbaed7" + end + + def install + # env args for building a release build with our clang, ninja and gn + ENV["GN"] = buildpath/"gn/out/gn" + # build rusty_v8 from source + ENV["V8_FROM_SOURCE"] = "1" + # overwrite Chromium minimum sdk version of 10.15 + ENV["FORCE_MAC_SDK_MIN"] = "10.13" + # build with llvm and link against system libc++ (no runtime dep) + ENV["CLANG_BASE_PATH"] = Formula["llvm"].prefix + ENV.remove "HOMEBREW_LIBRARY_PATHS", Formula["llvm"].opt_lib + + cd "cli" do + system "cargo", "install", "-vv", *std_cargo_args + end + + # Install bash and zsh completion + output = Utils.safe_popen_read("#{bin}/deno", "completions", "bash") + (bash_completion/"deno").write output + output = Utils.safe_popen_read("#{bin}/deno", "completions", "zsh") + (zsh_completion/"_deno").write output + end + + test do + (testpath/"hello.ts").write <<~EOS + console.log("hello", "deno"); + EOS + assert_match "hello deno", shell_output("#{bin}/deno run hello.ts") + assert_match "console.log", + shell_output("#{bin}/deno run --allow-read=#{testpath} https://deno.land/std@0.50.0/examples/cat.ts " \ + "#{testpath}/hello.ts") + end +end diff --git a/Formula/echoprint-codegen@4.12.rb b/Formula/echoprint-codegen@4.12.rb new file mode 100644 index 0000000..3c638db --- /dev/null +++ b/Formula/echoprint-codegen@4.12.rb @@ -0,0 +1,23 @@ +class EchoprintCodegenAT412 < Formula + desc "Codegen for Echoprint" + homepage "https://github.com/spotify/echoprint-codegen" + url "https://github.com/echonest/echoprint-codegen/archive/v4.12.tar.gz" + sha256 "dc80133839195838975757c5f6cada01d8e09d0aac622a8a4aa23755a5a9ae6d" + license "MIT" + revision 2 + head "https://github.com/echonest/echoprint-codegen.git" + + depends_on "boost" + depends_on "ffmpeg" + depends_on "taglib" + + # Removes unnecessary -framework vecLib; can be removed in the next release + patch do + url "https://github.com/echonest/echoprint-codegen/commit/5ac72c40ae920f507f3f4da8b8875533bccf5e02.patch?full_index=1" + sha256 "1c7ffdfa498bde0da8b1b20ace5c67238338648175a067f1b129d2c726ab0fd1" + end + + def install + system "make", "-C", "src", "install", "PREFIX=#{prefix}" + end +end diff --git a/Formula/gjs@1.66.1.rb b/Formula/gjs@1.66.1.rb new file mode 100644 index 0000000..e2bf4ff --- /dev/null +++ b/Formula/gjs@1.66.1.rb @@ -0,0 +1,130 @@ +class GjsAT1661 < Formula + desc "JavaScript Bindings for GNOME" + homepage "https://gitlab.gnome.org/GNOME/gjs/wikis/Home" + url "https://download.gnome.org/sources/gjs/1.66/gjs-1.66.1.tar.xz" + sha256 "8d4240455eff642c8bf6d9805077e33e0a60cb2ea13f77a55f7f30c29668344c" + license all_of: ["LGPL-2.0-or-later", "MIT"] + + livecheck do + url :stable + end + + depends_on "meson" => :build + depends_on "ninja" => :build + depends_on "pkg-config" => :build + depends_on "python@3.8" => :build + depends_on "rust" => :build + depends_on "gobject-introspection" + depends_on "gtk+3" + depends_on "llvm" + depends_on "nspr" + depends_on "readline" + + resource "autoconf@213" do + url "https://ftp.gnu.org/gnu/autoconf/autoconf-2.13.tar.gz" + mirror "https://ftpmirror.gnu.org/autoconf/autoconf-2.13.tar.gz" + sha256 "f0611136bee505811e9ca11ca7ac188ef5323a8e2ef19cffd3edb3cf08fd791e" + end + + resource "six" do + url "https://files.pythonhosted.org/packages/6b/34/415834bfdafca3c5f451532e8a8d9ba89a21c9743a0c59fbd0205c7f9426/six-1.15.0.tar.gz" + sha256 "30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259" + end + + resource "mozjs78" do + url "https://archive.mozilla.org/pub/firefox/releases/78.2.0esr/source/firefox-78.2.0esr.source.tar.xz" + sha256 "965ccfcbb8c0aa97639911997c54be0fcf896fd388b03138952089af675ea918" + end + + def install + ENV.cxx11 + + resource("autoconf@213").stage do + system "./configure", "--disable-debug", + "--disable-dependency-tracking", + "--program-suffix=213", + "--prefix=#{buildpath}/autoconf", + "--infodir=#{buildpath}/autoconf/share/info", + "--datadir=#{buildpath}/autoconf/share" + system "make", "install" + end + + resource("six").stage do + system Formula["python@3.8"].opt_bin/"python3", *Language::Python.setup_install_args(buildpath/"vendor") + end + + resource("mozjs78").stage do + inreplace "build/moz.configure/toolchain.configure", + "sdk_max_version = Version('10.15.4')", + "sdk_max_version = Version('11.0')" + inreplace "config/rules.mk", + "-install_name $(_LOADER_PATH)/$(SHARED_LIBRARY) ", + "-install_name #{lib}/$(SHARED_LIBRARY) " + inreplace "old-configure", "-Wl,-executable_path,${DIST}/bin", "" + + mkdir("build") do + xy = Language::Python.major_minor_version "python3" + ENV.prepend_create_path "PYTHONPATH", buildpath/"vendor/lib/python#{xy}/site-packages" + ENV["PYTHON"] = Formula["python@3.8"].opt_bin/"python3" + ENV["_MACOSX_DEPLOYMENT_TARGET"] = ENV["MACOSX_DEPLOYMENT_TARGET"] + ENV["CC"] = Formula["llvm"].opt_bin/"clang" + ENV["CXX"] = Formula["llvm"].opt_bin/"clang++" + ENV.prepend_path "PATH", buildpath/"autoconf/bin" + system "../js/src/configure", "--prefix=#{prefix}", + "--with-system-nspr", + "--with-system-zlib", + "--with-system-icu", + "--enable-readline", + "--enable-shared-js", + "--enable-optimize", + "--enable-release", + "--with-intl-api", + "--disable-jemalloc" + system "make" + system "make", "install" + rm Dir["#{bin}/*"] + end + # headers were installed as softlinks, which is not acceptable + cd(include.to_s) do + `find . -type l`.chomp.split.each do |link| + header = File.readlink(link) + rm link + cp header, link + end + end + ENV.append_path "PKG_CONFIG_PATH", "#{lib}/pkgconfig" + rm "#{lib}/libjs_static.ajs" + end + + # ensure that we don't run the meson post install script + ENV["DESTDIR"] = "/" + + args = std_meson_args + %w[ + -Dprofiler=disabled + -Dinstalled_tests=false + -Dbsymbolic_functions=false + -Dskip_dbus_tests=true + -Dskip_gtk_tests=true + ] + + mkdir "build" do + system "meson", *args, ".." + system "ninja", "-v" + system "ninja", "install", "-v" + end + end + + def post_install + system "#{Formula["glib"].opt_bin}/glib-compile-schemas", "#{HOMEBREW_PREFIX}/share/glib-2.0/schemas" + end + + test do + (testpath/"test.js").write <<~EOS + #!/usr/bin/env gjs + const GLib = imports.gi.GLib; + if (31 != GLib.Date.get_days_in_month(GLib.DateMonth.JANUARY, 2000)) + imports.system.exit(1) + EOS + system "#{bin}/gjs", "test.js" + end +end diff --git a/Formula/ktmpl@0.9.0.rb b/Formula/ktmpl@0.9.0.rb new file mode 100644 index 0000000..6f9cd4c --- /dev/null +++ b/Formula/ktmpl@0.9.0.rb @@ -0,0 +1,42 @@ +class KtmplAT090 < Formula + desc "Parameterized templates for Kubernetes manifests" + homepage "https://github.com/jimmycuadra/ktmpl" + url "https://github.com/jimmycuadra/ktmpl/archive/0.9.0.tar.gz" + sha256 "b2f05ae4b36f31f6801f4dcd2f5aec31d7b53b8b6dea6ddf974b22c88d8bc62b" + license "MIT" + head "https://github.com/jimmycuadra/ktmpl.git" + + depends_on "rust" => :build + + def install + system "cargo", "install", *std_cargo_args + end + + test do + (testpath/"test.yml").write <<~EOS + --- + kind: "Template" + apiVersion: "v1" + metadata: + name: "test" + objects: + - kind: "Service" + apiVersion: "v1" + metadata: + name: "test" + spec: + ports: + - name: "test" + protocol: "TCP" + targetPort: "$((PORT))" + selector: + app: "test" + parameters: + - name: "PORT" + description: "The port the service should run on" + required: true + parameterType: "int" + EOS + system bin/"ktmpl", "test.yml", "-p", "PORT", "8080" + end +end diff --git a/Formula/pcb2gcode@2.1.0.rb b/Formula/pcb2gcode@2.1.0.rb new file mode 100644 index 0000000..421e62f --- /dev/null +++ b/Formula/pcb2gcode@2.1.0.rb @@ -0,0 +1,164 @@ +class Pcb2gcodeAT210 < Formula + desc "Command-line tool for isolation, routing and drilling of PCBs" + homepage "https://github.com/pcb2gcode/pcb2gcode" + url "https://github.com/pcb2gcode/pcb2gcode/archive/v2.1.0.tar.gz" + sha256 "ee546f0e002e83434862c7a5a2171a2276038d239909a09adb36e148e7d7319a" + license "GPL-3.0-or-later" + revision 1 + head "https://github.com/pcb2gcode/pcb2gcode.git" + + # Release 2.0.0 doesn't include an autoreconfed tarball + # glibmm, gtkmm and librsvg are used only in unittests, + # and are therefore not needed at runtime. + depends_on "atkmm" => :build + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "cairomm@1.14" => :build + depends_on "glibmm" => :build + depends_on "gtkmm" => :build + depends_on "librsvg" => :build + depends_on "libsigc++@2" => :build + depends_on "libtool" => :build + depends_on "pangomm" => :build + depends_on "pkg-config" => :build + depends_on "gerbv" + + # Upstream maintainer claims that the geometry library from boost >= 1.67 + # is severely broken. Remove the vendoring once fixed. + # See https://github.com/Homebrew/homebrew-core/pull/30914#issuecomment-411662760 + # and https://svn.boost.org/trac10/ticket/13645 + resource "boost" do + url "https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.bz2" + sha256 "5721818253e6a0989583192f96782c4a98eb6204965316df9f5ad75819225ca9" + + # Fix build on Xcode 11.4 + patch do + url "https://github.com/boostorg/build/commit/b3a59d265929a213f02a451bb63cea75d668a4d9.patch?full_index=1" + sha256 "04a4df38ed9c5a4346fbb50ae4ccc948a1440328beac03cb3586c8e2e241be08" + directory "tools/build" + end + end + + def install + resource("boost").stage do + # Force boost to compile with the desired compiler + open("user-config.jam", "a") do |file| + file.write "using darwin : : #{ENV.cxx} ;\n" + end + + bootstrap_args = %W[ + --prefix=#{buildpath}/boost + --libdir=#{buildpath}/boost/lib + --with-libraries=program_options + --without-icu + ] + + args = %W[ + --prefix=#{buildpath}/boost + --libdir=#{buildpath}/boost/lib + -d2 + -j#{ENV.make_jobs} + --ignore-site-config + --layout=tagged + --user-config=user-config.jam + install + threading=multi + link=static + optimization=space + variant=release + cxxflags=-std=c++11 + ] + + args << "cxxflags=-stdlib=libc++" << "linkflags=-stdlib=libc++" if ENV.compiler == :clang + + system "./bootstrap.sh", *bootstrap_args + system "./b2", "headers" + system "./b2", *args + end + + system "autoreconf", "-fvi" + system "./configure", "--disable-dependency-tracking", + "--disable-silent-rules", + "--prefix=#{prefix}", + "--with-boost=#{buildpath}/boost", + "--enable-static-boost" + system "make", "install" + end + + test do + (testpath/"front.gbr").write <<~EOS + %FSLAX46Y46*% + %MOMM*% + G01* + %ADD11R,2.032000X2.032000*% + %ADD12O,2.032000X2.032000*% + %ADD13C,0.250000*% + D11* + X127000000Y-63500000D03* + D12* + X127000000Y-66040000D03* + D13* + X124460000Y-66040000D01* + X124460000Y-63500000D01* + X127000000Y-63500000D01* + M02* + EOS + (testpath/"edge.gbr").write <<~EOS + %FSLAX46Y46*% + %MOMM*% + G01* + %ADD11C,0.150000*% + D11* + X123190000Y-67310000D02* + X128270000Y-67310000D01* + X128270000Y-62230000D01* + X123190000Y-62230000D01* + X123190000Y-67310000D01* + M02* + EOS + (testpath/"drill.drl").write <<~EOS + M48 + FMAT,2 + METRIC,TZ + T1C1.016 + % + G90 + G05 + M71 + T1 + X127.Y-63.5 + X127.Y-66.04 + T0 + M30 + EOS + (testpath/"millproject").write <<~EOS + metric=true + zchange=10 + zsafe=5 + mill-feed=600 + mill-speed=10000 + offset=0.1 + zwork=-0.05 + drill-feed=1000 + drill-speed=10000 + zdrill=-2.5 + bridges=0.5 + bridgesnum=4 + cut-feed=600 + cut-infeed=10 + cut-speed=10000 + cutter-diameter=3 + fill-outline=true + zbridges=-0.6 + zcut=-2.5 + al-front=true + al-probefeed=100 + al-x=15 + al-y=15 + software=LinuxCNC + EOS + system "#{bin}/pcb2gcode", "--front=front.gbr", + "--outline=edge.gbr", + "--drill=drill.drl" + end +end diff --git a/Formula/rustscan@2.0.1.rb b/Formula/rustscan@2.0.1.rb new file mode 100644 index 0000000..0529b9f --- /dev/null +++ b/Formula/rustscan@2.0.1.rb @@ -0,0 +1,19 @@ +class RustscanAT201 < Formula + desc "Modern Day Portscanner" + homepage "https://github.com/rustscan/rustscan" + url "https://github.com/RustScan/RustScan/archive/2.0.1.tar.gz" + sha256 "1d458cb081cbed2db38472ff33f9546a6640632148b4396bd12f0229ca9de7eb" + license "GPL-3.0-or-later" + + depends_on "rust" => :build + depends_on "nmap" + + def install + system "cargo", "install", *std_cargo_args + end + + test do + assert_no_match /panic/, shell_output("#{bin}/rustscan --greppable -a 127.0.0.1") + assert_no_match /panic/, shell_output("#{bin}/rustscan --greppable -a 0.0.0.0") + end +end diff --git a/Formula/vice@3.5.rb b/Formula/vice@3.5.rb new file mode 100644 index 0000000..063c0c5 --- /dev/null +++ b/Formula/vice@3.5.rb @@ -0,0 +1,63 @@ +class ViceAT35 < Formula + desc "Versatile Commodore Emulator" + homepage "https://sourceforge.net/projects/vice-emu/" + url "https://downloads.sourceforge.net/project/vice-emu/releases/vice-3.5.tar.gz" + sha256 "56b978faaeb8b2896032bd604d03c3501002187eef1ca58ceced40f11a65dc0e" + license "GPL-2.0-or-later" + revision 1 + head "https://svn.code.sf.net/p/vice-emu/code/trunk/vice" + + livecheck do + url :stable + regex(%r{url=.*?/vice[._-]v?(\d+(?:\.\d+)+)\.t}i) + end + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "dos2unix" => :build + depends_on "pkg-config" => :build + depends_on "texinfo" => :build + depends_on "xa" => :build + depends_on "yasm" => :build + + depends_on "adwaita-icon-theme" + depends_on "ffmpeg" + depends_on "flac" + depends_on "giflib" + depends_on "glew" + depends_on "gtk+3" + depends_on "jpeg" + depends_on "lame" + depends_on "libogg" + depends_on "libpng" + depends_on "librsvg" + depends_on "libvorbis" + + def install + configure_flags = %W[ + --prefix=#{prefix} + --disable-dependency-tracking + --disable-arch + --disable-pdf-docs + --enable-native-gtk3ui + --enable-midi + --enable-lame + --enable-external-ffmpeg + --enable-ethernet + --enable-cpuhistory + --with-flac + --with-vorbis + --with-gif + --with-jpeg + --with-png + ] + + system "./autogen.sh" + system "./configure", *configure_flags + system "make", "install" + end + + test do + assert_match "cycle limit reached", shell_output("#{bin}/x64sc -console -limitcycles 1000000 -logfile -", 1) + end +end diff --git a/Formula/visp@3.3.0.rb b/Formula/visp@3.3.0.rb new file mode 100644 index 0000000..b7881f3 --- /dev/null +++ b/Formula/visp@3.3.0.rb @@ -0,0 +1,130 @@ +class VispAT330 < Formula + desc "Visual Servoing Platform library" + homepage "https://visp.inria.fr/" + url "https://gforge.inria.fr/frs/download.php/latestfile/475/visp-3.3.0.tar.gz" + sha256 "f2ed11f8fee52c89487e6e24ba6a31fa604b326e08fb0f561a22c877ebdb640d" + revision 11 + + livecheck do + url "https://visp.inria.fr/download/" + regex(/href=.*?visp[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + depends_on "cmake" => :build + depends_on "pkg-config" => :build + depends_on "eigen" + depends_on "gsl" + depends_on "jpeg" + depends_on "libdc1394" + depends_on "libpng" + depends_on "opencv" + depends_on "pcl" + depends_on "zbar" + + # from first commit at https://github.com/lagadic/visp/pull/768 - remove in next release + patch do + url "https://github.com/lagadic/visp/commit/61c8beb8442f9e0fe7df8966e2e874929af02344.patch?full_index=1" + sha256 "429bf02498fc03fff7bc2a2ad065dea6d8a8bfbde6bb1adb516fa821b1e5c96f" + end + + # Fixes build on OpenCV >= 4.4.0 + # Extracted from https://github.com/lagadic/visp/pull/795 + patch :DATA + + def install + ENV.cxx11 + + sdk = MacOS::CLT.installed? ? "" : MacOS.sdk_path + + # Avoid superenv shim references + inreplace "CMakeLists.txt" do |s| + s.sub! /CMake build tool:"\s+\${CMAKE_BUILD_TOOL}/, + "CMake build tool: gmake\"" + s.sub! /C\+\+ Compiler:"\s+\${VISP_COMPILER_STR}/, + "C++ Compiler: clang++\"" + s.sub! /C Compiler:"\s+\${CMAKE_C_COMPILER}/, + "C Compiler: clang\"" + end + + system "cmake", ".", "-DBUILD_DEMOS=OFF", + "-DBUILD_EXAMPLES=OFF", + "-DBUILD_TESTS=OFF", + "-DBUILD_TUTORIALS=OFF", + "-DUSE_DC1394=ON", + "-DDC1394_INCLUDE_DIR=#{Formula["libdc1394"].opt_include}", + "-DDC1394_LIBRARY=#{Formula["libdc1394"].opt_lib}/libdc1394.dylib", + "-DUSE_EIGEN3=ON", + "-DEigen3_DIR=#{Formula["eigen"].opt_share}/eigen3/cmake", + "-DUSE_GSL=ON", + "-DGSL_INCLUDE_DIR=#{Formula["gsl"].opt_include}", + "-DGSL_cblas_LIBRARY=#{Formula["gsl"].opt_lib}/libgslcblas.dylib", + "-DGSL_gsl_LIBRARY=#{Formula["gsl"].opt_lib}/libgsl.dylib", + "-DUSE_JPEG=ON", + "-DJPEG_INCLUDE_DIR=#{Formula["jpeg"].opt_include}", + "-DJPEG_LIBRARY=#{Formula["jpeg"].opt_lib}/libjpeg.dylib", + "-DUSE_LAPACK=ON", + "-DUSE_LIBUSB_1=OFF", + "-DUSE_OPENCV=ON", + "-DOpenCV_DIR=#{Formula["opencv"].opt_share}/OpenCV", + "-DUSE_PCL=ON", + "-DUSE_PNG=ON", + "-DPNG_PNG_INCLUDE_DIR=#{Formula["libpng"].opt_include}", + "-DPNG_LIBRARY_RELEASE=#{Formula["libpng"].opt_lib}/libpng.dylib", + "-DUSE_PTHREAD=ON", + "-DPTHREAD_INCLUDE_DIR=#{sdk}/usr/include", + "-DPTHREAD_LIBRARY=/usr/lib/libpthread.dylib", + "-DUSE_PYLON=OFF", + "-DUSE_REALSENSE=OFF", + "-DUSE_REALSENSE2=OFF", + "-DUSE_X11=OFF", + "-DUSE_XML2=ON", + "-DXML2_INCLUDE_DIR=#{sdk}/usr/include/libxml2", + "-DXML2_LIBRARY=/usr/lib/libxml2.dylib", + "-DUSE_ZBAR=ON", + "-DZBAR_INCLUDE_DIRS=#{Formula["zbar"].opt_include}", + "-DZBAR_LIBRARIES=#{Formula["zbar"].opt_lib}/libzbar.dylib", + "-DUSE_ZLIB=ON", + "-DZLIB_INCLUDE_DIR=#{sdk}/usr/include", + "-DZLIB_LIBRARY_RELEASE=/usr/lib/libz.dylib", + *std_cmake_args + system "make", "install" + end + + test do + (testpath/"test.cpp").write <<~EOS + #include + #include + int main() + { + std::cout << VISP_VERSION_MAJOR << "." << VISP_VERSION_MINOR << + "." << VISP_VERSION_PATCH << std::endl; + return 0; + } + EOS + system ENV.cxx, "test.cpp", "-I#{include}", "-L#{lib}", "-o", "test" + assert_equal version.to_s, shell_output("./test").chomp + end +end +__END__ +diff --git a/modules/vision/src/key-point/vpKeyPoint.cpp b/modules/vision/src/key-point/vpKeyPoint.cpp +index dd5cabf..23ed382 100644 +--- a/modules/vision/src/key-point/vpKeyPoint.cpp ++++ b/modules/vision/src/key-point/vpKeyPoint.cpp +@@ -2269,7 +2269,7 @@ void vpKeyPoint::initDetector(const std::string &detectorName) + + if (detectorNameTmp == "SIFT") { + #ifdef VISP_HAVE_OPENCV_XFEATURES2D +- cv::Ptr siftDetector = cv::xfeatures2d::SIFT::create(); ++ cv::Ptr siftDetector = cv::SIFT::create(); + if (!usePyramid) { + m_detectors[detectorNameTmp] = siftDetector; + } else { +@@ -2447,7 +2447,7 @@ void vpKeyPoint::initExtractor(const std::string &extractorName) + #else + if (extractorName == "SIFT") { + #ifdef VISP_HAVE_OPENCV_XFEATURES2D +- m_extractors[extractorName] = cv::xfeatures2d::SIFT::create(); ++ m_extractors[extractorName] = cv::SIFT::create(); + #else + std::stringstream ss_msg; + ss_msg << "Fail to initialize the extractor: SIFT. OpenCV version " << std::hex << VISP_HAVE_OPENCV_VERSION diff --git a/Formula/websocat@1.6.0.rb b/Formula/websocat@1.6.0.rb new file mode 100644 index 0000000..feeb4d0 --- /dev/null +++ b/Formula/websocat@1.6.0.rb @@ -0,0 +1,27 @@ +class WebsocatAT160 < Formula + desc "Command-line client for WebSockets" + homepage "https://github.com/vi/websocat" + url "https://github.com/vi/websocat/archive/v1.6.0.tar.gz" + sha256 "3f7e5e99d766b387292af56c8e4b39ce9a7f0da54ff558a6080ddc1024a33896" + license "MIT" + + livecheck do + url :stable + regex(/v([\d.]+$)/i) + end + + depends_on "pkg-config" => :build + depends_on "rust" => :build + + on_linux do + depends_on "openssl@1.1" + end + + def install + system "cargo", "install", "--features", "ssl", *std_cargo_args + end + + test do + system "#{bin}/websocat", "-t", "literal:qwe", "assert:qwe" + end +end diff --git a/Formula/zenith@0.11.0.rb b/Formula/zenith@0.11.0.rb new file mode 100644 index 0000000..6884e8f --- /dev/null +++ b/Formula/zenith@0.11.0.rb @@ -0,0 +1,28 @@ +class ZenithAT0110 < Formula + desc "In terminal graphical metrics for your *nix system" + homepage "https://github.com/bvaisvil/zenith/" + url "https://github.com/bvaisvil/zenith/archive/0.11.0.tar.gz" + sha256 "be216df5d4e9bc0271971a17e8e090d3abe513f501c69e69174899a30c857254" + license "MIT" + head "https://github.com/bvaisvil/zenith.git" + + depends_on "rust" => :build + + def install + system "cargo", "install", *std_cargo_args + end + + test do + require "pty" + require "io/console" + + (testpath/"zenith").mkdir + r, w, pid = PTY.spawn "#{bin}/zenith --db zenith" + r.winsize = [80, 43] + sleep 1 + w.write "q" + assert_match /PID\s+USER\s+P\s+N\s+↓CPU%\s+MEM%/, r.read + ensure + Process.kill("TERM", pid) + end +end