CombinedText
stringlengths
4
3.42M
class Gtk4 < Formula desc "Toolkit for creating graphical user interfaces" homepage "https://gtk.org/" url "https://download.gnome.org/sources/gtk/4.2/gtk-4.2.0.tar.xz" sha256 "e975f286e911666a79b6bcf486e6f99b0bd9d2b4cc348d19bce487a0b1c97072" license "LGPL-2.0-or-later" livecheck do url :stable regex(/gtk[._-](4\.([0-8]\d*?)?[02468](?:\.\d+)*?)\.t/i) end bottle do rebuild 1 sha256 arm64_big_sur: "b24bbbb6f3bbcb763cc3f15e55e18c2f38aa06c5ffb2e6a7e78b09906b2cdc91" sha256 big_sur: "e202b5c96d50daa83008998cd19c83b4c49b25685a53a2eec0522622b09ba103" sha256 catalina: "b8cf3ec0a9c87296f6f0df43ad4980af829a7176f1304409237f8a725a22bfe6" sha256 mojave: "283a3945e375204fbf73e10a699b9ff25c4896b875a08b770d6b17f514bf19af" end depends_on "docbook" => :build depends_on "docbook-xsl" => :build depends_on "gobject-introspection" => :build depends_on "meson" => :build depends_on "ninja" => :build depends_on "pkg-config" => [:build, :test] depends_on "sassc" => :build depends_on "gdk-pixbuf" depends_on "glib" depends_on "graphene" depends_on "hicolor-icon-theme" depends_on "libepoxy" depends_on "pango" uses_from_macos "libxslt" => :build # for xsltproc uses_from_macos "cups" on_linux do depends_on "libxkbcommon" end # fix linux build https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/3480 patch do url "https://gitlab.gnome.org/dlech/gtk/-/commit/b393b811c7a66a950485770f5864435c04c59d6e.diff" sha256 "1a9d1f7c857ebc33b6bb8e7c63cb6d547227394009319d2906ddc4ff7a3eb6aa" end def install args = std_meson_args + %w[ -Dgtk_doc=false -Dman-pages=true -Dintrospection=enabled -Dbuild-examples=false -Dbuild-tests=false ] on_macos do args << "-Dx11-backend=false" args << "-Dmacos-backend=true" args << "-Dprint-cups=disabled" if MacOS.version <= :mojave end # ensure that we don't run the meson post install script ENV["DESTDIR"] = "/" # Find our docbook catalog ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog" # Disable asserts and cast checks explicitly ENV.append "CPPFLAGS", "-DG_DISABLE_ASSERT -DG_DISABLE_CAST_CHECKS" 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" system bin/"gtk4-update-icon-cache", "-f", "-t", "#{HOMEBREW_PREFIX}/share/icons/hicolor" system "#{Formula["glib"].opt_bin}/gio-querymodules #{HOMEBREW_PREFIX}/lib/gtk-4.0/4.0.0/printbackends" end test do (testpath/"test.c").write <<~EOS #include <gtk/gtk.h> int main(int argc, char *argv[]) { gtk_disable_setlocale(); return 0; } EOS flags = shell_output("#{Formula["pkg-config"].opt_bin}/pkg-config --cflags --libs gtk4").strip.split system ENV.cc, "test.c", "-o", "test", *flags system "./test" # include a version check for the pkg-config files assert_match version.to_s, shell_output("cat #{lib}/pkgconfig/gtk4.pc").strip end end gtk4 4.2.1 Closes #76618. Signed-off-by: Carlo Cabrera <3ffc397d0e4bded29cb84b56167de54c01e3a55b@users.noreply.github.com> Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com> class Gtk4 < Formula desc "Toolkit for creating graphical user interfaces" homepage "https://gtk.org/" url "https://download.gnome.org/sources/gtk/4.2/gtk-4.2.1.tar.xz" sha256 "023169775de43f0a1fde066fbc19d78545ea6a7562c1915abde9b8ae4a7309e6" license "LGPL-2.0-or-later" livecheck do url :stable regex(/gtk[._-](4\.([0-8]\d*?)?[02468](?:\.\d+)*?)\.t/i) end bottle do rebuild 1 sha256 arm64_big_sur: "b24bbbb6f3bbcb763cc3f15e55e18c2f38aa06c5ffb2e6a7e78b09906b2cdc91" sha256 big_sur: "e202b5c96d50daa83008998cd19c83b4c49b25685a53a2eec0522622b09ba103" sha256 catalina: "b8cf3ec0a9c87296f6f0df43ad4980af829a7176f1304409237f8a725a22bfe6" sha256 mojave: "283a3945e375204fbf73e10a699b9ff25c4896b875a08b770d6b17f514bf19af" end depends_on "docbook" => :build depends_on "docbook-xsl" => :build depends_on "gobject-introspection" => :build depends_on "meson" => :build depends_on "ninja" => :build depends_on "pkg-config" => [:build, :test] depends_on "sassc" => :build depends_on "gdk-pixbuf" depends_on "glib" depends_on "graphene" depends_on "hicolor-icon-theme" depends_on "libepoxy" depends_on "pango" uses_from_macos "libxslt" => :build # for xsltproc uses_from_macos "cups" on_linux do depends_on "libxkbcommon" end def install args = std_meson_args + %w[ -Dgtk_doc=false -Dman-pages=true -Dintrospection=enabled -Dbuild-examples=false -Dbuild-tests=false ] on_macos do args << "-Dx11-backend=false" args << "-Dmacos-backend=true" args << "-Dprint-cups=disabled" if MacOS.version <= :mojave end # ensure that we don't run the meson post install script ENV["DESTDIR"] = "/" # Find our docbook catalog ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog" # Disable asserts and cast checks explicitly ENV.append "CPPFLAGS", "-DG_DISABLE_ASSERT -DG_DISABLE_CAST_CHECKS" 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" system bin/"gtk4-update-icon-cache", "-f", "-t", "#{HOMEBREW_PREFIX}/share/icons/hicolor" system "#{Formula["glib"].opt_bin}/gio-querymodules #{HOMEBREW_PREFIX}/lib/gtk-4.0/4.0.0/printbackends" end test do (testpath/"test.c").write <<~EOS #include <gtk/gtk.h> int main(int argc, char *argv[]) { gtk_disable_setlocale(); return 0; } EOS flags = shell_output("#{Formula["pkg-config"].opt_bin}/pkg-config --cflags --libs gtk4").strip.split system ENV.cc, "test.c", "-o", "test", *flags system "./test" # include a version check for the pkg-config files assert_match version.to_s, shell_output("cat #{lib}/pkgconfig/gtk4.pc").strip end end
require 'formula' class Hdf5 < Formula homepage 'http://www.hdfgroup.org/HDF5' url 'http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.10/src/hdf5-1.8.10-patch1.tar.bz2' sha1 '458cb91496e313debd55d52a7f89459a5469cceb' # TODO - warn that these options conflict option :universal option 'enable-fortran', 'Compile Fortran bindings' option 'enable-cxx', 'Compile C++ bindings' option 'enable-threadsafe', 'Trade performance and C++ or Fortran support for thread safety' option 'enable-parallel', 'Compile parallel bindings' depends_on 'szip' depends_on MPIDependency.new(:cc, :cxx, :f90) if build.include? "enable-parallel" def install ENV.universal_binary if build.universal? args = %W[ --prefix=#{prefix} --enable-production --enable-debug=no --disable-dependency-tracking --with-zlib=/usr --with-szlib=#{HOMEBREW_PREFIX} --enable-filters=all --enable-static=yes --enable-shared=yes ] args << '--enable-parallel' if build.include? 'enable-parallel' if build.include? 'enable-threadsafe' args.concat %w[--with-pthread=/usr --enable-threadsafe] else if build.include? 'enable-cxx' args << '--enable-cxx' end if build.include? 'enable-fortran' args << '--enable-fortran' ENV.fortran end end if build.include? 'enable-parallel' ENV['CC'] = 'mpicc' ENV['FC'] = 'mpif90' end system "./configure", *args system "make install" end end hdf5 1.8.10-patch1: add explicit version number Closes Homebrew/homebrew#18292. Signed-off-by: Jack Nagel <43386ce32af96f5c56f2a88e458cb94cebee3751@gmail.com> require 'formula' class Hdf5 < Formula homepage 'http://www.hdfgroup.org/HDF5' url 'http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.10/src/hdf5-1.8.10-patch1.tar.bz2' sha1 '458cb91496e313debd55d52a7f89459a5469cceb' version '1.8.10-patch1' # TODO - warn that these options conflict option :universal option 'enable-fortran', 'Compile Fortran bindings' option 'enable-cxx', 'Compile C++ bindings' option 'enable-threadsafe', 'Trade performance and C++ or Fortran support for thread safety' option 'enable-parallel', 'Compile parallel bindings' depends_on 'szip' depends_on MPIDependency.new(:cc, :cxx, :f90) if build.include? "enable-parallel" def install ENV.universal_binary if build.universal? args = %W[ --prefix=#{prefix} --enable-production --enable-debug=no --disable-dependency-tracking --with-zlib=/usr --with-szlib=#{HOMEBREW_PREFIX} --enable-filters=all --enable-static=yes --enable-shared=yes ] args << '--enable-parallel' if build.include? 'enable-parallel' if build.include? 'enable-threadsafe' args.concat %w[--with-pthread=/usr --enable-threadsafe] else if build.include? 'enable-cxx' args << '--enable-cxx' end if build.include? 'enable-fortran' args << '--enable-fortran' ENV.fortran end end if build.include? 'enable-parallel' ENV['CC'] = 'mpicc' ENV['FC'] = 'mpif90' end system "./configure", *args system "make install" end end
module HasAccountsEngine VERSION = "3.0.0.beta5" end Bump to 3.0.0.beta6 module HasAccountsEngine VERSION = "3.0.0.beta6" end
class Helm < Formula desc "Kubernetes package manager" homepage "https://helm.sh/" url "https://github.com/helm/helm.git", tag: "v3.8.2", revision: "6e3701edea09e5d55a8ca2aae03a68917630e91b" license "Apache-2.0" head "https://github.com/helm/helm.git", branch: "main" bottle do sha256 cellar: :any_skip_relocation, arm64_monterey: "78901162559cfde0d695e74c82e78a8f37f7d0cf9a2a0a613a6a694196e57f50" sha256 cellar: :any_skip_relocation, arm64_big_sur: "0516554247a183ea3a7c404a217b3c320f78fdbebc59ae58ad3088fb7d8448ff" sha256 cellar: :any_skip_relocation, monterey: "300526edf608faec380e94684fc5561e6640d574ee76f7975340ca6ef7c3dca4" sha256 cellar: :any_skip_relocation, big_sur: "4a5af378b7905afe6a6edf7beac1deb6ad05b9f38a85c274e2debb6a10c3d5be" sha256 cellar: :any_skip_relocation, catalina: "85af7192de62274fd60598b0d1486f5efe9c25afaa725e8311c8c46c44e7158b" sha256 cellar: :any_skip_relocation, x86_64_linux: "db18f47ce16dddaecc48be564eb6b4782b9f85ad3ff7a42274bf535fb719aa3b" end depends_on "go" => :build def install # Don't dirty the git tree rm_rf ".brew_home" system "make", "build" bin.install "bin/helm" mkdir "man1" do system bin/"helm", "docs", "--type", "man" man1.install Dir["*"] end output = Utils.safe_popen_read(bin/"helm", "completion", "bash") (bash_completion/"helm").write output output = Utils.safe_popen_read(bin/"helm", "completion", "zsh") (zsh_completion/"_helm").write output output = Utils.safe_popen_read(bin/"helm", "completion", "fish") (fish_completion/"helm.fish").write output end test do system bin/"helm", "create", "foo" assert File.directory? testpath/"foo/charts" version_output = shell_output(bin/"helm version 2>&1") assert_match "GitTreeState:\"clean\"", version_output if build.stable? revision = stable.specs[:revision] assert_match "GitCommit:\"#{revision}\"", version_output assert_match "Version:\"v#{version}\"", version_output end end end helm 3.9.0 Closes #101849. Signed-off-by: Rui Chen <907c7afd57be493757f13ccd1dd45dddf02db069@chenrui.dev> Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com> class Helm < Formula desc "Kubernetes package manager" homepage "https://helm.sh/" url "https://github.com/helm/helm.git", tag: "v3.9.0", revision: "7ceeda6c585217a19a1131663d8cd1f7d641b2a7" license "Apache-2.0" head "https://github.com/helm/helm.git", branch: "main" bottle do sha256 cellar: :any_skip_relocation, arm64_monterey: "78901162559cfde0d695e74c82e78a8f37f7d0cf9a2a0a613a6a694196e57f50" sha256 cellar: :any_skip_relocation, arm64_big_sur: "0516554247a183ea3a7c404a217b3c320f78fdbebc59ae58ad3088fb7d8448ff" sha256 cellar: :any_skip_relocation, monterey: "300526edf608faec380e94684fc5561e6640d574ee76f7975340ca6ef7c3dca4" sha256 cellar: :any_skip_relocation, big_sur: "4a5af378b7905afe6a6edf7beac1deb6ad05b9f38a85c274e2debb6a10c3d5be" sha256 cellar: :any_skip_relocation, catalina: "85af7192de62274fd60598b0d1486f5efe9c25afaa725e8311c8c46c44e7158b" sha256 cellar: :any_skip_relocation, x86_64_linux: "db18f47ce16dddaecc48be564eb6b4782b9f85ad3ff7a42274bf535fb719aa3b" end depends_on "go" => :build def install # Don't dirty the git tree rm_rf ".brew_home" system "make", "build" bin.install "bin/helm" mkdir "man1" do system bin/"helm", "docs", "--type", "man" man1.install Dir["*"] end output = Utils.safe_popen_read(bin/"helm", "completion", "bash") (bash_completion/"helm").write output output = Utils.safe_popen_read(bin/"helm", "completion", "zsh") (zsh_completion/"_helm").write output output = Utils.safe_popen_read(bin/"helm", "completion", "fish") (fish_completion/"helm.fish").write output end test do system bin/"helm", "create", "foo" assert File.directory? testpath/"foo/charts" version_output = shell_output(bin/"helm version 2>&1") assert_match "GitTreeState:\"clean\"", version_output if build.stable? revision = stable.specs[:revision] assert_match "GitCommit:\"#{revision}\"", version_output assert_match "Version:\"v#{version}\"", version_output end end end
class Hugo < Formula desc "Configurable static site generator" homepage "https://gohugo.io/" url "https://github.com/gohugoio/hugo/archive/v0.84.0.tar.gz" sha256 "4d5bf4888c3a652bec85b6a1dc05a55d9e26f9e315fc7e98bd720c0a36a405b8" license "Apache-2.0" head "https://github.com/gohugoio/hugo.git" bottle do sha256 cellar: :any_skip_relocation, arm64_big_sur: "7407043f3ac8c574f97fe87b539701f39c270faf1f2c81263e0aab62d333b422" sha256 cellar: :any_skip_relocation, big_sur: "d2fe202e4214df4b858f0b9f3cd8b69e7c2fc9db72b0709b6a2f1375128e76ca" sha256 cellar: :any_skip_relocation, catalina: "21891fcdfd49e305d2b51a5c2c172c3f10802bb319d77bb28e56fdd77c663b19" sha256 cellar: :any_skip_relocation, mojave: "1360554ab1038eb65f7687c141f0e22e04a0a30001932facc6a756f945db58ee" end depends_on "go" => :build def install system "go", "build", *std_go_args, "-tags", "extended" # Build bash completion system bin/"hugo", "gen", "autocomplete", "--completionfile=hugo.sh" bash_completion.install "hugo.sh" # Build man pages; target dir man/ is hardcoded :( (Pathname.pwd/"man").mkpath system bin/"hugo", "gen", "man" man1.install Dir["man/*.1"] end test do site = testpath/"hops-yeast-malt-water" system "#{bin}/hugo", "new", "site", site assert_predicate testpath/"#{site}/config.toml", :exist? end end hugo: update 0.84.0 bottle. class Hugo < Formula desc "Configurable static site generator" homepage "https://gohugo.io/" url "https://github.com/gohugoio/hugo/archive/v0.84.0.tar.gz" sha256 "4d5bf4888c3a652bec85b6a1dc05a55d9e26f9e315fc7e98bd720c0a36a405b8" license "Apache-2.0" head "https://github.com/gohugoio/hugo.git" bottle do sha256 cellar: :any_skip_relocation, arm64_big_sur: "7407043f3ac8c574f97fe87b539701f39c270faf1f2c81263e0aab62d333b422" sha256 cellar: :any_skip_relocation, big_sur: "d2fe202e4214df4b858f0b9f3cd8b69e7c2fc9db72b0709b6a2f1375128e76ca" sha256 cellar: :any_skip_relocation, catalina: "21891fcdfd49e305d2b51a5c2c172c3f10802bb319d77bb28e56fdd77c663b19" sha256 cellar: :any_skip_relocation, mojave: "1360554ab1038eb65f7687c141f0e22e04a0a30001932facc6a756f945db58ee" sha256 cellar: :any_skip_relocation, x86_64_linux: "5823fbedec4c672019e4b0c680c00abd305e45089ab8f118da4e95223ee2f511" end depends_on "go" => :build def install system "go", "build", *std_go_args, "-tags", "extended" # Build bash completion system bin/"hugo", "gen", "autocomplete", "--completionfile=hugo.sh" bash_completion.install "hugo.sh" # Build man pages; target dir man/ is hardcoded :( (Pathname.pwd/"man").mkpath system bin/"hugo", "gen", "man" man1.install Dir["man/*.1"] end test do site = testpath/"hops-yeast-malt-water" system "#{bin}/hugo", "new", "site", site assert_predicate testpath/"#{site}/config.toml", :exist? end end
module ProMotion class Console NAME = "RubyMotion::Console: " DEFAULT_COLOR = [ '', '' ] RED_COLOR = [ "\e[0;31m", "\e[0m" ] # Must be in double quotes GREEN_COLOR = [ "\e[0;32m", "\e[0m" ] PURPLE_COLOR = [ "\e[0;35m", "\e[0m" ] class << self def log(log, with_color:color) return if RUBYMOTION_ENV == "test" PM.logger.deprecated "ProMotion::Console.log is deprecated. Use PM.logger (see README)" puts color[0] + NAME + log + color[1] end def log(log, withColor:color) return if RUBYMOTION_ENV == "test" PM.logger.deprecated "ProMotion::Console.log is deprecated. Use PM.logger (see README)" self.log(log, with_color:color) end def log(log) return if RUBYMOTION_ENV == "test" PM.logger.deprecated "ProMotion::Console.log is deprecated. Use PM.logger (see README)" log(log, with_color: DEFAULT_COLOR) end end end end Fix if RUBYMOTION_ENV not defined module ProMotion class Console NAME = "RubyMotion::Console: " DEFAULT_COLOR = [ '', '' ] RED_COLOR = [ "\e[0;31m", "\e[0m" ] # Must be in double quotes GREEN_COLOR = [ "\e[0;32m", "\e[0m" ] PURPLE_COLOR = [ "\e[0;35m", "\e[0m" ] class << self def log(log, with_color:color) return if defined?(RUBYMOTION_ENV) && RUBYMOTION_ENV == "test" PM.logger.deprecated "ProMotion::Console.log is deprecated. Use PM.logger (see README)" puts color[0] + NAME + log + color[1] end def log(log, withColor:color) return if defined?(RUBYMOTION_ENV) && RUBYMOTION_ENV == "test" PM.logger.deprecated "ProMotion::Console.log is deprecated. Use PM.logger (see README)" self.log(log, with_color:color) end def log(log) return if defined?(RUBYMOTION_ENV) && RUBYMOTION_ENV == "test" PM.logger.deprecated "ProMotion::Console.log is deprecated. Use PM.logger (see README)" log(log, with_color: DEFAULT_COLOR) end end end end
class Hugo < Formula desc "Configurable static site generator" homepage "https://gohugo.io/" url "https://github.com/gohugoio/hugo/archive/v0.55.5.tar.gz" sha256 "372280e86fd97bf41e7e1307672328f99911f487b0e9c4245b906717a00f1747" head "https://github.com/gohugoio/hugo.git" bottle do cellar :any_skip_relocation sha256 "acc322e568d7e947d77a6d569f305941b8886389f1377e57891aa44f9a8045c3" => :mojave sha256 "5af0463325a96f5cf98a613f738b5c2319be70cd68cc7d612d066f9817cbc9fe" => :high_sierra sha256 "65f0053c900b5dc806af220ba48fede3c553242836b376b4e109ae338a86d070" => :sierra end depends_on "go" => :build def install ENV["GOPATH"] = HOMEBREW_CACHE/"go_cache" (buildpath/"src/github.com/gohugoio/hugo").install buildpath.children cd "src/github.com/gohugoio/hugo" do system "go", "build", "-o", bin/"hugo", "-tags", "extended", "main.go" # Build bash completion system bin/"hugo", "gen", "autocomplete", "--completionfile=hugo.sh" bash_completion.install "hugo.sh" # Build man pages; target dir man/ is hardcoded :( (Pathname.pwd/"man").mkpath system bin/"hugo", "gen", "man" man1.install Dir["man/*.1"] prefix.install_metafiles end end test do site = testpath/"hops-yeast-malt-water" system "#{bin}/hugo", "new", "site", site assert_predicate testpath/"#{site}/config.toml", :exist? end end hugo: update 0.55.5 bottle. class Hugo < Formula desc "Configurable static site generator" homepage "https://gohugo.io/" url "https://github.com/gohugoio/hugo/archive/v0.55.5.tar.gz" sha256 "372280e86fd97bf41e7e1307672328f99911f487b0e9c4245b906717a00f1747" head "https://github.com/gohugoio/hugo.git" bottle do cellar :any_skip_relocation sha256 "2c88f996c36157b5e451274663b867ad4e1c3f6f04c57d1d43cdd8c631a5b209" => :mojave sha256 "f645ad6f7c7bf8023334926888915d3f1c561a0149cb0733352ab09e1646808d" => :high_sierra sha256 "f67b2d1c3f067f85ff988345b1d101c9e6c70da07edc29779b09cc85e5066103" => :sierra end depends_on "go" => :build def install ENV["GOPATH"] = HOMEBREW_CACHE/"go_cache" (buildpath/"src/github.com/gohugoio/hugo").install buildpath.children cd "src/github.com/gohugoio/hugo" do system "go", "build", "-o", bin/"hugo", "-tags", "extended", "main.go" # Build bash completion system bin/"hugo", "gen", "autocomplete", "--completionfile=hugo.sh" bash_completion.install "hugo.sh" # Build man pages; target dir man/ is hardcoded :( (Pathname.pwd/"man").mkpath system bin/"hugo", "gen", "man" man1.install Dir["man/*.1"] prefix.install_metafiles end end test do site = testpath/"hops-yeast-malt-water" system "#{bin}/hugo", "new", "site", site assert_predicate testpath/"#{site}/config.toml", :exist? end end
class Inko < Formula desc "The Inko programming language" homepage "https://inko-lang.org/" url "https://gitlab.com/inko-lang/inko/-/archive/v0.6.0/inko-v0.6.0.tar.gz" sha256 "3560023128675db5f76698e546e7f3fce70f45816735fb3fa71d103ae383fc61" head "https://gitlab.com/inko-lang/inko.git" bottle do cellar :any_skip_relocation sha256 "f3191304d3390550d8c47e063ca84e204d571f398c6034fda2395487f8aa81ea" => :catalina sha256 "be14d156158816f1389f2b18e04f06f8a6bc9310c9ff6286e1045d9a98f27f18" => :mojave sha256 "751dd81d09fcbd7aff9fe9580997d04f8c96ea45c064a18b94455c7508a3ba7e" => :high_sierra end depends_on "autoconf" => :build depends_on "automake" => :build depends_on "coreutils" => :build depends_on "libtool" => :build depends_on "make" => :build depends_on "rust" => :build uses_from_macos "ruby", :since => :sierra def install make = Formula["make"].opt_bin/"gmake" system make, "install", "PREFIX=#{libexec}" bin.install Dir[libexec/"bin/*"] bin.env_script_all_files libexec/"bin", :INKOC_HOME => libexec/"lib/inko" end test do (testpath/"hello.inko").write <<~EOS import std::stdio::stdout stdout.print('Hello, world!') EOS assert_equal "Hello, world!\n", shell_output("#{bin}/inko hello.inko") end end inko: add license class Inko < Formula desc "The Inko programming language" homepage "https://inko-lang.org/" url "https://gitlab.com/inko-lang/inko/-/archive/v0.6.0/inko-v0.6.0.tar.gz" sha256 "3560023128675db5f76698e546e7f3fce70f45816735fb3fa71d103ae383fc61" license "MPL-2.0" head "https://gitlab.com/inko-lang/inko.git" bottle do cellar :any_skip_relocation sha256 "f3191304d3390550d8c47e063ca84e204d571f398c6034fda2395487f8aa81ea" => :catalina sha256 "be14d156158816f1389f2b18e04f06f8a6bc9310c9ff6286e1045d9a98f27f18" => :mojave sha256 "751dd81d09fcbd7aff9fe9580997d04f8c96ea45c064a18b94455c7508a3ba7e" => :high_sierra end depends_on "autoconf" => :build depends_on "automake" => :build depends_on "coreutils" => :build depends_on "libtool" => :build depends_on "make" => :build depends_on "rust" => :build uses_from_macos "ruby", :since => :sierra def install make = Formula["make"].opt_bin/"gmake" system make, "install", "PREFIX=#{libexec}" bin.install Dir[libexec/"bin/*"] bin.env_script_all_files libexec/"bin", :INKOC_HOME => libexec/"lib/inko" end test do (testpath/"hello.inko").write <<~EOS import std::stdio::stdout stdout.print('Hello, world!') EOS assert_equal "Hello, world!\n", shell_output("#{bin}/inko hello.inko") end end
HipaaCrypt::MultiEncryptor module HipaaCrypt class MultiEncryptor attr_reader :merged_options, :encryptors def initialize( options = {} ) @merged_options = merge_defaults(options) merged_options[:encryptor] ||= HipaaCrypt::Encryptor @encryptors = build_encryptors end def merge_defaults(options) default_options = HipaaCrypt.config.except(:encryptor).deep_merge(options) local_defaults = default_options.except :defaults local_defaults.deep_merge!( default_options.fetch :defaults, {}) end def build_encryptors chain = merged_options[:chain] || [] all_options = ([merged_options] + chain.map {|opts| merged_options.deep_merge(opts) }).uniq all_options.map { |opts| opts.delete(:encryptor) { HipaaCrypt::Encryptor }.new(opts) } end def encrypt(*args) encryptors.first.send :encrypt, *args end def decrypt(*args) enkryptors = encryptors.dup until value begin value = enkryptors.shift.send :decrypt, *args rescue HipaaCrypt::Error::OpenSSLCipherError => e retry unless enkryptors.empty? raise e end end value end end end
class Ipfs < Formula desc "Peer-to-peer hypermedia protocol" homepage "https://ipfs.io/" url "https://github.com/ipfs/go-ipfs.git", :tag => "v0.4.20", :revision => "8efc82534f74916b3416b7f10e4daac8ff1e95c9" head "https://github.com/ipfs/go-ipfs.git" bottle do cellar :any_skip_relocation sha256 "76bf9fcba53fe32bf6d858e5b5d7c7d6987eaf18284d6db6ee70e88f2b052aab" => :mojave sha256 "d4fd3569b3947e978a997d05c7ffec4afde680ed40905578ecbb7a96a3c511d9" => :high_sierra sha256 "ab5a73f05d99d58f4748c29808cfdcb77916d85292fb57c16b0ec4e831a7fe3e" => :sierra end depends_on "go" => :build def install ENV["GOPATH"] = buildpath (buildpath/"src/github.com/ipfs/go-ipfs").install buildpath.children cd("src/github.com/ipfs/go-ipfs") { system "make", "install" } bin.install "bin/ipfs" end plist_options :manual => "ipfs daemon" def plist; <<~EOS <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>#{plist_name}</string> <key>ProgramArguments</key> <array> <string>#{opt_bin}/ipfs</string> <string>daemon</string> </array> <key>RunAtLoad</key> <true/> </dict> </plist> EOS end test do assert_match "initializing IPFS node", shell_output(bin/"ipfs init") end end ipfs: update 0.4.20 bottle. class Ipfs < Formula desc "Peer-to-peer hypermedia protocol" homepage "https://ipfs.io/" url "https://github.com/ipfs/go-ipfs.git", :tag => "v0.4.20", :revision => "8efc82534f74916b3416b7f10e4daac8ff1e95c9" head "https://github.com/ipfs/go-ipfs.git" bottle do cellar :any_skip_relocation sha256 "ded3070262a29b67ae5793665728e998aaa0f3b9be92cc0a5b9a5f020493164a" => :mojave sha256 "051958731368a985c9b78fd30c70c0ca1880fe50a24135a49a389b9760de1eef" => :high_sierra sha256 "6b6ba9d2f2528a81ef3af055c726df76eca519089f3c0ac57c7375f85beda442" => :sierra end depends_on "go" => :build def install ENV["GOPATH"] = buildpath (buildpath/"src/github.com/ipfs/go-ipfs").install buildpath.children cd("src/github.com/ipfs/go-ipfs") { system "make", "install" } bin.install "bin/ipfs" end plist_options :manual => "ipfs daemon" def plist; <<~EOS <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>#{plist_name}</string> <key>ProgramArguments</key> <array> <string>#{opt_bin}/ipfs</string> <string>daemon</string> </array> <key>RunAtLoad</key> <true/> </dict> </plist> EOS end test do assert_match "initializing IPFS node", shell_output(bin/"ipfs init") end end
class Ired < Formula desc "Minimalistic hexadecimal editor designed to be used in scripts." homepage "https://github.com/radare/ired" url "https://github.com/radare/ired/archive/0.6.tar.gz" sha256 "c15d37b96b1a25c44435d824bd7ef1f9aea9dc191be14c78b689d3156312d58a" bottle do cellar :any_skip_relocation sha256 "5d10dfac87e4a4ca589a9fa76e8f9aff62625ef6358b6ab29360e79fe4a6dc35" => :sierra sha256 "4fc558225913b629b144661385841e63ebb167beb9900475fadb0c0e886b4997" => :el_capitan end def install system "make" system "make", "install", "PREFIX=#{prefix}" end test do input = <<-EOS.undent w"hello wurld" s+7 r-4 w"orld" q EOS pipe_output("#{bin}/ired test.text", input) assert_equal "hello world", (testpath/"test.text").read.chomp end end ired: update 0.6 bottle. class Ired < Formula desc "Minimalistic hexadecimal editor designed to be used in scripts." homepage "https://github.com/radare/ired" url "https://github.com/radare/ired/archive/0.6.tar.gz" sha256 "c15d37b96b1a25c44435d824bd7ef1f9aea9dc191be14c78b689d3156312d58a" bottle do cellar :any_skip_relocation sha256 "f6af714455a74c02769c9726855a92832e43c37c79a0c589a0c7744beac8956c" => :high_sierra sha256 "5d10dfac87e4a4ca589a9fa76e8f9aff62625ef6358b6ab29360e79fe4a6dc35" => :sierra sha256 "4fc558225913b629b144661385841e63ebb167beb9900475fadb0c0e886b4997" => :el_capitan end def install system "make" system "make", "install", "PREFIX=#{prefix}" end test do input = <<-EOS.undent w"hello wurld" s+7 r-4 w"orld" q EOS pipe_output("#{bin}/ired test.text", input) assert_equal "hello world", (testpath/"test.text").read.chomp end end
require "#{Rails.root}/lib/replica" require "#{Rails.root}/lib/importers/revision_score_importer" require "#{Rails.root}/lib/importers/article_importer" require "#{Rails.root}/lib/grok" require "#{Rails.root}/lib/wiki" #= Imports articles for a category, along with view data and revision scores class CategoryImporter ################ # Entry points # ################ def self.import_category(category) cat_query = category_query category cat_response = Wiki.query cat_query # turn this into a list of articles articles_in_cat = cat_response.data['categorymembers'] article_ids = articles_in_cat.map { |article| article['pageid'] } ArticleImporter.import_articles article_ids import_latest_revision article_ids import_scores_for_latest_revision article_ids update_average_views article_ids views_and_scores_output article_ids end ################## # Output methods # ################## def self.views_and_scores_output(article_ids) output = "title, average views, completeness, views/completeness\n" article_ids.each do |id| article = Article.find(id) title = article.title completeness = article.revisions.last.wp10.to_f average_views = article.average_views output += "#{title}, #{average_views}, #{completeness}, #{average_views / completeness}\n" end puts output end ################## # Helper methods # ################## def self.category_query(category) cat = 'Category:' + category cat_query = { list: 'categorymembers', cmtitle: cat, cmlimit: 50, cmnamespace: 0 # only get mainspace articles } cat_query end def self.revisions_query(article_ids) rev_query = { prop: 'revisions', pageids: article_ids, rvprop: 'userid|ids|timestamp' } rev_query end def self.import_latest_revision(article_ids) # TODO: handle continuation rev_query = revisions_query(article_ids) rev_response = Wiki.query rev_query latest_revisions = rev_response.data['pages'] revisions_to_import = [] article_ids.each do |id| rev_data = latest_revisions[id.to_s]['revisions'][0] new_article = (rev_data['parentid'] == 0) revisions_to_import << Revision.new( id: rev_data['revid'], article_id: id, date: rev_data['timestamp'].to_datetime, user_id: rev_data['userid'], new_article: new_article) end Revision.import revisions_to_import end def self.import_scores_for_latest_revision(article_ids) revisions_to_update = [] article_ids.each do |id| next unless Article.exists?(id) revision = Article.find(id).revisions.last revisions_to_update << revision if revision.wp10.nil? end RevisionScoreImporter.update_revision_scores revisions_to_update end def self.update_average_views(article_ids) articles = Article.where(id: article_ids) articles.each do |article| next unless article.average_views.nil? || article.average_views_updated_at < 1.month.ago article.average_views = Grok.average_views_for_article(article.title) article.average_views_updated_at = Date.today article.save end end end Handle continuation to get the full category require "#{Rails.root}/lib/replica" require "#{Rails.root}/lib/importers/revision_score_importer" require "#{Rails.root}/lib/importers/article_importer" require "#{Rails.root}/lib/grok" require "#{Rails.root}/lib/wiki" #= Imports articles for a category, along with view data and revision scores class CategoryImporter ################ # Entry points # ################ def self.import_category(category) article_ids = article_ids_for_category(category) ArticleImporter.import_articles article_ids import_latest_revision article_ids import_scores_for_latest_revision article_ids update_average_views article_ids views_and_scores_output article_ids end ################## # Output methods # ################## def self.views_and_scores_output(article_ids) output = "title, average views, completeness, views/completeness\n" article_ids.each do |id| article = Article.find(id) title = article.title completeness = article.revisions.last.wp10.to_f average_views = article.average_views output += "#{title}, #{average_views}, #{completeness}, #{average_views / completeness}\n" end puts output end ################## # Helper methods # ################## def self.article_ids_for_category(category) article_ids = [] cat_query = category_query category continue = true until continue.nil? cat_response = Wiki.query cat_query article_data = cat_response.data['categorymembers'] article_data.each do |article| article_ids << article['pageid'] end continue = cat_response['continue'] cat_query['cmcontinue'] = continue['cmcontinue'] if continue end article_ids end def self.category_query(category) cat = 'Category:' + category cat_query = { list: 'categorymembers', cmtitle: cat, cmlimit: 500, cmnamespace: 0, # only get mainspace articles continue: '' } cat_query end def self.revisions_query(article_ids) rev_query = { prop: 'revisions', pageids: article_ids, rvprop: 'userid|ids|timestamp' } rev_query end def self.import_latest_revision(article_ids) latest_revisions = {} article_ids.each_slice(50) do |fifty_ids| rev_query = revisions_query(fifty_ids) rev_response = Wiki.query rev_query latest_revisions.merge! rev_response.data['pages'] end revisions_to_import = [] article_ids.each do |id| rev_data = latest_revisions[id.to_s]['revisions'][0] new_article = (rev_data['parentid'] == 0) revisions_to_import << Revision.new( id: rev_data['revid'], article_id: id, date: rev_data['timestamp'].to_datetime, user_id: rev_data['userid'], new_article: new_article) end Revision.import revisions_to_import end def self.import_scores_for_latest_revision(article_ids) revisions_to_update = [] article_ids.each do |id| next unless Article.exists?(id) revision = Article.find(id).revisions.last revisions_to_update << revision if revision.wp10.nil? end RevisionScoreImporter.update_revision_scores revisions_to_update end def self.update_average_views(article_ids) articles = Article.where(id: article_ids) articles.each do |article| next unless article.average_views.nil? || article.average_views_updated_at < 1.month.ago article.average_views = Grok.average_views_for_article(article.title) article.average_views_updated_at = Date.today article.save end end end
# This now builds a version of JACKv1 which matches the current API # for JACKv2. JACKv2 is not buildable on a number of macOS # distributions, and the JACK team instead suggests installation of # JACKOSX, a pre-built binary form for which the source is not available. # If you require JACKv2, you should use that. Otherwise, this formula should # operate fine. # Please see https://github.com/Homebrew/homebrew/pull/22043 for more info class Jack < Formula desc "Audio Connection Kit" homepage "http://jackaudio.org" url "http://jackaudio.org/downloads/jack-audio-connection-kit-0.125.0.tar.gz" sha256 "3517b5bff82139a76b2b66fe2fd9a3b34b6e594c184f95a988524c575b11d444" revision 1 bottle do sha256 "0a993d32dd74ce014e0c0aa5a04e632a7e4bca7bc6ced4afa9a7d717cc893f06" => :sierra sha256 "abb9fc993cda86b4daf45f0d2a8c775716fec08fc016facd8151787ac06e60e4" => :el_capitan sha256 "de96b9c43cb77f57d42ba02c1373b31a421ec485eafe401c11cc27c8c8c1838f" => :yosemite end depends_on "pkg-config" => :build depends_on "berkeley-db" depends_on "libsndfile" depends_on "libsamplerate" def install # Makefile hardcodes Carbon header location inreplace Dir["drivers/coreaudio/Makefile.{am,in}"], "/System/Library/Frameworks/Carbon.framework/Headers/Carbon.h", "#{MacOS.sdk_path}/System/Library/Frameworks/Carbon.framework/Headers/Carbon.h" ENV["LINKFLAGS"] = ENV.ldflags system "./configure", "--prefix=#{prefix}" system "make", "install" end plist_options :manual => "jackd -d coreaudio" def plist; <<-EOS.undent <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>#{plist_name}</string> <key>WorkingDirectory</key> <string>#{prefix}</string> <key>ProgramArguments</key> <array> <string>#{opt_bin}/jackd</string> <string>-d</string> <string>coreaudio</string> </array> <key>RunAtLoad</key> <true/> <key>KeepAlive</key> <true/> </dict> </plist> EOS end test do assert_match version.to_s, shell_output("#{bin}/jackd --version") end end jack: update 0.125.0_1 bottle. # This now builds a version of JACKv1 which matches the current API # for JACKv2. JACKv2 is not buildable on a number of macOS # distributions, and the JACK team instead suggests installation of # JACKOSX, a pre-built binary form for which the source is not available. # If you require JACKv2, you should use that. Otherwise, this formula should # operate fine. # Please see https://github.com/Homebrew/homebrew/pull/22043 for more info class Jack < Formula desc "Audio Connection Kit" homepage "http://jackaudio.org" url "http://jackaudio.org/downloads/jack-audio-connection-kit-0.125.0.tar.gz" sha256 "3517b5bff82139a76b2b66fe2fd9a3b34b6e594c184f95a988524c575b11d444" revision 1 bottle do sha256 "6b002d858a3a8b70c95f8e72471ca165c48a0c260c25ac34e2fa5b3a149bc8e6" => :high_sierra sha256 "0a993d32dd74ce014e0c0aa5a04e632a7e4bca7bc6ced4afa9a7d717cc893f06" => :sierra sha256 "abb9fc993cda86b4daf45f0d2a8c775716fec08fc016facd8151787ac06e60e4" => :el_capitan sha256 "de96b9c43cb77f57d42ba02c1373b31a421ec485eafe401c11cc27c8c8c1838f" => :yosemite end depends_on "pkg-config" => :build depends_on "berkeley-db" depends_on "libsndfile" depends_on "libsamplerate" def install # Makefile hardcodes Carbon header location inreplace Dir["drivers/coreaudio/Makefile.{am,in}"], "/System/Library/Frameworks/Carbon.framework/Headers/Carbon.h", "#{MacOS.sdk_path}/System/Library/Frameworks/Carbon.framework/Headers/Carbon.h" ENV["LINKFLAGS"] = ENV.ldflags system "./configure", "--prefix=#{prefix}" system "make", "install" end plist_options :manual => "jackd -d coreaudio" def plist; <<-EOS.undent <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>#{plist_name}</string> <key>WorkingDirectory</key> <string>#{prefix}</string> <key>ProgramArguments</key> <array> <string>#{opt_bin}/jackd</string> <string>-d</string> <string>coreaudio</string> </array> <key>RunAtLoad</key> <true/> <key>KeepAlive</key> <true/> </dict> </plist> EOS end test do assert_match version.to_s, shell_output("#{bin}/jackd --version") end end
module InheritedResources VERSION = '1.0.0'.freeze end Release new version. module InheritedResources VERSION = '1.0.1'.freeze end
# re2 (http://github.com/mudge/re2) # Ruby bindings to re2, an "efficient, principled regular expression library" # # Copyright (c) 2010-2012, Paul Mucur (http://mudge.name) # Released under the BSD Licence, please see LICENSE.txt require 'mkmf' incl, lib = dir_config("re2", "/usr/local/include", "/usr/local/lib") $CFLAGS << " -Wall -Wextra -funroll-loops" # Pass -x c++ to force gcc to compile the test program # as C++ (as it will end in .c by default). compile_options = "-x c++" have_library("stdc++") have_header("stdint.h") have_func("rb_str_sublen") unless have_library("re2") abort "You must have re2 installed and specified with --with-re2-dir, please see https://github.com/google/re2/wiki/Install" end # Recent versions of re2 now require a compiler with C++11 support checking_for("re2 requires C++11 compiler") do minimal_program = <<SRC #include <re2/re2.h> int main() { return 0; } SRC unless try_compile(minimal_program, compile_options) if try_compile(minimal_program, compile_options + " -std=c++11") compile_options << " -std=c++11" $CPPFLAGS << " -std=c++11" elsif try_compile(minimal_program, compile_options + " -std=c++0x") compile_options << " -std=c++0x" $CPPFLAGS << " -std=c++0x" else abort "Cannot compile re2 with your compiler: recent versions require C++11 support." end end end # Determine which version of re2 the user has installed. # Revision d9f8806c004d added an `endpos` argument to the # generic Match() function. # # To test for this, try to compile a simple program that uses # the newer form of Match() and set a flag if it is successful. checking_for("RE2::Match() with endpos argument") do test_re2_match_signature = <<SRC #include <re2/re2.h> int main() { RE2 pattern("test"); re2::StringPiece *match; pattern.Match("test", 0, 0, RE2::UNANCHORED, match, 0); return 0; } SRC if try_compile(test_re2_match_signature, compile_options) $defs.push("-DHAVE_ENDPOS_ARGUMENT") end end create_makefile("re2") Use CC and CXX from the environment GitHub: https://github.com/mudge/re2/issues/33 Follow the lead from Nokogiri and the sqlite3 gem by using the CC (and CXX) environments to configure the Makefile during installation if present. See: * https://github.com/sparklemotion/sqlite3-ruby/blob/master/ext/sqlite3/extconf.rb#L7 * https://github.com/sparklemotion/nokogiri/blob/master/ext/nokogiri/extconf.rb#L395-L402 # re2 (http://github.com/mudge/re2) # Ruby bindings to re2, an "efficient, principled regular expression library" # # Copyright (c) 2010-2012, Paul Mucur (http://mudge.name) # Released under the BSD Licence, please see LICENSE.txt require 'mkmf' RbConfig::MAKEFILE_CONFIG["CC"] = ENV["CC"] if ENV["CC"] RbConfig::MAKEFILE_CONFIG["CXX"] = ENV["CXX"] if ENV["CXX"] incl, lib = dir_config("re2", "/usr/local/include", "/usr/local/lib") $CFLAGS << " -Wall -Wextra -funroll-loops" # Pass -x c++ to force gcc to compile the test program # as C++ (as it will end in .c by default). compile_options = "-x c++" have_library("stdc++") have_header("stdint.h") have_func("rb_str_sublen") unless have_library("re2") abort "You must have re2 installed and specified with --with-re2-dir, please see https://github.com/google/re2/wiki/Install" end # Recent versions of re2 now require a compiler with C++11 support checking_for("re2 requires C++11 compiler") do minimal_program = <<SRC #include <re2/re2.h> int main() { return 0; } SRC unless try_compile(minimal_program, compile_options) if try_compile(minimal_program, compile_options + " -std=c++11") compile_options << " -std=c++11" $CPPFLAGS << " -std=c++11" elsif try_compile(minimal_program, compile_options + " -std=c++0x") compile_options << " -std=c++0x" $CPPFLAGS << " -std=c++0x" else abort "Cannot compile re2 with your compiler: recent versions require C++11 support." end end end # Determine which version of re2 the user has installed. # Revision d9f8806c004d added an `endpos` argument to the # generic Match() function. # # To test for this, try to compile a simple program that uses # the newer form of Match() and set a flag if it is successful. checking_for("RE2::Match() with endpos argument") do test_re2_match_signature = <<SRC #include <re2/re2.h> int main() { RE2 pattern("test"); re2::StringPiece *match; pattern.Match("test", 0, 0, RE2::UNANCHORED, match, 0); return 0; } SRC if try_compile(test_re2_match_signature, compile_options) $defs.push("-DHAVE_ENDPOS_ARGUMENT") end end create_makefile("re2")
require 'formula' class Jags < Formula homepage 'http://www-fis.iarc.fr/~martyn/software/jags/' url 'http://downloads.sourceforge.net/project/mcmc-jags/JAGS/3.x/Source/JAGS-3.3.0.tar.gz' sha1 '79a50baaf1e2b2e7673d477e830963b49aad2a6c' depends_on :fortran def install system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}" system "make install" end end jags: update homepage. Looks like the new homepage is now http://mcmc-jags.sourceforge.net. Closes Homebrew/homebrew#24801. Signed-off-by: Mike McQuaid <a17fed27eaa842282862ff7c1b9c8395a26ac320@mikemcquaid.com> require 'formula' class Jags < Formula homepage 'http://mcmc-jags.sourceforge.net' url 'http://downloads.sourceforge.net/project/mcmc-jags/JAGS/3.x/Source/JAGS-3.3.0.tar.gz' sha1 '79a50baaf1e2b2e7673d477e830963b49aad2a6c' depends_on :fortran def install system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}" system "make install" end end
# Title: FreeBSD manual tag for Jekyll # Author: Nicole Reid http://cooltrainer.org # Description: Easily link to BSD manpages. # # Syntax {% man [section] command ['release'] ['link text'] ['title text'] %} # # Examples: # {% man 8 lpc "FreeBSD 8.1-RELEASE" "the manpage" "Section 8 of the lpc manpage" %} # {% man 8 lpc "FreeBSD 8.1-RELEASE" %} # {% man lpc %} # # Output: # <a href='http://www.freebsd.org/cgi/man.cgi?query=lpc&sektion=8&manpath=FreeBSD 8.1-RELEASE' title='Section 8 of the lpc manpage'>the manpage</a> # <a href='http://www.freebsd.org/cgi/man.cgi?query=lpc&sektion=8&manpath=FreeBSD 8.1-RELEASE' title='man lpc(8) from FreeBSD 8.1-RELEASE'>lpc(8)</a> # <a href='http://www.freebsd.org/cgi/man.cgi?query=lpc&sektion=&manpath=' title='man lpc'>lpc</a> # module Jekyll class ManTag < Liquid::Tag def initialize(tag_name, markup, tokens) if markup =~ /((\d+)\s+)?([a-zA-Z0-9_.]+)(\s+((?:"|')([^"']+)(?:"|')))?(\s+((?:"|')([^"']+)(?:"|')))?(\s+((?:"|')([^"']+)(?:"|')))?/i @section = $2 || '' @man = $3 || nil @release = $6 || '' @link_text = $9 || '' @anchor_title = $12 || '' unless @link_text @link_text = @man if @section @link_text += "(#{@section})" end if @anchor_title @anchor_title += " from #{@release}" if @release end end unless @anchor_title @anchor_title = "man #{@man}" @anchor_title += " from #{@release}" if @release end end super end def render(context) output = super if @man if @release.eql? 'ubuntu' href = "http://manpages.ubuntu.com/#{@man}.#{@section}" else href = "http://www.freebsd.org/cgi/man.cgi?query=#{@man}&amp;sektion=#{@section}&amp;manpath=#{@release}" end "<a class='man' href='#{href}' title='#{@anchor_title}'>#{@link_text}</a>" else "Error processing input, expected syntax: {% man topic [release] ['link text'] ['title text'] %}" end end end end Liquid::Template.register_tag('man', Jekyll::ManTag) renamed variable '@man' to '@page' # Title: FreeBSD manual tag for Jekyll # Author: Nicole Reid http://cooltrainer.org # Description: Easily link to BSD manpages. # # Syntax {% man [section] command ['release'] ['link text'] ['title text'] %} # # Examples: # {% man 8 lpc "FreeBSD 8.1-RELEASE" "the manpage" "Section 8 of the lpc manpage" %} # {% man 8 lpc "FreeBSD 8.1-RELEASE" %} # {% man lpc %} # # Output: # <a href='http://www.freebsd.org/cgi/man.cgi?query=lpc&sektion=8&manpath=FreeBSD 8.1-RELEASE' title='Section 8 of the lpc manpage'>the manpage</a> # <a href='http://www.freebsd.org/cgi/man.cgi?query=lpc&sektion=8&manpath=FreeBSD 8.1-RELEASE' title='man lpc(8) from FreeBSD 8.1-RELEASE'>lpc(8)</a> # <a href='http://www.freebsd.org/cgi/man.cgi?query=lpc&sektion=&manpath=' title='man lpc'>lpc</a> # module Jekyll class ManTag < Liquid::Tag def initialize(tag_name, markup, tokens) if markup =~ /((\d+)\s+)?([a-zA-Z0-9_.]+)(\s+((?:"|')([^"']+)(?:"|')))?(\s+((?:"|')([^"']+)(?:"|')))?(\s+((?:"|')([^"']+)(?:"|')))?/i @section = $2 || '' @page = $3 || nil @release = $6 || '' @link_text = $9 || '' @anchor_title = $12 || '' unless @link_text @link_text = @page if @section @link_text += "(#{@section})" end if @anchor_title @anchor_title += " from #{@release}" if @release end end unless @anchor_title @anchor_title = "man #{@page}" @anchor_title += " from #{@release}" if @release end end super end def render(context) output = super if @page if @release.eql? 'ubuntu' href = "http://manpages.ubuntu.com/#{@page}.#{@section}" else href = "http://www.freebsd.org/cgi/man.cgi?query=#{@page}&amp;sektion=#{@section}&amp;manpath=#{@release}" end "<a class='man' href='#{href}' title='#{@anchor_title}'>#{@link_text}</a>" else "Error processing input, expected syntax: {% man section page [release] ['link text'] ['title text'] %}" end end end end Liquid::Template.register_tag('man', Jekyll::ManTag)
class Jlog < Formula desc "Pure C message queue with subscribers and publishers for logs" homepage "https://labs.omniti.com/labs/jlog" url "https://github.com/omniti-labs/jlog/archive/2.5.3.tar.gz" sha256 "66730afc62aa9c9f93ef686998a5396f8721edca3750097d4a2848a688d55bf9" license "BSD-3-Clause" head "https://github.com/omniti-labs/jlog.git" bottle do sha256 cellar: :any, arm64_big_sur: "aae9bc7604223b7535c8787af8737c7fb8e8e357a4106aafffcdc6ebf2d5e228" sha256 cellar: :any, big_sur: "bf009b8acfcfe3b702b017ef8e5c232fc791722fe505b71a0c3fabdeebd13443" sha256 cellar: :any, catalina: "28a606466256bf030942104c0e7b5618b442ecee7bcd7498cfac9f2cbb098ebc" sha256 cellar: :any, mojave: "e45a56ff580b67b3a17407996d72768b57f06b6f7878ca8320dc8befe8f2793f" sha256 cellar: :any, high_sierra: "583bdc22413565285d5f3551be33c17d12e18a25b665e57076332147cfb283d9" sha256 cellar: :any_skip_relocation, x86_64_linux: "ba179ee6b8b414864eea944003ac434c532e53f731e2593ac6e9978568a5b7fa" end depends_on "autoconf" => :build depends_on "automake" => :build def install system "autoconf" system "./configure", "--prefix=#{prefix}" system "make", "install" end test do (testpath/"jlogtest.c").write <<~EOS #include <stdio.h> #include <jlog.h> int main() { jlog_ctx *ctx; const char *path = "#{testpath}/jlogexample"; int rv; // First, ensure that the jlog is created ctx = jlog_new(path); if (jlog_ctx_init(ctx) != 0) { if(jlog_ctx_err(ctx) != JLOG_ERR_CREATE_EXISTS) { fprintf(stderr, "jlog_ctx_init failed: %d %s\\n", jlog_ctx_err(ctx), jlog_ctx_err_string(ctx)); exit(1); } // Make sure it knows about our subscriber(s) jlog_ctx_add_subscriber(ctx, "one", JLOG_BEGIN); jlog_ctx_add_subscriber(ctx, "two", JLOG_BEGIN); } // Now re-open for writing jlog_ctx_close(ctx); ctx = jlog_new(path); if (jlog_ctx_open_writer(ctx) != 0) { fprintf(stderr, "jlog_ctx_open_writer failed: %d %s\\n", jlog_ctx_err(ctx), jlog_ctx_err_string(ctx)); exit(0); } // Send in some data rv = jlog_ctx_write(ctx, "hello\\n", strlen("hello\\n")); if (rv != 0) { fprintf(stderr, "jlog_ctx_write_message failed: %d %s\\n", jlog_ctx_err(ctx), jlog_ctx_err_string(ctx)); } jlog_ctx_close(ctx); } EOS system ENV.cc, "jlogtest.c", "-I#{include}", "-L#{lib}", "-ljlog", "-o", "jlogtest" system testpath/"jlogtest" end end jlog: update 2.5.3 bottle. class Jlog < Formula desc "Pure C message queue with subscribers and publishers for logs" homepage "https://labs.omniti.com/labs/jlog" url "https://github.com/omniti-labs/jlog/archive/2.5.3.tar.gz" sha256 "66730afc62aa9c9f93ef686998a5396f8721edca3750097d4a2848a688d55bf9" license "BSD-3-Clause" head "https://github.com/omniti-labs/jlog.git" bottle do sha256 cellar: :any, arm64_monterey: "a47745b2bd24e09f7be0a6e55171d9e989c03914747e732153358ab76176fae6" sha256 cellar: :any, arm64_big_sur: "aae9bc7604223b7535c8787af8737c7fb8e8e357a4106aafffcdc6ebf2d5e228" sha256 cellar: :any, monterey: "bdb8f7eaef8cd4387ae246fb64d92999985c91dd9057eb08d18df4e3ccb74a04" sha256 cellar: :any, big_sur: "bf009b8acfcfe3b702b017ef8e5c232fc791722fe505b71a0c3fabdeebd13443" sha256 cellar: :any, catalina: "28a606466256bf030942104c0e7b5618b442ecee7bcd7498cfac9f2cbb098ebc" sha256 cellar: :any, mojave: "e45a56ff580b67b3a17407996d72768b57f06b6f7878ca8320dc8befe8f2793f" sha256 cellar: :any, high_sierra: "583bdc22413565285d5f3551be33c17d12e18a25b665e57076332147cfb283d9" sha256 cellar: :any_skip_relocation, x86_64_linux: "ba179ee6b8b414864eea944003ac434c532e53f731e2593ac6e9978568a5b7fa" end depends_on "autoconf" => :build depends_on "automake" => :build def install system "autoconf" system "./configure", "--prefix=#{prefix}" system "make", "install" end test do (testpath/"jlogtest.c").write <<~EOS #include <stdio.h> #include <jlog.h> int main() { jlog_ctx *ctx; const char *path = "#{testpath}/jlogexample"; int rv; // First, ensure that the jlog is created ctx = jlog_new(path); if (jlog_ctx_init(ctx) != 0) { if(jlog_ctx_err(ctx) != JLOG_ERR_CREATE_EXISTS) { fprintf(stderr, "jlog_ctx_init failed: %d %s\\n", jlog_ctx_err(ctx), jlog_ctx_err_string(ctx)); exit(1); } // Make sure it knows about our subscriber(s) jlog_ctx_add_subscriber(ctx, "one", JLOG_BEGIN); jlog_ctx_add_subscriber(ctx, "two", JLOG_BEGIN); } // Now re-open for writing jlog_ctx_close(ctx); ctx = jlog_new(path); if (jlog_ctx_open_writer(ctx) != 0) { fprintf(stderr, "jlog_ctx_open_writer failed: %d %s\\n", jlog_ctx_err(ctx), jlog_ctx_err_string(ctx)); exit(0); } // Send in some data rv = jlog_ctx_write(ctx, "hello\\n", strlen("hello\\n")); if (rv != 0) { fprintf(stderr, "jlog_ctx_write_message failed: %d %s\\n", jlog_ctx_err(ctx), jlog_ctx_err_string(ctx)); } jlog_ctx_close(ctx); } EOS system ENV.cc, "jlogtest.c", "-I#{include}", "-L#{lib}", "-ljlog", "-o", "jlogtest" system testpath/"jlogtest" end end
class Jlog < Formula desc "Pure C simple durable message queue with subscribers and publishers for logs" homepage "https://labs.omniti.com/labs/jlog" url "https://github.com/omniti-labs/jlog/archive/2.0.1.tar.gz" sha256 "ce4ec8495798e4f50af878f9fc3b922a46dd41df498a5602c802757df16499b7" bottle do cellar :any sha256 "72dcde70465b3483a9cca19b8ca6934a99176bfdb6582f89dd3d6b8009bf2f3b" => :yosemite sha256 "d0cd10cec8add751435cc2fda57d95b105df3ad2c5e58610051c125fdd52de47" => :mavericks sha256 "5bf4c685c14c48034909ac2f6a0346fc7992ae11e659e7f8b99964d7d41813c9" => :mountain_lion end depends_on "automake" => :build depends_on "autoconf" => :build def install system "autoconf" system "./configure", "--prefix=#{prefix}" system "make" system "make", "install" end test do (testpath/"jlogtest.c").write <<-EOF.undent #include <stdio.h> #include <jlog.h> int main() { jlog_ctx *ctx; const char *path = "#{testpath}/jlogexample"; int rv; // First, ensure that the jlog is created ctx = jlog_new(path); if (jlog_ctx_init(ctx) != 0) { if(jlog_ctx_err(ctx) != JLOG_ERR_CREATE_EXISTS) { fprintf(stderr, "jlog_ctx_init failed: %d %s\\n", jlog_ctx_err(ctx), jlog_ctx_err_string(ctx)); exit(1); } // Make sure it knows about our subscriber(s) jlog_ctx_add_subscriber(ctx, "one", JLOG_BEGIN); jlog_ctx_add_subscriber(ctx, "two", JLOG_BEGIN); } // Now re-open for writing jlog_ctx_close(ctx); ctx = jlog_new(path); if (jlog_ctx_open_writer(ctx) != 0) { fprintf(stderr, "jlog_ctx_open_writer failed: %d %s\\n", jlog_ctx_err(ctx), jlog_ctx_err_string(ctx)); exit(0); } // Send in some data rv = jlog_ctx_write(ctx, "hello\\n", strlen("hello\\n")); if (rv != 0) { fprintf(stderr, "jlog_ctx_write_message failed: %d %s\\n", jlog_ctx_err(ctx), jlog_ctx_err_string(ctx)); } jlog_ctx_close(ctx); } EOF system ENV.cc, "jlogtest.c", "-I#{include}", "-ljlog", "-o", "jlogtest" system testpath/"jlogtest" end end jlog 2.1.3.2 Closes #134. Signed-off-by: Alex Dunn <46952c1342d5ce1a4f5689855eda3c9064bca8f6@gmail.com> class Jlog < Formula desc "Pure C message queue with subscribers and publishers for logs" homepage "https://labs.omniti.com/labs/jlog" url "https://github.com/omniti-labs/jlog/archive/2.1.3.2.tar.gz" sha256 "2915a964cade8fbc7f392b454ef33ef999a33a53457f503762e6108b86c4d979" head "https://github.com/omniti-labs/jlog.git" bottle do cellar :any sha256 "72dcde70465b3483a9cca19b8ca6934a99176bfdb6582f89dd3d6b8009bf2f3b" => :yosemite sha256 "d0cd10cec8add751435cc2fda57d95b105df3ad2c5e58610051c125fdd52de47" => :mavericks sha256 "5bf4c685c14c48034909ac2f6a0346fc7992ae11e659e7f8b99964d7d41813c9" => :mountain_lion end depends_on "automake" => :build depends_on "autoconf" => :build def install system "autoconf" system "./configure", "--prefix=#{prefix}" system "make" system "make", "install" end test do (testpath/"jlogtest.c").write <<-EOF.undent #include <stdio.h> #include <jlog.h> int main() { jlog_ctx *ctx; const char *path = "#{testpath}/jlogexample"; int rv; // First, ensure that the jlog is created ctx = jlog_new(path); if (jlog_ctx_init(ctx) != 0) { if(jlog_ctx_err(ctx) != JLOG_ERR_CREATE_EXISTS) { fprintf(stderr, "jlog_ctx_init failed: %d %s\\n", jlog_ctx_err(ctx), jlog_ctx_err_string(ctx)); exit(1); } // Make sure it knows about our subscriber(s) jlog_ctx_add_subscriber(ctx, "one", JLOG_BEGIN); jlog_ctx_add_subscriber(ctx, "two", JLOG_BEGIN); } // Now re-open for writing jlog_ctx_close(ctx); ctx = jlog_new(path); if (jlog_ctx_open_writer(ctx) != 0) { fprintf(stderr, "jlog_ctx_open_writer failed: %d %s\\n", jlog_ctx_err(ctx), jlog_ctx_err_string(ctx)); exit(0); } // Send in some data rv = jlog_ctx_write(ctx, "hello\\n", strlen("hello\\n")); if (rv != 0) { fprintf(stderr, "jlog_ctx_write_message failed: %d %s\\n", jlog_ctx_err(ctx), jlog_ctx_err_string(ctx)); } jlog_ctx_close(ctx); } EOF system ENV.cc, "jlogtest.c", "-I#{include}", "-ljlog", "-o", "jlogtest" system testpath/"jlogtest" end end
require 'formula' class Jp2a < Formula homepage 'http://csl.sublevel3.org/jp2a/' url 'https://downloads.sourceforge.net/project/jp2a/jp2a/1.0.6/jp2a-1.0.6.tar.gz' sha1 '8d08a7f9428632c02351452067828af215afe2cf' depends_on 'jpeg' def install system "./configure", "--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}" system "make install" end test do system "#{bin}/jp2a", "-V" end end jp2a: real test added Closes Homebrew/homebrew#35785. Signed-off-by: Mike McQuaid <a17fed27eaa842282862ff7c1b9c8395a26ac320@mikemcquaid.com> class Jp2a < Formula homepage "http://csl.sublevel3.org/jp2a/" url "https://downloads.sourceforge.net/project/jp2a/jp2a/1.0.6/jp2a-1.0.6.tar.gz" sha1 "8d08a7f9428632c02351452067828af215afe2cf" option "without-check", "Skip compile-time tests." depends_on "jpeg" def install system "./configure", "--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}" system "make", "test" if build.with? "check" system "make", "install" end test do system "#{bin}/jp2a", test_fixtures("test.jpg") end end
require 'formula' class Jpeg < Formula homepage 'http://www.ijg.org' url 'http://www.ijg.org/files/jpegsrc.v8d.tar.gz' version '8d' sha1 'f080b2fffc7581f7d19b968092ba9ebc234556ff' bottle do sha1 '80b23581fb5b2b92d787969f75cedbe8054c93a4' => :mountainlion sha1 'a16984c6522807644ea960cb724f91aeca2d3dd0' => :lion sha1 'edff61d516f97d76341a14211d0206bda18d0cf7' => :snowleopard end def install ENV.universal_binary # Builds universal libs. Default is static & shared. system "./configure", "--prefix=#{prefix}", "--disable-dependency-tracking" system "make install" end end jpeg: support version format. require 'formula' class Jpeg < Formula homepage 'http://www.ijg.org' url 'http://www.ijg.org/files/jpegsrc.v8d.tar.gz' sha1 'f080b2fffc7581f7d19b968092ba9ebc234556ff' bottle do sha1 '80b23581fb5b2b92d787969f75cedbe8054c93a4' => :mountainlion sha1 'a16984c6522807644ea960cb724f91aeca2d3dd0' => :lion sha1 'edff61d516f97d76341a14211d0206bda18d0cf7' => :snowleopard end def install ENV.universal_binary # Builds static and shared libraries. system "./configure", "--prefix=#{prefix}", "--disable-dependency-tracking" system "make install" end end
require "json/stream" module Json module Streamer class JsonStreamer attr_reader :aggregator attr_reader :parser def initialize(file_io = nil, chunk_size = 1000) @parser = JSON::Stream::Parser.new @file_io = file_io @chunk_size = chunk_size @current_nesting_level = -1 @current_key = nil @aggregator = {} @aggregator_keys = {} @parser.start_object {start_object} @parser.start_array {start_array} @parser.key {|k| key(k)} end # Callbacks containing `yield` have to be defined in the method called via block otherwise yield won't work def get(nesting_level:-1, key:nil, yield_values:true) yield_nesting_level = nesting_level wanted_key = key @parser.value do |v| if array_level?(@current_nesting_level) if yield_values and yield_value?(yield_nesting_level) yield v else @aggregator[@current_nesting_level] << v end else @aggregator[@current_nesting_level][@current_key] = v if yield_values and yield_value?(yield_nesting_level, wanted_key) yield v end end end @parser.end_object do if yield_object?(yield_nesting_level, wanted_key) yield @aggregator[@current_nesting_level].clone reset_current_level(Hash.new) else merge_up end @current_nesting_level -= 1 end @parser.end_array do if yield_object?(yield_nesting_level, wanted_key) yield @aggregator[@current_nesting_level].clone reset_current_level(Array.new) else merge_up end @current_nesting_level -= 1 end if @file_io @file_io.each(@chunk_size) do |chunk| @parser << chunk end end end def yield_object?(yield_nesting_level, wanted_key) @current_nesting_level.eql? yield_nesting_level or (not wanted_key.nil? and wanted_key == @aggregator_keys[@current_nesting_level-1]) end def yield_value?(yield_nesting_level, wanted_key = nil) (@current_nesting_level + 1).eql? yield_nesting_level or (not wanted_key.nil? and wanted_key == @current_key) end def start_object new_level(Hash.new) end def start_array new_level(Array.new) end def new_level(type) set_aggregator_key @current_nesting_level += 1 reset_current_level(type) end def reset_current_level(type) @aggregator[@current_nesting_level] = type end def set_aggregator_key reset_current_key if array_level?(@current_nesting_level) @aggregator_keys[@current_nesting_level] = @current_key end def reset_current_key @current_key = nil end def array_level?(nesting_level) @aggregator[nesting_level].is_a?(Array) end def key(k) @current_key = k end def merge_up return if @current_nesting_level.zero? if array_level?(previous_nesting_level) @aggregator[previous_nesting_level] << @aggregator[@current_nesting_level] else @aggregator[previous_nesting_level][@aggregator_keys[previous_nesting_level]] = @aggregator[@current_nesting_level] end @aggregator.delete(@current_nesting_level) end def previous_nesting_level @current_nesting_level - 1 end end end end Refactors to use guard clause require "json/stream" module Json module Streamer class JsonStreamer attr_reader :aggregator attr_reader :parser def initialize(file_io = nil, chunk_size = 1000) @parser = JSON::Stream::Parser.new @file_io = file_io @chunk_size = chunk_size @current_nesting_level = -1 @current_key = nil @aggregator = {} @aggregator_keys = {} @parser.start_object {start_object} @parser.start_array {start_array} @parser.key {|k| key(k)} end # Callbacks containing `yield` have to be defined in the method called via block otherwise yield won't work def get(nesting_level:-1, key:nil, yield_values:true) yield_nesting_level = nesting_level wanted_key = key @parser.value do |v| if array_level?(@current_nesting_level) if yield_values and yield_value?(yield_nesting_level) yield v else @aggregator[@current_nesting_level] << v end else @aggregator[@current_nesting_level][@current_key] = v if yield_values and yield_value?(yield_nesting_level, wanted_key) yield v end end end @parser.end_object do if yield_object?(yield_nesting_level, wanted_key) yield @aggregator[@current_nesting_level].clone reset_current_level(Hash.new) else merge_up end @current_nesting_level -= 1 end @parser.end_array do if yield_object?(yield_nesting_level, wanted_key) yield @aggregator[@current_nesting_level].clone reset_current_level(Array.new) else merge_up end @current_nesting_level -= 1 end @file_io.each(@chunk_size) { |chunk| @parser << chunk } if @file_io end def yield_object?(yield_nesting_level, wanted_key) @current_nesting_level.eql? yield_nesting_level or (not wanted_key.nil? and wanted_key == @aggregator_keys[@current_nesting_level-1]) end def yield_value?(yield_nesting_level, wanted_key = nil) (@current_nesting_level + 1).eql? yield_nesting_level or (not wanted_key.nil? and wanted_key == @current_key) end def start_object new_level(Hash.new) end def start_array new_level(Array.new) end def new_level(type) set_aggregator_key @current_nesting_level += 1 reset_current_level(type) end def reset_current_level(type) @aggregator[@current_nesting_level] = type end def set_aggregator_key reset_current_key if array_level?(@current_nesting_level) @aggregator_keys[@current_nesting_level] = @current_key end def reset_current_key @current_key = nil end def array_level?(nesting_level) @aggregator[nesting_level].is_a?(Array) end def key(k) @current_key = k end def merge_up return if @current_nesting_level.zero? if array_level?(previous_nesting_level) @aggregator[previous_nesting_level] << @aggregator[@current_nesting_level] else @aggregator[previous_nesting_level][@aggregator_keys[previous_nesting_level]] = @aggregator[@current_nesting_level] end @aggregator.delete(@current_nesting_level) end def previous_nesting_level @current_nesting_level - 1 end end end end
class Jrnl < Formula include Language::Python::Virtualenv desc "Command-line note taker" homepage "https://jrnl.sh/" url "https://files.pythonhosted.org/packages/b2/38/d8bec99bbc94d8bab97e9432bd4878f7c98826caa0d228604b6fcd2248d3/jrnl-2.5.tar.gz" sha256 "3984d402feb18538fca6bbba3e0b9900b2f78af0a800fffa735ab9b08896ffda" license "GPL-3.0-only" livecheck do url :stable end bottle do sha256 "96a6adf438d7e5b0f6da73a3ba45c1bd4d3b8b3bd9c6e89d1bc3c240bc221264" => :catalina sha256 "b620db98f7e06d2e1321406fc3527ea66a214d3586bf76683586a7e73e353fe0" => :mojave sha256 "bb6ac873a16d1944c6191425f379105ea58e8deb59adf66991b337a8169b2ba4" => :high_sierra end depends_on "python@3.9" uses_from_macos "expect" => :test on_linux do depends_on "pkg-config" => :build end resource "ansiwrap" do url "https://files.pythonhosted.org/packages/7c/45/2616341cfcace37d4619d5106a85fcc24f2170d1a161bc5f7fdb81772fbc/ansiwrap-0.8.4.zip" sha256 "ca0c740734cde59bf919f8ff2c386f74f9a369818cdc60efe94893d01ea8d9b7" end resource "asteval" do url "https://files.pythonhosted.org/packages/4d/35/140edd280047b77aef487a8840c0f60372ab15210eb8064e5de9b832730c/asteval-0.9.19.tar.gz" sha256 "445f3a59df692c0c0ff2868c0bbf9b293884db4a9f9a13c73555485ba75ed08b" end resource "cffi" do url "https://files.pythonhosted.org/packages/cb/ae/380e33d621ae301770358eb11a896a34c34f30db188847a561e8e39ee866/cffi-1.14.3.tar.gz" sha256 "f92f789e4f9241cd262ad7a555ca2c648a98178a953af117ef7fad46aa1d5591" end resource "colorama" do url "https://files.pythonhosted.org/packages/1f/bb/5d3246097ab77fa083a61bd8d3d527b7ae063c7d8e8671b1cf8c4ec10cbe/colorama-0.4.4.tar.gz" sha256 "5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b" end resource "cryptography" do url "https://files.pythonhosted.org/packages/94/5c/42de91c7fbdb817b2d9a4e64b067946eb38a4eb36c1a09c96c87a0f86a82/cryptography-3.2.1.tar.gz" sha256 "d3d5e10be0cf2a12214ddee45c6bd203dab435e3d83b4560c03066eda600bfe3" end resource "keyring" do url "https://files.pythonhosted.org/packages/c9/5a/c7aefc112d75872ea2099c494b84ba6e108b20584264929e614c60939368/keyring-21.5.0.tar.gz" sha256 "207bd66f2a9881c835dad653da04e196c678bf104f8252141d2d3c4f31051579" end resource "packaging" do url "https://files.pythonhosted.org/packages/55/fd/fc1aca9cf51ed2f2c11748fa797370027babd82f87829c7a8e6dbe720145/packaging-20.4.tar.gz" sha256 "4357f74f47b9c12db93624a82154e9b120fa8293699949152b22065d556079f8" end resource "parsedatetime" do url "https://files.pythonhosted.org/packages/a8/20/cb587f6672dbe585d101f590c3871d16e7aec5a576a1694997a3777312ac/parsedatetime-2.6.tar.gz" sha256 "4cb368fbb18a0b7231f4d76119165451c8d2e35951455dfee97c62a87b04d455" end resource "passlib" do url "https://files.pythonhosted.org/packages/b6/06/9da9ee59a67fae7761aab3ccc84fa4f3f33f125b370f1ccdb915bf967c11/passlib-1.7.4.tar.gz" sha256 "defd50f72b65c5402ab2c573830a6978e5f202ad0d984793c8dde2c4152ebe04" end resource "pycparser" do url "https://files.pythonhosted.org/packages/0f/86/e19659527668d70be91d0369aeaa055b4eb396b0f387a4f92293a20035bd/pycparser-2.20.tar.gz" sha256 "2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0" end resource "pyparsing" do url "https://files.pythonhosted.org/packages/c1/47/dfc9c342c9842bbe0036c7f763d2d6686bcf5eb1808ba3e170afdb282210/pyparsing-2.4.7.tar.gz" sha256 "c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1" end resource "python-dateutil" do url "https://files.pythonhosted.org/packages/be/ed/5bbc91f03fa4c839c4c7360375da77f9659af5f7086b7a7bdda65771c8e0/python-dateutil-2.8.1.tar.gz" sha256 "73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c" end resource "pytz" do url "https://files.pythonhosted.org/packages/09/07/448a8887c7195450604dfc0305d80d74324c36ee18ed997664051d4bffe3/pytz-2020.4.tar.gz" sha256 "3e6b7dd2d1e0a59084bcee14a17af60c5c562cdc16d828e8eba2e683d3a7e268" end resource "pyxdg" do url "https://files.pythonhosted.org/packages/47/6e/311d5f22e2b76381719b5d0c6e9dc39cd33999adae67db71d7279a6d70f4/pyxdg-0.26.tar.gz" sha256 "fe2928d3f532ed32b39c32a482b54136fe766d19936afc96c8f00645f9da1a06" end resource "PyYAML" do url "https://files.pythonhosted.org/packages/64/c2/b80047c7ac2478f9501676c988a5411ed5572f35d1beff9cae07d321512c/PyYAML-5.3.1.tar.gz" sha256 "b8eac752c5e14d3eca0e6dd9199cd627518cb5ec06add0de9d32baeee6fe645d" end resource "six" do url "https://files.pythonhosted.org/packages/6b/34/415834bfdafca3c5f451532e8a8d9ba89a21c9743a0c59fbd0205c7f9426/six-1.15.0.tar.gz" sha256 "30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259" end resource "textwrap3" do url "https://files.pythonhosted.org/packages/4d/02/cef645d4558411b51700e3f56cefd88f05f05ec1b8fa39a3142963f5fcd2/textwrap3-0.9.2.zip" sha256 "5008eeebdb236f6303dcd68f18b856d355f6197511d952ba74bc75e40e0c3414" end resource "tzlocal" do url "https://files.pythonhosted.org/packages/ce/73/99e4cc30db6b21cba6c3b3b80cffc472cc5a0feaf79c290f01f1ac460710/tzlocal-2.1.tar.gz" sha256 "643c97c5294aedc737780a49d9df30889321cbe1204eac2c2ec6134035a92e44" end resource "asn1crypto" do on_linux do url "https://files.pythonhosted.org/packages/9f/3d/8beae739ed8c1c8f00ceac0ab6b0e97299b42da869e24cf82851b27a9123/asn1crypto-1.3.0.tar.gz" sha256 "5a215cb8dc12f892244e3a113fe05397ee23c5c4ca7a69cd6e69811755efc42d" end end resource "jeepney" do on_linux do url "https://files.pythonhosted.org/packages/74/24/9b720cc6b2a73c908896a0ed64cb49780dcfbf4964e23a725aa6323f4452/jeepney-0.4.3.tar.gz" sha256 "3479b861cc2b6407de5188695fa1a8d57e5072d7059322469b62628869b8e36e" end end resource "secretstorage" do on_linux do url "https://files.pythonhosted.org/packages/fd/9f/36197c75d9a09b1ab63f56cb985af6cd858ca3fc41fd9cd890ce69bae5b9/SecretStorage-3.1.2.tar.gz" sha256 "15da8a989b65498e29be338b3b279965f1b8f09b9668bd8010da183024c8bff6" end end def install virtualenv_install_with_resources end test do (testpath/"tests.sh").write <<~EOS #{OS.mac? ? "#!/usr/bin/expect -f" : "#!/usr/bin/env expect"} set timeout 3 match_max 100000 # Write the journal spawn "#{bin}/jrnl" "This is the fanciest test in the world." expect { "/.local/share/jrnl/journal.txt" { send -- "#{testpath}/test.txt\r" } timeout { exit 1 } } expect { "You can always change this later" { send -- "n\r" } timeout { exit 1 } } expect { eof { exit } timeout { exit 1 } } # Read the journal spawn "#{bin}/jrnl" -1 expect { "This is the fanciest test in the world." { exit } timeout { exit 1 } eof { exit 1 } } # Encrypt the journal spawn "#{bin}/jrnl" --encrypt expect { -exact "Enter password for new journal: " { send -- "homebrew\r" } timeout { exit 1 } } expect { -exact "Enter password again: " { send -- "homebrew\r" } timeout { exit 1 } } expect { -exact "Do you want to store the password in your keychain? \[Y/n\] " { send -- "n\r" } timeout { exit 1 } } expect { -re "Journal encrypted to .*/test.txt." { exit } timeout { exit 1 } eof { exit 1 } } EOS system "expect", "./tests.sh" assert_predicate testpath/".config/jrnl/jrnl.yaml", :exist? assert_predicate testpath/"test.txt", :exist? end end jrnl: update 2.5 bottle. class Jrnl < Formula include Language::Python::Virtualenv desc "Command-line note taker" homepage "https://jrnl.sh/" url "https://files.pythonhosted.org/packages/b2/38/d8bec99bbc94d8bab97e9432bd4878f7c98826caa0d228604b6fcd2248d3/jrnl-2.5.tar.gz" sha256 "3984d402feb18538fca6bbba3e0b9900b2f78af0a800fffa735ab9b08896ffda" license "GPL-3.0-only" livecheck do url :stable end bottle do sha256 "96a6adf438d7e5b0f6da73a3ba45c1bd4d3b8b3bd9c6e89d1bc3c240bc221264" => :catalina sha256 "b620db98f7e06d2e1321406fc3527ea66a214d3586bf76683586a7e73e353fe0" => :mojave sha256 "bb6ac873a16d1944c6191425f379105ea58e8deb59adf66991b337a8169b2ba4" => :high_sierra sha256 "2583feefc6e0292b480f403b64ada39db0761defb88fc4e85522dde2c4c740bb" => :x86_64_linux end depends_on "python@3.9" uses_from_macos "expect" => :test on_linux do depends_on "pkg-config" => :build end resource "ansiwrap" do url "https://files.pythonhosted.org/packages/7c/45/2616341cfcace37d4619d5106a85fcc24f2170d1a161bc5f7fdb81772fbc/ansiwrap-0.8.4.zip" sha256 "ca0c740734cde59bf919f8ff2c386f74f9a369818cdc60efe94893d01ea8d9b7" end resource "asteval" do url "https://files.pythonhosted.org/packages/4d/35/140edd280047b77aef487a8840c0f60372ab15210eb8064e5de9b832730c/asteval-0.9.19.tar.gz" sha256 "445f3a59df692c0c0ff2868c0bbf9b293884db4a9f9a13c73555485ba75ed08b" end resource "cffi" do url "https://files.pythonhosted.org/packages/cb/ae/380e33d621ae301770358eb11a896a34c34f30db188847a561e8e39ee866/cffi-1.14.3.tar.gz" sha256 "f92f789e4f9241cd262ad7a555ca2c648a98178a953af117ef7fad46aa1d5591" end resource "colorama" do url "https://files.pythonhosted.org/packages/1f/bb/5d3246097ab77fa083a61bd8d3d527b7ae063c7d8e8671b1cf8c4ec10cbe/colorama-0.4.4.tar.gz" sha256 "5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b" end resource "cryptography" do url "https://files.pythonhosted.org/packages/94/5c/42de91c7fbdb817b2d9a4e64b067946eb38a4eb36c1a09c96c87a0f86a82/cryptography-3.2.1.tar.gz" sha256 "d3d5e10be0cf2a12214ddee45c6bd203dab435e3d83b4560c03066eda600bfe3" end resource "keyring" do url "https://files.pythonhosted.org/packages/c9/5a/c7aefc112d75872ea2099c494b84ba6e108b20584264929e614c60939368/keyring-21.5.0.tar.gz" sha256 "207bd66f2a9881c835dad653da04e196c678bf104f8252141d2d3c4f31051579" end resource "packaging" do url "https://files.pythonhosted.org/packages/55/fd/fc1aca9cf51ed2f2c11748fa797370027babd82f87829c7a8e6dbe720145/packaging-20.4.tar.gz" sha256 "4357f74f47b9c12db93624a82154e9b120fa8293699949152b22065d556079f8" end resource "parsedatetime" do url "https://files.pythonhosted.org/packages/a8/20/cb587f6672dbe585d101f590c3871d16e7aec5a576a1694997a3777312ac/parsedatetime-2.6.tar.gz" sha256 "4cb368fbb18a0b7231f4d76119165451c8d2e35951455dfee97c62a87b04d455" end resource "passlib" do url "https://files.pythonhosted.org/packages/b6/06/9da9ee59a67fae7761aab3ccc84fa4f3f33f125b370f1ccdb915bf967c11/passlib-1.7.4.tar.gz" sha256 "defd50f72b65c5402ab2c573830a6978e5f202ad0d984793c8dde2c4152ebe04" end resource "pycparser" do url "https://files.pythonhosted.org/packages/0f/86/e19659527668d70be91d0369aeaa055b4eb396b0f387a4f92293a20035bd/pycparser-2.20.tar.gz" sha256 "2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0" end resource "pyparsing" do url "https://files.pythonhosted.org/packages/c1/47/dfc9c342c9842bbe0036c7f763d2d6686bcf5eb1808ba3e170afdb282210/pyparsing-2.4.7.tar.gz" sha256 "c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1" end resource "python-dateutil" do url "https://files.pythonhosted.org/packages/be/ed/5bbc91f03fa4c839c4c7360375da77f9659af5f7086b7a7bdda65771c8e0/python-dateutil-2.8.1.tar.gz" sha256 "73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c" end resource "pytz" do url "https://files.pythonhosted.org/packages/09/07/448a8887c7195450604dfc0305d80d74324c36ee18ed997664051d4bffe3/pytz-2020.4.tar.gz" sha256 "3e6b7dd2d1e0a59084bcee14a17af60c5c562cdc16d828e8eba2e683d3a7e268" end resource "pyxdg" do url "https://files.pythonhosted.org/packages/47/6e/311d5f22e2b76381719b5d0c6e9dc39cd33999adae67db71d7279a6d70f4/pyxdg-0.26.tar.gz" sha256 "fe2928d3f532ed32b39c32a482b54136fe766d19936afc96c8f00645f9da1a06" end resource "PyYAML" do url "https://files.pythonhosted.org/packages/64/c2/b80047c7ac2478f9501676c988a5411ed5572f35d1beff9cae07d321512c/PyYAML-5.3.1.tar.gz" sha256 "b8eac752c5e14d3eca0e6dd9199cd627518cb5ec06add0de9d32baeee6fe645d" end resource "six" do url "https://files.pythonhosted.org/packages/6b/34/415834bfdafca3c5f451532e8a8d9ba89a21c9743a0c59fbd0205c7f9426/six-1.15.0.tar.gz" sha256 "30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259" end resource "textwrap3" do url "https://files.pythonhosted.org/packages/4d/02/cef645d4558411b51700e3f56cefd88f05f05ec1b8fa39a3142963f5fcd2/textwrap3-0.9.2.zip" sha256 "5008eeebdb236f6303dcd68f18b856d355f6197511d952ba74bc75e40e0c3414" end resource "tzlocal" do url "https://files.pythonhosted.org/packages/ce/73/99e4cc30db6b21cba6c3b3b80cffc472cc5a0feaf79c290f01f1ac460710/tzlocal-2.1.tar.gz" sha256 "643c97c5294aedc737780a49d9df30889321cbe1204eac2c2ec6134035a92e44" end resource "asn1crypto" do on_linux do url "https://files.pythonhosted.org/packages/9f/3d/8beae739ed8c1c8f00ceac0ab6b0e97299b42da869e24cf82851b27a9123/asn1crypto-1.3.0.tar.gz" sha256 "5a215cb8dc12f892244e3a113fe05397ee23c5c4ca7a69cd6e69811755efc42d" end end resource "jeepney" do on_linux do url "https://files.pythonhosted.org/packages/74/24/9b720cc6b2a73c908896a0ed64cb49780dcfbf4964e23a725aa6323f4452/jeepney-0.4.3.tar.gz" sha256 "3479b861cc2b6407de5188695fa1a8d57e5072d7059322469b62628869b8e36e" end end resource "secretstorage" do on_linux do url "https://files.pythonhosted.org/packages/fd/9f/36197c75d9a09b1ab63f56cb985af6cd858ca3fc41fd9cd890ce69bae5b9/SecretStorage-3.1.2.tar.gz" sha256 "15da8a989b65498e29be338b3b279965f1b8f09b9668bd8010da183024c8bff6" end end def install virtualenv_install_with_resources end test do (testpath/"tests.sh").write <<~EOS #{OS.mac? ? "#!/usr/bin/expect -f" : "#!/usr/bin/env expect"} set timeout 3 match_max 100000 # Write the journal spawn "#{bin}/jrnl" "This is the fanciest test in the world." expect { "/.local/share/jrnl/journal.txt" { send -- "#{testpath}/test.txt\r" } timeout { exit 1 } } expect { "You can always change this later" { send -- "n\r" } timeout { exit 1 } } expect { eof { exit } timeout { exit 1 } } # Read the journal spawn "#{bin}/jrnl" -1 expect { "This is the fanciest test in the world." { exit } timeout { exit 1 } eof { exit 1 } } # Encrypt the journal spawn "#{bin}/jrnl" --encrypt expect { -exact "Enter password for new journal: " { send -- "homebrew\r" } timeout { exit 1 } } expect { -exact "Enter password again: " { send -- "homebrew\r" } timeout { exit 1 } } expect { -exact "Do you want to store the password in your keychain? \[Y/n\] " { send -- "n\r" } timeout { exit 1 } } expect { -re "Journal encrypted to .*/test.txt." { exit } timeout { exit 1 } eof { exit 1 } } EOS system "expect", "./tests.sh" assert_predicate testpath/".config/jrnl/jrnl.yaml", :exist? assert_predicate testpath/"test.txt", :exist? end end
class Juju < Formula desc "DevOps management tool" homepage "https://jujucharms.com/" url "https://launchpad.net/juju/2.4/2.4.7/+download/juju-core_2.4.7.tar.gz" sha256 "0b4cc36d38c19592a605c90c3df503e4c2fcb9dc8bf0b91cc87c396d82e40d82" bottle do cellar :any_skip_relocation sha256 "8b4f4f73bbfc64b5037f829592b4bd7dc93682973809f4553170ea7ae03be47b" => :mojave sha256 "fdef9af3b15299468b14171665095bdc63f2f1aad3471554b975bc5198a50e7e" => :high_sierra sha256 "f5ea70c523419704878f34174a09525be3bb9ededf334b86c1bcc2635560896c" => :sierra end depends_on "go" => :build def install ENV["GOPATH"] = buildpath system "go", "build", "github.com/juju/juju/cmd/juju" system "go", "build", "github.com/juju/juju/cmd/plugins/juju-metadata" bin.install "juju", "juju-metadata" bash_completion.install "src/github.com/juju/juju/etc/bash_completion.d/juju" end test do system "#{bin}/juju", "version" end end juju: update 2.4.7 bottle for Linuxbrew. Closes Linuxbrew/homebrew-core#10520. Signed-off-by: Michka Popoff <7b0496f66f66ee22a38826c310c38b415671b832@gmail.com> class Juju < Formula desc "DevOps management tool" homepage "https://jujucharms.com/" url "https://launchpad.net/juju/2.4/2.4.7/+download/juju-core_2.4.7.tar.gz" sha256 "0b4cc36d38c19592a605c90c3df503e4c2fcb9dc8bf0b91cc87c396d82e40d82" bottle do cellar :any_skip_relocation sha256 "8b4f4f73bbfc64b5037f829592b4bd7dc93682973809f4553170ea7ae03be47b" => :mojave sha256 "fdef9af3b15299468b14171665095bdc63f2f1aad3471554b975bc5198a50e7e" => :high_sierra sha256 "f5ea70c523419704878f34174a09525be3bb9ededf334b86c1bcc2635560896c" => :sierra sha256 "bb6b73fda28831270d3d4611179b09ad5aa08eaeaf3f82a493e0732f78b4887f" => :x86_64_linux end depends_on "go" => :build def install ENV["GOPATH"] = buildpath system "go", "build", "github.com/juju/juju/cmd/juju" system "go", "build", "github.com/juju/juju/cmd/plugins/juju-metadata" bin.install "juju", "juju-metadata" bash_completion.install "src/github.com/juju/juju/etc/bash_completion.d/juju" end test do system "#{bin}/juju", "version" end end
class Juju < Formula desc "DevOps management tool" homepage "https://jujucharms.com/" url "https://launchpad.net/juju/2.6/2.6.8/+download/juju-core_2.6.8.tar.gz" sha256 "0c5a6ccae09e602621c3958a2c56c0bfa7676060f2169008577b809552af4568" bottle do cellar :any_skip_relocation sha256 "a21ad6d5481c55f9b3d276882118735807f63f363534bdcfb0d49f11c29a9659" => :mojave sha256 "9dc5acf1097e94c691954ef3a737685ddf2341745592d6e6b242be4518dfc513" => :high_sierra sha256 "654fa4d4591d41c9318ff0a8c0fd084d3e73031a6f95e936b0c65aac6cad704c" => :sierra end depends_on "go" => :build def install ENV["GOPATH"] = buildpath system "go", "build", "github.com/juju/juju/cmd/juju" system "go", "build", "github.com/juju/juju/cmd/plugins/juju-metadata" bin.install "juju", "juju-metadata" bash_completion.install "src/github.com/juju/juju/etc/bash_completion.d/juju" end test do system "#{bin}/juju", "version" end end juju: update 2.6.8 bottle. class Juju < Formula desc "DevOps management tool" homepage "https://jujucharms.com/" url "https://launchpad.net/juju/2.6/2.6.8/+download/juju-core_2.6.8.tar.gz" sha256 "0c5a6ccae09e602621c3958a2c56c0bfa7676060f2169008577b809552af4568" bottle do cellar :any_skip_relocation sha256 "32164113ecacb50bd0d1c9d279ddd813a5230e3879e6db323447c2fd8491cdad" => :mojave sha256 "7136831eb565b490ac3720ca7cea5b3902f6847f3247af1893b612aac213bb0f" => :high_sierra sha256 "51e05635d54300ae1e9d4d389036d8d8460edd94feb491e6e4967bc42fa61f9c" => :sierra end depends_on "go" => :build def install ENV["GOPATH"] = buildpath system "go", "build", "github.com/juju/juju/cmd/juju" system "go", "build", "github.com/juju/juju/cmd/plugins/juju-metadata" bin.install "juju", "juju-metadata" bash_completion.install "src/github.com/juju/juju/etc/bash_completion.d/juju" end test do system "#{bin}/juju", "version" end end
module Kushojin module Sender class EachSender < Base def initialize(logger, serializer: Serializer::SimpleSerializer) super @serializer = serializer end def send(changes, controller:) changes.each do |change| @logger.post(tag(controller), @serializer.serialize(change, controller: controller)) end end private def tag(controller) "#{controller.controller_name}.#{controller.action_name}" end def map(change, controller:) changes = change.changes_without_primary_key.reject { |attr_name, _| ignore_columns.include?(attr_name) } { "event" => change.event.to_s, "request_id" => controller.request.request_id, "table_name" => change.table_name, change.primary_key => change.model.id, "changes" => changes, } end end end end Remove duplicated code module Kushojin module Sender class EachSender < Base def initialize(logger, serializer: Serializer::SimpleSerializer) super @serializer = serializer end def send(changes, controller:) changes.each do |change| @logger.post(tag(controller), @serializer.serialize(change, controller: controller)) end end private def tag(controller) "#{controller.controller_name}.#{controller.action_name}" end end end end
class Just < Formula desc "Handy way to save and run project-specific commands" homepage "https://github.com/casey/just" url "https://github.com/casey/just/archive/v0.4.2.tar.gz" sha256 "7bcde022994eaa06ce17974f494e4cf98a1d00f4e5791c6ae61f8dd45685da25" bottle do sha256 "57d43f3d4c61eb0cff35b2bd0f6c6094b1a9437dfab8df79ce7c5d096f97430f" => :mojave sha256 "715fb7af58659ce90e2a6a241f2d622df112488c334c88166bc2b2377b57d6fe" => :high_sierra sha256 "f0956c2e6e4ba10ba1bf3a1182d2641f6cba6091cc08c1d75b8023345dd6c419" => :sierra end depends_on "rust" => :build def install system "cargo", "install", "--root", prefix, "--path", "." end test do (testpath/"justfile").write <<~EOS default: touch it-worked EOS system "#{bin}/just" assert_predicate testpath/"it-worked", :exist? end end just: Fix bottling for Linuxbrew Closes #12711. Signed-off-by: Michka Popoff <7b0496f66f66ee22a38826c310c38b415671b832@gmail.com> class Just < Formula desc "Handy way to save and run project-specific commands" homepage "https://github.com/casey/just" url "https://github.com/casey/just/archive/v0.4.2.tar.gz" sha256 "7bcde022994eaa06ce17974f494e4cf98a1d00f4e5791c6ae61f8dd45685da25" bottle do cellar :any_skip_relocation sha256 "57d43f3d4c61eb0cff35b2bd0f6c6094b1a9437dfab8df79ce7c5d096f97430f" => :mojave sha256 "715fb7af58659ce90e2a6a241f2d622df112488c334c88166bc2b2377b57d6fe" => :high_sierra sha256 "f0956c2e6e4ba10ba1bf3a1182d2641f6cba6091cc08c1d75b8023345dd6c419" => :sierra end depends_on "rust" => :build def install system "cargo", "install", "--root", prefix, "--path", "." end test do (testpath/"justfile").write <<~EOS default: touch it-worked EOS system "#{bin}/just" assert_predicate testpath/"it-worked", :exist? end end
require 'larrow/qingcloud' require 'larrow/runner/config' module Larrow module Runner module Service class Cloud def initialize access_id = Config.qingcloud[:qy_access_key_id] secret_key = Config.qingcloud[:qy_secret_access_key] zone_id = Config.qingcloud[:zone_id] || 'pek1' @keypair_id = Config.qingcloud[:keypair_id] Qingcloud.establish_connection access_id,secret_key,zone_id end def create count=1,image_id:'trustysrvx64a' RunLogger.level(1).detail "assign node" instances = Qingcloud::Instance.create(image_id, count:count, login_mode:'keypair', keypair_id: @keypair_id ) eips = Qingcloud::Eip.create(count:count) count.times do |i| RunLogger.level(1).detail "bind ip: #{eips[i].address}" eips[i] = eips[i].associate instances[i].id end # eips contains promise object, so it should be force (0...count).map{ |i| [instances[i], eips[i]]} end # return image future def create_image instance_id Qingcloud::Image.create instance_id end def image? image_id Qingcloud::Image.list(:self, ids: [image_id]).size == 1 end end end end end use default image id require 'larrow/qingcloud' require 'larrow/runner/config' module Larrow module Runner module Service class Cloud include Qingcloud def initialize access_id = Config.qingcloud[:qy_access_key_id] secret_key = Config.qingcloud[:qy_secret_access_key] zone_id = Config.qingcloud[:zone_id] || 'pek1' @keypair_id = Config.qingcloud[:keypair_id] Qingcloud.establish_connection access_id,secret_key,zone_id end # return: Array< [ instance,eip ] > # WARN: eips contains promise object, so it should be force def create image_id:nil,count:1 RunLogger.level(1).detail "assign node" instances = Instance.create(image_id: image_id, count:count, login_mode:'keypair', keypair_id: @keypair_id ) eips = Eip.create(count:count) count.times do |i| RunLogger.level(1).detail "bind ip: #{eips[i].address}" eips[i] = eips[i].associate instances[i].id end # eips contains promise object, so it should be force (0...count).map{ |i| [instances[i], eips[i]]} end # return image future def create_image instance_id Image.create instance_id end def image? image_id Image.list(:self, ids: [image_id]).size == 1 end end end end end
class Just < Formula desc "Handy way to save and run project-specific commands" homepage "https://github.com/casey/just" url "https://github.com/casey/just/archive/v0.3.6.tar.gz" sha256 "25b37ad9c44704a89a8ab570157c9c78da63c481aac75caa40757d9bc84a191a" bottle do sha256 "62b828fd3295c2978d26f321c0b16eaaf795e8d5cd92cabd2a49ff04289a60ec" => :high_sierra sha256 "ab13445c92586431895e54c6ff18976c8668ee7c0ee8aa03bbc1b91ef7e29872" => :sierra sha256 "d958f3da28c50164960a197b0e7fe06108a8580a5fbe1e6f76d89cc4697a9374" => :el_capitan end depends_on "rust" => :build def install system "cargo", "build", "--release" bin.install "target/release/just" end test do (testpath/"justfile").write <<~EOS default: touch it-worked EOS system "#{bin}/just" assert_predicate testpath/"it-worked", :exist? end end just: update 0.3.6 bottle. class Just < Formula desc "Handy way to save and run project-specific commands" homepage "https://github.com/casey/just" url "https://github.com/casey/just/archive/v0.3.6.tar.gz" sha256 "25b37ad9c44704a89a8ab570157c9c78da63c481aac75caa40757d9bc84a191a" bottle do sha256 "52f800707225d5847ab43967f4d0d50b6a1b96763bedee300829ea6fcc3b9eed" => :high_sierra sha256 "e1ad66bef5b0dabd2be8a2af72d129d3d6a2e81b5570a6b1a9a56f9f869246ce" => :sierra sha256 "959efe969763984c165acc69364cccd766d19d3ae087e304b648e926a34ef9fb" => :el_capitan end depends_on "rust" => :build def install system "cargo", "build", "--release" bin.install "target/release/just" end test do (testpath/"justfile").write <<~EOS default: touch it-worked EOS system "#{bin}/just" assert_predicate testpath/"it-worked", :exist? end end
class Kcgi < Formula desc "Minimal CGI and FastCGI library for C/C++" homepage "https://kristaps.bsd.lv/kcgi" url "https://kristaps.bsd.lv/kcgi/snapshots/kcgi-0.12.2.tgz" sha256 "59e9219ae439f0c4fbffe6584014715c2fc206b8cd00de7aa8d062ddb52c2a0e" license "ISC" depends_on "bmake" => :build def install system "./configure", "MANDIR=#{man}", "PREFIX=#{prefix}" system "bmake" system "bmake", "install" end test do (testpath/"test.c").write <<~EOS #include <sys/types.h> #include <stdarg.h> #include <stddef.h> #include <stdint.h> #include <kcgi.h> int main(void) { struct kreq r; const char *pages = ""; khttp_parse(&r, NULL, 0, &pages, 1, 0); return 0; } EOS flags = %W[ -L#{lib} -lkcgi -lz ] system ENV.cc, "test.c", "-o", "test", *flags system "./test" end end kcgi: add 0.12.2 bottle. class Kcgi < Formula desc "Minimal CGI and FastCGI library for C/C++" homepage "https://kristaps.bsd.lv/kcgi" url "https://kristaps.bsd.lv/kcgi/snapshots/kcgi-0.12.2.tgz" sha256 "59e9219ae439f0c4fbffe6584014715c2fc206b8cd00de7aa8d062ddb52c2a0e" license "ISC" bottle do cellar :any_skip_relocation sha256 "db56ea0e40697618474f90af5b3f354043027b837e94464650a81d3813cde3d9" => :big_sur sha256 "a3190c30830f6667c7f6df30047610e12845835f3d16c647b3c223e7ec8033db" => :catalina sha256 "096b70bd684486a61c8c393aea6596268701807e27b41da94c0e5e996bfc7b3c" => :mojave end depends_on "bmake" => :build def install system "./configure", "MANDIR=#{man}", "PREFIX=#{prefix}" system "bmake" system "bmake", "install" end test do (testpath/"test.c").write <<~EOS #include <sys/types.h> #include <stdarg.h> #include <stddef.h> #include <stdint.h> #include <kcgi.h> int main(void) { struct kreq r; const char *pages = ""; khttp_parse(&r, NULL, 0, &pages, 1, 0); return 0; } EOS flags = %W[ -L#{lib} -lkcgi -lz ] system ENV.cc, "test.c", "-o", "test", *flags system "./test" end end
require 'i18n' require 'set' require 'cgi' require 'lingua_franca/i18n/backend' require 'lingua_franca/action_view_helper' require 'lingua_franca/action_controller_helper' require 'lingua_franca/activerecord' require 'lingua_franca/action_mailer' module LinguaFranca module TestModes RECORD = 'RECORD' end START_TRANSLATION = '<!-- lingua_franca_start(${key}) -->' END_TRANSLATION = '<!-- lingua_franca_end(${key}) -->' KEY_MATCH = '${key}' KEY_MATCH_REGEX = Regexp.escape('${key}') REGEX_START_TRANSLATION = Regexp.escape(START_TRANSLATION).gsub(KEY_MATCH_REGEX, '(.*?)') REGEX_END_TRANSLATION = Regexp.escape(END_TRANSLATION).gsub(KEY_MATCH_REGEX, '(.*?)') SANITIZE_HTML_REGEX = { '<\1(\2)\3>' => /&lt;(!\-\- lingua_franca_(?:start|end))\((.*?)\)( \-\-)&gt;/, '' => /(0x[a-z0-9]+&gt;|<\/:[^>]+:0x[a-z0-9]+>)/ # gets injected by ActionMailer } class << self def test(mode, &block) ENV['_lingua_franca_test'] = mode last_request = nil case mode when TestModes::RECORD # clear the translation info before recording write_translation_info # get rid of te recording directory if it exists FileUtils.rm_rf(recording_dir) # get rid of the failed test dir if it exists FileUtils.rm_rf(failed_test_dir) # re-make the recording dir FileUtils.mkdir_p(recording_dir) end # run the tests passed = true begin yield rescue passed = false end case mode when TestModes::RECORD if passed # replace the current records FileUtils.rm_rf(last_test_dir) if Dir.exists?(records_dir) FileUtils.mv(records_dir, last_test_dir) end FileUtils.rm(info_file) FileUtils.mv(recording_info_file, info_file) version_file = File.join(recording_dir, '.version') File.open(version_file, 'w') { |f| f.write((Time.new.to_i - 1492600000).to_s(36)) } FileUtils.mv(recording_dir, records_dir) else # don't replace the records if the tests failed FileUtils.mv(recording_dir, failed_test_dir) end end ENV['_lingua_franca_test'] = nil end def info_file I18n.config.info_file end def recording_info_file I18n.config.info_file.gsub(/^(.*\/)(.*?)$/, '\1.\2') end def records_dir I18n.config.html_records_dir end def recording_dir "#{I18n.config.html_records_dir}-testing" end def last_test_dir "#{I18n.config.html_records_dir}-last-test" end def failed_test_dir "#{I18n.config.html_records_dir}-failed" end def test_mode return ENV['_lingua_franca_test'] end def recording? test_mode == TestModes::RECORD end def debugging=(state) @_lingua_franca_debug = state end def debugging? @_lingua_franca_debug end def debugging @_lingua_franca_debug end def set_application(application) @application = application end def set_request(request) @request = request end def check_request if new_request? last_request = @request.uuid end end def host @@host end def host=(host) @@host = host end def test_driver @@test_driver end def test_driver=(driver) @@test_driver = driver end def last_email_name @@last_email_name end def last_email_name=(method_name) @@last_email_name = method_name end def test_version(app_slug, app_path) version_file = File.expand_path(File.join(app_path, records_dir, '.version')) File.exist?(version_file) ? File.read(version_file).strip : nil end def get_html(distance_from_root = 4) public_dir = "#{'../' * distance_from_root}public/" test_driver.html.gsub(/(=\"|\(['"]?)(?:#{host})?\/(assets|uploads)/, "\\1#{public_dir}\\2") .gsub(/<script id="lingua\-franca\-capture">.*?<\/script>\s*/m, '') .gsub(/<script type="json" id="lingua\-franca\-translations">.*?<\/script>\s*/m) { |m| m.gsub(/\\u003c!\-\-/, '<!--').gsub(/\-\-\\u003e/, '-->') } end def screenshot_mail emails = Dir.glob(File.join(recording_dir, 'email', '*.html')) + Dir.glob(File.join(recording_dir, 'email', '*.txt')) emails.each do |file| # assemble the png file name png_file = File.expand_path(file + '.png') unless File.exist? png_file # if it doesn't exist already, load it and take a screenshot test_driver.visit('file:///' + File.expand_path(file).gsub(/\\/, '/')) # set the background to white test_driver.evaluate_script("document.body.bgColor = '#FFF';"); # resize the window to capture the mobile version old_size = test_driver.browser.client.window_size test_driver.resize_window(600, 400) test_driver.save_screenshot(png_file, full: true) test_driver.resize_window(*old_size) end end end def capture_translations data = {} Dir.glob(File.join(recording_dir, '*', '*.html')).each do |file| sanitized_html, keys = analyze_html(html) group = File.basename(File.dirname(file)) page, page_index = File.basename(file).split('--') page_index = page_index.gsub(/^(\d+).*$/, '\1').to_i data = collect_translations(data, keys, current_page(page, group), page_index) end write_translation_info(data) end def capture_mail(mail) FileUtils.mkdir_p(recording_dir) FileUtils.mkdir_p(File.join(recording_dir, 'email')) begin mail.body.parts.each do |part| type = part.header.first.field.element.sub_type unless type == 'plain' # hold back on recording plain text until we can fix it extension = type == 'plain' ? 'plain.txt' : 'html' capture_html(part.body.raw_source, last_email_name, 'email', { extension: extension, ensure_translated: type != 'plain' }) end end rescue Exception => exception puts exception.to_s puts exception.backtrace.join("\n") end end def capture_request(action = nil, controller = nil) if test_driver.respond_to?(:html) filename = capture_html(get_html, action, controller) if test_driver.respond_to?(:save_screenshot) && filename.present? png_filename = filename.gsub(/.html$/, '.png') png_mobile_filename = filename.gsub(/.html$/, '.mobile.png') # save the desktop version # sleep 0.25 # sleep to make sure the browser has time to adjust test_driver.save_screenshot(File.expand_path(png_filename), full: true) # resize the window to capture the mobile version old_size = test_driver.browser.client.window_size test_driver.resize_window(375, 667) # sleep 0.25 # sleep to make sure the browser has time to adjust test_driver.save_screenshot(File.expand_path(png_mobile_filename), full: true) test_driver.resize_window(*old_size) end end end def analyze_html(html, keys = nil) keys ||= {} head, comment, key, tail = html.split(/(#{REGEX_START_TRANSLATION})/, 2) return [html, keys] if key.nil? if key.present? key, key_data = key.split(',', 2) keys[key] ||= [] keys[key] << CGI::unescapeHTML(key_data || '{}') end translation, tail = tail.split(/#{REGEX_END_TRANSLATION.gsub('(.*?)', key)}/, 2) translation_keys = nil while translation_keys.nil? || translation_keys.present? translation, translation_keys = analyze_html(translation) keys.merge!(translation_keys) end return analyze_html(head + (tail || ''), keys) end def capture_html(html, action = nil, controller = nil, options = {}) page_name = current_page(action, controller) return nil unless page_name.present? # remove translated content from the HTML SANITIZE_HTML_REGEX.each { |replace, regex| html.gsub!(regex, replace) } data = get_translation_info sanitized_html, keys = analyze_html(html) # strip out all the HTML, some weird string show up from time to time (particularly in emails) stripped_string = ActionView::Base.full_sanitizer.sanitize(sanitized_html).gsub(/(\b)\d(\b)/, '\1\2') # if anything is left other than whitespace, there must be content that is not translated unless options[:ensure_translated] == false || stripped_string.gsub(/\s*/, '').blank? # so fail any tests that might be happening fail "Untranslated content found: [#{stripped_string.strip.gsub(/\s+/, ' ')}] in:\n\t#{sanitized_html.gsub(/\s+/m, ' ')}" end html_file = nil extension = options[:extension] || 'html' @@html_cache ||= {} @@html_cache[page_name] ||= {} @@html_cache[page_name][extension] ||= [] page_index = nil i = 0 while page_index.nil? && i < @@html_cache[page_name][extension].size # compare the HTML without translations so that we don't repeat a page just because it has # a different value if @@html_cache[page_name][extension][i] == sanitized_html page_index = i end i += 1 end if page_index.nil? page_index = @@html_cache[page_name][extension].size @@html_cache[page_name][extension] << sanitized_html FileUtils.mkdir_p(recording_dir) FileUtils.mkdir_p(File.join(recording_dir, controller || @request[:controller])) html_file = File.join(recording_dir, "#{page_name}--#{page_index}.#{extension}") File.open(html_file, 'w') { |f| f.write(html) } end # record which translations were found on this variation data = collect_translations(data, keys, page_name, page_index) write_translation_info(data) return html_file end def collect_translations(data, keys, page_name, page_index) keys.each do |key, key_data| data[key] ||= {} data[key][page_name] ||= {} data[key][page_name]['indices'] ||= [] data[key][page_name]['indices'] << page_index unless data[key][page_name]['indices'].include?(page_index) if data.present? key_data.each do |kd| keydata = begin JSON.parse(kd) rescue JSON::ParserError JSON.parse(CGI::unescapeHTML(kd)) end keydata.each do |k,v| data[key][page_name]['data'] ||= {} if k == 'vars' data[key][page_name]['data']['vars'] ||= {} v.each do |var_key, var_value| data[key][page_name]['data']['vars'][var_key] ||= [] data[key][page_name]['data']['vars'][var_key] |= [var_value] end else data[key][page_name]['data'][k] = v end end end end end return data end def example_file_path(app_path, group, page, index, extension = 'html') File.expand_path(File.join(app_path, records_dir, group, "#{page}--#{index}.#{extension}")) end def load_example(app_path, group, page, index) File.read(example_file_path(app_path, group, page, index)) end def last_request=(request) ENV['_lingua_franca_last_request'] = request end def last_request return ENV['_lingua_franca_last_request'] end def new_request? last_request != (@request.present? ? @request.uuid : nil) end def request_id @request.present? ? @request.uuid : nil end def current_page(action, controller) File.join(controller, action) end def get_route(path) @application.routes.routes.each do |route| if route.defaults[:controller] == @request[:controller] && route.defaults[:action] == @request[:action] return { name: route.name, path: route.path.spec.to_s } end end return "#{@request[:controller]}__#{@request[:action]}" end def record_translation(locale, key, options, translation) translation end def reserved?(word) word.to_s =~ I18n::RESERVED_KEYS_PATTERN end def with_locale(locale, &block) old_locale = I18n.locale I18n.locale = locale yield ensure I18n.locale = old_locale end # Sets the current locale based on the URL and user settings # If the language is detected and it is avilable, the current locale is set the locale detected # If the language language is not detected or is not available, the current locale # is set to the user's settings using the Accept-Language header, or the default locale # # Returns: # => true if the language is detected and it is enabled, the page should be shown # => false if the language is detected and it is not enabled, a 404 page should be shown # => nil if the language was detectable from the given host, a redirect should probably occur def set_locale(host, params, default_locale = I18n.default_locale) case I18n.config.language_detection_method when I18n::Config::DETECT_LANGUAGE_FROM_URL_PARAM lang = params[I18n.config.language_url_param.to_sym] when I18n::Config::DETECT_LANGUAGE_FROM_SUBDOMAIN @@hosts ||= Hash.new if @@hosts.has_key?(host) return @@hosts[host] end lang = get_locale(host) end if lang.present? && locale_enabled?(lang) I18n.locale = lang return true end I18n.locale = I18n.default_locale return (lang.present? && I18n.locale_available?(lang)) ? false : nil end # Determines the locale based on the current URL def get_locale(host) host.gsub(I18n.config.host_locale_regex, '\1') || I18n.default_locale end # Returns a hash containing a list of all keys and data on how they are used def get_translation_info(app = nil) @@translation_info ||= {} unless @@translation_info[app].present? if app.present? location = File.join(app, info_file) else location = info_file end if File.exists?(location) @@translation_info[app] = YAML.load_file(location) || {} end end return @@translation_info[app] || {} end def write_translation_info(translations = {}) File.open(recording_info_file, 'w') { |f| f.write translations.to_yaml } end def backend_for_app(app_slug, app_path) @@backends ||= {} @@backends[app_slug.to_sym] ||= I18n::Backend::LinguaFranca.new i18n = @@backends[app_slug.to_sym] unless i18n.loaded? # load all translations for all enabled locales enabled_locales(app_slug, app_path).each do |locale| i18n.load(locale_file(app_path, locale)) end end return i18n end def reload_backend(app_slug, app_path) @@translations[app_slug] = nil backend_for_app(app_slug, app_path).clear_store backend_for_app(app_slug, app_path) end def save_translation(app_slug, app_path, locale, key, value, options = {}) save_translations(app_slug, app_path, locale, { key => value }, options = {}) end def save_translations(app_slug, app_path, locale, data, options = {}) i18n = backend_for_app(app_slug, app_path) new_data = {} data.each do | key, value | new_data.deep_merge!(expand_key(key, value)) end i18n.store_translations(locale, new_data, options) i18n.save_translations(locale, locale_file(app_path, locale)) reload_backend(app_slug, app_path) end def get_translations(app_slug, app_path, locale) @@translations ||= {} @@translations[app_slug] ||= {} unless @@translations[app_slug][locale].present? @@translations[app_slug][locale] = backend_for_app(app_slug, app_path).get_translations(locale).stringify_keys end return @@translations[app_slug][locale] || {} end def locales_path(app_path = nil) File.expand_path(File.join(*[app_path, 'config', 'locales'].compact)) end def locale_file(app_path, locale, enabled = true) File.join(locales_path(app_path), "#{enabled ? '' : '.'}#{locale.to_s}.yml") end def locale_stats(app_slug, app_path, locale) translations = LinguaFranca.get_translations(app_slug, app_path, locale) return nil if translations.nil? info = get_translation_info(app_path) complete = 0 total = 0 info.each do |key, page_info| if page_info.values.first['data'].present? && page_info.values.first['data']['vars'].present? && page_info.values.first['data']['vars']['count'].present? [:one, :other].each do |v| total += 1 complete += 1 if translations[key].present? && translations[key][v].present? end else unless key =~ /(?:^geography\.(?:countries|subregions)\.|^languages\.|\[[0-9]+\]$)/ total += 1 complete += 1 if translations[key].present? end end end { total: total, complete: complete } end def locale_enabled?(locale, app_slug = nil, app_path = nil) enabled_locales(app_slug, app_path).include?(locale.to_sym) end def enabled_locales(app_slug = nil, app_path = nil) @@enabled_locales ||= {} @@enabled_locales[app_slug] ||= nil if @@enabled_locales[app_slug].nil? @@enabled_locales[app_slug] = available_locales.select do |locale| File.exists?(locale_file(app_path, locale)) end end return @@enabled_locales[app_slug] end def available_locales @@available_locales ||= nil if @@available_locales.nil? @@available_locales = [] Dir.glob(File.join(Gem.loaded_specs['rails-i18n'].full_gem_path, 'rails', 'locale', '*.yml')).each do |file| locale = File.basename(file, '.yml') @@available_locales << locale.to_sym if locale =~ /^[a-z]{2,3}$/ end end return @@available_locales end def get_context(context) case context.to_s when 'c', 'char', 'chars', 'character', 'characters' return 'character' when 'w', 'word', 'words' return 'word' when 's', 'sentence', 'sentences' return 'sentence' when 't', 'title' return 'title' when 'p', 'paragraph', 'paragraphs' return 'paragraph' end return nil end private def expand_key(key, value) expanded = value key.split('.').reverse.each do |part| expanded = { part => expanded } end return expanded end end end require 'lingua_franca/railtie' if defined?(Rails::Railtie) Blacklisted currencies from stats require 'i18n' require 'set' require 'cgi' require 'lingua_franca/i18n/backend' require 'lingua_franca/action_view_helper' require 'lingua_franca/action_controller_helper' require 'lingua_franca/activerecord' require 'lingua_franca/action_mailer' module LinguaFranca module TestModes RECORD = 'RECORD' end START_TRANSLATION = '<!-- lingua_franca_start(${key}) -->' END_TRANSLATION = '<!-- lingua_franca_end(${key}) -->' KEY_MATCH = '${key}' KEY_MATCH_REGEX = Regexp.escape('${key}') REGEX_START_TRANSLATION = Regexp.escape(START_TRANSLATION).gsub(KEY_MATCH_REGEX, '(.*?)') REGEX_END_TRANSLATION = Regexp.escape(END_TRANSLATION).gsub(KEY_MATCH_REGEX, '(.*?)') SANITIZE_HTML_REGEX = { '<\1(\2)\3>' => /&lt;(!\-\- lingua_franca_(?:start|end))\((.*?)\)( \-\-)&gt;/, '' => /(0x[a-z0-9]+&gt;|<\/:[^>]+:0x[a-z0-9]+>)/ # gets injected by ActionMailer } class << self def test(mode, &block) ENV['_lingua_franca_test'] = mode last_request = nil case mode when TestModes::RECORD # clear the translation info before recording write_translation_info # get rid of te recording directory if it exists FileUtils.rm_rf(recording_dir) # get rid of the failed test dir if it exists FileUtils.rm_rf(failed_test_dir) # re-make the recording dir FileUtils.mkdir_p(recording_dir) end # run the tests passed = true begin yield rescue passed = false end case mode when TestModes::RECORD if passed # replace the current records FileUtils.rm_rf(last_test_dir) if Dir.exists?(records_dir) FileUtils.mv(records_dir, last_test_dir) end FileUtils.rm(info_file) FileUtils.mv(recording_info_file, info_file) version_file = File.join(recording_dir, '.version') File.open(version_file, 'w') { |f| f.write((Time.new.to_i - 1492600000).to_s(36)) } FileUtils.mv(recording_dir, records_dir) else # don't replace the records if the tests failed FileUtils.mv(recording_dir, failed_test_dir) end end ENV['_lingua_franca_test'] = nil end def info_file I18n.config.info_file end def recording_info_file I18n.config.info_file.gsub(/^(.*\/)(.*?)$/, '\1.\2') end def records_dir I18n.config.html_records_dir end def recording_dir "#{I18n.config.html_records_dir}-testing" end def last_test_dir "#{I18n.config.html_records_dir}-last-test" end def failed_test_dir "#{I18n.config.html_records_dir}-failed" end def test_mode return ENV['_lingua_franca_test'] end def recording? test_mode == TestModes::RECORD end def debugging=(state) @_lingua_franca_debug = state end def debugging? @_lingua_franca_debug end def debugging @_lingua_franca_debug end def set_application(application) @application = application end def set_request(request) @request = request end def check_request if new_request? last_request = @request.uuid end end def host @@host end def host=(host) @@host = host end def test_driver @@test_driver end def test_driver=(driver) @@test_driver = driver end def last_email_name @@last_email_name end def last_email_name=(method_name) @@last_email_name = method_name end def test_version(app_slug, app_path) version_file = File.expand_path(File.join(app_path, records_dir, '.version')) File.exist?(version_file) ? File.read(version_file).strip : nil end def get_html(distance_from_root = 4) public_dir = "#{'../' * distance_from_root}public/" test_driver.html.gsub(/(=\"|\(['"]?)(?:#{host})?\/(assets|uploads)/, "\\1#{public_dir}\\2") .gsub(/<script id="lingua\-franca\-capture">.*?<\/script>\s*/m, '') .gsub(/<script type="json" id="lingua\-franca\-translations">.*?<\/script>\s*/m) { |m| m.gsub(/\\u003c!\-\-/, '<!--').gsub(/\-\-\\u003e/, '-->') } end def screenshot_mail emails = Dir.glob(File.join(recording_dir, 'email', '*.html')) + Dir.glob(File.join(recording_dir, 'email', '*.txt')) emails.each do |file| # assemble the png file name png_file = File.expand_path(file + '.png') unless File.exist? png_file # if it doesn't exist already, load it and take a screenshot test_driver.visit('file:///' + File.expand_path(file).gsub(/\\/, '/')) # set the background to white test_driver.evaluate_script("document.body.bgColor = '#FFF';"); # resize the window to capture the mobile version old_size = test_driver.browser.client.window_size test_driver.resize_window(600, 400) test_driver.save_screenshot(png_file, full: true) test_driver.resize_window(*old_size) end end end def capture_translations data = {} Dir.glob(File.join(recording_dir, '*', '*.html')).each do |file| sanitized_html, keys = analyze_html(html) group = File.basename(File.dirname(file)) page, page_index = File.basename(file).split('--') page_index = page_index.gsub(/^(\d+).*$/, '\1').to_i data = collect_translations(data, keys, current_page(page, group), page_index) end write_translation_info(data) end def capture_mail(mail) FileUtils.mkdir_p(recording_dir) FileUtils.mkdir_p(File.join(recording_dir, 'email')) begin mail.body.parts.each do |part| type = part.header.first.field.element.sub_type unless type == 'plain' # hold back on recording plain text until we can fix it extension = type == 'plain' ? 'plain.txt' : 'html' capture_html(part.body.raw_source, last_email_name, 'email', { extension: extension, ensure_translated: type != 'plain' }) end end rescue Exception => exception puts exception.to_s puts exception.backtrace.join("\n") end end def capture_request(action = nil, controller = nil) if test_driver.respond_to?(:html) filename = capture_html(get_html, action, controller) if test_driver.respond_to?(:save_screenshot) && filename.present? png_filename = filename.gsub(/.html$/, '.png') png_mobile_filename = filename.gsub(/.html$/, '.mobile.png') # save the desktop version # sleep 0.25 # sleep to make sure the browser has time to adjust test_driver.save_screenshot(File.expand_path(png_filename), full: true) # resize the window to capture the mobile version old_size = test_driver.browser.client.window_size test_driver.resize_window(375, 667) # sleep 0.25 # sleep to make sure the browser has time to adjust test_driver.save_screenshot(File.expand_path(png_mobile_filename), full: true) test_driver.resize_window(*old_size) end end end def analyze_html(html, keys = nil) keys ||= {} head, comment, key, tail = html.split(/(#{REGEX_START_TRANSLATION})/, 2) return [html, keys] if key.nil? if key.present? key, key_data = key.split(',', 2) keys[key] ||= [] keys[key] << CGI::unescapeHTML(key_data || '{}') end translation, tail = tail.split(/#{REGEX_END_TRANSLATION.gsub('(.*?)', key)}/, 2) translation_keys = nil while translation_keys.nil? || translation_keys.present? translation, translation_keys = analyze_html(translation) keys.merge!(translation_keys) end return analyze_html(head + (tail || ''), keys) end def capture_html(html, action = nil, controller = nil, options = {}) page_name = current_page(action, controller) return nil unless page_name.present? # remove translated content from the HTML SANITIZE_HTML_REGEX.each { |replace, regex| html.gsub!(regex, replace) } data = get_translation_info sanitized_html, keys = analyze_html(html) # strip out all the HTML, some weird string show up from time to time (particularly in emails) stripped_string = ActionView::Base.full_sanitizer.sanitize(sanitized_html).gsub(/(\b)\d(\b)/, '\1\2') # if anything is left other than whitespace, there must be content that is not translated unless options[:ensure_translated] == false || stripped_string.gsub(/\s*/, '').blank? # so fail any tests that might be happening fail "Untranslated content found: [#{stripped_string.strip.gsub(/\s+/, ' ')}] in:\n\t#{sanitized_html.gsub(/\s+/m, ' ')}" end html_file = nil extension = options[:extension] || 'html' @@html_cache ||= {} @@html_cache[page_name] ||= {} @@html_cache[page_name][extension] ||= [] page_index = nil i = 0 while page_index.nil? && i < @@html_cache[page_name][extension].size # compare the HTML without translations so that we don't repeat a page just because it has # a different value if @@html_cache[page_name][extension][i] == sanitized_html page_index = i end i += 1 end if page_index.nil? page_index = @@html_cache[page_name][extension].size @@html_cache[page_name][extension] << sanitized_html FileUtils.mkdir_p(recording_dir) FileUtils.mkdir_p(File.join(recording_dir, controller || @request[:controller])) html_file = File.join(recording_dir, "#{page_name}--#{page_index}.#{extension}") File.open(html_file, 'w') { |f| f.write(html) } end # record which translations were found on this variation data = collect_translations(data, keys, page_name, page_index) write_translation_info(data) return html_file end def collect_translations(data, keys, page_name, page_index) keys.each do |key, key_data| data[key] ||= {} data[key][page_name] ||= {} data[key][page_name]['indices'] ||= [] data[key][page_name]['indices'] << page_index unless data[key][page_name]['indices'].include?(page_index) if data.present? key_data.each do |kd| keydata = begin JSON.parse(kd) rescue JSON::ParserError JSON.parse(CGI::unescapeHTML(kd)) end keydata.each do |k,v| data[key][page_name]['data'] ||= {} if k == 'vars' data[key][page_name]['data']['vars'] ||= {} v.each do |var_key, var_value| data[key][page_name]['data']['vars'][var_key] ||= [] data[key][page_name]['data']['vars'][var_key] |= [var_value] end else data[key][page_name]['data'][k] = v end end end end end return data end def example_file_path(app_path, group, page, index, extension = 'html') File.expand_path(File.join(app_path, records_dir, group, "#{page}--#{index}.#{extension}")) end def load_example(app_path, group, page, index) File.read(example_file_path(app_path, group, page, index)) end def last_request=(request) ENV['_lingua_franca_last_request'] = request end def last_request return ENV['_lingua_franca_last_request'] end def new_request? last_request != (@request.present? ? @request.uuid : nil) end def request_id @request.present? ? @request.uuid : nil end def current_page(action, controller) File.join(controller, action) end def get_route(path) @application.routes.routes.each do |route| if route.defaults[:controller] == @request[:controller] && route.defaults[:action] == @request[:action] return { name: route.name, path: route.path.spec.to_s } end end return "#{@request[:controller]}__#{@request[:action]}" end def record_translation(locale, key, options, translation) translation end def reserved?(word) word.to_s =~ I18n::RESERVED_KEYS_PATTERN end def with_locale(locale, &block) old_locale = I18n.locale I18n.locale = locale yield ensure I18n.locale = old_locale end # Sets the current locale based on the URL and user settings # If the language is detected and it is avilable, the current locale is set the locale detected # If the language language is not detected or is not available, the current locale # is set to the user's settings using the Accept-Language header, or the default locale # # Returns: # => true if the language is detected and it is enabled, the page should be shown # => false if the language is detected and it is not enabled, a 404 page should be shown # => nil if the language was detectable from the given host, a redirect should probably occur def set_locale(host, params, default_locale = I18n.default_locale) case I18n.config.language_detection_method when I18n::Config::DETECT_LANGUAGE_FROM_URL_PARAM lang = params[I18n.config.language_url_param.to_sym] when I18n::Config::DETECT_LANGUAGE_FROM_SUBDOMAIN @@hosts ||= Hash.new if @@hosts.has_key?(host) return @@hosts[host] end lang = get_locale(host) end if lang.present? && locale_enabled?(lang) I18n.locale = lang return true end I18n.locale = I18n.default_locale return (lang.present? && I18n.locale_available?(lang)) ? false : nil end # Determines the locale based on the current URL def get_locale(host) host.gsub(I18n.config.host_locale_regex, '\1') || I18n.default_locale end # Returns a hash containing a list of all keys and data on how they are used def get_translation_info(app = nil) @@translation_info ||= {} unless @@translation_info[app].present? if app.present? location = File.join(app, info_file) else location = info_file end if File.exists?(location) @@translation_info[app] = YAML.load_file(location) || {} end end return @@translation_info[app] || {} end def write_translation_info(translations = {}) File.open(recording_info_file, 'w') { |f| f.write translations.to_yaml } end def backend_for_app(app_slug, app_path) @@backends ||= {} @@backends[app_slug.to_sym] ||= I18n::Backend::LinguaFranca.new i18n = @@backends[app_slug.to_sym] unless i18n.loaded? # load all translations for all enabled locales enabled_locales(app_slug, app_path).each do |locale| i18n.load(locale_file(app_path, locale)) end end return i18n end def reload_backend(app_slug, app_path) @@translations[app_slug] = nil backend_for_app(app_slug, app_path).clear_store backend_for_app(app_slug, app_path) end def save_translation(app_slug, app_path, locale, key, value, options = {}) save_translations(app_slug, app_path, locale, { key => value }, options = {}) end def save_translations(app_slug, app_path, locale, data, options = {}) i18n = backend_for_app(app_slug, app_path) new_data = {} data.each do | key, value | new_data.deep_merge!(expand_key(key, value)) end i18n.store_translations(locale, new_data, options) i18n.save_translations(locale, locale_file(app_path, locale)) reload_backend(app_slug, app_path) end def get_translations(app_slug, app_path, locale) @@translations ||= {} @@translations[app_slug] ||= {} unless @@translations[app_slug][locale].present? @@translations[app_slug][locale] = backend_for_app(app_slug, app_path).get_translations(locale).stringify_keys end return @@translations[app_slug][locale] || {} end def locales_path(app_path = nil) File.expand_path(File.join(*[app_path, 'config', 'locales'].compact)) end def locale_file(app_path, locale, enabled = true) File.join(locales_path(app_path), "#{enabled ? '' : '.'}#{locale.to_s}.yml") end def locale_stats(app_slug, app_path, locale) translations = LinguaFranca.get_translations(app_slug, app_path, locale) return nil if translations.nil? info = get_translation_info(app_path) complete = 0 total = 0 info.each do |key, page_info| if page_info.values.first['data'].present? && page_info.values.first['data']['vars'].present? && page_info.values.first['data']['vars']['count'].present? [:one, :other].each do |v| total += 1 complete += 1 if translations[key].present? && translations[key][v].present? end else unless imported_translation?(key) total += 1 complete += 1 if translations[key].present? end end end { total: total, complete: complete } end def imported_translation?(key) key =~ /(?:^geography\.(?:countries|subregions)\.|^languages\.|^currencies\.|\[[0-9]+\]$)/ end def locale_enabled?(locale, app_slug = nil, app_path = nil) enabled_locales(app_slug, app_path).include?(locale.to_sym) end def enabled_locales(app_slug = nil, app_path = nil) @@enabled_locales ||= {} @@enabled_locales[app_slug] ||= nil if @@enabled_locales[app_slug].nil? @@enabled_locales[app_slug] = available_locales.select do |locale| File.exists?(locale_file(app_path, locale)) end end return @@enabled_locales[app_slug] end def available_locales @@available_locales ||= nil if @@available_locales.nil? @@available_locales = [] Dir.glob(File.join(Gem.loaded_specs['rails-i18n'].full_gem_path, 'rails', 'locale', '*.yml')).each do |file| locale = File.basename(file, '.yml') @@available_locales << locale.to_sym if locale =~ /^[a-z]{2,3}$/ end end return @@available_locales end def get_context(context) case context.to_s when 'c', 'char', 'chars', 'character', 'characters' return 'character' when 'w', 'word', 'words' return 'word' when 's', 'sentence', 'sentences' return 'sentence' when 't', 'title' return 'title' when 'p', 'paragraph', 'paragraphs' return 'paragraph' end return nil end private def expand_key(key, value) expanded = value key.split('.').reverse.each do |part| expanded = { part => expanded } end return expanded end end end require 'lingua_franca/railtie' if defined?(Rails::Railtie)
class Khal < Formula include Language::Python::Virtualenv desc "CLI calendar application" homepage "https://lostpackets.de/khal/" url "https://github.com/pimutils/khal.git", :tag => "v0.10.1", :revision => "a6d7d62388d33459e85dfb5cf57a31c46f120769" head "https://github.com/pimutils/khal.git" bottle do cellar :any_skip_relocation sha256 "7a5ff88f863f07170a7ac8244c7bbec213690ed09b5b6d47a0d38f757230f790" => :catalina sha256 "65c0e242110629b9aba6fc3fb7dcdd0b48c256465cbf8e4bdce6eca10ef791b0" => :mojave sha256 "e64129f4743de673ab7ecadf45943cf920e1f263a943e13f4bb2c138cc542855" => :high_sierra sha256 "f3fc8e90d8d5e5f452a56954563d2c5e40f17cbda7f1552ad9ad2bd5e8bda30a" => :sierra end depends_on "python" def install venv = virtualenv_create(libexec, "python3") system libexec/"bin/pip", "install", "-v", "--no-binary", ":all:", "--ignore-installed", buildpath system libexec/"bin/pip", "uninstall", "-y", name venv.pip_install_and_link buildpath end test do ENV["LC_ALL"] = "en_US.UTF-8" ENV["LANG"] = "en_US.UTF-8" (testpath/".calendar/test/01ef8547.ics").write <<~EOS BEGIN:VCALENDAR VERSION:2.0 BEGIN:VEVENT DTSTART;VALUE=DATE:20130726 SUMMARY:testevent DTEND;VALUE=DATE:20130727 LAST-MODIFIED:20130725T142824Z DTSTAMP:20130725T142824Z CREATED:20130725T142824Z UID:01ef8547 END:VEVENT END:VCALENDAR EOS (testpath/".config/khal/config").write <<~EOS [calendars] [[test]] path = #{testpath}/.calendar/test/ color = light gray [sqlite] path = #{testpath}/.calendar/khal.db [locale] firstweekday = 0 [default] default_calendar = test EOS system "#{bin}/khal", "--no-color", "search", "testevent" end end khal: use python@3.8 class Khal < Formula include Language::Python::Virtualenv desc "CLI calendar application" homepage "https://lostpackets.de/khal/" url "https://github.com/pimutils/khal.git", :tag => "v0.10.1", :revision => "a6d7d62388d33459e85dfb5cf57a31c46f120769" revision 1 head "https://github.com/pimutils/khal.git" bottle do cellar :any_skip_relocation sha256 "7a5ff88f863f07170a7ac8244c7bbec213690ed09b5b6d47a0d38f757230f790" => :catalina sha256 "65c0e242110629b9aba6fc3fb7dcdd0b48c256465cbf8e4bdce6eca10ef791b0" => :mojave sha256 "e64129f4743de673ab7ecadf45943cf920e1f263a943e13f4bb2c138cc542855" => :high_sierra sha256 "f3fc8e90d8d5e5f452a56954563d2c5e40f17cbda7f1552ad9ad2bd5e8bda30a" => :sierra end depends_on "python@3.8" def install venv = virtualenv_create(libexec, "python3") system libexec/"bin/pip", "install", "-v", "--no-binary", ":all:", "--ignore-installed", buildpath system libexec/"bin/pip", "uninstall", "-y", name venv.pip_install_and_link buildpath end test do ENV["LC_ALL"] = "en_US.UTF-8" ENV["LANG"] = "en_US.UTF-8" (testpath/".calendar/test/01ef8547.ics").write <<~EOS BEGIN:VCALENDAR VERSION:2.0 BEGIN:VEVENT DTSTART;VALUE=DATE:20130726 SUMMARY:testevent DTEND;VALUE=DATE:20130727 LAST-MODIFIED:20130725T142824Z DTSTAMP:20130725T142824Z CREATED:20130725T142824Z UID:01ef8547 END:VEVENT END:VCALENDAR EOS (testpath/".config/khal/config").write <<~EOS [calendars] [[test]] path = #{testpath}/.calendar/test/ color = light gray [sqlite] path = #{testpath}/.calendar/khal.db [locale] firstweekday = 0 [default] default_calendar = test EOS system "#{bin}/khal", "--no-color", "search", "testevent" end end
require 'i18n' require 'set' require 'cgi' require 'lingua_franca/i18n/backend' require 'lingua_franca/action_view_helper' require 'lingua_franca/action_controller_helper' require 'lingua_franca/activerecord' require 'lingua_franca/action_mailer' module LinguaFranca module TestModes RECORD = 'RECORD' end START_TRANSLATION = '<!-- lingua_franca_start(${key}) -->' END_TRANSLATION = '<!-- lingua_franca_end(${key}) -->' KEY_MATCH = '${key}' KEY_MATCH_REGEX = Regexp.escape('${key}') REGEX_START_TRANSLATION = Regexp.escape(START_TRANSLATION).gsub(KEY_MATCH_REGEX, '(.*?)') REGEX_END_TRANSLATION = Regexp.escape(END_TRANSLATION).gsub(KEY_MATCH_REGEX, '(.*?)') SANITIZE_HTML_REGEX = { '<\1(\2)\3>' => /&lt;(!\-\- lingua_franca_(?:start|end))\((.*?)\)( \-\-)&gt;/, '' => /(0x[a-z0-9]+&gt;|<\/:[^>]+:0x[a-z0-9]+>)/ # gets injected by ActionMailer } class << self def test(mode, &block) ENV['_lingua_franca_test'] = mode last_request = nil case mode when TestModes::RECORD # clear the translation info before recording write_translation_info # get rid of te recording directory if it exists FileUtils.rm_rf(recording_dir) # get rid of the failed test dir if it exists FileUtils.rm_rf(failed_test_dir) # re-make the recording dir FileUtils.mkdir_p(recording_dir) end # run the tests passed = true begin yield rescue passed = false end case mode when TestModes::RECORD if passed # replace the current records FileUtils.rm_rf(last_test_dir) if Dir.exists?(records_dir) FileUtils.mv(records_dir, last_test_dir) end FileUtils.rm(info_file) FileUtils.mv(recording_info_file, info_file) version_file = File.join(recording_dir, '.version') File.open(version_file, 'w') { |f| f.write((Time.new.to_i - 1492600000).to_s(36)) } FileUtils.mv(recording_dir, records_dir) else # don't replace the records if the tests failed FileUtils.mv(recording_dir, failed_test_dir) end end ENV['_lingua_franca_test'] = nil end def info_file I18n.config.info_file end def recording_info_file I18n.config.info_file.gsub(/^(.*\/)(.*?)$/, '\1.\2') end def records_dir I18n.config.html_records_dir end def recording_dir "#{I18n.config.html_records_dir}-testing" end def last_test_dir "#{I18n.config.html_records_dir}-last-test" end def failed_test_dir "#{I18n.config.html_records_dir}-failed" end def test_mode return ENV['_lingua_franca_test'] end def recording? test_mode == TestModes::RECORD end def debugging=(state) @_lingua_franca_debug = state end def debugging? @_lingua_franca_debug end def debugging @_lingua_franca_debug end def set_application(application) @application = application end def set_request(request) @request = request end def check_request if new_request? last_request = @request.uuid end end def host @@host end def host=(host) @@host = host end def test_driver @@test_driver end def test_driver=(driver) @@test_driver = driver end def last_email_name @@last_email_name end def last_email_name=(method_name) @@last_email_name = method_name end def test_version(app_slug, app_path) version_file = File.expand_path(File.join(app_path, records_dir, '.version')) File.exist?(version_file) ? File.read(version_file).strip : nil end def get_html(distance_from_root = 4) public_dir = "#{'../' * distance_from_root}public/" test_driver.html.gsub(/(=\"|\(['"]?)(?:#{host})?\/(assets|uploads)/, "\\1#{public_dir}\\2") .gsub(/<script id="lingua\-franca\-capture">.*?<\/script>\s*/m, '') .gsub(/<script type="json" id="lingua\-franca\-translations">.*?<\/script>\s*/m) { |m| m.gsub(/\\u003c!\-\-/, '<!--').gsub(/\-\-\\u003e/, '-->') } end def screenshot_mail emails = Dir.glob(File.join(recording_dir, 'email', '*.html')) + Dir.glob(File.join(recording_dir, 'email', '*.txt')) emails.each do |file| # assemble the png file name png_file = File.expand_path(file + '.png') unless File.exist? png_file # if it doesn't exist already, load it and take a screenshot test_driver.visit('file:///' + File.expand_path(file).gsub(/\\/, '/')) # set the background to white test_driver.evaluate_script("document.body.bgColor = '#FFF';"); # resize the window to capture the mobile version old_size = test_driver.browser.client.window_size test_driver.resize_window(600, 400) test_driver.save_screenshot(png_file, full: true) test_driver.resize_window(*old_size) end end end def capture_translations data = {} Dir.glob(File.join(recording_dir, '*', '*.html')).each do |file| sanitized_html, keys = analyze_html(html) group = File.basename(File.dirname(file)) page, page_index = File.basename(file).split('--') page_index = page_index.gsub(/^(\d+).*$/, '\1').to_i data = collect_translations(data, keys, current_page(page, group), page_index) end write_translation_info(data) end def capture_mail(mail) FileUtils.mkdir_p(recording_dir) FileUtils.mkdir_p(File.join(recording_dir, 'email')) begin mail.body.parts.each do |part| type = part.header.first.field.element.sub_type unless type == 'plain' # hold back on recording plain text until we can fix it extension = type == 'plain' ? 'plain.txt' : 'html' capture_html(part.body.raw_source, last_email_name, 'email', { extension: extension, ensure_translated: type != 'plain' }) end end rescue Exception => exception puts exception.to_s puts exception.backtrace.join("\n") end end def capture_request(action = nil, controller = nil) if test_driver.respond_to?(:html) filename = capture_html(get_html, action, controller) if test_driver.respond_to?(:save_screenshot) && filename.present? png_filename = filename.gsub(/.html$/, '.png') png_mobile_filename = filename.gsub(/.html$/, '.mobile.png') # save the desktop version # sleep 0.25 # sleep to make sure the browser has time to adjust test_driver.save_screenshot(File.expand_path(png_filename), full: true) # resize the window to capture the mobile version old_size = test_driver.browser.client.window_size test_driver.resize_window(375, 667) # sleep 0.25 # sleep to make sure the browser has time to adjust test_driver.save_screenshot(File.expand_path(png_mobile_filename), full: true) test_driver.resize_window(*old_size) end end end def analyze_html(html, keys = nil) keys ||= {} head, comment, key, tail = html.split(/(#{REGEX_START_TRANSLATION})/, 2) return [html, keys] if key.nil? if key.present? key, key_data = key.split(',', 2) keys[key] ||= [] keys[key] << CGI::unescapeHTML(key_data || '{}') end translation, tail = tail.split(/#{REGEX_END_TRANSLATION.gsub('(.*?)', key)}/, 2) translation_keys = nil while translation_keys.nil? || translation_keys.present? translation, translation_keys = analyze_html(translation) keys.merge!(translation_keys) end return analyze_html(head + (tail || ''), keys) end def capture_html(html, action = nil, controller = nil, options = {}) page_name = current_page(action, controller) return nil unless page_name.present? # remove translated content from the HTML SANITIZE_HTML_REGEX.each { |replace, regex| html.gsub!(regex, replace) } data = get_translation_info sanitized_html, keys = analyze_html(html) # strip out all the HTML, some weird string show up from time to time (particularly in emails) stripped_string = ActionView::Base.full_sanitizer.sanitize(sanitized_html).gsub(/(\b)\d(\b)/, '\1\2') # if anything is left other than whitespace, there must be content that is not translated unless options[:ensure_translated] == false || stripped_string.gsub(/\s*/, '').blank? # so fail any tests that might be happening fail "Untranslated content found: [#{stripped_string.strip.gsub(/\s+/, ' ')}] in:\n\t#{sanitized_html.gsub(/\s+/m, ' ')}" end html_file = nil extension = options[:extension] || 'html' @@html_cache ||= {} @@html_cache[page_name] ||= {} @@html_cache[page_name][extension] ||= [] page_index = nil i = 0 while page_index.nil? && i < @@html_cache[page_name][extension].size # compare the HTML without translations so that we don't repeat a page just because it has # a different value if @@html_cache[page_name][extension][i] == sanitized_html page_index = i end i += 1 end if page_index.nil? page_index = @@html_cache[page_name][extension].size @@html_cache[page_name][extension] << sanitized_html FileUtils.mkdir_p(recording_dir) FileUtils.mkdir_p(File.join(recording_dir, controller || @request[:controller])) html_file = File.join(recording_dir, "#{page_name}--#{page_index}.#{extension}") File.open(html_file, 'w') { |f| f.write(html) } end # record which translations were found on this variation data = collect_translations(data, keys, page_name, page_index) write_translation_info(data) return html_file end def collect_translations(data, keys, page_name, page_index) keys.each do |key, key_data| data[key] ||= {} data[key][page_name] ||= {} data[key][page_name]['indices'] ||= [] data[key][page_name]['indices'] << page_index unless data[key][page_name]['indices'].include?(page_index) if data.present? key_data.each do |kd| keydata = begin JSON.parse(kd) rescue JSON::ParserError JSON.parse(CGI::unescapeHTML(kd)) end keydata.each do |k,v| data[key][page_name]['data'] ||= {} if k == 'vars' data[key][page_name]['data']['vars'] ||= {} v.each do |var_key, var_value| data[key][page_name]['data']['vars'][var_key] ||= [] data[key][page_name]['data']['vars'][var_key] |= [var_value] end else data[key][page_name]['data'][k] = v end end end end end return data end def example_file_path(app_path, group, page, index, extension = 'html') File.expand_path(File.join(app_path, records_dir, group, "#{page}--#{index}.#{extension}")) end def load_example(app_path, group, page, index) File.read(example_file_path(app_path, group, page, index)) end def last_request=(request) ENV['_lingua_franca_last_request'] = request end def last_request return ENV['_lingua_franca_last_request'] end def new_request? last_request != (@request.present? ? @request.uuid : nil) end def request_id @request.present? ? @request.uuid : nil end def current_page(action, controller) File.join(controller, action) end def get_route(path) @application.routes.routes.each do |route| if route.defaults[:controller] == @request[:controller] && route.defaults[:action] == @request[:action] return { name: route.name, path: route.path.spec.to_s } end end return "#{@request[:controller]}__#{@request[:action]}" end def record_translation(locale, key, options, translation) translation end def reserved?(word) word.to_s =~ I18n::RESERVED_KEYS_PATTERN end # Sets the current locale based on the URL and user settings # If the language is detected and it is avilable, the current locale is set the locale detected # If the language language is not detected or is not available, the current locale # is set to the user's settings using the Accept-Language header, or the default locale # # Returns: # => true if the language is detected and it is enabled, the page should be shown # => false if the language is detected and it is not enabled, a 404 page should be shown # => nil if the language was detectable from the given host, a redirect should probably occur def set_locale(host, params, default_locale = I18n.default_locale) case I18n.config.language_detection_method when I18n::Config::DETECT_LANGUAGE_FROM_URL_PARAM lang = params[I18n.config.language_url_param.to_sym] when I18n::Config::DETECT_LANGUAGE_FROM_SUBDOMAIN @@hosts ||= Hash.new if @@hosts.has_key?(host) return @@hosts[host] end lang = get_locale(host) end if lang.present? && locale_enabled?(lang) I18n.locale = lang return true end I18n.locale = I18n.default_locale return (lang.present? && I18n.locale_available?(lang)) ? false : nil end # Determines the locale based on the current URL def get_locale(host) host.gsub(I18n.config.host_locale_regex, '\1') || I18n.default_locale end # Returns a hash containing a list of all keys and data on how they are used def get_translation_info(app = nil) @@translation_info ||= {} unless @@translation_info[app].present? if app.present? location = File.join(app, info_file) else location = info_file end if File.exists?(location) @@translation_info[app] = YAML.load_file(location) || {} end end return @@translation_info[app] || {} end def write_translation_info(translations = {}) File.open(recording_info_file, 'w') { |f| f.write translations.to_yaml } end def backend_for_app(app_slug, app_path) @@backends ||= {} @@backends[app_slug.to_sym] ||= I18n::Backend::LinguaFranca.new i18n = @@backends[app_slug.to_sym] unless i18n.loaded? # load all translations for all enabled locales enabled_locales(app_slug, app_path).each do |locale| i18n.load(locale_file(app_path, locale)) end end return i18n end def reload_backend(app_slug, app_path) @@translations[app_slug] = nil backend_for_app(app_slug, app_path).clear_store backend_for_app(app_slug, app_path) end def save_translation(app_slug, app_path, locale, key, value, options = {}) save_translations(app_slug, app_path, locale, { key => value }, options = {}) end def save_translations(app_slug, app_path, locale, data, options = {}) i18n = backend_for_app(app_slug, app_path) new_data = {} data.each do | key, value | new_data.deep_merge!(expand_key(key, value)) end i18n.store_translations(locale, new_data, options) i18n.save_translations(locale, locale_file(app_path, locale)) reload_backend(app_slug, app_path) end def get_translations(app_slug, app_path, locale) @@translations ||= {} @@translations[app_slug] ||= {} unless @@translations[app_slug][locale].present? @@translations[app_slug][locale] = backend_for_app(app_slug, app_path).get_translations(locale).stringify_keys end return @@translations[app_slug][locale] || {} end def locales_path(app_path = nil) File.expand_path(File.join(*[app_path, 'config', 'locales'].compact)) end def locale_file(app_path, locale, enabled = true) File.join(locales_path(app_path), "#{enabled ? '' : '.'}#{locale.to_s}.yml") end def locale_stats(app_slug, app_path, locale) translations = LinguaFranca.get_translations(app_slug, app_path, locale) return nil if translations.nil? info = get_translation_info(app_path) complete = 0 total = 0 info.each do |key, page_info| if page_info.values.first['data'].present? && page_info.values.first['data']['vars'].present? && page_info.values.first['data']['vars']['count'].present? [:one, :other].each do |v| total += 1 complete += 1 if translations[key].present? && translations[key][v].present? end else unless key =~ /(?:^geography\.(?:countries|subregions)\.|^languages\.|\[[0-9]+\]$)/ total += 1 complete += 1 if translations[key].present? end end end { total: total, complete: complete } end def locale_enabled?(locale, app_slug = nil, app_path = nil) enabled_locales(app_slug, app_path).include?(locale.to_sym) end def enabled_locales(app_slug = nil, app_path = nil) @@enabled_locales ||= {} @@enabled_locales[app_slug] ||= nil if @@enabled_locales[app_slug].nil? @@enabled_locales[app_slug] = available_locales.select do |locale| File.exists?(locale_file(app_path, locale)) end end return @@enabled_locales[app_slug] end def available_locales @@available_locales ||= nil if @@available_locales.nil? @@available_locales = [] Dir.glob(File.join(Gem.loaded_specs['rails-i18n'].full_gem_path, 'rails', 'locale', '*.yml')).each do |file| locale = File.basename(file, '.yml') @@available_locales << locale.to_sym if locale =~ /^[a-z]{2,3}$/ end end return @@available_locales end def get_context(context) case context.to_s when 'c', 'char', 'chars', 'character', 'characters' return 'character' when 'w', 'word', 'words' return 'word' when 's', 'sentence', 'sentences' return 'sentence' when 't', 'title' return 'title' when 'p', 'paragraph', 'paragraphs' return 'paragraph' end return nil end private def expand_key(key, value) expanded = value key.split('.').reverse.each do |part| expanded = { part => expanded } end return expanded end end end require 'lingua_franca/railtie' if defined?(Rails::Railtie) Added with_locale method require 'i18n' require 'set' require 'cgi' require 'lingua_franca/i18n/backend' require 'lingua_franca/action_view_helper' require 'lingua_franca/action_controller_helper' require 'lingua_franca/activerecord' require 'lingua_franca/action_mailer' module LinguaFranca module TestModes RECORD = 'RECORD' end START_TRANSLATION = '<!-- lingua_franca_start(${key}) -->' END_TRANSLATION = '<!-- lingua_franca_end(${key}) -->' KEY_MATCH = '${key}' KEY_MATCH_REGEX = Regexp.escape('${key}') REGEX_START_TRANSLATION = Regexp.escape(START_TRANSLATION).gsub(KEY_MATCH_REGEX, '(.*?)') REGEX_END_TRANSLATION = Regexp.escape(END_TRANSLATION).gsub(KEY_MATCH_REGEX, '(.*?)') SANITIZE_HTML_REGEX = { '<\1(\2)\3>' => /&lt;(!\-\- lingua_franca_(?:start|end))\((.*?)\)( \-\-)&gt;/, '' => /(0x[a-z0-9]+&gt;|<\/:[^>]+:0x[a-z0-9]+>)/ # gets injected by ActionMailer } class << self def test(mode, &block) ENV['_lingua_franca_test'] = mode last_request = nil case mode when TestModes::RECORD # clear the translation info before recording write_translation_info # get rid of te recording directory if it exists FileUtils.rm_rf(recording_dir) # get rid of the failed test dir if it exists FileUtils.rm_rf(failed_test_dir) # re-make the recording dir FileUtils.mkdir_p(recording_dir) end # run the tests passed = true begin yield rescue passed = false end case mode when TestModes::RECORD if passed # replace the current records FileUtils.rm_rf(last_test_dir) if Dir.exists?(records_dir) FileUtils.mv(records_dir, last_test_dir) end FileUtils.rm(info_file) FileUtils.mv(recording_info_file, info_file) version_file = File.join(recording_dir, '.version') File.open(version_file, 'w') { |f| f.write((Time.new.to_i - 1492600000).to_s(36)) } FileUtils.mv(recording_dir, records_dir) else # don't replace the records if the tests failed FileUtils.mv(recording_dir, failed_test_dir) end end ENV['_lingua_franca_test'] = nil end def info_file I18n.config.info_file end def recording_info_file I18n.config.info_file.gsub(/^(.*\/)(.*?)$/, '\1.\2') end def records_dir I18n.config.html_records_dir end def recording_dir "#{I18n.config.html_records_dir}-testing" end def last_test_dir "#{I18n.config.html_records_dir}-last-test" end def failed_test_dir "#{I18n.config.html_records_dir}-failed" end def test_mode return ENV['_lingua_franca_test'] end def recording? test_mode == TestModes::RECORD end def debugging=(state) @_lingua_franca_debug = state end def debugging? @_lingua_franca_debug end def debugging @_lingua_franca_debug end def set_application(application) @application = application end def set_request(request) @request = request end def check_request if new_request? last_request = @request.uuid end end def host @@host end def host=(host) @@host = host end def test_driver @@test_driver end def test_driver=(driver) @@test_driver = driver end def last_email_name @@last_email_name end def last_email_name=(method_name) @@last_email_name = method_name end def test_version(app_slug, app_path) version_file = File.expand_path(File.join(app_path, records_dir, '.version')) File.exist?(version_file) ? File.read(version_file).strip : nil end def get_html(distance_from_root = 4) public_dir = "#{'../' * distance_from_root}public/" test_driver.html.gsub(/(=\"|\(['"]?)(?:#{host})?\/(assets|uploads)/, "\\1#{public_dir}\\2") .gsub(/<script id="lingua\-franca\-capture">.*?<\/script>\s*/m, '') .gsub(/<script type="json" id="lingua\-franca\-translations">.*?<\/script>\s*/m) { |m| m.gsub(/\\u003c!\-\-/, '<!--').gsub(/\-\-\\u003e/, '-->') } end def screenshot_mail emails = Dir.glob(File.join(recording_dir, 'email', '*.html')) + Dir.glob(File.join(recording_dir, 'email', '*.txt')) emails.each do |file| # assemble the png file name png_file = File.expand_path(file + '.png') unless File.exist? png_file # if it doesn't exist already, load it and take a screenshot test_driver.visit('file:///' + File.expand_path(file).gsub(/\\/, '/')) # set the background to white test_driver.evaluate_script("document.body.bgColor = '#FFF';"); # resize the window to capture the mobile version old_size = test_driver.browser.client.window_size test_driver.resize_window(600, 400) test_driver.save_screenshot(png_file, full: true) test_driver.resize_window(*old_size) end end end def capture_translations data = {} Dir.glob(File.join(recording_dir, '*', '*.html')).each do |file| sanitized_html, keys = analyze_html(html) group = File.basename(File.dirname(file)) page, page_index = File.basename(file).split('--') page_index = page_index.gsub(/^(\d+).*$/, '\1').to_i data = collect_translations(data, keys, current_page(page, group), page_index) end write_translation_info(data) end def capture_mail(mail) FileUtils.mkdir_p(recording_dir) FileUtils.mkdir_p(File.join(recording_dir, 'email')) begin mail.body.parts.each do |part| type = part.header.first.field.element.sub_type unless type == 'plain' # hold back on recording plain text until we can fix it extension = type == 'plain' ? 'plain.txt' : 'html' capture_html(part.body.raw_source, last_email_name, 'email', { extension: extension, ensure_translated: type != 'plain' }) end end rescue Exception => exception puts exception.to_s puts exception.backtrace.join("\n") end end def capture_request(action = nil, controller = nil) if test_driver.respond_to?(:html) filename = capture_html(get_html, action, controller) if test_driver.respond_to?(:save_screenshot) && filename.present? png_filename = filename.gsub(/.html$/, '.png') png_mobile_filename = filename.gsub(/.html$/, '.mobile.png') # save the desktop version # sleep 0.25 # sleep to make sure the browser has time to adjust test_driver.save_screenshot(File.expand_path(png_filename), full: true) # resize the window to capture the mobile version old_size = test_driver.browser.client.window_size test_driver.resize_window(375, 667) # sleep 0.25 # sleep to make sure the browser has time to adjust test_driver.save_screenshot(File.expand_path(png_mobile_filename), full: true) test_driver.resize_window(*old_size) end end end def analyze_html(html, keys = nil) keys ||= {} head, comment, key, tail = html.split(/(#{REGEX_START_TRANSLATION})/, 2) return [html, keys] if key.nil? if key.present? key, key_data = key.split(',', 2) keys[key] ||= [] keys[key] << CGI::unescapeHTML(key_data || '{}') end translation, tail = tail.split(/#{REGEX_END_TRANSLATION.gsub('(.*?)', key)}/, 2) translation_keys = nil while translation_keys.nil? || translation_keys.present? translation, translation_keys = analyze_html(translation) keys.merge!(translation_keys) end return analyze_html(head + (tail || ''), keys) end def capture_html(html, action = nil, controller = nil, options = {}) page_name = current_page(action, controller) return nil unless page_name.present? # remove translated content from the HTML SANITIZE_HTML_REGEX.each { |replace, regex| html.gsub!(regex, replace) } data = get_translation_info sanitized_html, keys = analyze_html(html) # strip out all the HTML, some weird string show up from time to time (particularly in emails) stripped_string = ActionView::Base.full_sanitizer.sanitize(sanitized_html).gsub(/(\b)\d(\b)/, '\1\2') # if anything is left other than whitespace, there must be content that is not translated unless options[:ensure_translated] == false || stripped_string.gsub(/\s*/, '').blank? # so fail any tests that might be happening fail "Untranslated content found: [#{stripped_string.strip.gsub(/\s+/, ' ')}] in:\n\t#{sanitized_html.gsub(/\s+/m, ' ')}" end html_file = nil extension = options[:extension] || 'html' @@html_cache ||= {} @@html_cache[page_name] ||= {} @@html_cache[page_name][extension] ||= [] page_index = nil i = 0 while page_index.nil? && i < @@html_cache[page_name][extension].size # compare the HTML without translations so that we don't repeat a page just because it has # a different value if @@html_cache[page_name][extension][i] == sanitized_html page_index = i end i += 1 end if page_index.nil? page_index = @@html_cache[page_name][extension].size @@html_cache[page_name][extension] << sanitized_html FileUtils.mkdir_p(recording_dir) FileUtils.mkdir_p(File.join(recording_dir, controller || @request[:controller])) html_file = File.join(recording_dir, "#{page_name}--#{page_index}.#{extension}") File.open(html_file, 'w') { |f| f.write(html) } end # record which translations were found on this variation data = collect_translations(data, keys, page_name, page_index) write_translation_info(data) return html_file end def collect_translations(data, keys, page_name, page_index) keys.each do |key, key_data| data[key] ||= {} data[key][page_name] ||= {} data[key][page_name]['indices'] ||= [] data[key][page_name]['indices'] << page_index unless data[key][page_name]['indices'].include?(page_index) if data.present? key_data.each do |kd| keydata = begin JSON.parse(kd) rescue JSON::ParserError JSON.parse(CGI::unescapeHTML(kd)) end keydata.each do |k,v| data[key][page_name]['data'] ||= {} if k == 'vars' data[key][page_name]['data']['vars'] ||= {} v.each do |var_key, var_value| data[key][page_name]['data']['vars'][var_key] ||= [] data[key][page_name]['data']['vars'][var_key] |= [var_value] end else data[key][page_name]['data'][k] = v end end end end end return data end def example_file_path(app_path, group, page, index, extension = 'html') File.expand_path(File.join(app_path, records_dir, group, "#{page}--#{index}.#{extension}")) end def load_example(app_path, group, page, index) File.read(example_file_path(app_path, group, page, index)) end def last_request=(request) ENV['_lingua_franca_last_request'] = request end def last_request return ENV['_lingua_franca_last_request'] end def new_request? last_request != (@request.present? ? @request.uuid : nil) end def request_id @request.present? ? @request.uuid : nil end def current_page(action, controller) File.join(controller, action) end def get_route(path) @application.routes.routes.each do |route| if route.defaults[:controller] == @request[:controller] && route.defaults[:action] == @request[:action] return { name: route.name, path: route.path.spec.to_s } end end return "#{@request[:controller]}__#{@request[:action]}" end def record_translation(locale, key, options, translation) translation end def reserved?(word) word.to_s =~ I18n::RESERVED_KEYS_PATTERN end def with_locale(locale, &block) old_locale = I18n.locale I18n.locale = locale yield ensure I18n.locale = old_locale end # Sets the current locale based on the URL and user settings # If the language is detected and it is avilable, the current locale is set the locale detected # If the language language is not detected or is not available, the current locale # is set to the user's settings using the Accept-Language header, or the default locale # # Returns: # => true if the language is detected and it is enabled, the page should be shown # => false if the language is detected and it is not enabled, a 404 page should be shown # => nil if the language was detectable from the given host, a redirect should probably occur def set_locale(host, params, default_locale = I18n.default_locale) case I18n.config.language_detection_method when I18n::Config::DETECT_LANGUAGE_FROM_URL_PARAM lang = params[I18n.config.language_url_param.to_sym] when I18n::Config::DETECT_LANGUAGE_FROM_SUBDOMAIN @@hosts ||= Hash.new if @@hosts.has_key?(host) return @@hosts[host] end lang = get_locale(host) end if lang.present? && locale_enabled?(lang) I18n.locale = lang return true end I18n.locale = I18n.default_locale return (lang.present? && I18n.locale_available?(lang)) ? false : nil end # Determines the locale based on the current URL def get_locale(host) host.gsub(I18n.config.host_locale_regex, '\1') || I18n.default_locale end # Returns a hash containing a list of all keys and data on how they are used def get_translation_info(app = nil) @@translation_info ||= {} unless @@translation_info[app].present? if app.present? location = File.join(app, info_file) else location = info_file end if File.exists?(location) @@translation_info[app] = YAML.load_file(location) || {} end end return @@translation_info[app] || {} end def write_translation_info(translations = {}) File.open(recording_info_file, 'w') { |f| f.write translations.to_yaml } end def backend_for_app(app_slug, app_path) @@backends ||= {} @@backends[app_slug.to_sym] ||= I18n::Backend::LinguaFranca.new i18n = @@backends[app_slug.to_sym] unless i18n.loaded? # load all translations for all enabled locales enabled_locales(app_slug, app_path).each do |locale| i18n.load(locale_file(app_path, locale)) end end return i18n end def reload_backend(app_slug, app_path) @@translations[app_slug] = nil backend_for_app(app_slug, app_path).clear_store backend_for_app(app_slug, app_path) end def save_translation(app_slug, app_path, locale, key, value, options = {}) save_translations(app_slug, app_path, locale, { key => value }, options = {}) end def save_translations(app_slug, app_path, locale, data, options = {}) i18n = backend_for_app(app_slug, app_path) new_data = {} data.each do | key, value | new_data.deep_merge!(expand_key(key, value)) end i18n.store_translations(locale, new_data, options) i18n.save_translations(locale, locale_file(app_path, locale)) reload_backend(app_slug, app_path) end def get_translations(app_slug, app_path, locale) @@translations ||= {} @@translations[app_slug] ||= {} unless @@translations[app_slug][locale].present? @@translations[app_slug][locale] = backend_for_app(app_slug, app_path).get_translations(locale).stringify_keys end return @@translations[app_slug][locale] || {} end def locales_path(app_path = nil) File.expand_path(File.join(*[app_path, 'config', 'locales'].compact)) end def locale_file(app_path, locale, enabled = true) File.join(locales_path(app_path), "#{enabled ? '' : '.'}#{locale.to_s}.yml") end def locale_stats(app_slug, app_path, locale) translations = LinguaFranca.get_translations(app_slug, app_path, locale) return nil if translations.nil? info = get_translation_info(app_path) complete = 0 total = 0 info.each do |key, page_info| if page_info.values.first['data'].present? && page_info.values.first['data']['vars'].present? && page_info.values.first['data']['vars']['count'].present? [:one, :other].each do |v| total += 1 complete += 1 if translations[key].present? && translations[key][v].present? end else unless key =~ /(?:^geography\.(?:countries|subregions)\.|^languages\.|\[[0-9]+\]$)/ total += 1 complete += 1 if translations[key].present? end end end { total: total, complete: complete } end def locale_enabled?(locale, app_slug = nil, app_path = nil) enabled_locales(app_slug, app_path).include?(locale.to_sym) end def enabled_locales(app_slug = nil, app_path = nil) @@enabled_locales ||= {} @@enabled_locales[app_slug] ||= nil if @@enabled_locales[app_slug].nil? @@enabled_locales[app_slug] = available_locales.select do |locale| File.exists?(locale_file(app_path, locale)) end end return @@enabled_locales[app_slug] end def available_locales @@available_locales ||= nil if @@available_locales.nil? @@available_locales = [] Dir.glob(File.join(Gem.loaded_specs['rails-i18n'].full_gem_path, 'rails', 'locale', '*.yml')).each do |file| locale = File.basename(file, '.yml') @@available_locales << locale.to_sym if locale =~ /^[a-z]{2,3}$/ end end return @@available_locales end def get_context(context) case context.to_s when 'c', 'char', 'chars', 'character', 'characters' return 'character' when 'w', 'word', 'words' return 'word' when 's', 'sentence', 'sentences' return 'sentence' when 't', 'title' return 'title' when 'p', 'paragraph', 'paragraphs' return 'paragraph' end return nil end private def expand_key(key, value) expanded = value key.split('.').reverse.each do |part| expanded = { part => expanded } end return expanded end end end require 'lingua_franca/railtie' if defined?(Rails::Railtie)
class Kind < Formula desc "Run local Kubernetes cluster in Docker" homepage "https://kind.sigs.k8s.io/" url "https://github.com/kubernetes-sigs/kind/archive/v0.10.0.tar.gz" sha256 "9ede2b77b451417e36a208cc5183a21f0420f7b6a6230146ba7d76ab34b99bc7" license "Apache-2.0" head "https://github.com/kubernetes-sigs/kind.git" bottle do sha256 cellar: :any_skip_relocation, arm64_big_sur: "4b233d91a8d967dd1c2e0b1cda5abfc9c18d67d7062d74193d6bbb3247726227" sha256 cellar: :any_skip_relocation, big_sur: "21dd92a2adc3dc568e6b6b29a17f85227cf938bd93709ee1817f40f9e1c9a2fb" sha256 cellar: :any_skip_relocation, catalina: "88fc4241b464cfec95189c325d2d28eecb0b04aeb1d7e56f9d04a7cd82f7ebd5" sha256 cellar: :any_skip_relocation, mojave: "0e920ee972ce05f98aaddf4a7bc4b591df4fdd19dc95db508dfaa763499ff118" end depends_on "go" => :build def install system "go", "build", "-o", bin/"kind" prefix.install_metafiles # Install bash completion output = Utils.safe_popen_read("#{bin}/kind", "completion", "bash") (bash_completion/"kind").write output # Install zsh completion output = Utils.safe_popen_read("#{bin}/kind", "completion", "zsh") (zsh_completion/"_kind").write output # Install fish completion output = Utils.safe_popen_read("#{bin}/kind", "completion", "fish") (fish_completion/"kind.fish").write output end test do # Should error out as creating a kind cluster requires root status_output = shell_output("#{bin}/kind get kubeconfig --name homebrew 2>&1", 1) assert_match "failed to list clusters", status_output end end kind: fix test, use `main` branch for `--HEAD` (#77346) * kind: user `main` branch for `--HEAD`. * Add `docker` dependency for the test * Fix the test case class Kind < Formula desc "Run local Kubernetes cluster in Docker" homepage "https://kind.sigs.k8s.io/" url "https://github.com/kubernetes-sigs/kind/archive/v0.10.0.tar.gz" sha256 "9ede2b77b451417e36a208cc5183a21f0420f7b6a6230146ba7d76ab34b99bc7" license "Apache-2.0" head "https://github.com/kubernetes-sigs/kind.git", branch: "main" bottle do sha256 cellar: :any_skip_relocation, arm64_big_sur: "4b233d91a8d967dd1c2e0b1cda5abfc9c18d67d7062d74193d6bbb3247726227" sha256 cellar: :any_skip_relocation, big_sur: "21dd92a2adc3dc568e6b6b29a17f85227cf938bd93709ee1817f40f9e1c9a2fb" sha256 cellar: :any_skip_relocation, catalina: "88fc4241b464cfec95189c325d2d28eecb0b04aeb1d7e56f9d04a7cd82f7ebd5" sha256 cellar: :any_skip_relocation, mojave: "0e920ee972ce05f98aaddf4a7bc4b591df4fdd19dc95db508dfaa763499ff118" end depends_on "go" => :build depends_on "docker" => :test def install system "go", "build", "-o", bin/"kind" prefix.install_metafiles # Install bash completion output = Utils.safe_popen_read("#{bin}/kind", "completion", "bash") (bash_completion/"kind").write output # Install zsh completion output = Utils.safe_popen_read("#{bin}/kind", "completion", "zsh") (zsh_completion/"_kind").write output # Install fish completion output = Utils.safe_popen_read("#{bin}/kind", "completion", "fish") (fish_completion/"kind.fish").write output end test do ENV["DOCKER_HOST"] = "unix://#{testpath}/invalid.sock" # Should error out as creating a kind cluster requires root status_output = shell_output("#{bin}/kind get kubeconfig --name homebrew 2>&1", 1) assert_match "Cannot connect to the Docker daemon", status_output end end
class Klee < Formula desc "Symbolic Execution Engine" homepage "https://klee.github.io/" url "https://github.com/klee/klee/archive/v2.2.tar.gz" sha256 "1ff2e37ed3128e005b89920fad7bcf98c7792a11a589dd443186658f5eb91362" license "NCSA" revision 1 head "https://github.com/klee/klee.git" bottle do sha256 big_sur: "68926d21ba91e49e600c58329c81ffbe552ceac655b9c57ae6043e0df4ca926a" sha256 catalina: "d601b6ef40172702659f7efe267d766fe1c82a627afed9017467c4714e3aac52" sha256 mojave: "30147bcef9d3993cb28f0e4235d0e0cb061b1f03dbfd6d698d7fd3ab214dc712" end depends_on "cmake" => :build depends_on "gperftools" depends_on "llvm@11" depends_on "python-tabulate" depends_on "python@3.9" depends_on "sqlite" depends_on "wllvm" depends_on "z3" uses_from_macos "zlib" # klee needs a version of libc++ compiled with wllvm resource "libcxx" do url "https://github.com/llvm/llvm-project/releases/download/llvmorg-11.1.0/llvm-project-11.1.0.src.tar.xz" sha256 "74d2529159fd118c3eac6f90107b5611bccc6f647fdea104024183e8d5e25831" end def install llvm = Formula["llvm@11"] libcxx_install_dir = libexec/"libcxx" libcxx_src_dir = buildpath/"libcxx" resource("libcxx").stage libcxx_src_dir cd libcxx_src_dir do # Use build configuration at # https://github.com/klee/klee/blob/v#{version}/scripts/build/p-libcxx.inc libcxx_args = std_cmake_args.reject { |s| s["CMAKE_INSTALL_PREFIX"] } + %W[ -DCMAKE_C_COMPILER=wllvm -DCMAKE_CXX_COMPILER=wllvm++ -DCMAKE_INSTALL_PREFIX=#{libcxx_install_dir} -DLLVM_ENABLE_PROJECTS=libcxx;libcxxabi -DLLVM_ENABLE_THREADS:BOOL=OFF -DLLVM_ENABLE_EH:BOOL=OFF -DLLVM_ENABLE_RTTI:BOOL=OFF -DLIBCXX_ENABLE_THREADS:BOOL=OFF -DLIBCXX_ENABLE_SHARED:BOOL=ON -DLIBCXXABI_ENABLE_THREADS:BOOL=OFF ] on_macos do libcxx_args << "-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY:BOOL=OFF" end on_linux do libcxx_args << "-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY:BOOL=ON" end mkdir "llvm/build" do with_env( LLVM_COMPILER: "clang", LLVM_COMPILER_PATH: llvm.opt_bin, ) do system "cmake", "..", *libcxx_args system "make", "cxx" system "make", "-C", "projects", "install" Dir[libcxx_install_dir/"lib/#{shared_library("*")}", libcxx_install_dir/"lib/*.a"].each do |sl| next if File.symlink? sl system "extract-bc", sl end end end end # CMake options are documented at # https://github.com/klee/klee/blob/v#{version}/README-CMake.md args = std_cmake_args + %W[ -DKLEE_RUNTIME_BUILD_TYPE=Release -DLLVM_CONFIG_BINARY=#{llvm.opt_bin}/llvm-config -DENABLE_DOCS=OFF -DENABLE_SYSTEM_TESTS=OFF -DENABLE_KLEE_ASSERTS=ON -DENABLE_KLEE_LIBCXX=ON -DENABLE_KLEE_EH_CXX=OFF -DENABLE_KLEE_UCLIBC=OFF -DENABLE_POSIX_RUNTIME=OFF -DENABLE_SOLVER_METASMT=OFF -DENABLE_SOLVER_STP=OFF -DENABLE_UNIT_TESTS=OFF -DENABLE_TCMALLOC=ON -DENABLE_SOLVER_Z3=ON -DENABLE_ZLIB=ON -DKLEE_LIBCXX_DIR=#{libcxx_install_dir} -DKLEE_LIBCXX_INCLUDE_DIR=#{libcxx_install_dir}/include/c++/v1 -DKLEE_LIBCXXABI_SRC_DIR=#{libcxx_src_dir}/libcxxabi ] mkdir "build" do system "cmake", "..", *args system "make" system "make", "install" end end # Test adapted from # http://klee.github.io/tutorials/testing-function/ test do llvm = Formula["llvm@11"] (testpath/"get_sign.c").write <<~EOS #include "klee/klee.h" int get_sign(int x) { if (x == 0) return 0; if (x < 0) return -1; else return 1; } int main() { int a; klee_make_symbolic(&a, sizeof(a), "a"); return get_sign(a); } EOS ENV["CC"] = llvm.opt_bin/"clang" system ENV.cc, "-I#{opt_include}", "-emit-llvm", "-c", "-g", "-O0", "-disable-O0-optnone", testpath/"get_sign.c" expected_output = <<~EOS KLEE: done: total instructions = 33 KLEE: done: completed paths = 3 KLEE: done: generated tests = 3 EOS output = pipe_output("#{bin}/klee get_sign.bc 2>&1") assert_match expected_output, output assert_predicate testpath/"klee-out-0", :exist? assert_match "['get_sign.bc']", shell_output("#{bin}/ktest-tool klee-last/test000001.ktest") system ENV.cc, "-I#{opt_include}", "-L#{opt_lib}", "-lkleeRuntest", testpath/"get_sign.c" with_env(KTEST_FILE: "klee-last/test000001.ktest") do system "./a.out" end end end klee: switch to LLVM 12 Let's apply the relevant patches from klee/klee#1389 to enable support for LLVM 12. While we're here, let's enable support for STP now that it's available in Homebrew/core. STP is the default solver used by klee. I've also reorganised the build flags a little to make it easier to read. Closes #79551. Signed-off-by: Sean Molenaar <2b250e3fea88cfef248b497ad5fc17f7dc435154@users.noreply.github.com> Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com> class Klee < Formula desc "Symbolic Execution Engine" homepage "https://klee.github.io/" url "https://github.com/klee/klee/archive/v2.2.tar.gz" sha256 "1ff2e37ed3128e005b89920fad7bcf98c7792a11a589dd443186658f5eb91362" license "NCSA" revision 2 head "https://github.com/klee/klee.git" bottle do sha256 big_sur: "68926d21ba91e49e600c58329c81ffbe552ceac655b9c57ae6043e0df4ca926a" sha256 catalina: "d601b6ef40172702659f7efe267d766fe1c82a627afed9017467c4714e3aac52" sha256 mojave: "30147bcef9d3993cb28f0e4235d0e0cb061b1f03dbfd6d698d7fd3ab214dc712" end depends_on "cmake" => :build depends_on "gperftools" depends_on "llvm" depends_on "python-tabulate" depends_on "python@3.9" depends_on "sqlite" depends_on "stp" depends_on "wllvm" depends_on "z3" uses_from_macos "zlib" # klee needs a version of libc++ compiled with wllvm resource "libcxx" do url "https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.0/llvm-project-12.0.0.src.tar.xz" sha256 "9ed1688943a4402d7c904cc4515798cdb20080066efa010fe7e1f2551b423628" end # Patches for LLVM 12 Support # https://github.com/klee/klee/pull/1389 patch do url "https://github.com/klee/klee/commit/74ea9e5e63c5933ca2d5d7f846858c4de6e86b81.patch?full_index=1" sha256 "5af19fb3dbc609a180014f89a78bd007316e1384f3b23bf64fcd15621951b130" end patch do url "https://github.com/klee/klee/commit/a34fb8961649bf3a065ec8f0eb4bc58715fd1d57.patch?full_index=1" sha256 "beb18d3e74c8a580e2c3785e7224cacfb878b527fc4f261f7acb2ebecec93fb0" end patch do url "https://github.com/klee/klee/commit/2b29d86a39421ac76421b888b96613173bc18851.patch?full_index=1" sha256 "34515f7841dc3bc6e68888aa98492e3e003131fdc43018f4923799b0e2ff32fd" end patch do url "https://github.com/klee/klee/commit/c0b10c6f7a00d81cfce24115168dd06888685f87.patch?full_index=1" sha256 "d970235981e6f96f408b5943f80877b633a01cf098e1b4be2c19967b5412eff5" end def llvm deps.map(&:to_formula).find { |f| f.name.match? "^llvm" } end def install libcxx_install_dir = libexec/"libcxx" libcxx_src_dir = buildpath/"libcxx" resource("libcxx").stage libcxx_src_dir cd libcxx_src_dir do # Use build configuration at # https://github.com/klee/klee/blob/v#{version}/scripts/build/p-libcxx.inc libcxx_args = std_cmake_args.reject { |s| s["CMAKE_INSTALL_PREFIX"] } + %W[ -DCMAKE_C_COMPILER=wllvm -DCMAKE_CXX_COMPILER=wllvm++ -DCMAKE_INSTALL_PREFIX=#{libcxx_install_dir} -DLLVM_ENABLE_PROJECTS=libcxx;libcxxabi -DLLVM_ENABLE_THREADS:BOOL=OFF -DLLVM_ENABLE_EH:BOOL=OFF -DLLVM_ENABLE_RTTI:BOOL=OFF -DLIBCXX_ENABLE_THREADS:BOOL=OFF -DLIBCXX_ENABLE_SHARED:BOOL=ON -DLIBCXXABI_ENABLE_THREADS:BOOL=OFF ] on_macos do libcxx_args << "-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY:BOOL=OFF" end on_linux do libcxx_args << "-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY:BOOL=ON" end mkdir "llvm/build" do with_env( LLVM_COMPILER: "clang", LLVM_COMPILER_PATH: llvm.opt_bin, ) do system "cmake", "..", *libcxx_args system "make", "cxx" system "make", "-C", "projects", "install" Dir[libcxx_install_dir/"lib/#{shared_library("*")}", libcxx_install_dir/"lib/*.a"].each do |sl| next if File.symlink? sl system "extract-bc", sl end end end end # CMake options are documented at # https://github.com/klee/klee/blob/v#{version}/README-CMake.md args = std_cmake_args + %W[ -DKLEE_RUNTIME_BUILD_TYPE=Release -DKLEE_LIBCXX_DIR=#{libcxx_install_dir} -DKLEE_LIBCXX_INCLUDE_DIR=#{libcxx_install_dir}/include/c++/v1 -DKLEE_LIBCXXABI_SRC_DIR=#{libcxx_src_dir}/libcxxabi -DLLVM_CONFIG_BINARY=#{llvm.opt_bin}/llvm-config -DENABLE_KLEE_ASSERTS=ON -DENABLE_KLEE_LIBCXX=ON -DENABLE_SOLVER_STP=ON -DENABLE_TCMALLOC=ON -DENABLE_SOLVER_Z3=ON -DENABLE_ZLIB=ON -DENABLE_DOCS=OFF -DENABLE_SYSTEM_TESTS=OFF -DENABLE_KLEE_EH_CXX=OFF -DENABLE_KLEE_UCLIBC=OFF -DENABLE_POSIX_RUNTIME=OFF -DENABLE_SOLVER_METASMT=OFF -DENABLE_UNIT_TESTS=OFF ] mkdir "build" do system "cmake", "..", *args system "make" system "make", "install" end end # Test adapted from # http://klee.github.io/tutorials/testing-function/ test do (testpath/"get_sign.c").write <<~EOS #include "klee/klee.h" int get_sign(int x) { if (x == 0) return 0; if (x < 0) return -1; else return 1; } int main() { int a; klee_make_symbolic(&a, sizeof(a), "a"); return get_sign(a); } EOS ENV["CC"] = llvm.opt_bin/"clang" system ENV.cc, "-I#{opt_include}", "-emit-llvm", "-c", "-g", "-O0", "-disable-O0-optnone", testpath/"get_sign.c" expected_output = <<~EOS KLEE: done: total instructions = 33 KLEE: done: completed paths = 3 KLEE: done: generated tests = 3 EOS output = pipe_output("#{bin}/klee get_sign.bc 2>&1") assert_match expected_output, output assert_predicate testpath/"klee-out-0", :exist? assert_match "['get_sign.bc']", shell_output("#{bin}/ktest-tool klee-last/test000001.ktest") system ENV.cc, "-I#{opt_include}", "-L#{opt_lib}", "-lkleeRuntest", testpath/"get_sign.c" with_env(KTEST_FILE: "klee-last/test000001.ktest") do system "./a.out" end end end
require 'faraday' module MailRoom module Delivery class Postback def initialize(mailbox) @mailbox = mailbox end def deliver(message) connection = Faraday.new connection.token_auth @mailbox.delivery_token connection.post do |request| request.url @mailbox.delivery_url request.body = message # request.options[:timeout] = 3 # request.headers['Content-Type'] = 'text/plain' end end end end end url-encode the POST params to please rack require 'faraday' require 'uri' module MailRoom module Delivery class Postback def initialize(mailbox) @mailbox = mailbox end def deliver(message) connection = Faraday.new connection.token_auth @mailbox.delivery_token # ERROR ArgumentError: invalid %-encoding ("f T-KT-JX" can be seen as a rack error (only detected when using webbrick and looking at stderr) # on some emails that have oddities. % seems to be the worst offender but there are others. # message = message.encode('UTF-8', :invalid => :replace, :undef => :replace) # won't do it -- we need to url-encode the POST params. We don't try setting the Content Type and let rack figure it out instead # (probably the default is url_encoded anyway). # Trying to set request.headers['Content-Length'] to the size of the message doesn't seem needed and may crash the server. # Trying to convince Rack to do the right thing with unencoded params to the POST doesn't seem to work either: # (e.g., setting request.headers['Content-Type'] to 'text/plain' or 'message/rfc822'). connection.post do |request| request.url @mailbox.delivery_url request.body = URI.encode(message) end end end end end
class Klee < Formula desc "Symbolic Execution Engine" homepage "https://klee.github.io/" url "https://github.com/klee/klee/archive/v2.2.tar.gz" sha256 "1ff2e37ed3128e005b89920fad7bcf98c7792a11a589dd443186658f5eb91362" license "NCSA" revision 3 head "https://github.com/klee/klee.git", branch: "master" bottle do sha256 big_sur: "3534cffd757f8fa4c3be4f05c7534dbe705e54657512bb4a1b9d8b13cbe6b337" sha256 catalina: "508ab6444c02c26e061edf84519c18d888c4d9c1098c89215b5b788224838d37" sha256 mojave: "b29dd739b4644aafc918f40a1c5abce7c00657c09a8959401c9ac8c77397a560" end depends_on "cmake" => :build depends_on "gperftools" depends_on "llvm@12" depends_on "python-tabulate" depends_on "python@3.9" depends_on "sqlite" depends_on "stp" depends_on "wllvm" depends_on "z3" uses_from_macos "zlib" on_linux do depends_on "gcc" end fails_with gcc: "5" # klee needs a version of libc++ compiled with wllvm resource "libcxx" do url "https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/llvm-project-12.0.1.src.tar.xz" sha256 "129cb25cd13677aad951ce5c2deb0fe4afc1e9d98950f53b51bdcfb5a73afa0e" end # Patches for LLVM 12 Support # https://github.com/klee/klee/pull/1389 patch do url "https://github.com/klee/klee/commit/8ac323db7d367799fba9435b64fe715c603e60ba.patch?full_index=1" sha256 "e8c325ebe471b4f36eabd9d041f3ad9461061cc261c898e078d4dd211a1f3632" end patch do url "https://github.com/klee/klee/commit/96aa751760b4efc3424a82b573057008bc639c3b.patch?full_index=1" sha256 "1cbc17d413992f211f077687c4187f70b82d7129594fb178c7694fe1d897dac1" end patch do url "https://github.com/klee/klee/commit/3d7c05a7e86a72a4fc8df115591bd1e7a50f9d84.patch?full_index=1" sha256 "6eb99a36c25eaf311bcf666d4b893f9e9bdfd06b72cca63d570b6f3e8a8013bc" end patch do url "https://github.com/klee/klee/commit/8775b9cf6c716f51fe90d668e734a1288c8b5404.patch?full_index=1" sha256 "baefa3e332b2fb699d5329ba2e7c0d87485654dd7ae0a49e6da3a71102ef4ca0" end def llvm deps.map(&:to_formula).find { |f| f.name.match? "^llvm" } end def install libcxx_install_dir = libexec/"libcxx" libcxx_src_dir = buildpath/"libcxx" resource("libcxx").stage libcxx_src_dir cd libcxx_src_dir do # Use build configuration at # https://github.com/klee/klee/blob/v#{version}/scripts/build/p-libcxx.inc libcxx_args = std_cmake_args.reject { |s| s["CMAKE_INSTALL_PREFIX"] } + %W[ -DCMAKE_C_COMPILER=wllvm -DCMAKE_CXX_COMPILER=wllvm++ -DCMAKE_INSTALL_PREFIX=#{libcxx_install_dir} -DLLVM_ENABLE_PROJECTS=libcxx;libcxxabi -DLLVM_ENABLE_THREADS:BOOL=OFF -DLLVM_ENABLE_EH:BOOL=OFF -DLLVM_ENABLE_RTTI:BOOL=OFF -DLIBCXX_ENABLE_THREADS:BOOL=OFF -DLIBCXX_ENABLE_SHARED:BOOL=ON -DLIBCXXABI_ENABLE_THREADS:BOOL=OFF ] if OS.mac? libcxx_args << "-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY:BOOL=OFF" else libcxx_args += %w[ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY:BOOL=ON -DCMAKE_CXX_FLAGS=-I/usr/include/x86_64-linux-gnu ] end mkdir "llvm/build" do with_env( LLVM_COMPILER: "clang", LLVM_COMPILER_PATH: llvm.opt_bin, ) do system "cmake", "..", *libcxx_args system "make", "cxx" system "make", "-C", "projects", "install" Dir[libcxx_install_dir/"lib/#{shared_library("*")}", libcxx_install_dir/"lib/*.a"].each do |sl| next if File.symlink? sl system "extract-bc", sl end end end end # Homebrew-specific workaround to add paths to some glibc headers inreplace "runtime/CMakeLists.txt", "\"-I${CMAKE_SOURCE_DIR}/include\"", "\"-I${CMAKE_SOURCE_DIR}/include\"\n-I/usr/include/x86_64-linux-gnu" # CMake options are documented at # https://github.com/klee/klee/blob/v#{version}/README-CMake.md args = std_cmake_args + %W[ -DKLEE_RUNTIME_BUILD_TYPE=Release -DKLEE_LIBCXX_DIR=#{libcxx_install_dir} -DKLEE_LIBCXX_INCLUDE_DIR=#{libcxx_install_dir}/include/c++/v1 -DKLEE_LIBCXXABI_SRC_DIR=#{libcxx_src_dir}/libcxxabi -DLLVM_CONFIG_BINARY=#{llvm.opt_bin}/llvm-config -DM32_SUPPORTED=OFF -DENABLE_KLEE_ASSERTS=ON -DENABLE_KLEE_LIBCXX=ON -DENABLE_SOLVER_STP=ON -DENABLE_TCMALLOC=ON -DENABLE_SOLVER_Z3=ON -DENABLE_ZLIB=ON -DENABLE_DOCS=OFF -DENABLE_SYSTEM_TESTS=OFF -DENABLE_KLEE_EH_CXX=OFF -DENABLE_KLEE_UCLIBC=OFF -DENABLE_POSIX_RUNTIME=OFF -DENABLE_SOLVER_METASMT=OFF -DENABLE_UNIT_TESTS=OFF ] mkdir "build" do system "cmake", "..", *args system "make" system "make", "install" end end # Test adapted from # http://klee.github.io/tutorials/testing-function/ test do (testpath/"get_sign.c").write <<~EOS #include "klee/klee.h" int get_sign(int x) { if (x == 0) return 0; if (x < 0) return -1; else return 1; } int main() { int a; klee_make_symbolic(&a, sizeof(a), "a"); return get_sign(a); } EOS ENV["CC"] = llvm.opt_bin/"clang" system ENV.cc, "-I#{opt_include}", "-emit-llvm", "-c", "-g", "-O0", "-disable-O0-optnone", testpath/"get_sign.c" expected_output = <<~EOS KLEE: done: total instructions = 33 KLEE: done: completed paths = 3 KLEE: done: generated tests = 3 EOS output = pipe_output("#{bin}/klee get_sign.bc 2>&1") assert_match expected_output, output assert_predicate testpath/"klee-out-0", :exist? assert_match "['get_sign.bc']", shell_output("#{bin}/ktest-tool klee-last/test000001.ktest") system ENV.cc, "-I#{opt_include}", "-L#{opt_lib}", "-lkleeRuntest", testpath/"get_sign.c" with_env(KTEST_FILE: "klee-last/test000001.ktest") do system "./a.out" end end end klee: update 2.2_3 bottle. class Klee < Formula desc "Symbolic Execution Engine" homepage "https://klee.github.io/" url "https://github.com/klee/klee/archive/v2.2.tar.gz" sha256 "1ff2e37ed3128e005b89920fad7bcf98c7792a11a589dd443186658f5eb91362" license "NCSA" revision 3 head "https://github.com/klee/klee.git", branch: "master" bottle do sha256 big_sur: "3534cffd757f8fa4c3be4f05c7534dbe705e54657512bb4a1b9d8b13cbe6b337" sha256 catalina: "508ab6444c02c26e061edf84519c18d888c4d9c1098c89215b5b788224838d37" sha256 mojave: "b29dd739b4644aafc918f40a1c5abce7c00657c09a8959401c9ac8c77397a560" sha256 x86_64_linux: "687e221b5f04745e4f60aad142974d38d06b4c48e717c35edc14b5b2de7be832" end depends_on "cmake" => :build depends_on "gperftools" depends_on "llvm@12" depends_on "python-tabulate" depends_on "python@3.9" depends_on "sqlite" depends_on "stp" depends_on "wllvm" depends_on "z3" uses_from_macos "zlib" on_linux do depends_on "gcc" end fails_with gcc: "5" # klee needs a version of libc++ compiled with wllvm resource "libcxx" do url "https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/llvm-project-12.0.1.src.tar.xz" sha256 "129cb25cd13677aad951ce5c2deb0fe4afc1e9d98950f53b51bdcfb5a73afa0e" end # Patches for LLVM 12 Support # https://github.com/klee/klee/pull/1389 patch do url "https://github.com/klee/klee/commit/8ac323db7d367799fba9435b64fe715c603e60ba.patch?full_index=1" sha256 "e8c325ebe471b4f36eabd9d041f3ad9461061cc261c898e078d4dd211a1f3632" end patch do url "https://github.com/klee/klee/commit/96aa751760b4efc3424a82b573057008bc639c3b.patch?full_index=1" sha256 "1cbc17d413992f211f077687c4187f70b82d7129594fb178c7694fe1d897dac1" end patch do url "https://github.com/klee/klee/commit/3d7c05a7e86a72a4fc8df115591bd1e7a50f9d84.patch?full_index=1" sha256 "6eb99a36c25eaf311bcf666d4b893f9e9bdfd06b72cca63d570b6f3e8a8013bc" end patch do url "https://github.com/klee/klee/commit/8775b9cf6c716f51fe90d668e734a1288c8b5404.patch?full_index=1" sha256 "baefa3e332b2fb699d5329ba2e7c0d87485654dd7ae0a49e6da3a71102ef4ca0" end def llvm deps.map(&:to_formula).find { |f| f.name.match? "^llvm" } end def install libcxx_install_dir = libexec/"libcxx" libcxx_src_dir = buildpath/"libcxx" resource("libcxx").stage libcxx_src_dir cd libcxx_src_dir do # Use build configuration at # https://github.com/klee/klee/blob/v#{version}/scripts/build/p-libcxx.inc libcxx_args = std_cmake_args.reject { |s| s["CMAKE_INSTALL_PREFIX"] } + %W[ -DCMAKE_C_COMPILER=wllvm -DCMAKE_CXX_COMPILER=wllvm++ -DCMAKE_INSTALL_PREFIX=#{libcxx_install_dir} -DLLVM_ENABLE_PROJECTS=libcxx;libcxxabi -DLLVM_ENABLE_THREADS:BOOL=OFF -DLLVM_ENABLE_EH:BOOL=OFF -DLLVM_ENABLE_RTTI:BOOL=OFF -DLIBCXX_ENABLE_THREADS:BOOL=OFF -DLIBCXX_ENABLE_SHARED:BOOL=ON -DLIBCXXABI_ENABLE_THREADS:BOOL=OFF ] if OS.mac? libcxx_args << "-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY:BOOL=OFF" else libcxx_args += %w[ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY:BOOL=ON -DCMAKE_CXX_FLAGS=-I/usr/include/x86_64-linux-gnu ] end mkdir "llvm/build" do with_env( LLVM_COMPILER: "clang", LLVM_COMPILER_PATH: llvm.opt_bin, ) do system "cmake", "..", *libcxx_args system "make", "cxx" system "make", "-C", "projects", "install" Dir[libcxx_install_dir/"lib/#{shared_library("*")}", libcxx_install_dir/"lib/*.a"].each do |sl| next if File.symlink? sl system "extract-bc", sl end end end end # Homebrew-specific workaround to add paths to some glibc headers inreplace "runtime/CMakeLists.txt", "\"-I${CMAKE_SOURCE_DIR}/include\"", "\"-I${CMAKE_SOURCE_DIR}/include\"\n-I/usr/include/x86_64-linux-gnu" # CMake options are documented at # https://github.com/klee/klee/blob/v#{version}/README-CMake.md args = std_cmake_args + %W[ -DKLEE_RUNTIME_BUILD_TYPE=Release -DKLEE_LIBCXX_DIR=#{libcxx_install_dir} -DKLEE_LIBCXX_INCLUDE_DIR=#{libcxx_install_dir}/include/c++/v1 -DKLEE_LIBCXXABI_SRC_DIR=#{libcxx_src_dir}/libcxxabi -DLLVM_CONFIG_BINARY=#{llvm.opt_bin}/llvm-config -DM32_SUPPORTED=OFF -DENABLE_KLEE_ASSERTS=ON -DENABLE_KLEE_LIBCXX=ON -DENABLE_SOLVER_STP=ON -DENABLE_TCMALLOC=ON -DENABLE_SOLVER_Z3=ON -DENABLE_ZLIB=ON -DENABLE_DOCS=OFF -DENABLE_SYSTEM_TESTS=OFF -DENABLE_KLEE_EH_CXX=OFF -DENABLE_KLEE_UCLIBC=OFF -DENABLE_POSIX_RUNTIME=OFF -DENABLE_SOLVER_METASMT=OFF -DENABLE_UNIT_TESTS=OFF ] mkdir "build" do system "cmake", "..", *args system "make" system "make", "install" end end # Test adapted from # http://klee.github.io/tutorials/testing-function/ test do (testpath/"get_sign.c").write <<~EOS #include "klee/klee.h" int get_sign(int x) { if (x == 0) return 0; if (x < 0) return -1; else return 1; } int main() { int a; klee_make_symbolic(&a, sizeof(a), "a"); return get_sign(a); } EOS ENV["CC"] = llvm.opt_bin/"clang" system ENV.cc, "-I#{opt_include}", "-emit-llvm", "-c", "-g", "-O0", "-disable-O0-optnone", testpath/"get_sign.c" expected_output = <<~EOS KLEE: done: total instructions = 33 KLEE: done: completed paths = 3 KLEE: done: generated tests = 3 EOS output = pipe_output("#{bin}/klee get_sign.bc 2>&1") assert_match expected_output, output assert_predicate testpath/"klee-out-0", :exist? assert_match "['get_sign.bc']", shell_output("#{bin}/ktest-tool klee-last/test000001.ktest") system ENV.cc, "-I#{opt_include}", "-L#{opt_lib}", "-lkleeRuntest", testpath/"get_sign.c" with_env(KTEST_FILE: "klee-last/test000001.ktest") do system "./a.out" end end end
module Wombat class OrderMapper def initialize(nuorder_order) @nuorder_order = nuorder_order.dup.freeze end def build @order ||= Wombat::Order.new( id: @nuorder_order['order_number'], nuorder_id: @nuorder_order['_id'], status: 'complete', channel: 'nuorder', email: 'spree@example.com', # TODO: where to find this email? currency: @nuorder_order['currency_code'], placed_on: @nuorder_order['created_on'], totals: totals, rep_name: @nuorder_order['rep_name'], rep_code: @nuorder_order['rep_code'], retailer: retailer, line_items: line_items, adjustments: adjustments, shipping_address: shipping_address, billing_address: billing_address, payments: payments ) rescue Virtus::CoercionError => e raise ArgumentError.new( "`#{e.attribute.name}` attribute type is #{e.output.class}, expected #{e.target_type}" ) end private def totals @totals ||= Wombat::Order::OrderTotal.new( item: line_items.reduce(0) do |total, item| total + (item.quantity*item.price) end, tax: 0, # TODO: where to get tax cost from? shipping: 0, # TODO: where to get shipping cost from? ) end def retailer @retailer ||= Wombat::Order::Retailer.new( retailer_name: nuorder_retailer['retailer_name'], retailer_code: nuorder_retailer['retailer_code'], buyer_name: nuorder_retailer['buyer_name'] ) end def line_items @line_items ||= @nuorder_order['line_items'].try(:map) do |line_item| price = 0 quantity = 0 line_item['sizes'].try(:each) do |size| price += size['price'].to_i quantity += size['quantity'].to_i end Wombat::Order::LineItem.new( product_id: 'SPREE T-SHIRT', # TODO: what it should be? name: 'Spree t-shirt', # TODO: make another api call to get it? quantity: quantity, price: price, ) end end def adjustments # TODO: placeholders, nuroder does not have tax and shipping info in API @adjustments ||= [ Wombat::Order::Adjustment.new(name: 'Tax', value: 0), Wombat::Order::Adjustment.new(name: 'Shipping', value: 0) ] end def shipping_address @shipping_address ||= Wombat::Order::Address.new( { firstname: customers_first_name, lastname: customers_last_name, address1: nuorder_shipping_address['line_1'], address2: nuorder_shipping_address['line_2'], zipcode: nuorder_shipping_address['zip'], city: nuorder_shipping_address['city'], state: nuorder_shipping_address['state'], country: nuorder_shipping_address['country'], phone: nuorder_shipping_address['phone'] }.compact ) end def billing_address @billing_address ||= Wombat::Order::Address.new( { firstname: customers_first_name, lastname: customers_last_name, address1: nuorder_billing_address['line_1'], address2: nuorder_billing_address['line_2'], zipcode: nuorder_billing_address['zip'], city: nuorder_billing_address['city'], state: nuorder_billing_address['state'], country: nuorder_billing_address['country'], phone: nuorder_billing_address['phone'] }.compact ) end def payments # This should be empty for now as nuorder does not have payments in API @payments ||= [] end def split_customers_name @nuorder_order.fetch('retailer', {})['buyer_name'].try(:split, ' ', 2) end def customers_first_name split_customers_name.try(:[], 0) end def customers_last_name split_customers_name.try(:[], 1) end def nuorder_shipping_address @nuroder_shipping_address ||= @nuorder_order.fetch('shipping_address', {}) end def nuorder_billing_address @nuorder_billing_address ||= @nuorder_order.fetch('billing_address', {}) end def nuorder_retailer @nuorder_retailer ||= @nuorder_order.fetch('retailer', {}) end end end email should be blank module Wombat class OrderMapper def initialize(nuorder_order) @nuorder_order = nuorder_order.dup.freeze end def build @order ||= Wombat::Order.new( id: @nuorder_order['order_number'], nuorder_id: @nuorder_order['_id'], status: 'complete', channel: 'nuorder', email: '', # TODO: where to find this email? currency: @nuorder_order['currency_code'], placed_on: @nuorder_order['created_on'], totals: totals, rep_name: @nuorder_order['rep_name'], rep_code: @nuorder_order['rep_code'], retailer: retailer, line_items: line_items, adjustments: adjustments, shipping_address: shipping_address, billing_address: billing_address, payments: payments ) rescue Virtus::CoercionError => e raise ArgumentError.new( "`#{e.attribute.name}` attribute type is #{e.output.class}, expected #{e.target_type}" ) end private def totals @totals ||= Wombat::Order::OrderTotal.new( item: line_items.reduce(0) do |total, item| total + (item.quantity*item.price) end, tax: 0, # TODO: where to get tax cost from? shipping: 0, # TODO: where to get shipping cost from? ) end def retailer @retailer ||= Wombat::Order::Retailer.new( retailer_name: nuorder_retailer['retailer_name'], retailer_code: nuorder_retailer['retailer_code'], buyer_name: nuorder_retailer['buyer_name'] ) end def line_items @line_items ||= @nuorder_order['line_items'].try(:map) do |line_item| price = 0 quantity = 0 line_item['sizes'].try(:each) do |size| price += size['price'].to_i quantity += size['quantity'].to_i end Wombat::Order::LineItem.new( product_id: 'SPREE T-SHIRT', # TODO: what it should be? name: 'Spree t-shirt', # TODO: make another api call to get it? quantity: quantity, price: price, ) end end def adjustments # TODO: placeholders, nuroder does not have tax and shipping info in API @adjustments ||= [ Wombat::Order::Adjustment.new(name: 'Tax', value: 0), Wombat::Order::Adjustment.new(name: 'Shipping', value: 0) ] end def shipping_address @shipping_address ||= Wombat::Order::Address.new( { firstname: customers_first_name, lastname: customers_last_name, address1: nuorder_shipping_address['line_1'], address2: nuorder_shipping_address['line_2'], zipcode: nuorder_shipping_address['zip'], city: nuorder_shipping_address['city'], state: nuorder_shipping_address['state'], country: nuorder_shipping_address['country'], phone: nuorder_shipping_address['phone'] }.compact ) end def billing_address @billing_address ||= Wombat::Order::Address.new( { firstname: customers_first_name, lastname: customers_last_name, address1: nuorder_billing_address['line_1'], address2: nuorder_billing_address['line_2'], zipcode: nuorder_billing_address['zip'], city: nuorder_billing_address['city'], state: nuorder_billing_address['state'], country: nuorder_billing_address['country'], phone: nuorder_billing_address['phone'] }.compact ) end def payments # This should be empty for now as nuorder does not have payments in API @payments ||= [] end def split_customers_name @nuorder_order.fetch('retailer', {})['buyer_name'].try(:split, ' ', 2) end def customers_first_name split_customers_name.try(:[], 0) end def customers_last_name split_customers_name.try(:[], 1) end def nuorder_shipping_address @nuroder_shipping_address ||= @nuorder_order.fetch('shipping_address', {}) end def nuorder_billing_address @nuorder_billing_address ||= @nuorder_order.fetch('billing_address', {}) end def nuorder_retailer @nuorder_retailer ||= @nuorder_order.fetch('retailer', {}) end end end
class Knot < Formula desc "High-performance authoritative-only DNS server" homepage "https://www.knot-dns.cz/" url "https://secure.nic.cz/files/knot-dns/knot-2.9.3.tar.xz" sha256 "f2adf137d70955a4a20df90c5409e10be8e1127204a98b27d626ac090531a07e" bottle do sha256 "a3b574d75b38744bbb32ea2a077e81be97116e632e07ca1015d2a036f4fa4902" => :catalina sha256 "6c5c90612e187974dceb1b65631f717466f5e14d2ff85ef21988b8d6ba524198" => :mojave sha256 "9edf381f0cb6f032d8555d09f73d8bed00ab521272599b6e0f23c9231cca0d2a" => :high_sierra sha256 "70932776472512c70875050822363b65e443e77363f8f85b2519f0fc5d3cf090" => :sierra end head do url "https://gitlab.labs.nic.cz/knot/knot-dns.git" depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build end depends_on "pkg-config" => :build depends_on "sphinx-doc" => :build depends_on "fstrm" depends_on "gnutls" depends_on "libidn2" depends_on :macos => :yosemite # due to AT_REMOVEDIR depends_on "protobuf-c" depends_on "userspace-rcu" def install system "autoreconf", "-fvi" if build.head? system "./configure", "--disable-dependency-tracking", "--disable-silent-rules", "--with-configdir=#{etc}", "--with-storage=#{var}/knot", "--with-rundir=#{var}/run/knot", "--prefix=#{prefix}", "--with-module-dnstap", "--enable-dnstap" inreplace "samples/Makefile", "install-data-local:", "disable-install-data-local:" system "make" system "make", "install" system "make", "install-singlehtml" (buildpath/"knot.conf").write(knot_conf) etc.install "knot.conf" end def post_install (var/"knot").mkpath end def knot_conf <<~EOS server: rundir: "#{var}/knot" listen: [ "0.0.0.0@53", "::@53" ] log: - target: "stderr" any: "info" control: listen: "knot.sock" template: - id: "default" storage: "#{var}/knot" EOS end plist_options :startup => true def plist <<~EOS <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>EnableTransactions</key> <true/> <key>Label</key> <string>#{plist_name}</string> <key>RunAtLoad</key> <true/> <key>ProgramArguments</key> <array> <string>#{opt_sbin}/knotd</string> </array> <key>StandardInPath</key> <string>/dev/null</string> <key>StandardOutPath</key> <string>/dev/null</string> <key>StandardErrorPath</key> <string>#{var}/log/knot.log</string> </dict> </plist> EOS end test do system bin/"kdig", "www.knot-dns.cz" system bin/"khost", "brew.sh" system sbin/"knotc", "conf-check" end end knot: update 2.9.3 bottle. class Knot < Formula desc "High-performance authoritative-only DNS server" homepage "https://www.knot-dns.cz/" url "https://secure.nic.cz/files/knot-dns/knot-2.9.3.tar.xz" sha256 "f2adf137d70955a4a20df90c5409e10be8e1127204a98b27d626ac090531a07e" bottle do sha256 "c5de8c5074e1f09b4b4deadfc9510c673d556c98a6cb637be71e8d44f7171e9e" => :catalina sha256 "76ce20dd866c1189fbd660e48c498c7119fdc90b8c7bbc3282da579d52396d2b" => :mojave sha256 "94113b40854b70f3ffd33077b6585ee78aa90666a05a1f281b5ef15f2a6c39ce" => :high_sierra end head do url "https://gitlab.labs.nic.cz/knot/knot-dns.git" depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build end depends_on "pkg-config" => :build depends_on "sphinx-doc" => :build depends_on "fstrm" depends_on "gnutls" depends_on "libidn2" depends_on :macos => :yosemite # due to AT_REMOVEDIR depends_on "protobuf-c" depends_on "userspace-rcu" def install system "autoreconf", "-fvi" if build.head? system "./configure", "--disable-dependency-tracking", "--disable-silent-rules", "--with-configdir=#{etc}", "--with-storage=#{var}/knot", "--with-rundir=#{var}/run/knot", "--prefix=#{prefix}", "--with-module-dnstap", "--enable-dnstap" inreplace "samples/Makefile", "install-data-local:", "disable-install-data-local:" system "make" system "make", "install" system "make", "install-singlehtml" (buildpath/"knot.conf").write(knot_conf) etc.install "knot.conf" end def post_install (var/"knot").mkpath end def knot_conf <<~EOS server: rundir: "#{var}/knot" listen: [ "0.0.0.0@53", "::@53" ] log: - target: "stderr" any: "info" control: listen: "knot.sock" template: - id: "default" storage: "#{var}/knot" EOS end plist_options :startup => true def plist <<~EOS <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>EnableTransactions</key> <true/> <key>Label</key> <string>#{plist_name}</string> <key>RunAtLoad</key> <true/> <key>ProgramArguments</key> <array> <string>#{opt_sbin}/knotd</string> </array> <key>StandardInPath</key> <string>/dev/null</string> <key>StandardOutPath</key> <string>/dev/null</string> <key>StandardErrorPath</key> <string>#{var}/log/knot.log</string> </dict> </plist> EOS end test do system bin/"kdig", "www.knot-dns.cz" system bin/"khost", "brew.sh" system sbin/"knotc", "conf-check" end end
class Lame < Formula desc "High quality MPEG Audio Layer III (MP3) encoder" homepage "http://lame.sourceforge.net/" url "https://downloads.sourceforge.net/sourceforge/lame/lame-3.99.5.tar.gz" sha256 "24346b4158e4af3bd9f2e194bb23eb473c75fb7377011523353196b19b9a23ff" bottle do cellar :any rebuild 1 sha256 "687dd6b97e6c8d385b55eb4ace546b52bb584a7c56516f97a144ff99e29abdc3" => :sierra sha256 "fc7884b76f15e5feebef087b4597e1f142b9aed83274e989c1ca959edb294454" => :el_capitan sha256 "064e13206ca4f731d919f89adb480b4a83116a4374f5aa6d205528838364ca7b" => :yosemite sha256 "43ee3550ab5ce2c5e9b4e8adfedc197b5ffbf252320d46de97cd6a7133ddd16f" => :mavericks sha256 "db743baefa0ec1b0f8c00df4728536418916c4d42c71c548dc43d43a1b24b523" => :mountain_lion end option :universal def install ENV.universal_binary if build.universal? system "./configure", "--disable-dependency-tracking", "--disable-debug", "--prefix=#{prefix}", "--enable-nasm" system "make", "install" end test do system "#{bin}/lame", "--genre-list", test_fixtures("test.mp3") end end lame: fix audit --warning class Lame < Formula desc "High quality MPEG Audio Layer III (MP3) encoder" homepage "https://lame.sourceforge.io/" url "https://downloads.sourceforge.net/sourceforge/lame/lame-3.99.5.tar.gz" sha256 "24346b4158e4af3bd9f2e194bb23eb473c75fb7377011523353196b19b9a23ff" bottle do cellar :any rebuild 1 sha256 "687dd6b97e6c8d385b55eb4ace546b52bb584a7c56516f97a144ff99e29abdc3" => :sierra sha256 "fc7884b76f15e5feebef087b4597e1f142b9aed83274e989c1ca959edb294454" => :el_capitan sha256 "064e13206ca4f731d919f89adb480b4a83116a4374f5aa6d205528838364ca7b" => :yosemite sha256 "43ee3550ab5ce2c5e9b4e8adfedc197b5ffbf252320d46de97cd6a7133ddd16f" => :mavericks sha256 "db743baefa0ec1b0f8c00df4728536418916c4d42c71c548dc43d43a1b24b523" => :mountain_lion end option :universal def install ENV.universal_binary if build.universal? system "./configure", "--disable-dependency-tracking", "--disable-debug", "--prefix=#{prefix}", "--enable-nasm" system "make", "install" end test do system "#{bin}/lame", "--genre-list", test_fixtures("test.mp3") end end
namespace :metaforce do Metaforce.log = true task :require do require 'metaforce' end task :login do if File.exists?('metaforce.yml') require 'yaml' config = YAML.load_file('metaforce.yml') env = ENV['env'] || 'developer' root = config.has_key?(env) ? config[env] : config username = root["username"] password = root["password"] security_token = root["security_token"] || '' test = root["test"] || false Metaforce.configuration.test = test else print "username: "; username = STDIN.gets.chomp print "password: "; password = STDIN.gets.chomp print "security token: "; security_token = STDIN.gets.chomp end @client = Metaforce::Metadata::Client.new :username => username, :password => password, :security_token => security_token end desc "Deploy current directory to the organization" task :deploy => :login do deployment = @client.deploy File.dirname(__FILE__) result = deployment.result(:wait_until_done => true) if result[:success] puts "Successfully deployed metadata." else puts "An error occurred." end end desc "Retrieve metadata from the organization to src directory" task :retrieve => :login do dir = ENV['dir'] || 'src' retrieval = @client.retrieve_unpackaged(File.expand_path('src/package.xml')) result = retrieval.result(:wait_until_done => true) retrieval.unzip(File.expand_path(dir)) puts "Successfully retrieved metadata to '#{dir}'." end end Use 'default' as the default environment namespace :metaforce do Metaforce.log = true task :require do require 'metaforce' end task :login do if File.exists?('metaforce.yml') require 'yaml' config = YAML.load_file('metaforce.yml') env = ENV['env'] || 'default' root = config.has_key?(env) ? config[env] : config username = root["username"] password = root["password"] security_token = root["security_token"] || '' test = root["test"] || false Metaforce.configuration.test = test else print "username: "; username = STDIN.gets.chomp print "password: "; password = STDIN.gets.chomp print "security token: "; security_token = STDIN.gets.chomp end @client = Metaforce::Metadata::Client.new :username => username, :password => password, :security_token => security_token end desc "Deploy current directory to the organization" task :deploy => :login do deployment = @client.deploy File.dirname(__FILE__) result = deployment.result(:wait_until_done => true) if result[:success] puts "Successfully deployed metadata." else puts "An error occurred." end end desc "Retrieve metadata from the organization to src directory" task :retrieve => :login do dir = ENV['dir'] || 'src' retrieval = @client.retrieve_unpackaged(File.expand_path('src/package.xml')) result = retrieval.result(:wait_until_done => true) retrieval.unzip(File.expand_path(dir)) puts "Successfully retrieved metadata to '#{dir}'." end end
require 'formula' class Lame < Formula homepage 'http://lame.sourceforge.net/' url 'http://downloads.sourceforge.net/sourceforge/lame/lame-3.99.2.tar.gz' md5 'd049cc1c6b2be16805d5765cc0b23737' def install system "./configure", "--disable-debug", "--prefix=#{prefix}", "--enable-nasm" system "make install" end end lame 3.99.3 Update LAME to 3.99.3 (stable / minor bugfix) Changes: Fix for tracker item [ 3441349 ] --tg does not handle genre number when adding unicode tag. Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com> require 'formula' class Lame < Formula homepage 'http://lame.sourceforge.net/' url 'http://downloads.sourceforge.net/sourceforge/lame/lame-3.99.3.tar.gz' md5 '5ad31e33e70455eb3a7b79a5dd934fce' def install system "./configure", "--disable-debug", "--prefix=#{prefix}", "--enable-nasm" system "make install" end end
class Ldns < Formula desc "DNS library written in C" homepage "https://nlnetlabs.nl/projects/ldns/" url "https://nlnetlabs.nl/downloads/ldns/ldns-1.7.0.tar.gz" sha256 "c19f5b1b4fb374cfe34f4845ea11b1e0551ddc67803bd6ddd5d2a20f0997a6cc" bottle do sha256 "294b0901da29bba11010f1ac2716ab111cb4fcc283779264cb857c1057270ebb" => :sierra sha256 "bee97f2127cacd4fef3fbd77d00b0bbfb4f2afc738c8242634b2de2e90ac4c8a" => :el_capitan sha256 "60d00b07a87aacace15aa4ac992e45e21b0d3827658c588e15643d3434f30304" => :yosemite end depends_on "swig" => :build depends_on "openssl@1.1" def install args = %W[ --prefix=#{prefix} --with-drill --with-examples --with-ssl=#{Formula["openssl@1.1"].opt_prefix} --with-pyldns PYTHON_SITE_PKG=#{lib}/python2.7/site-packages ] system "./configure", *args inreplace "Makefile" do |s| s.change_make_var! "PYTHON_LDFLAGS", "-undefined dynamic_lookup" s.gsub! /(\$\(PYTHON_LDFLAGS\).*) -no-undefined/, "\\1" end system "make" system "make", "install" system "make", "install-pyldns" (lib/"pkgconfig").install "packaging/libldns.pc" end test do (testpath/"powerdns.com.dnskey").write("powerdns.com. 10773 IN DNSKEY 256 3 8 AwEAAbQOlJUPNWM8DQown5y/wFgDVt7jskfEQcd4pbLV/1osuBfBNDZX v9ru7wDC/PbpvysEZgFXTPJ9QrdwSsd8KAZVO5mjeDNL0RnlhjHWuXKC qnLI+iLb3OMLQTizjdscdHPoW98wk5931pJkyf2qMDRjRB4c5d81sfoZ Od6D7Rrx\npowerdns.com. 10773 IN DNSKEY 257 3 8 AwEAAb/+pXOZWYQ8mv9WM5dFva8WU9jcIUdDuEjldbyfnkQ/xlrJC5zA EfhYhrea3SmIPmMTDimLqbh3/4SMTNPTUF+9+U1vpNfIRTFadqsmuU9F ddz3JqCcYwEpWbReg6DJOeyu+9oBoIQkPxFyLtIXEPGlQzrynKubn04C x83I6NfzDTraJT3jLHKeW5PVc1ifqKzHz5TXdHHTA7NkJAa0sPcZCoNE 1LpnJI/wcUpRUiuQhoLFeT1E432GuPuZ7y+agElGj0NnBxEgnHrhrnZW UbULpRa/il+Cr5Taj988HqX9Xdm6FjcP4Lbuds/44U7U8du224Q8jTrZ 57Yvj4VDQKc=") system "#{bin}/ldns-key2ds", "powerdns.com.dnskey" assert_match /d4c3d5552b8679faeebc317e5f048b614b2e5f607dc57f1553182d49ab2179f7/, File.read("Kpowerdns.com.+008+44030.ds") end end ldns: fix rubocop warnings. class Ldns < Formula desc "DNS library written in C" homepage "https://nlnetlabs.nl/projects/ldns/" url "https://nlnetlabs.nl/downloads/ldns/ldns-1.7.0.tar.gz" sha256 "c19f5b1b4fb374cfe34f4845ea11b1e0551ddc67803bd6ddd5d2a20f0997a6cc" bottle do sha256 "294b0901da29bba11010f1ac2716ab111cb4fcc283779264cb857c1057270ebb" => :sierra sha256 "bee97f2127cacd4fef3fbd77d00b0bbfb4f2afc738c8242634b2de2e90ac4c8a" => :el_capitan sha256 "60d00b07a87aacace15aa4ac992e45e21b0d3827658c588e15643d3434f30304" => :yosemite end depends_on "swig" => :build depends_on "openssl@1.1" def install args = %W[ --prefix=#{prefix} --with-drill --with-examples --with-ssl=#{Formula["openssl@1.1"].opt_prefix} --with-pyldns PYTHON_SITE_PKG=#{lib}/python2.7/site-packages ] system "./configure", *args inreplace "Makefile" do |s| s.change_make_var! "PYTHON_LDFLAGS", "-undefined dynamic_lookup" s.gsub! /(\$\(PYTHON_LDFLAGS\).*) -no-undefined/, "\\1" end system "make" system "make", "install" system "make", "install-pyldns" (lib/"pkgconfig").install "packaging/libldns.pc" end test do (testpath/"powerdns.com.dnskey").write <<-EOS.undent powerdns.com. 10773 IN DNSKEY 256 3 8 AwEAAbQOlJUPNWM8DQown5y/wFgDVt7jskfEQcd4pbLV/1osuBfBNDZX v9ru7wDC/PbpvysEZgFXTPJ9QrdwSsd8KAZVO5mjeDNL0RnlhjHWuXKC qnLI+iLb3OMLQTizjdscdHPoW98wk5931pJkyf2qMDRjRB4c5d81sfoZ Od6D7Rrx powerdns.com. 10773 IN DNSKEY 257 3 8 AwEAAb/+pXOZWYQ8mv9WM5dFva8WU9jcIUdDuEjldbyfnkQ/xlrJC5zA EfhYhrea3SmIPmMTDimLqbh3/4SMTNPTUF+9+U1vpNfIRTFadqsmuU9F ddz3JqCcYwEpWbReg6DJOeyu+9oBoIQkPxFyLtIXEPGlQzrynKubn04C x83I6NfzDTraJT3jLHKeW5PVc1ifqKzHz5TXdHHTA7NkJAa0sPcZCoNE 1LpnJI/wcUpRUiuQhoLFeT1E432GuPuZ7y+agElGj0NnBxEgnHrhrnZW UbULpRa/il+Cr5Taj988HqX9Xdm6FjcP4Lbuds/44U7U8du224Q8jTrZ 57Yvj4VDQKc=" EOS system "#{bin}/ldns-key2ds", "powerdns.com.dnskey" assert_match /d4c3d5552b8679faeebc317e5f048b614b2e5f607dc57f1553182d49ab2179f7/, File.read("Kpowerdns.com.+008+44030.ds") end end
class Lean < Formula desc "Theorem prover" homepage "https://leanprover.github.io/" url "https://github.com/leanprover/lean/archive/v3.4.2.tar.gz" sha256 "ec4488be8473577666f38dec81123d0f7b26476139d3caa2e175a571f6c00d87" head "https://github.com/leanprover/lean.git" bottle do cellar :any sha256 "f9b31e72b4a0c314c09af988e21172bcfce644487a2e7f4d0bafb898be3a8ee0" => :mojave sha256 "5afcb08796f1e4bf4600006c7b3ebcb76e90f15a14bce73af97f55f1896a4ef1" => :high_sierra sha256 "4c25bc5a6233614a706323e9a4bfec26bb83f10d67a96f05272ad2c0fe2c7e71" => :sierra sha256 "711ed18ebd939e8db24c1c87cba002fd6e590fbc92e110aae7e78310852343b2" => :el_capitan end depends_on "cmake" => :build depends_on "gmp" depends_on "jemalloc" def install mkdir "src/build" do system "cmake", "..", *std_cmake_args system "make", "install" end end test do (testpath/"hello.lean").write <<~EOS def id' {α : Type} (x : α) : α := x inductive tree (α : Type) : Type | node : α → list tree → tree example (a b : Prop) : a ∧ b -> b ∧ a := begin intro h, cases h, split, repeat { assumption } end EOS system "#{bin}/lean", testpath/"hello.lean" end end lean: update 3.4.2 bottle. class Lean < Formula desc "Theorem prover" homepage "https://leanprover.github.io/" url "https://github.com/leanprover/lean/archive/v3.4.2.tar.gz" sha256 "ec4488be8473577666f38dec81123d0f7b26476139d3caa2e175a571f6c00d87" head "https://github.com/leanprover/lean.git" bottle do cellar :any sha256 "a4e42293767b2c39d46ededd68ccdbae0deddc8280a8d5a0004390091e91acd4" => :mojave sha256 "31506dc58b1108625510415a551fea963739898ad675d8cb3023af6e3922e109" => :high_sierra sha256 "a5df8afdccd0db40f4a9c8184d9197a8a66a47b2c2bbf7451e05976b13274025" => :sierra end depends_on "cmake" => :build depends_on "gmp" depends_on "jemalloc" def install mkdir "src/build" do system "cmake", "..", *std_cmake_args system "make", "install" end end test do (testpath/"hello.lean").write <<~EOS def id' {α : Type} (x : α) : α := x inductive tree (α : Type) : Type | node : α → list tree → tree example (a b : Prop) : a ∧ b -> b ∧ a := begin intro h, cases h, split, repeat { assumption } end EOS system "#{bin}/lean", testpath/"hello.lean" end end
module Mohawk module Adapters module UIA class Control include Mohawk::Waiter class << self attr_reader :patterns def valid_patterns(*patterns) @patterns = patterns end end def initialize(adapter, locator) @parent = adapter.window.element @locator = locator end def click element.click end def focus element.focus end def exist? locate_element != nil end def enabled? exist? && element.enabled? end def disabled? !enabled? end def visible? exist? && element.visible? end def element @element ||= wait_for { locate_element } end def handle element.handle end def value element.name end alias_method :control_name, :value def view self end def method_missing(meth, *args, &block) if element.respond_to? meth element.send meth, *args, &block else super end end private def locate_element scope = (@locator.delete(:children_only) && :children) || :descendants locator = @locator.merge(scope: scope) patterns = @locator.delete(:pattern) || self.class.patterns locator.merge!(pattern: patterns) if patterns @parent.find locator end end end end end alias :exist? to :exists? module Mohawk module Adapters module UIA class Control include Mohawk::Waiter class << self attr_reader :patterns def valid_patterns(*patterns) @patterns = patterns end end def initialize(adapter, locator) @parent = adapter.window.element @locator = locator end def click element.click end def focus element.focus end def exist? locate_element != nil end alias_method :exists?, :exist? def enabled? exist? && element.enabled? end def disabled? !enabled? end def visible? exist? && element.visible? end def element @element ||= wait_for { locate_element } end def handle element.handle end def value element.name end alias_method :control_name, :value def view self end def method_missing(meth, *args, &block) if element.respond_to? meth element.send meth, *args, &block else super end end private def locate_element scope = (@locator.delete(:children_only) && :children) || :descendants locator = @locator.merge(scope: scope) patterns = @locator.delete(:pattern) || self.class.patterns locator.merge!(pattern: patterns) if patterns @parent.find locator end end end end end
class Less < Formula desc "Pager program similar to more" homepage "http://www.greenwoodsoftware.com/less/index.html" url "https://ftpmirror.gnu.org/less/less-487.tar.gz" mirror "http://www.greenwoodsoftware.com/less/less-487.tar.gz" sha256 "f3dc8455cb0b2b66e0c6b816c00197a71bf6d1787078adeee0bcf2aea4b12706" bottle do sha256 "9ca07bd92196f4fbf122054b3ee394f43f14173b816a5217f05661453c13dd23" => :sierra sha256 "877f32f255528633a67c4ae76dfda423315473a0780f8f066b7d78af4d58bbc8" => :el_capitan sha256 "5be9c4ad7e6eda596a6828d1f49c70612ac02e2df6a65254e99dc1a34ecf1095" => :yosemite end depends_on "pcre" => :optional def install args = ["--prefix=#{prefix}"] args << "--with-regex=pcre" if build.with? "pcre" system "./configure", *args system "make", "install" end test do system "#{bin}/lesskey", "-V" end end less: swap GNU url and mirror. class Less < Formula desc "Pager program similar to more" homepage "http://www.greenwoodsoftware.com/less/index.html" url "https://ftp.gnu.org/gnu/less/less-487.tar.gz" mirror "http://www.greenwoodsoftware.com/less/less-487.tar.gz" sha256 "f3dc8455cb0b2b66e0c6b816c00197a71bf6d1787078adeee0bcf2aea4b12706" bottle do sha256 "9ca07bd92196f4fbf122054b3ee394f43f14173b816a5217f05661453c13dd23" => :sierra sha256 "877f32f255528633a67c4ae76dfda423315473a0780f8f066b7d78af4d58bbc8" => :el_capitan sha256 "5be9c4ad7e6eda596a6828d1f49c70612ac02e2df6a65254e99dc1a34ecf1095" => :yosemite end depends_on "pcre" => :optional def install args = ["--prefix=#{prefix}"] args << "--with-regex=pcre" if build.with? "pcre" system "./configure", *args system "make", "install" end test do system "#{bin}/lesskey", "-V" end end
module MongoSessionStore VERSION = "3.0.0.beta.1".freeze end Update version, was alpha module MongoSessionStore VERSION = "3.0.0.alpha.1".freeze end
class Lima < Formula desc "Linux virtual machines" homepage "https://github.com/lima-vm/lima" url "https://github.com/lima-vm/lima/archive/v0.7.2.tar.gz" sha256 "aa61149a91a20a6ced531bda02b63491fd8f7cf7d23a373090ce1d605475b533" license "Apache-2.0" bottle do sha256 cellar: :any_skip_relocation, arm64_monterey: "3fea9d44c79aa9471a9bf1c1f42f544cf06eeebe9fe0bba77962776d9327a3c6" sha256 cellar: :any_skip_relocation, arm64_big_sur: "32fbfa81dff42b0f2c830cb06276c4c209a8eb5d0f94576faf17d1112701c839" sha256 cellar: :any_skip_relocation, monterey: "0eaa520e15e95091c3dc0c9cf121bba437fc5ebdfc4456d8c8b9c00e808cbe56" sha256 cellar: :any_skip_relocation, big_sur: "d84c330c8713efadb2482ec2711163776232fae7eb64533af4bbcb648a227d1c" sha256 cellar: :any_skip_relocation, catalina: "eb84a1f53766e2f94a6fc55561ba4386879439cba0009921bbaf03c660106b82" sha256 cellar: :any_skip_relocation, x86_64_linux: "5c574b960b46a968f438d34450c0cb1c3c3d71dd1961cdd5896d5ac80a548477" end depends_on "go" => :build depends_on "qemu" def install system "make", "VERSION=#{version}", "clean", "binaries" bin.install Dir["_output/bin/*"] share.install Dir["_output/share/*"] # Install shell completions output = Utils.safe_popen_read("#{bin}/limactl", "completion", "bash") (bash_completion/"limactl").write output output = Utils.safe_popen_read("#{bin}/limactl", "completion", "zsh") (zsh_completion/"_limactl").write output output = Utils.safe_popen_read("#{bin}/limactl", "completion", "fish") (fish_completion/"limactl.fish").write output end test do assert_match "Pruning", shell_output("#{bin}/limactl prune 2>&1") end end lima 0.7.3 Closes #88765. Signed-off-by: Carlo Cabrera <3ffc397d0e4bded29cb84b56167de54c01e3a55b@users.noreply.github.com> Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com> class Lima < Formula desc "Linux virtual machines" homepage "https://github.com/lima-vm/lima" url "https://github.com/lima-vm/lima/archive/v0.7.3.tar.gz" sha256 "f6b178e2536e3fb141db8c532b831e555253485fed4e0ad1a139c0998d5d7f3f" license "Apache-2.0" bottle do sha256 cellar: :any_skip_relocation, arm64_monterey: "3fea9d44c79aa9471a9bf1c1f42f544cf06eeebe9fe0bba77962776d9327a3c6" sha256 cellar: :any_skip_relocation, arm64_big_sur: "32fbfa81dff42b0f2c830cb06276c4c209a8eb5d0f94576faf17d1112701c839" sha256 cellar: :any_skip_relocation, monterey: "0eaa520e15e95091c3dc0c9cf121bba437fc5ebdfc4456d8c8b9c00e808cbe56" sha256 cellar: :any_skip_relocation, big_sur: "d84c330c8713efadb2482ec2711163776232fae7eb64533af4bbcb648a227d1c" sha256 cellar: :any_skip_relocation, catalina: "eb84a1f53766e2f94a6fc55561ba4386879439cba0009921bbaf03c660106b82" sha256 cellar: :any_skip_relocation, x86_64_linux: "5c574b960b46a968f438d34450c0cb1c3c3d71dd1961cdd5896d5ac80a548477" end depends_on "go" => :build depends_on "qemu" def install system "make", "VERSION=#{version}", "clean", "binaries" bin.install Dir["_output/bin/*"] share.install Dir["_output/share/*"] # Install shell completions output = Utils.safe_popen_read("#{bin}/limactl", "completion", "bash") (bash_completion/"limactl").write output output = Utils.safe_popen_read("#{bin}/limactl", "completion", "zsh") (zsh_completion/"_limactl").write output output = Utils.safe_popen_read("#{bin}/limactl", "completion", "fish") (fish_completion/"limactl.fish").write output end test do assert_match "Pruning", shell_output("#{bin}/limactl prune 2>&1") end end
require_relative '../base' module MSFLVisitors module Nodes module Set class Set < Base attr_accessor :contents def accept(visitor) nodes = Array.new nodes << Open.new if contents.count > 0 contents.each do |item| nodes << item nodes << Delimiter.new end # Remove the last (and therefore extra) delimiter nodes.pop end nodes << Close.new nodes.each do |node| node.accept visitor end end # @param nodes [Array<MSFL::Nodes::Base>] the nodes that the filter surrounds def initialize(nodes) self.contents = Array(nodes) end def ==(other) self.class == other.class && contents == other.contents end end end end end Delegate array-like methods to its contents - Delegate :count - Delegate :first - Delegate :each require_relative '../base' module MSFLVisitors module Nodes module Set class Set < Base extend Forwardable attr_accessor :contents def_delegators :contents, :count, :first, :each def accept(visitor) nodes = Array.new nodes << Open.new if contents.count > 0 contents.each do |item| nodes << item nodes << Delimiter.new end # Remove the last (and therefore extra) delimiter nodes.pop end nodes << Close.new nodes.each do |node| node.accept visitor end end # @param nodes [Array<MSFL::Nodes::Base>] the nodes that the filter surrounds def initialize(nodes) self.contents = Array(nodes) end def ==(other) self.class == other.class && contents == other.contents end end end end end
class Llvm < Formula homepage 'http://llvm.org/' revision 1 stable do url "http://llvm.org/releases/3.5.0/llvm-3.5.0.src.tar.xz" sha1 "58d817ac2ff573386941e7735d30702fe71267d5" resource "clang" do url "http://llvm.org/releases/3.5.0/cfe-3.5.0.src.tar.xz" sha1 "834cee2ed8dc6638a486d8d886b6dce3db675ffa" end resource "libcxx" do url "http://llvm.org/releases/3.5.0/libcxx-3.5.0.src.tar.xz" sha1 "c98beed86ae1adf9ab7132aeae8fd3b0893ea995" end resource "lld" do url "http://llvm.org/releases/3.5.0/lld-3.5.0.src.tar.xz" sha1 "13c88e1442b482b3ffaff5934f0a2b51cab067e5" end end bottle do sha1 "55d7d41aa61b9978149bf8a81836743a83d42372" => :yosemite sha1 "2ce36f9babaaeac765ce29b0070b53e2bd5c4a14" => :mavericks sha1 "272c0ecfc51ddb5251731c867a039601c415bea2" => :mountain_lion end head do url "http://llvm.org/git/llvm.git" resource "clang" do url "http://llvm.org/git/clang.git" end resource "libcxx" do url "http://llvm.org/git/libcxx.git" end resource "lld" do url "http://llvm.org/git/lld.git" end end # Use absolute paths for shared library IDs patch :DATA option :universal option 'with-clang', 'Build Clang support library' option 'with-lld', 'Build LLD linker' option 'disable-shared', "Don't build LLVM as a shared library" option 'all-targets', 'Build all target backends' option 'rtti', 'Build with C++ RTTI' option 'disable-assertions', 'Speeds up LLVM, but provides less debug information' depends_on :python => :optional keg_only :provided_by_osx # Apple's libstdc++ is too old to build LLVM fails_with :gcc fails_with :llvm def install # Apple's libstdc++ is too old to build LLVM ENV.libcxx if ENV.compiler == :clang if build.with? "python" and build.include? 'disable-shared' raise 'The Python bindings need the shared library.' end if build.with? "clang" (buildpath/"projects/libcxx").install resource("libcxx") (buildpath/"tools/clang").install resource("clang") end (buildpath/"tools/lld").install resource("lld") if build.with? "lld" if build.universal? ENV.permit_arch_flags ENV['UNIVERSAL'] = '1' ENV['UNIVERSAL_ARCH'] = Hardware::CPU.universal_archs.join(' ') end ENV["REQUIRES_RTTI"] = "1" if build.include? "rtti" or build.with? "clang" args = [ "--prefix=#{prefix}", "--enable-optimized", # As of LLVM 3.1, attempting to build ocaml bindings with Homebrew's # OCaml 3.12.1 results in errors. "--disable-bindings", ] if build.include? 'all-targets' args << "--enable-targets=all" else args << "--enable-targets=host" end args << "--enable-shared" unless build.include? 'disable-shared' args << "--disable-assertions" if build.include? 'disable-assertions' system "./configure", *args system "make" system "make", "install" if build.with? "clang" system "make", "-C", "projects/libcxx", "install", "DSTROOT=#{prefix}", "SYMROOT=#{buildpath}/projects/libcxx" (share/"clang/tools").install Dir["tools/clang/tools/scan-{build,view}"] inreplace "#{share}/clang/tools/scan-build/scan-build", "$RealBin/bin/clang", "#{bin}/clang" bin.install_symlink share/"clang/tools/scan-build/scan-build", share/"clang/tools/scan-view/scan-view" man1.install_symlink share/"clang/tools/scan-build/scan-build.1" end # install llvm python bindings if build.with? "python" (lib+'python2.7/site-packages').install buildpath/'bindings/python/llvm' (lib+'python2.7/site-packages').install buildpath/'tools/clang/bindings/python/clang' if build.with? 'clang' end end test do system "#{bin}/llvm-config", "--version" end def caveats <<-EOS.undent LLVM executables are installed in #{opt_bin}. Extra tools are installed in #{opt_share}/llvm. EOS end end __END__ diff --git a/Makefile.rules b/Makefile.rules index ebebc0a..b0bb378 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -599,7 +599,12 @@ ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) ifneq ($(HOST_OS),Darwin) LD.Flags += $(RPATH) -Wl,'$$ORIGIN' else - LD.Flags += -Wl,-install_name -Wl,"@rpath/lib$(LIBRARYNAME)$(SHLIBEXT)" + LD.Flags += -Wl,-install_name + ifdef LOADABLE_MODULE + LD.Flags += -Wl,"$(PROJ_libdir)/$(LIBRARYNAME)$(SHLIBEXT)" + else + LD.Flags += -Wl,"$(PROJ_libdir)/$(SharedPrefix)$(LIBRARYNAME)$(SHLIBEXT)" + endif endif endif endif llvm: install clang-tools-extra Closes Homebrew/homebrew#35192. class Llvm < Formula homepage 'http://llvm.org/' revision 1 stable do url "http://llvm.org/releases/3.5.0/llvm-3.5.0.src.tar.xz" sha1 "58d817ac2ff573386941e7735d30702fe71267d5" resource "clang" do url "http://llvm.org/releases/3.5.0/cfe-3.5.0.src.tar.xz" sha1 "834cee2ed8dc6638a486d8d886b6dce3db675ffa" end resource "libcxx" do url "http://llvm.org/releases/3.5.0/libcxx-3.5.0.src.tar.xz" sha1 "c98beed86ae1adf9ab7132aeae8fd3b0893ea995" end resource "lld" do url "http://llvm.org/releases/3.5.0/lld-3.5.0.src.tar.xz" sha1 "13c88e1442b482b3ffaff5934f0a2b51cab067e5" end resource "clang-tools-extra" do url "http://llvm.org/releases/3.5.0/clang-tools-extra-3.5.0.src.tar.xz" sha1 "74a84493e3313c180490a4affbb92d61ee4f0d21" end end bottle do sha1 "55d7d41aa61b9978149bf8a81836743a83d42372" => :yosemite sha1 "2ce36f9babaaeac765ce29b0070b53e2bd5c4a14" => :mavericks sha1 "272c0ecfc51ddb5251731c867a039601c415bea2" => :mountain_lion end head do url "http://llvm.org/git/llvm.git" resource "clang" do url "http://llvm.org/git/clang.git" end resource "libcxx" do url "http://llvm.org/git/libcxx.git" end resource "lld" do url "http://llvm.org/git/lld.git" end resource "clang-tools-extra" do url "http://llvm.org/git/clang-tools-extra.git" end end # Use absolute paths for shared library IDs patch :DATA option :universal option 'with-clang', 'Build Clang support library' option 'with-lld', 'Build LLD linker' option 'disable-shared', "Don't build LLVM as a shared library" option 'all-targets', 'Build all target backends' option 'rtti', 'Build with C++ RTTI' option 'disable-assertions', 'Speeds up LLVM, but provides less debug information' depends_on :python => :optional keg_only :provided_by_osx # Apple's libstdc++ is too old to build LLVM fails_with :gcc fails_with :llvm def install # Apple's libstdc++ is too old to build LLVM ENV.libcxx if ENV.compiler == :clang if build.with? "python" and build.include? 'disable-shared' raise 'The Python bindings need the shared library.' end if build.with? "clang" (buildpath/"projects/libcxx").install resource("libcxx") (buildpath/"tools/clang").install resource("clang") (buildpath/"tools/clang/tools/extra").install resource("clang-tools-extra") end (buildpath/"tools/lld").install resource("lld") if build.with? "lld" if build.universal? ENV.permit_arch_flags ENV['UNIVERSAL'] = '1' ENV['UNIVERSAL_ARCH'] = Hardware::CPU.universal_archs.join(' ') end ENV["REQUIRES_RTTI"] = "1" if build.include? "rtti" or build.with? "clang" args = [ "--prefix=#{prefix}", "--enable-optimized", # As of LLVM 3.1, attempting to build ocaml bindings with Homebrew's # OCaml 3.12.1 results in errors. "--disable-bindings", ] if build.include? 'all-targets' args << "--enable-targets=all" else args << "--enable-targets=host" end args << "--enable-shared" unless build.include? 'disable-shared' args << "--disable-assertions" if build.include? 'disable-assertions' system "./configure", *args system "make" system "make", "install" if build.with? "clang" system "make", "-C", "projects/libcxx", "install", "DSTROOT=#{prefix}", "SYMROOT=#{buildpath}/projects/libcxx" (share/"clang/tools").install Dir["tools/clang/tools/scan-{build,view}"] inreplace "#{share}/clang/tools/scan-build/scan-build", "$RealBin/bin/clang", "#{bin}/clang" bin.install_symlink share/"clang/tools/scan-build/scan-build", share/"clang/tools/scan-view/scan-view" man1.install_symlink share/"clang/tools/scan-build/scan-build.1" end # install llvm python bindings if build.with? "python" (lib+'python2.7/site-packages').install buildpath/'bindings/python/llvm' (lib+'python2.7/site-packages').install buildpath/'tools/clang/bindings/python/clang' if build.with? 'clang' end end test do system "#{bin}/llvm-config", "--version" end def caveats <<-EOS.undent LLVM executables are installed in #{opt_bin}. Extra tools are installed in #{opt_share}/llvm. EOS end end __END__ diff --git a/Makefile.rules b/Makefile.rules index ebebc0a..b0bb378 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -599,7 +599,12 @@ ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) ifneq ($(HOST_OS),Darwin) LD.Flags += $(RPATH) -Wl,'$$ORIGIN' else - LD.Flags += -Wl,-install_name -Wl,"@rpath/lib$(LIBRARYNAME)$(SHLIBEXT)" + LD.Flags += -Wl,-install_name + ifdef LOADABLE_MODULE + LD.Flags += -Wl,"$(PROJ_libdir)/$(LIBRARYNAME)$(SHLIBEXT)" + else + LD.Flags += -Wl,"$(PROJ_libdir)/$(SharedPrefix)$(LIBRARYNAME)$(SHLIBEXT)" + endif endif endif endif
class Lzop < Formula desc "File compressor" homepage "https://www.lzop.org/" url "https://www.lzop.org/download/lzop-1.04.tar.gz" sha256 "7e72b62a8a60aff5200a047eea0773a8fb205caf7acbe1774d95147f305a2f41" license "GPL-2.0" livecheck do url "https://www.lzop.org/download/" regex(/href=.*?lzop[._-]v?(\d+(?:\.\d+)+)\.t/i) end bottle do sha256 cellar: :any, arm64_monterey: "32f4ffb33fda5a32802c7a37dcf41eef9b74185e726c6332912dc7d0d524381a" sha256 cellar: :any, arm64_big_sur: "32390eb8141791296e84ed7c6a39edb5bb2ded9b04581c301d32a6dfa322db4d" sha256 cellar: :any, monterey: "5a74762d3592fc992174fff54cb221db8a4c104f185ac3eff12deda7e97563be" sha256 cellar: :any, big_sur: "f04a876a2b69220632fb027546104d9c6cb9ee8bdb1d9f6a2845a054500d8bb7" sha256 cellar: :any, catalina: "3aa57a50254d383c0fe0e4d0d0585e1525d50d0cd30f87390d087523348044a0" sha256 cellar: :any, mojave: "0ec93aa163500d45c456bce3ee100dbe61c4db080494ee41383286ca10f4d246" sha256 cellar: :any, high_sierra: "d42fafd3f1f39d9ab512f755bd216edd24002caf8a4da82f80818fe2c29f0556" sha256 cellar: :any, sierra: "73c2ce334be9317ca79509aec3acef2fa1eff0ffb69fdc10b3850b7f51101f72" sha256 cellar: :any, el_capitan: "26e49bf0d06fb60d7cd5c431634966f28993edc250c4d06b0db26b28aae3cd0d" sha256 cellar: :any, yosemite: "d9e12c4bb51c43dd306d5283fde5c3350e3e1f7f1d48c05c831a57b058db1354" sha256 cellar: :any_skip_relocation, x86_64_linux: "15ba7328bdcb1e9789b03851966efb4cd6ccc3feb35cfbc37a364be6fc4c77e7" end depends_on "lzo" def install system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}" system "make", "install" end test do path = testpath/"test" text = "This is Homebrew" path.write text system "#{bin}/lzop", "test" assert_predicate testpath/"test.lzo", :exist? rm path system "#{bin}/lzop", "-d", "test.lzo" assert_equal text, path.read end end lzop: remove Yosemite bottle Yosemite support was removed in Homebrew 3.5.0. class Lzop < Formula desc "File compressor" homepage "https://www.lzop.org/" url "https://www.lzop.org/download/lzop-1.04.tar.gz" sha256 "7e72b62a8a60aff5200a047eea0773a8fb205caf7acbe1774d95147f305a2f41" license "GPL-2.0" livecheck do url "https://www.lzop.org/download/" regex(/href=.*?lzop[._-]v?(\d+(?:\.\d+)+)\.t/i) end bottle do sha256 cellar: :any, arm64_monterey: "32f4ffb33fda5a32802c7a37dcf41eef9b74185e726c6332912dc7d0d524381a" sha256 cellar: :any, arm64_big_sur: "32390eb8141791296e84ed7c6a39edb5bb2ded9b04581c301d32a6dfa322db4d" sha256 cellar: :any, monterey: "5a74762d3592fc992174fff54cb221db8a4c104f185ac3eff12deda7e97563be" sha256 cellar: :any, big_sur: "f04a876a2b69220632fb027546104d9c6cb9ee8bdb1d9f6a2845a054500d8bb7" sha256 cellar: :any, catalina: "3aa57a50254d383c0fe0e4d0d0585e1525d50d0cd30f87390d087523348044a0" sha256 cellar: :any, mojave: "0ec93aa163500d45c456bce3ee100dbe61c4db080494ee41383286ca10f4d246" sha256 cellar: :any, high_sierra: "d42fafd3f1f39d9ab512f755bd216edd24002caf8a4da82f80818fe2c29f0556" sha256 cellar: :any, sierra: "73c2ce334be9317ca79509aec3acef2fa1eff0ffb69fdc10b3850b7f51101f72" sha256 cellar: :any, el_capitan: "26e49bf0d06fb60d7cd5c431634966f28993edc250c4d06b0db26b28aae3cd0d" sha256 cellar: :any_skip_relocation, x86_64_linux: "15ba7328bdcb1e9789b03851966efb4cd6ccc3feb35cfbc37a364be6fc4c77e7" end depends_on "lzo" def install system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}" system "make", "install" end test do path = testpath/"test" text = "This is Homebrew" path.write text system "#{bin}/lzop", "test" assert_predicate testpath/"test.lzo", :exist? rm path system "#{bin}/lzop", "-d", "test.lzo" assert_equal text, path.read end end
class Make < Formula desc "Utility for directing compilation" homepage "https://www.gnu.org/software/make/" url "https://ftp.gnu.org/gnu/make/make-4.3.tar.lz" mirror "https://ftpmirror.gnu.org/make/make-4.3.tar.lz" sha256 "de1a441c4edf952521db30bfca80baae86a0ff1acd0a00402999344f04c45e82" license "GPL-3.0-only" bottle do rebuild 1 sha256 arm64_ventura: "0d6dcfb8e0df7c3c0ff82dbbc56ae7a9b764dd8c046d38902b177437a39e5e28" sha256 arm64_monterey: "1ba1c273aa4b9c0a2c927c8bdb8a48146ebd8a14dfc8ab6608fdc5cc792eaba1" sha256 arm64_big_sur: "eab3fbc3688aecec0fe90b8d0fe3cb7beb84ed773ba0411fc2f855c66deaf882" sha256 monterey: "4349e2c715f78210c29b4c35112e8343402dad5c1e44fe8d6272d9aace6bbdf7" sha256 big_sur: "2019ba646e4471d42e09c28a0992c59dd82e292bf8275b0b3bfcce3220ef9c1b" sha256 catalina: "39fc5ebff5ff708c2e3eea597b9f2eb79b910a122d30c3ac9bb93ebe313f030c" sha256 mojave: "0c0a08eef68bcd78b0345f5f57a6efffcc7be877bcb3b803f39ac8916b882477" sha256 high_sierra: "429177235322c3209e1657bea36364cd84222075b636939f6ed93a1cd04aeb21" sha256 x86_64_linux: "dd17cdf0a93ef30324250694ea5baec67c037e1d71c1cab8fe6432d66758fd62" end conflicts_with "remake", because: "both install texinfo files for make" def install args = %W[ --disable-dependency-tracking --prefix=#{prefix} ] args << "--program-prefix=g" if OS.mac? system "./configure", *args system "make", "install" if OS.mac? (libexec/"gnubin").install_symlink bin/"gmake" =>"make" (libexec/"gnuman/man1").install_symlink man1/"gmake.1" => "make.1" end libexec.install_symlink "gnuman" => "man" end def caveats on_macos do <<~EOS GNU "make" has been installed as "gmake". If you need to use it as "make", you can add a "gnubin" directory to your PATH from your bashrc like: PATH="#{opt_libexec}/gnubin:$PATH" EOS end end test do (testpath/"Makefile").write <<~EOS default: \t@echo Homebrew EOS if OS.mac? assert_equal "Homebrew\n", shell_output("#{bin}/gmake") assert_equal "Homebrew\n", shell_output("#{opt_libexec}/gnubin/make") else assert_equal "Homebrew\n", shell_output("#{bin}/make") end end end make 4.4 Closes #114327. Signed-off-by: Sean Molenaar <2b250e3fea88cfef248b497ad5fc17f7dc435154@users.noreply.github.com> Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com> class Make < Formula desc "Utility for directing compilation" homepage "https://www.gnu.org/software/make/" url "https://ftp.gnu.org/gnu/make/make-4.4.tar.lz" mirror "https://ftpmirror.gnu.org/make/make-4.4.tar.lz" sha256 "48d0fc0b2a04bb50f2911c16da65723285f7f4804c74fc5a2124a3df6c5f78c4" license "GPL-3.0-only" bottle do rebuild 1 sha256 arm64_ventura: "0d6dcfb8e0df7c3c0ff82dbbc56ae7a9b764dd8c046d38902b177437a39e5e28" sha256 arm64_monterey: "1ba1c273aa4b9c0a2c927c8bdb8a48146ebd8a14dfc8ab6608fdc5cc792eaba1" sha256 arm64_big_sur: "eab3fbc3688aecec0fe90b8d0fe3cb7beb84ed773ba0411fc2f855c66deaf882" sha256 monterey: "4349e2c715f78210c29b4c35112e8343402dad5c1e44fe8d6272d9aace6bbdf7" sha256 big_sur: "2019ba646e4471d42e09c28a0992c59dd82e292bf8275b0b3bfcce3220ef9c1b" sha256 catalina: "39fc5ebff5ff708c2e3eea597b9f2eb79b910a122d30c3ac9bb93ebe313f030c" sha256 mojave: "0c0a08eef68bcd78b0345f5f57a6efffcc7be877bcb3b803f39ac8916b882477" sha256 high_sierra: "429177235322c3209e1657bea36364cd84222075b636939f6ed93a1cd04aeb21" sha256 x86_64_linux: "dd17cdf0a93ef30324250694ea5baec67c037e1d71c1cab8fe6432d66758fd62" end conflicts_with "remake", because: "both install texinfo files for make" def install args = %W[ --disable-dependency-tracking --prefix=#{prefix} ] args << "--program-prefix=g" if OS.mac? system "./configure", *args system "make", "install" if OS.mac? (libexec/"gnubin").install_symlink bin/"gmake" =>"make" (libexec/"gnuman/man1").install_symlink man1/"gmake.1" => "make.1" end libexec.install_symlink "gnuman" => "man" end def caveats on_macos do <<~EOS GNU "make" has been installed as "gmake". If you need to use it as "make", you can add a "gnubin" directory to your PATH from your bashrc like: PATH="#{opt_libexec}/gnubin:$PATH" EOS end end test do (testpath/"Makefile").write <<~EOS default: \t@echo Homebrew EOS if OS.mac? assert_equal "Homebrew\n", shell_output("#{bin}/gmake") assert_equal "Homebrew\n", shell_output("#{opt_libexec}/gnubin/make") else assert_equal "Homebrew\n", shell_output("#{bin}/make") end end end
class Mcap < Formula desc "Serialization-agnostic container file format for pub/sub messages" homepage "https://mcap.dev" url "https://github.com/foxglove/mcap/archive/releases/mcap-cli/v0.0.19.tar.gz" sha256 "ce0aa5febb036db24f5cab5f4cf7daf3ddba77bce8f7b4a3afcd646ed154c608" license "Apache-2.0" head "https://github.com/foxglove/mcap.git", branch: "main" livecheck do url :stable regex(%r{^releases/mcap-cli/v?(\d+(?:\.\d+)+)$}i) end bottle do sha256 cellar: :any_skip_relocation, arm64_monterey: "c7a2a913a2210a98c2612853d819c9067f31aae16e47376913643d3960129f1f" sha256 cellar: :any_skip_relocation, arm64_big_sur: "1ccdac52d70736a41af955d39841c44a40b23178d6f4b165c9901c9dd3d089f5" sha256 cellar: :any_skip_relocation, monterey: "ebac07b54f4ce2c59dab68c124d06a462007d12c342e287a4dfc896f864e666a" sha256 cellar: :any_skip_relocation, big_sur: "2a07cd2da0f621eb24d16d164e37f59a9fdc5a0a206040d500b79a5f7ac5c738" sha256 cellar: :any_skip_relocation, catalina: "7198194bfad45958dcac035fcb4bd2ca362abd366c49e9fe8a1b46509fac282b" sha256 cellar: :any_skip_relocation, x86_64_linux: "ecd2eb2ae940fffeb67605ba6f3b34e07e7a3d6c5d167ac977a3dfa2aeb959f1" end depends_on "go" => :build resource "homebrew-testdata" do url "https://media.githubusercontent.com/media/foxglove/mcap/releases/mcap-cli/v0.0.10/tests/conformance/data/OneMessage/OneMessage-ch-chx-mx-pad-rch-rsh-st-sum.mcap" sha256 "9db644f7fad2a256b891946a011fb23127b95d67dc03551b78224aa6cad8c5db" end def install cd "go/cli/mcap" do system "make", "build", "VERSION=v#{version}" bin.install "bin/mcap" end end test do assert_equal "v#{version}", pipe_output("#{bin}/mcap version").strip resource("homebrew-testdata").stage do assert_equal "2 example [Example] [1 2 3]", pipe_output("#{bin}/mcap cat", File.read("OneMessage-ch-chx-mx-pad-rch-rsh-st-sum.mcap")).strip expected_info = <<~EOF library: profile: messages: 1 duration: 0s start: 0.000 end: 0.000 compression: : [1/1 chunks] (0.00%) channels: (1) example 1 msgs (+Inf Hz) : Example [c] attachments: 0 EOF assert_equal expected_info.lines.map(&:strip), shell_output("#{bin}/mcap info OneMessage-ch-chx-mx-pad-rch-rsh-st-sum.mcap").lines.map(&:strip) end end end mcap 0.0.20 * mcap 0.0.20 Created by https://github.com/mislav/bump-homebrew-formula-action * fix license, fix tests, add completions * fix audit Closes #111855. Co-authored-by: Jacob Bandes-Storch <f862f167b85d41b225785c70d70808bc7337c1fe@foxglove.dev> Signed-off-by: Carlo Cabrera <3ffc397d0e4bded29cb84b56167de54c01e3a55b@users.noreply.github.com> Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com> class Mcap < Formula desc "Serialization-agnostic container file format for pub/sub messages" homepage "https://mcap.dev" url "https://github.com/foxglove/mcap/archive/releases/mcap-cli/v0.0.20.tar.gz" sha256 "82066fd241eeb034b108213ebe540064fdb2b493e07afc86e24f244006a95acc" license "MIT" head "https://github.com/foxglove/mcap.git", branch: "main" livecheck do url :stable regex(%r{^releases/mcap-cli/v?(\d+(?:\.\d+)+)$}i) end bottle do sha256 cellar: :any_skip_relocation, arm64_monterey: "c7a2a913a2210a98c2612853d819c9067f31aae16e47376913643d3960129f1f" sha256 cellar: :any_skip_relocation, arm64_big_sur: "1ccdac52d70736a41af955d39841c44a40b23178d6f4b165c9901c9dd3d089f5" sha256 cellar: :any_skip_relocation, monterey: "ebac07b54f4ce2c59dab68c124d06a462007d12c342e287a4dfc896f864e666a" sha256 cellar: :any_skip_relocation, big_sur: "2a07cd2da0f621eb24d16d164e37f59a9fdc5a0a206040d500b79a5f7ac5c738" sha256 cellar: :any_skip_relocation, catalina: "7198194bfad45958dcac035fcb4bd2ca362abd366c49e9fe8a1b46509fac282b" sha256 cellar: :any_skip_relocation, x86_64_linux: "ecd2eb2ae940fffeb67605ba6f3b34e07e7a3d6c5d167ac977a3dfa2aeb959f1" end depends_on "go" => :build resource "homebrew-testdata-OneMessage" do url "https://github.com/foxglove/mcap/raw/releases/mcap-cli/v0.0.20/tests/conformance/data/OneMessage/OneMessage-ch-chx-mx-pad-rch-rsh-st-sum.mcap" sha256 "16e841dbae8aae5cc6824a63379c838dca2e81598ae08461bdcc4e7334e11da4" end resource "homebrew-testdata-OneAttachment" do url "https://github.com/foxglove/mcap/raw/releases/mcap-cli/v0.0.20/tests/conformance/data/OneAttachment/OneAttachment-ax-pad-st-sum.mcap" sha256 "f9dde0a5c9f7847e145be73ea874f9cdf048119b4f716f5847513ee2f4d70643" end resource "homebrew-testdata-OneMetadata" do url "https://github.com/foxglove/mcap/raw/releases/mcap-cli/v0.0.20/tests/conformance/data/OneMetadata/OneMetadata-mdx-pad-st-sum.mcap" sha256 "cb779e0296d288ad2290d3c1911a77266a87c0bdfee957049563169f15d6ba8e" end def install cd "go/cli/mcap" do system "make", "build", "VERSION=v#{version}" bin.install "bin/mcap" end generate_completions_from_executable(bin/"mcap", "completion", shells: [:bash, :zsh, :fish]) end test do assert_equal "v#{version}", shell_output("#{bin}/mcap version").strip resource("homebrew-testdata-OneMessage").stage do assert_equal "2 example [Example] [1 2 3]", shell_output("#{bin}/mcap cat OneMessage-ch-chx-mx-pad-rch-rsh-st-sum.mcap").strip end resource("homebrew-testdata-OneAttachment").stage do assert_equal "\x01\x02\x03", shell_output("#{bin}/mcap get attachment OneAttachment-ax-pad-st-sum.mcap --name myFile") end resource("homebrew-testdata-OneMetadata").stage do assert_equal({ "foo" => "bar" }, JSON.parse(shell_output("#{bin}/mcap get metadata OneMetadata-mdx-pad-st-sum.mcap --name myMetadata"))) end end end
class Mdds < Formula desc "Multi-dimensional data structure and indexing algorithm" homepage "https://gitlab.com/mdds/mdds" url "https://kohei.us/files/mdds/src/mdds-1.7.0.tar.bz2" sha256 "a66a2a8293a3abc6cd9baff7c236156e2666935cbfb69a15d64d38141638fecf" license "MIT" livecheck do url :head end bottle do cellar :any_skip_relocation sha256 "a5e6a996bf112bca0d5c7e628fd15128977b9075938155a4185aaf5613d136bc" => :catalina sha256 "5146b50529f63030c978dbdab3755ce7a7383d7c8049e03ae1186fa231f867c9" => :mojave sha256 "67f497efa10f695da64e4769d3ef5de6fb0e9d3d0d62026c2105b7c5148b91a9" => :high_sierra end head do url "https://gitlab.com/mdds/mdds.git" depends_on "automake" => :build end depends_on "autoconf" => :build depends_on "boost" def install args = %W[ --prefix=#{prefix} --disable-openmp ] # Gets it to work when the CLT is installed inreplace "configure.ac", "$CPPFLAGS -I/usr/include -I/usr/local/include", "$CPPFLAGS -I/usr/local/include" if build.head? system "./autogen.sh", *args else system "autoconf" system "./configure", *args end system "make", "install" end test do (testpath/"test.cpp").write <<~EOS #include <mdds/flat_segment_tree.hpp> int main() { mdds::flat_segment_tree<unsigned, unsigned> fst(0, 4, 8); } EOS system ENV.cxx, "test.cpp", "-o", "test", "-std=c++11", "-I#{include.children.first}" system "./test" end end mdds: update 1.7.0 bottle. class Mdds < Formula desc "Multi-dimensional data structure and indexing algorithm" homepage "https://gitlab.com/mdds/mdds" url "https://kohei.us/files/mdds/src/mdds-1.7.0.tar.bz2" sha256 "a66a2a8293a3abc6cd9baff7c236156e2666935cbfb69a15d64d38141638fecf" license "MIT" livecheck do url :head end bottle do cellar :any_skip_relocation sha256 "a5e6a996bf112bca0d5c7e628fd15128977b9075938155a4185aaf5613d136bc" => :catalina sha256 "5146b50529f63030c978dbdab3755ce7a7383d7c8049e03ae1186fa231f867c9" => :mojave sha256 "67f497efa10f695da64e4769d3ef5de6fb0e9d3d0d62026c2105b7c5148b91a9" => :high_sierra sha256 "74a98b3e6799ed29beb6cc2ef8d68c49631f9bc23c22de1f1d25958f3746d7a3" => :x86_64_linux end head do url "https://gitlab.com/mdds/mdds.git" depends_on "automake" => :build end depends_on "autoconf" => :build depends_on "boost" def install args = %W[ --prefix=#{prefix} --disable-openmp ] # Gets it to work when the CLT is installed inreplace "configure.ac", "$CPPFLAGS -I/usr/include -I/usr/local/include", "$CPPFLAGS -I/usr/local/include" if build.head? system "./autogen.sh", *args else system "autoconf" system "./configure", *args end system "make", "install" end test do (testpath/"test.cpp").write <<~EOS #include <mdds/flat_segment_tree.hpp> int main() { mdds::flat_segment_tree<unsigned, unsigned> fst(0, 4, 8); } EOS system ENV.cxx, "test.cpp", "-o", "test", "-std=c++11", "-I#{include.children.first}" system "./test" end end
class Mesa < Formula include Language::Python::Virtualenv desc "Graphics Library" homepage "https://www.mesa3d.org/" url "https://mesa.freedesktop.org/archive/mesa-18.3.4.tar.xz" sha256 "32314da4365d37f80d84f599bd9625b00161c273c39600ba63b45002d500bb07" head "https://gitlab.freedesktop.org/mesa/mesa.git" bottle do sha256 "5c7193422a481be349e23c7209dff8076db66af5bcfa4a90ed3c52074a4bafa9" => :mojave sha256 "eac4afd7cad4210ab05edae9b8ed61e6bbb6408ea90aa8ce685046c101062be3" => :high_sierra sha256 "debcf39e35a7bc2ebd3cf32711fe541c6f3998421593453e29aead7748274c7a" => :sierra end depends_on "meson-internal" => :build depends_on "ninja" => :build depends_on "pkg-config" => :build depends_on "python@2" => :build depends_on "freeglut" => :test depends_on "expat" depends_on "gettext" depends_on :x11 resource "Mako" do url "https://files.pythonhosted.org/packages/eb/f3/67579bb486517c0d49547f9697e36582cd19dafb5df9e687ed8e22de57fa/Mako-1.0.7.tar.gz" sha256 "4e02fde57bd4abb5ec400181e4c314f56ac3e49ba4fb8b0d50bba18cb27d25ae" end resource "gears.c" do url "https://www.opengl.org/archives/resources/code/samples/glut_examples/mesademos/gears.c" sha256 "7df9d8cda1af9d0a1f64cc028df7556705d98471fdf3d0830282d4dcfb7a78cc" end def install ENV.prepend_create_path "PYTHONPATH", buildpath/"vendor/lib/python2.7/site-packages" resource("Mako").stage do system "python", *Language::Python.setup_install_args(buildpath/"vendor") end resource("gears.c").stage(pkgshare.to_s) mkdir "build" do system "meson", "--prefix=#{prefix}", "-D buildtype=plain", "-D b_ndebug=true", ".." system "ninja" system "ninja", "install" end end test do system ENV.cc, "#{pkgshare}/gears.c", "-o", "gears", "-L#{lib}", "-I#{Formula["freeglut"].opt_include}", "-L#{Formula["freeglut"].opt_lib}", "-lgl", "-lglut" end end mesa 19.0.0 Closes #37886. Signed-off-by: Chongyu Zhu <042dc4512fa3d391c5170cf3aa61e6a638f84342@lembacon.com> class Mesa < Formula include Language::Python::Virtualenv desc "Graphics Library" homepage "https://www.mesa3d.org/" url "https://mesa.freedesktop.org/archive/mesa-19.0.0.tar.xz" sha256 "5a549dfb40ec31e5c36c47aadac04554cb2e2a8d144a046a378fc16da57e38f8" head "https://gitlab.freedesktop.org/mesa/mesa.git" bottle do sha256 "5c7193422a481be349e23c7209dff8076db66af5bcfa4a90ed3c52074a4bafa9" => :mojave sha256 "eac4afd7cad4210ab05edae9b8ed61e6bbb6408ea90aa8ce685046c101062be3" => :high_sierra sha256 "debcf39e35a7bc2ebd3cf32711fe541c6f3998421593453e29aead7748274c7a" => :sierra end depends_on "meson-internal" => :build depends_on "ninja" => :build depends_on "pkg-config" => :build depends_on "python@2" => :build depends_on "freeglut" => :test depends_on "expat" depends_on "gettext" depends_on :x11 resource "Mako" do url "https://files.pythonhosted.org/packages/eb/f3/67579bb486517c0d49547f9697e36582cd19dafb5df9e687ed8e22de57fa/Mako-1.0.7.tar.gz" sha256 "4e02fde57bd4abb5ec400181e4c314f56ac3e49ba4fb8b0d50bba18cb27d25ae" end resource "gears.c" do url "https://www.opengl.org/archives/resources/code/samples/glut_examples/mesademos/gears.c" sha256 "7df9d8cda1af9d0a1f64cc028df7556705d98471fdf3d0830282d4dcfb7a78cc" end def install ENV.prepend_create_path "PYTHONPATH", buildpath/"vendor/lib/python2.7/site-packages" resource("Mako").stage do system "python", *Language::Python.setup_install_args(buildpath/"vendor") end resource("gears.c").stage(pkgshare.to_s) mkdir "build" do system "meson", "--prefix=#{prefix}", "-D buildtype=plain", "-D b_ndebug=true", ".." system "ninja" system "ninja", "install" end end test do system ENV.cc, "#{pkgshare}/gears.c", "-o", "gears", "-L#{lib}", "-I#{Formula["freeglut"].opt_include}", "-L#{Formula["freeglut"].opt_lib}", "-lgl", "-lglut" end end
class Mfoc < Formula desc "Implementation of 'offline nested' attack by Nethemba" homepage "https://github.com/nfc-tools/mfoc" url "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/mfoc/mfoc-0.10.7.tar.bz2" sha256 "93d8ac4cb0aa6ed94855ca9732a2ffd898a9095c087f12f9402205443c2eb98c" bottle do cellar :any sha256 "5a4fe631caec6c2070b408158048c9d5976da9aa0fc8f1e60bd43dc64616db39" => :mojave sha256 "854390fb4717577ae0cfa33cffc50c0d5d568f23b28401aee6c81661b12dede4" => :high_sierra sha256 "be07709faf874fb9b9457950201a71b5f683f7971f2a3a7d61de630f78a2e69c" => :sierra sha256 "d895fdd47221e48e45f6858a1dc1c39c79ae743419b93ec4dfce84baa80af0a9" => :el_capitan sha256 "931fb4f22e9b02e40b4f1f28210df4a994a12efbd746bd7644d99a02837dbfda" => :yosemite sha256 "ecbf3f20c620ad022ab253ed68bc0005ee05c1fcc9eb178d6cc33bdf34f4515a" => :mavericks end depends_on "pkg-config" => :build depends_on "libnfc" depends_on "libusb" def install system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}" system "make" system "make", "install" end test do system bin/"mfoc", "-h" end end mfoc: update 0.10.7 bottle. class Mfoc < Formula desc "Implementation of 'offline nested' attack by Nethemba" homepage "https://github.com/nfc-tools/mfoc" url "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/mfoc/mfoc-0.10.7.tar.bz2" sha256 "93d8ac4cb0aa6ed94855ca9732a2ffd898a9095c087f12f9402205443c2eb98c" bottle do cellar :any sha256 "ae0c48b0627ab98e77eb92b35be2fc049cb7fdf39da9cec82c03342c09d8d852" => :catalina sha256 "5a4fe631caec6c2070b408158048c9d5976da9aa0fc8f1e60bd43dc64616db39" => :mojave sha256 "854390fb4717577ae0cfa33cffc50c0d5d568f23b28401aee6c81661b12dede4" => :high_sierra sha256 "be07709faf874fb9b9457950201a71b5f683f7971f2a3a7d61de630f78a2e69c" => :sierra sha256 "d895fdd47221e48e45f6858a1dc1c39c79ae743419b93ec4dfce84baa80af0a9" => :el_capitan sha256 "931fb4f22e9b02e40b4f1f28210df4a994a12efbd746bd7644d99a02837dbfda" => :yosemite sha256 "ecbf3f20c620ad022ab253ed68bc0005ee05c1fcc9eb178d6cc33bdf34f4515a" => :mavericks end depends_on "pkg-config" => :build depends_on "libnfc" depends_on "libusb" def install system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}" system "make" system "make", "install" end test do system bin/"mfoc", "-h" end end
class Mmix < Formula desc "64-bit RISC architecture designed by Donald Knuth" homepage "http://mmix.cs.hm.edu/" url "http://mmix.cs.hm.edu/src/mmix-20160804.tgz" sha256 "fad8e64fddf2d75cbcd5080616b47e11a2d292a428cdb0c12e579be680ecdee9" bottle do cellar :any_skip_relocation sha256 "b694920e61edf2dec094618910be78fcd4fbbcad22d4d37363555aad38ee0af0" => :sierra sha256 "c1e8e0d2d627b3ab2c2c68a8b358981dab07466c3c70f3a2e4df8557006deb92" => :el_capitan sha256 "7675c2bc1253e4da2a126d52942449f71cabdd83c39874403d449b5a05ceb145" => :yosemite end depends_on "cweb" => :build def install ENV.deparallelize system "make", "all" bin.install "mmix", "mmixal", "mmmix", "mmotype" end test do (testpath/"hello.mms").write <<-EOS.undent LOC Data_Segment GREG @ txt BYTE "Hello world!",0 LOC #100 Main LDA $255,txt TRAP 0,Fputs,StdOut TRAP 0,Fputs,StdErr TRAP 0,Halt,0 EOS system bin/"mmixal", "hello.mms" assert_equal "Hello world!", shell_output("#{bin}/mmix hello.mmo") end end mmix: update 20160804 bottle. class Mmix < Formula desc "64-bit RISC architecture designed by Donald Knuth" homepage "http://mmix.cs.hm.edu/" url "http://mmix.cs.hm.edu/src/mmix-20160804.tgz" sha256 "fad8e64fddf2d75cbcd5080616b47e11a2d292a428cdb0c12e579be680ecdee9" bottle do cellar :any_skip_relocation sha256 "7bc054e2d244fe693b4ed5ef47c56e23ac4952b15ddc5de55d19150d4dc2bf30" => :high_sierra sha256 "b694920e61edf2dec094618910be78fcd4fbbcad22d4d37363555aad38ee0af0" => :sierra sha256 "c1e8e0d2d627b3ab2c2c68a8b358981dab07466c3c70f3a2e4df8557006deb92" => :el_capitan sha256 "7675c2bc1253e4da2a126d52942449f71cabdd83c39874403d449b5a05ceb145" => :yosemite end depends_on "cweb" => :build def install ENV.deparallelize system "make", "all" bin.install "mmix", "mmixal", "mmmix", "mmotype" end test do (testpath/"hello.mms").write <<-EOS.undent LOC Data_Segment GREG @ txt BYTE "Hello world!",0 LOC #100 Main LDA $255,txt TRAP 0,Fputs,StdOut TRAP 0,Fputs,StdErr TRAP 0,Halt,0 EOS system bin/"mmixal", "hello.mms" assert_equal "Hello world!", shell_output("#{bin}/mmix hello.mmo") end end
class Modd < Formula desc "Flexible tool for responding to filesystem changes" homepage "https://github.com/cortesi/modd" url "https://github.com/cortesi/modd/archive/v0.8.tar.gz" sha256 "04e9bacf5a73cddea9455f591700f452d2465001ccc0c8e6f37d27b8b376b6e0" license "MIT" head "https://github.com/cortesi/modd.git" bottle do cellar :any_skip_relocation rebuild 1 sha256 "87423ac35521b65b0d45d6d7a1b0589bbfa57a14b62e3b9dcbb4e1e2a6e2f874" => :big_sur sha256 "0657ac604def86ff2bfac4797944290d0fc4afabee8855506901437d2870ce61" => :catalina sha256 "c7a4a376466ad627e747c4054e6398fa4a8637e5542c2cf496740ea2b0db79ff" => :mojave end depends_on "go" => :build def install ENV["GOPATH"] = buildpath (buildpath/"src/github.com/cortesi/modd").install buildpath.children cd "src/github.com/cortesi/modd" do system "go", "build", *std_go_args, "./cmd/modd" end end test do begin io = IO.popen("#{bin}/modd") sleep 2 ensure Process.kill("SIGINT", io.pid) Process.wait(io.pid) end assert_match "Error reading config file ./modd.conf", io.read end end modd: update 0.8 bottle. class Modd < Formula desc "Flexible tool for responding to filesystem changes" homepage "https://github.com/cortesi/modd" url "https://github.com/cortesi/modd/archive/v0.8.tar.gz" sha256 "04e9bacf5a73cddea9455f591700f452d2465001ccc0c8e6f37d27b8b376b6e0" license "MIT" head "https://github.com/cortesi/modd.git" bottle do cellar :any_skip_relocation rebuild 1 sha256 "87423ac35521b65b0d45d6d7a1b0589bbfa57a14b62e3b9dcbb4e1e2a6e2f874" => :big_sur sha256 "0657ac604def86ff2bfac4797944290d0fc4afabee8855506901437d2870ce61" => :catalina sha256 "c7a4a376466ad627e747c4054e6398fa4a8637e5542c2cf496740ea2b0db79ff" => :mojave sha256 "54ac86bc8055d83b877c9824cf2ac2188891c942d0944d870ee7fd89c17e20f0" => :x86_64_linux end depends_on "go" => :build def install ENV["GOPATH"] = buildpath (buildpath/"src/github.com/cortesi/modd").install buildpath.children cd "src/github.com/cortesi/modd" do system "go", "build", *std_go_args, "./cmd/modd" end end test do begin io = IO.popen("#{bin}/modd") sleep 2 ensure Process.kill("SIGINT", io.pid) Process.wait(io.pid) end assert_match "Error reading config file ./modd.conf", io.read end end
class Mold < Formula desc "Modern Linker" homepage "https://github.com/rui314/mold" url "https://github.com/rui314/mold/archive/v1.6.0.tar.gz" sha256 "59cd3ea1a2a5fb50d0d97faddd8bff4c7e71054a576c00a87b17f56ecbd88729" license "AGPL-3.0-only" head "https://github.com/rui314/mold.git", branch: "main" bottle do sha256 cellar: :any, arm64_monterey: "076338cdf41f1c403516dc7f9e6acd1c940893b388c86b45ae1c834c6760e820" sha256 cellar: :any, arm64_big_sur: "bb483a8a578217eaacd1af58268312e66617a89a0af2592217fea0dec1a4fde6" sha256 cellar: :any, monterey: "150c90061b5071315d8e24df6a57a2640662e096815225a89f170b16aea41ef4" sha256 cellar: :any, big_sur: "94ad4e9c77451fe06844d73686e3f5773d6c47db092ef0f22e4af3fa58a618d4" sha256 cellar: :any, catalina: "9596cca4cc75cc2e53bf3440d06e76a48426bbdc98eef6a0796e182369d4fdb3" sha256 cellar: :any_skip_relocation, x86_64_linux: "32fa1a5949e8b986715b0e32127e546f92cd7583de3384a695d760bc1f700abe" end depends_on "cmake" => :build depends_on "tbb" depends_on "zstd" uses_from_macos "zlib" on_macos do depends_on "llvm" => :build if DevelopmentTools.clang_build_version <= 1200 end on_linux do depends_on "mimalloc" depends_on "openssl@1.1" # Uses CommonCrypto on macOS end fails_with :clang do build 1200 cause "Requires C++20" end fails_with :gcc do version "7" cause "Requires C++20" end def install ENV.llvm_clang if OS.mac? && (DevelopmentTools.clang_build_version <= 1200) # Undefine the `LIBDIR` macro to avoid embedding it in the binary. # This helps make the bottle relocatable. ENV.append_to_cflags "-ULIBDIR" # Ensure we're using Homebrew-provided versions of these dependencies. %w[mimalloc tbb zlib zstd].map { |dir| (buildpath/"third-party"/dir).rmtree } args = %w[ -DMOLD_LTO=ON -DMOLD_USE_MIMALLOC=ON -DMOLD_USE_SYSTEM_MIMALLOC=ON -DMOLD_USE_SYSTEM_TBB=ON -DCMAKE_SKIP_INSTALL_RULES=OFF ] system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args system "cmake", "--build", "build" system "cmake", "--install", "build" inreplace buildpath.glob("test/macho/*.sh"), "./ld64", bin/"ld64.mold", false inreplace buildpath.glob("test/elf/*.sh") do |s| s.gsub!(%r{(`pwd`/)?mold-wrapper}, lib/"mold/mold-wrapper", false) s.gsub!(%r{(\.|`pwd`)/mold}, bin/"mold", false) s.gsub!(/-B[^\s]+/, "-B#{libexec}/mold", false) end pkgshare.install "test" end test do (testpath/"test.c").write <<~EOS int main(void) { return 0; } EOS linker_flag = case ENV.compiler when /^gcc(-(\d|10|11))?$/ then "-B#{libexec}/mold" when :clang, /^gcc-\d{2,}$/ then "-fuse-ld=mold" else odie "unexpected compiler" end system ENV.cc, linker_flag, "test.c" system "./a.out" # Tests use `--ld-path`, which is not supported on old versions of Apple Clang. return if OS.mac? && MacOS.version < :big_sur if OS.mac? cp_r pkgshare/"test", testpath # Delete failing test. Reported upstream at # https://github.com/rui314/mold/issues/735 if (MacOS.version >= :monterey) && Hardware::CPU.arm? untested = %w[libunwind objc-selector] testpath.glob("test/macho/{#{untested.join(",")}}.sh").map(&:unlink) end testpath.glob("test/macho/*.sh").each { |t| system t } else system bin/"mold", "-run", ENV.cc, "test.c", "-o", "test" system "./test" end end end mold: update 1.6.0 bottle. class Mold < Formula desc "Modern Linker" homepage "https://github.com/rui314/mold" url "https://github.com/rui314/mold/archive/v1.6.0.tar.gz" sha256 "59cd3ea1a2a5fb50d0d97faddd8bff4c7e71054a576c00a87b17f56ecbd88729" license "AGPL-3.0-only" head "https://github.com/rui314/mold.git", branch: "main" bottle do sha256 cellar: :any, arm64_ventura: "435481b79444b069e9e7d271298e6064b956900dc345454cd9d381612cf8e8d3" sha256 cellar: :any, arm64_monterey: "076338cdf41f1c403516dc7f9e6acd1c940893b388c86b45ae1c834c6760e820" sha256 cellar: :any, arm64_big_sur: "bb483a8a578217eaacd1af58268312e66617a89a0af2592217fea0dec1a4fde6" sha256 cellar: :any, monterey: "150c90061b5071315d8e24df6a57a2640662e096815225a89f170b16aea41ef4" sha256 cellar: :any, big_sur: "94ad4e9c77451fe06844d73686e3f5773d6c47db092ef0f22e4af3fa58a618d4" sha256 cellar: :any, catalina: "9596cca4cc75cc2e53bf3440d06e76a48426bbdc98eef6a0796e182369d4fdb3" sha256 cellar: :any_skip_relocation, x86_64_linux: "32fa1a5949e8b986715b0e32127e546f92cd7583de3384a695d760bc1f700abe" end depends_on "cmake" => :build depends_on "tbb" depends_on "zstd" uses_from_macos "zlib" on_macos do depends_on "llvm" => :build if DevelopmentTools.clang_build_version <= 1200 end on_linux do depends_on "mimalloc" depends_on "openssl@1.1" # Uses CommonCrypto on macOS end fails_with :clang do build 1200 cause "Requires C++20" end fails_with :gcc do version "7" cause "Requires C++20" end def install ENV.llvm_clang if OS.mac? && (DevelopmentTools.clang_build_version <= 1200) # Undefine the `LIBDIR` macro to avoid embedding it in the binary. # This helps make the bottle relocatable. ENV.append_to_cflags "-ULIBDIR" # Ensure we're using Homebrew-provided versions of these dependencies. %w[mimalloc tbb zlib zstd].map { |dir| (buildpath/"third-party"/dir).rmtree } args = %w[ -DMOLD_LTO=ON -DMOLD_USE_MIMALLOC=ON -DMOLD_USE_SYSTEM_MIMALLOC=ON -DMOLD_USE_SYSTEM_TBB=ON -DCMAKE_SKIP_INSTALL_RULES=OFF ] system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args system "cmake", "--build", "build" system "cmake", "--install", "build" inreplace buildpath.glob("test/macho/*.sh"), "./ld64", bin/"ld64.mold", false inreplace buildpath.glob("test/elf/*.sh") do |s| s.gsub!(%r{(`pwd`/)?mold-wrapper}, lib/"mold/mold-wrapper", false) s.gsub!(%r{(\.|`pwd`)/mold}, bin/"mold", false) s.gsub!(/-B[^\s]+/, "-B#{libexec}/mold", false) end pkgshare.install "test" end test do (testpath/"test.c").write <<~EOS int main(void) { return 0; } EOS linker_flag = case ENV.compiler when /^gcc(-(\d|10|11))?$/ then "-B#{libexec}/mold" when :clang, /^gcc-\d{2,}$/ then "-fuse-ld=mold" else odie "unexpected compiler" end system ENV.cc, linker_flag, "test.c" system "./a.out" # Tests use `--ld-path`, which is not supported on old versions of Apple Clang. return if OS.mac? && MacOS.version < :big_sur if OS.mac? cp_r pkgshare/"test", testpath # Delete failing test. Reported upstream at # https://github.com/rui314/mold/issues/735 if (MacOS.version >= :monterey) && Hardware::CPU.arm? untested = %w[libunwind objc-selector] testpath.glob("test/macho/{#{untested.join(",")}}.sh").map(&:unlink) end testpath.glob("test/macho/*.sh").each { |t| system t } else system bin/"mold", "-run", ENV.cc, "test.c", "-o", "test" system "./test" end end end
class Mosh < Formula desc "Remote terminal application" homepage "https://mosh.org" license "GPL-3.0-or-later" revision OS.mac? ? 15 : 16 stable do url "https://mosh.org/mosh-1.3.2.tar.gz" sha256 "da600573dfa827d88ce114e0fed30210689381bbdcff543c931e4d6a2e851216" # Fix mojave build. patch do url "https://github.com/mobile-shell/mosh/commit/e5f8a826ef9ff5da4cfce3bb8151f9526ec19db0.patch?full_index=1" sha256 "022bf82de1179b2ceb7dc6ae7b922961dfacd52fbccc30472c527cb7c87c96f0" end end bottle do rebuild 1 sha256 cellar: :any, arm64_big_sur: "d1470fbc90fe39efa99654c554ec40643754249c7600d8e53d59d888ead3d9b8" sha256 cellar: :any, big_sur: "ee9e5f52a4e9e19112f42427e1f869a318ee68f19aed1bbb29e3f0bae4f57406" sha256 cellar: :any, catalina: "15efe4f981856e4df8da40350299730988a9c8b7d0fad98bf413d9e293e953a8" sha256 cellar: :any, mojave: "f921eb384a179c6b65078a36bc479087c20de42562957d92510dc54dfec92c97" end head do url "https://github.com/mobile-shell/mosh.git", shallow: false depends_on "autoconf" => :build depends_on "automake" => :build end depends_on "pkg-config" => :build depends_on "openssl@1.1" depends_on "protobuf" uses_from_macos "ncurses" uses_from_macos "zlib" on_linux do depends_on "openssl@1.1" end def install ENV.cxx11 # teach mosh to locate mosh-client without referring # PATH to support launching outside shell e.g. via launcher inreplace "scripts/mosh.pl", "'mosh-client", "\'#{bin}/mosh-client" system "./autogen.sh" if build.head? system "./configure", "--prefix=#{prefix}", "--enable-completion" system "make", "install" end test do system bin/"mosh-client", "-c" end end mosh: update 1.3.2_16 bottle. class Mosh < Formula desc "Remote terminal application" homepage "https://mosh.org" license "GPL-3.0-or-later" revision OS.mac? ? 15 : 16 stable do url "https://mosh.org/mosh-1.3.2.tar.gz" sha256 "da600573dfa827d88ce114e0fed30210689381bbdcff543c931e4d6a2e851216" # Fix mojave build. patch do url "https://github.com/mobile-shell/mosh/commit/e5f8a826ef9ff5da4cfce3bb8151f9526ec19db0.patch?full_index=1" sha256 "022bf82de1179b2ceb7dc6ae7b922961dfacd52fbccc30472c527cb7c87c96f0" end end bottle do rebuild 1 sha256 cellar: :any, arm64_big_sur: "d1470fbc90fe39efa99654c554ec40643754249c7600d8e53d59d888ead3d9b8" sha256 cellar: :any, big_sur: "ee9e5f52a4e9e19112f42427e1f869a318ee68f19aed1bbb29e3f0bae4f57406" sha256 cellar: :any, catalina: "15efe4f981856e4df8da40350299730988a9c8b7d0fad98bf413d9e293e953a8" sha256 cellar: :any, mojave: "f921eb384a179c6b65078a36bc479087c20de42562957d92510dc54dfec92c97" sha256 cellar: :any_skip_relocation, x86_64_linux: "155ef66b60eea52b312c3d9e88e127f813891fafa9c6ff46b4cde25fda283bb7" end head do url "https://github.com/mobile-shell/mosh.git", shallow: false depends_on "autoconf" => :build depends_on "automake" => :build end depends_on "pkg-config" => :build depends_on "openssl@1.1" depends_on "protobuf" uses_from_macos "ncurses" uses_from_macos "zlib" on_linux do depends_on "openssl@1.1" end def install ENV.cxx11 # teach mosh to locate mosh-client without referring # PATH to support launching outside shell e.g. via launcher inreplace "scripts/mosh.pl", "'mosh-client", "\'#{bin}/mosh-client" system "./autogen.sh" if build.head? system "./configure", "--prefix=#{prefix}", "--enable-completion" system "make", "install" end test do system bin/"mosh-client", "-c" end end
class Mosh < Formula desc "Remote terminal application" homepage "https://mosh.org" license "GPL-3.0-or-later" revision 16 stable do url "https://mosh.org/mosh-1.3.2.tar.gz" sha256 "da600573dfa827d88ce114e0fed30210689381bbdcff543c931e4d6a2e851216" # Fix mojave build. patch do url "https://github.com/mobile-shell/mosh/commit/e5f8a826ef9ff5da4cfce3bb8151f9526ec19db0.patch?full_index=1" sha256 "022bf82de1179b2ceb7dc6ae7b922961dfacd52fbccc30472c527cb7c87c96f0" end # Fix Xcode 12.5 build. Backport of the following commit: # https://github.com/mobile-shell/mosh/commit/12199114fe4234f791ef4c306163901643b40538 patch :p0 do url "https://raw.githubusercontent.com/macports/macports-ports/72fb5d9a79e581a5033bce38fb00ee25a0c2fdfe/net/mosh/files/patch-version-subdir.diff" sha256 "939e5435ce7d9cecb7b2bccaf31294092eb131b5bd41d5776a40d660ffc95982" end end bottle do sha256 cellar: :any, arm64_big_sur: "994d3f53c9af51c4bb759dd67de60a8bfffa5a2be1f5ffbd60477abe709b1801" sha256 cellar: :any, big_sur: "b297986eb2a108d1f38c75e90e12f19953a39bda71ff75860e060f15f26f17d0" sha256 cellar: :any, catalina: "b9f84223c2299ed1ecefcb98fa545d2a53613933280fbc45c9dec32e9d9a9902" sha256 cellar: :any, mojave: "0201d43d7aed512afa30e241423c12b4828f193a7fe3155c173cccb55be56ce8" sha256 cellar: :any_skip_relocation, x86_64_linux: "ec64cfea75e3ef0eecdae39fafd071aac8e059cc7034f0105ad4b84f862a4778" end head do url "https://github.com/mobile-shell/mosh.git" depends_on "autoconf" => :build depends_on "automake" => :build end # Remove autoconf and automake when the # Xcode 12.5 patch is removed. depends_on "autoconf" => :build depends_on "automake" => :build depends_on "pkg-config" => :build depends_on "openssl" depends_on "protobuf" uses_from_macos "ncurses" uses_from_macos "openssl" uses_from_macos "zlib" def install ENV.cxx11 # teach mosh to locate mosh-client without referring # PATH to support launching outside shell e.g. via launcher inreplace "scripts/mosh.pl", "'mosh-client", "\'#{bin}/mosh-client" # Uncomment `if build.head?` when Xcode 12.5 patch is removed system "./autogen.sh" # if build.head? system "./configure", "--prefix=#{prefix}", "--enable-completion" system "make", "install" end test do system bin/"mosh-client", "-c" end end mosh: fix OpenSSL dependency (#85850) class Mosh < Formula desc "Remote terminal application" homepage "https://mosh.org" license "GPL-3.0-or-later" revision 16 stable do url "https://mosh.org/mosh-1.3.2.tar.gz" sha256 "da600573dfa827d88ce114e0fed30210689381bbdcff543c931e4d6a2e851216" # Fix mojave build. patch do url "https://github.com/mobile-shell/mosh/commit/e5f8a826ef9ff5da4cfce3bb8151f9526ec19db0.patch?full_index=1" sha256 "022bf82de1179b2ceb7dc6ae7b922961dfacd52fbccc30472c527cb7c87c96f0" end # Fix Xcode 12.5 build. Backport of the following commit: # https://github.com/mobile-shell/mosh/commit/12199114fe4234f791ef4c306163901643b40538 patch :p0 do url "https://raw.githubusercontent.com/macports/macports-ports/72fb5d9a79e581a5033bce38fb00ee25a0c2fdfe/net/mosh/files/patch-version-subdir.diff" sha256 "939e5435ce7d9cecb7b2bccaf31294092eb131b5bd41d5776a40d660ffc95982" end end bottle do sha256 cellar: :any, arm64_big_sur: "994d3f53c9af51c4bb759dd67de60a8bfffa5a2be1f5ffbd60477abe709b1801" sha256 cellar: :any, big_sur: "b297986eb2a108d1f38c75e90e12f19953a39bda71ff75860e060f15f26f17d0" sha256 cellar: :any, catalina: "b9f84223c2299ed1ecefcb98fa545d2a53613933280fbc45c9dec32e9d9a9902" sha256 cellar: :any, mojave: "0201d43d7aed512afa30e241423c12b4828f193a7fe3155c173cccb55be56ce8" sha256 cellar: :any_skip_relocation, x86_64_linux: "ec64cfea75e3ef0eecdae39fafd071aac8e059cc7034f0105ad4b84f862a4778" end head do url "https://github.com/mobile-shell/mosh.git" depends_on "autoconf" => :build depends_on "automake" => :build end # Remove autoconf and automake when the # Xcode 12.5 patch is removed. depends_on "autoconf" => :build depends_on "automake" => :build depends_on "pkg-config" => :build depends_on "protobuf" uses_from_macos "ncurses" uses_from_macos "zlib" on_linux do depends_on "openssl@1.1" # Uses CommonCrypto on macOS end def install ENV.cxx11 # teach mosh to locate mosh-client without referring # PATH to support launching outside shell e.g. via launcher inreplace "scripts/mosh.pl", "'mosh-client", "\'#{bin}/mosh-client" # Uncomment `if build.head?` when Xcode 12.5 patch is removed system "./autogen.sh" # if build.head? system "./configure", "--prefix=#{prefix}", "--enable-completion" system "make", "install" end test do system bin/"mosh-client", "-c" end end
class Mosh < Formula desc "Remote terminal application" homepage "https://mosh.org" url "https://mosh.org/mosh-1.3.2.tar.gz" sha256 "da600573dfa827d88ce114e0fed30210689381bbdcff543c931e4d6a2e851216" revision OS.mac? ? 11 : 12 bottle do cellar :any_skip_relocation sha256 "d864ba6a3869df2fd47894862f5f0b7d8e5f5f55daf58742243fa3ca8c69d474" => :catalina sha256 "1f46edf8fbd83303ea4156530357207b6ad538a6abbbd5118f9c39e4898a4a19" => :mojave sha256 "c8aa1ef313d62059bd8abee131880d5fa73f45e961388c055bc5f89970bcaf24" => :high_sierra sha256 "2ed3c3b6564e47f224182f9a798d53fa655abdb6d3c73f6a7be919235118e3dd" => :x86_64_linux end head do url "https://github.com/mobile-shell/mosh.git", :shallow => false depends_on "autoconf" => :build depends_on "automake" => :build end depends_on "pkg-config" => :build depends_on "tmux" => :build depends_on "protobuf" depends_on "openssl@1.1" unless OS.mac? uses_from_macos "ncurses" # Fix mojave build. unless build.head? patch do url "https://github.com/mobile-shell/mosh/commit/e5f8a826ef9ff5da4cfce3bb8151f9526ec19db0.patch?full_index=1" sha256 "022bf82de1179b2ceb7dc6ae7b922961dfacd52fbccc30472c527cb7c87c96f0" end end def install ENV.cxx11 # teach mosh to locate mosh-client without referring # PATH to support launching outside shell e.g. via launcher inreplace "scripts/mosh.pl", "'mosh-client", "\'#{bin}/mosh-client" system "./autogen.sh" if build.head? system "./configure", "--prefix=#{prefix}", "--enable-completion" system "make", "check" if OS.mac? system "make", "install" end test do system bin/"mosh-client", "-c" end end mosh: fix RuboCop style. See https://github.com/Homebrew/brew/pull/7867. class Mosh < Formula desc "Remote terminal application" homepage "https://mosh.org" url "https://mosh.org/mosh-1.3.2.tar.gz" sha256 "da600573dfa827d88ce114e0fed30210689381bbdcff543c931e4d6a2e851216" revision OS.mac? ? 11 : 12 bottle do cellar :any_skip_relocation sha256 "d864ba6a3869df2fd47894862f5f0b7d8e5f5f55daf58742243fa3ca8c69d474" => :catalina sha256 "1f46edf8fbd83303ea4156530357207b6ad538a6abbbd5118f9c39e4898a4a19" => :mojave sha256 "c8aa1ef313d62059bd8abee131880d5fa73f45e961388c055bc5f89970bcaf24" => :high_sierra sha256 "2ed3c3b6564e47f224182f9a798d53fa655abdb6d3c73f6a7be919235118e3dd" => :x86_64_linux end head do url "https://github.com/mobile-shell/mosh.git", shallow: false depends_on "autoconf" => :build depends_on "automake" => :build end depends_on "pkg-config" => :build depends_on "tmux" => :build depends_on "protobuf" depends_on "openssl@1.1" unless OS.mac? uses_from_macos "ncurses" # Fix mojave build. unless build.head? patch do url "https://github.com/mobile-shell/mosh/commit/e5f8a826ef9ff5da4cfce3bb8151f9526ec19db0.patch?full_index=1" sha256 "022bf82de1179b2ceb7dc6ae7b922961dfacd52fbccc30472c527cb7c87c96f0" end end def install ENV.cxx11 # teach mosh to locate mosh-client without referring # PATH to support launching outside shell e.g. via launcher inreplace "scripts/mosh.pl", "'mosh-client", "\'#{bin}/mosh-client" system "./autogen.sh" if build.head? system "./configure", "--prefix=#{prefix}", "--enable-completion" system "make", "check" if OS.mac? system "make", "install" end test do system bin/"mosh-client", "-c" end end
class Moto < Formula include Language::Python::Virtualenv desc "Mock AWS services" homepage "http://getmoto.org/" url "https://files.pythonhosted.org/packages/eb/84/186db078f0ae23bec3cf0015ac648473ffddde44fa4002284b99f63b2e3e/moto-3.1.11.tar.gz" sha256 "1b0c472f4b7401775a92e63fbcfa26112a00e087b9f6edda12202a39c62c6181" license "Apache-2.0" bottle do sha256 cellar: :any, arm64_monterey: "25cfaeb9ccc0b81a6adf7784b930af1067609868d006495a8e791234feb850b8" sha256 cellar: :any, arm64_big_sur: "07772379a867a90c922567f42d380e2098af5c166928f62be8496640268c7601" sha256 cellar: :any, monterey: "9b7121d3944ed67332f7a48ed8b0fcda9f8fa1cd7ecdd9ca3fedba7ee9c1d8c1" sha256 cellar: :any, big_sur: "f23d55fb5a451e0b0bde8f9c83011de755f08a230a0765cf6b7985722a7c3f7b" sha256 cellar: :any, catalina: "02b10af011ca5644d1e3a45f04cd5b0b22db4da1be938457f04c676b43ea812e" sha256 cellar: :any_skip_relocation, x86_64_linux: "db20df9433bf709e2080dce676db7638e3c5a0a33f28a05b7707a829a7cf3ecc" end depends_on "rust" => :build # for cryptography depends_on "python@3.10" depends_on "six" resource "attrs" do url "https://files.pythonhosted.org/packages/d7/77/ebb15fc26d0f815839ecd897b919ed6d85c050feeb83e100e020df9153d2/attrs-21.4.0.tar.gz" sha256 "626ba8234211db98e869df76230a137c4c40a12d72445c45d5f5b716f076e2fd" end resource "aws-sam-translator" do url "https://files.pythonhosted.org/packages/b1/ce/402ea474888505f956bba9a5b224d2662d5a4071925ad38079eb3506bd90/aws-sam-translator-1.45.0.tar.gz" sha256 "bf321ab62aa1731d3e471fd55de6f5d1ab07dfc169cd254aa523dd9ad30246f9" end resource "aws-xray-sdk" do url "https://files.pythonhosted.org/packages/49/26/927206007f1ac57b0801046dc9baed8df9ccbdc7622b79bdaf0c193e8051/aws-xray-sdk-2.9.0.tar.gz" sha256 "b0cd972db218d4d8f7b53ad806fc6184626b924c4997ae58fc9f2a8cd1281568" end resource "boto3" do url "https://files.pythonhosted.org/packages/04/dd/c32878e575c1c67c5f732c0f8a36e50a7dcd79b37e964a13e10b68582e63/boto3-1.23.10.tar.gz" sha256 "2a4395e3241c20eef441d7443a5e6eaa0ee3f7114653fb9d9cef41587526f7bd" end resource "botocore" do url "https://files.pythonhosted.org/packages/af/c8/37c491b2a4198943e74d6a1792f1a18a70fd0e0e40a9cb0694cc7751a342/botocore-1.26.10.tar.gz" sha256 "5df2cf7ebe34377470172bd0bbc582cf98c5cbd02da0909a14e9e2885ab3ae9c" end resource "certifi" do url "https://files.pythonhosted.org/packages/07/10/75277f313d13a2b74fc56e29239d5c840c2bf09f17bf25c02b35558812c6/certifi-2022.5.18.1.tar.gz" sha256 "9c5705e395cd70084351dd8ad5c41e65655e08ce46f2ec9cf6c2c08390f71eb7" end resource "cffi" do url "https://files.pythonhosted.org/packages/00/9e/92de7e1217ccc3d5f352ba21e52398372525765b2e0c4530e6eb2ba9282a/cffi-1.15.0.tar.gz" sha256 "920f0d66a896c2d99f0adbb391f990a84091179542c205fa53ce5787aff87954" end resource "cfn-lint" do url "https://files.pythonhosted.org/packages/fa/92/8e1f7db6d746f02ab36fe2918c51aefa8fadd74ca73c3917a8b9c12992f8/cfn-lint-0.60.1.tar.gz" sha256 "834b7cc7e7211c02dbe9fa3e0fafa035d16af2fe806977afb6d00666022b133e" end resource "charset-normalizer" do url "https://files.pythonhosted.org/packages/56/31/7bcaf657fafb3c6db8c787a865434290b726653c912085fbd371e9b92e1c/charset-normalizer-2.0.12.tar.gz" sha256 "2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597" end resource "click" do url "https://files.pythonhosted.org/packages/59/87/84326af34517fca8c58418d148f2403df25303e02736832403587318e9e8/click-8.1.3.tar.gz" sha256 "7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e" end resource "cryptography" do url "https://files.pythonhosted.org/packages/51/05/bb2b681f6a77276fc423d04187c39dafdb65b799c8d87b62ca82659f9ead/cryptography-37.0.2.tar.gz" sha256 "f224ad253cc9cea7568f49077007d2263efa57396a2f2f78114066fd54b5c68e" end resource "docker" do url "https://files.pythonhosted.org/packages/ab/d2/45ea0ee13c6cffac96c32ac36db0299932447a736660537ec31ec3a6d877/docker-5.0.3.tar.gz" sha256 "d916a26b62970e7c2f554110ed6af04c7ccff8e9f81ad17d0d40c75637e227fb" end resource "ecdsa" do url "https://files.pythonhosted.org/packages/bf/3d/3d909532ad541651390bf1321e097404cbd39d1d89c2046f42a460220fb3/ecdsa-0.17.0.tar.gz" sha256 "b9f500bb439e4153d0330610f5d26baaf18d17b8ced1bc54410d189385ea68aa" end resource "Flask" do url "https://files.pythonhosted.org/packages/d3/3c/94f38d4db919a9326a706ad56f05a7e6f0c8f7b7d93e2997cca54d3bc14b/Flask-2.1.2.tar.gz" sha256 "315ded2ddf8a6281567edb27393010fe3406188bafbfe65a3339d5787d89e477" end resource "Flask-Cors" do url "https://files.pythonhosted.org/packages/cf/25/e3b2553d22ed542be807739556c69621ad2ab276ae8d5d2560f4ed20f652/Flask-Cors-3.0.10.tar.gz" sha256 "b60839393f3b84a0f3746f6cdca56c1ad7426aa738b70d6c61375857823181de" end resource "future" do url "https://files.pythonhosted.org/packages/45/0b/38b06fd9b92dc2b68d58b75f900e97884c45bedd2ff83203d933cf5851c9/future-0.18.2.tar.gz" sha256 "b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d" end resource "graphql-core" do url "https://files.pythonhosted.org/packages/61/9e/798c1cfc5b03e98f068a793c2d2f1fd94f76ba50521f3812ff1a4e3c29d2/graphql-core-3.2.1.tar.gz" sha256 "9d1bf141427b7d54be944587c8349df791ce60ade2e3cccaf9c56368c133c201" end resource "idna" do url "https://files.pythonhosted.org/packages/62/08/e3fc7c8161090f742f504f40b1bccbfc544d4a4e09eb774bf40aafce5436/idna-3.3.tar.gz" sha256 "9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d" end resource "itsdangerous" do url "https://files.pythonhosted.org/packages/7f/a1/d3fb83e7a61fa0c0d3d08ad0a94ddbeff3731c05212617dff3a94e097f08/itsdangerous-2.1.2.tar.gz" sha256 "5dbbc68b317e5e42f327f9021763545dc3fc3bfe22e6deb96aaf1fc38874156a" end resource "Jinja2" do url "https://files.pythonhosted.org/packages/7a/ff/75c28576a1d900e87eb6335b063fab47a8ef3c8b4d88524c4bf78f670cce/Jinja2-3.1.2.tar.gz" sha256 "31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852" end resource "jmespath" do url "https://files.pythonhosted.org/packages/06/7e/44686b986ef9ca6069db224651baaa8300b93af2a085a5b135997bf659b3/jmespath-1.0.0.tar.gz" sha256 "a490e280edd1f57d6de88636992d05b71e97d69a26a19f058ecf7d304474bf5e" end resource "jschema-to-python" do url "https://files.pythonhosted.org/packages/1d/7f/5ae3d97ddd86ec33323231d68453afd504041efcfd4f4dde993196606849/jschema_to_python-1.2.3.tar.gz" sha256 "76ff14fe5d304708ccad1284e4b11f96a658949a31ee7faed9e0995279549b91" end resource "jsondiff" do url "https://files.pythonhosted.org/packages/dd/13/2b691afe0a90fb930a32b8fc1b0fd6b5bdeaed459a32c5a58dc6654342da/jsondiff-2.0.0.tar.gz" sha256 "2795844ef075ec8a2b8d385c4d59f5ea48b08e7180fce3cb2787be0db00b1fb4" end resource "jsonpatch" do url "https://files.pythonhosted.org/packages/21/67/83452af2a6db7c4596d1e2ecaa841b9a900980103013b867f2865e5e1cf0/jsonpatch-1.32.tar.gz" sha256 "b6ddfe6c3db30d81a96aaeceb6baf916094ffa23d7dd5fa2c13e13f8b6e600c2" end resource "jsonpickle" do url "https://files.pythonhosted.org/packages/65/09/50bc3aabaeba15b319737560b41f3b6acddf6f10011b9869c796683886aa/jsonpickle-2.2.0.tar.gz" sha256 "7b272918b0554182e53dc340ddd62d9b7f902fec7e7b05620c04f3ccef479a0e" end resource "jsonpointer" do url "https://files.pythonhosted.org/packages/a0/6c/c52556b957a0f904e7c45585444feef206fe5cb1ff656303a1d6d922a53b/jsonpointer-2.3.tar.gz" sha256 "97cba51526c829282218feb99dab1b1e6bdf8efd1c43dc9d57be093c0d69c99a" end resource "jsonschema" do url "https://files.pythonhosted.org/packages/69/11/a69e2a3c01b324a77d3a7c0570faa372e8448b666300c4117a516f8b1212/jsonschema-3.2.0.tar.gz" sha256 "c8a85b28d377cc7737e46e2d9f2b4f44ee3c0e1deac6bf46ddefc7187d30797a" end resource "junit-xml-2" do url "https://files.pythonhosted.org/packages/4d/f2/a99adf9deb57949b81ff8e113edf971da1840251794a6f4184d61faa5a65/junit-xml-2-1.9.tar.gz" sha256 "3b8d9635c5215f754c7807104f6493e3ea3bc9481e2d33db294560da3a1b00f7" end resource "MarkupSafe" do url "https://files.pythonhosted.org/packages/1d/97/2288fe498044284f39ab8950703e88abbac2abbdf65524d576157af70556/MarkupSafe-2.1.1.tar.gz" sha256 "7f91197cc9e48f989d12e4e6fbc46495c446636dfc81b9ccf50bb0ec74b91d4b" end resource "networkx" do url "https://files.pythonhosted.org/packages/4a/e2/1f9d6cf8562cf2bde58c102db70fe48d2d9652ec256f86bab6b279601b0d/networkx-2.8.2.tar.gz" sha256 "ae99c9b0d35e5b4a62cf1cfea01e5b3633d8d02f4a0ead69685b6e7de5b85eab" end resource "openapi-schema-validator" do url "https://files.pythonhosted.org/packages/69/0d/7ec64ebe984c6c0bb3fe239775bed72c94bcdcf954d091c2565eaf613445/openapi-schema-validator-0.2.3.tar.gz" sha256 "2c64907728c3ef78e23711c8840a423f0b241588c9ed929855e4b2d1bb0cf5f2" end resource "openapi-spec-validator" do url "https://files.pythonhosted.org/packages/37/41/199441b0ae1f9522ce511fd65cbcd9e8634aed733bd0ab2a9235fe29dec6/openapi-spec-validator-0.4.0.tar.gz" sha256 "97f258850afc97b048f7c2653855e0f88fa66ac103c2be5077c7960aca2ad49a" end resource "pbr" do url "https://files.pythonhosted.org/packages/96/9f/f4bc832eeb4ae723b86372277da56a5643b0ad472a95314e8f516a571bb0/pbr-5.9.0.tar.gz" sha256 "e8dca2f4b43560edef58813969f52a56cef023146cbb8931626db80e6c1c4308" end resource "pyasn1" do url "https://files.pythonhosted.org/packages/a4/db/fffec68299e6d7bad3d504147f9094830b704527a7fc098b721d38cc7fa7/pyasn1-0.4.8.tar.gz" sha256 "aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba" end resource "pycparser" do url "https://files.pythonhosted.org/packages/5e/0b/95d387f5f4433cb0f53ff7ad859bd2c6051051cebbb564f139a999ab46de/pycparser-2.21.tar.gz" sha256 "e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206" end resource "pyparsing" do url "https://files.pythonhosted.org/packages/71/22/207523d16464c40a0310d2d4d8926daffa00ac1f5b1576170a32db749636/pyparsing-3.0.9.tar.gz" sha256 "2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb" end resource "pyrsistent" do url "https://files.pythonhosted.org/packages/42/ac/455fdc7294acc4d4154b904e80d964cc9aae75b087bbf486be04df9f2abd/pyrsistent-0.18.1.tar.gz" sha256 "d4d61f8b993a7255ba714df3aca52700f8125289f84f704cf80916517c46eb96" end resource "python-dateutil" do url "https://files.pythonhosted.org/packages/4c/c4/13b4776ea2d76c115c1d1b84579f3764ee6d57204f6be27119f13a61d0a9/python-dateutil-2.8.2.tar.gz" sha256 "0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86" end resource "python-jose" do url "https://files.pythonhosted.org/packages/e4/19/b2c86504116dc5f0635d29f802da858404d77d930a25633d2e86a64a35b3/python-jose-3.3.0.tar.gz" sha256 "55779b5e6ad599c6336191246e95eb2293a9ddebd555f796a65f838f07e5d78a" end resource "pytz" do url "https://files.pythonhosted.org/packages/2f/5f/a0f653311adff905bbcaa6d3dfaf97edcf4d26138393c6ccd37a484851fb/pytz-2022.1.tar.gz" sha256 "1e760e2fe6a8163bc0b3d9a19c4f84342afa0a2affebfaa84b01b978a02ecaa7" end resource "PyYAML" do url "https://files.pythonhosted.org/packages/36/2b/61d51a2c4f25ef062ae3f74576b01638bebad5e045f747ff12643df63844/PyYAML-6.0.tar.gz" sha256 "68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2" end resource "requests" do url "https://files.pythonhosted.org/packages/60/f3/26ff3767f099b73e0efa138a9998da67890793bfa475d8278f84a30fec77/requests-2.27.1.tar.gz" sha256 "68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61" end resource "responses" do url "https://files.pythonhosted.org/packages/6d/db/b949a6bf2a75c64caea0a6b39d05e433aa2e51bea78ae9d5dda1110b31a5/responses-0.21.0.tar.gz" sha256 "b82502eb5f09a0289d8e209e7bad71ef3978334f56d09b444253d5ad67bf5253" end resource "rsa" do url "https://files.pythonhosted.org/packages/8c/ee/4022542e0fed77dd6ddade38e1e4dea3299f873b7fd4e6d78319953b0f83/rsa-4.8.tar.gz" sha256 "5c6bd9dc7a543b7fe4304a631f8a8a3b674e2bbfc49c2ae96200cdbe55df6b17" end resource "s3transfer" do url "https://files.pythonhosted.org/packages/7e/19/f82e4af435a19b28bdbfba63f338ea20a264f4df4beaf8f2ab9bfa34072b/s3transfer-0.5.2.tar.gz" sha256 "95c58c194ce657a5f4fb0b9e60a84968c808888aed628cd98ab8771fe1db98ed" end resource "sarif-om" do url "https://files.pythonhosted.org/packages/ba/de/bbdd93fe456d4011500784657c5e4a31e3f4fcbb276255d4db1213aed78c/sarif_om-1.0.4.tar.gz" sha256 "cd5f416b3083e00d402a92e449a7ff67af46f11241073eea0461802a3b5aef98" end resource "sshpubkeys" do url "https://files.pythonhosted.org/packages/a3/b9/e5b76b4089007dcbe9a7e71b1976d3c0f27e7110a95a13daf9620856c220/sshpubkeys-3.3.1.tar.gz" sha256 "3020ed4f8c846849299370fbe98ff4157b0ccc1accec105e07cfa9ae4bb55064" end resource "urllib3" do url "https://files.pythonhosted.org/packages/1b/a5/4eab74853625505725cefdf168f48661b2cd04e7843ab836f3f63abf81da/urllib3-1.26.9.tar.gz" sha256 "aabaf16477806a5e1dd19aa41f8c2b7950dd3c746362d7e3223dbe6de6ac448e" end resource "websocket-client" do url "https://files.pythonhosted.org/packages/7c/de/9f5354b4b37df453b7d664f587124c70a75c81805095d491d39f5b591818/websocket-client-1.3.2.tar.gz" sha256 "50b21db0058f7a953d67cc0445be4b948d7fc196ecbeb8083d68d94628e4abf6" end resource "Werkzeug" do url "https://files.pythonhosted.org/packages/10/cf/97eb1a3847c01ae53e8376bc21145555ac95279523a935963dc8ff96c50b/Werkzeug-2.1.2.tar.gz" sha256 "1ce08e8093ed67d638d63879fd1ba3735817f7a80de3674d293f5984f25fb6e6" end resource "wrapt" do url "https://files.pythonhosted.org/packages/11/eb/e06e77394d6cf09977d92bff310cb0392930c08a338f99af6066a5a98f92/wrapt-1.14.1.tar.gz" sha256 "380a85cf89e0e69b7cfbe2ea9f765f004ff419f34194018a6827ac0e3edfed4d" end resource "xmltodict" do url "https://files.pythonhosted.org/packages/39/0d/40df5be1e684bbaecdb9d1e0e40d5d482465de6b00cbb92b84ee5d243c7f/xmltodict-0.13.0.tar.gz" sha256 "341595a488e3e01a85a9d8911d8912fd922ede5fecc4dce437eb4b6c8d037e56" end def install virtualenv_install_with_resources end service do run [opt_bin/"moto_server"] keep_alive true working_dir var log_path var/"log/moto.log" error_log_path var/"log/moto.log" end test do port = free_port pid = fork do exec bin/"moto_server", "--port=#{port}" end # keep trying to connect until the server is up curl_cmd = "curl --silent 127.0.0.1:#{port}/" ohai curl_cmd output = "" exitstatus = 7 loop do sleep 1 output = `#{curl_cmd}` exitstatus = $CHILD_STATUS.exitstatus break if exitstatus != 7 # CURLE_COULDNT_CONNECT end assert_equal exitstatus, 0 expected_output = <<~EOS <ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01"><Owner><ID>bcaf1ffd86f41161ca5fb16fd081034f</ID><DisplayName>webfile</DisplayName></Owner><Buckets></Buckets></ListAllMyBucketsResult> EOS assert_equal expected_output.strip, output.strip ensure Process.kill "TERM", pid Process.wait pid end end moto: update 3.1.11 bottle. class Moto < Formula include Language::Python::Virtualenv desc "Mock AWS services" homepage "http://getmoto.org/" url "https://files.pythonhosted.org/packages/eb/84/186db078f0ae23bec3cf0015ac648473ffddde44fa4002284b99f63b2e3e/moto-3.1.11.tar.gz" sha256 "1b0c472f4b7401775a92e63fbcfa26112a00e087b9f6edda12202a39c62c6181" license "Apache-2.0" bottle do sha256 cellar: :any, arm64_monterey: "f99e226e2784c6fa2e66ca54b7cfb36d59ce7ba534102c79f3793a7c32ee15f5" sha256 cellar: :any, arm64_big_sur: "a2a7980921cd19e3788fb8e65996bc21ef9e1b91de67bcebdea41add0b1ba4ef" sha256 cellar: :any, monterey: "50429662c8c8d2e084c1b980295084d49570ce6ac563db525c34e0fe96982c76" sha256 cellar: :any, big_sur: "26a8133768b4a98306c31e62e105a4736546591bb637b0978f6e62b989570136" sha256 cellar: :any, catalina: "2964a84c059c59ce4a702e393ba6b216ee07d25451e6a2a27f4f2e1f2c0eb5be" sha256 cellar: :any_skip_relocation, x86_64_linux: "8668b1607921cda7455eb0a26552e61f5670f8a033718c3624455053a7a8bf16" end depends_on "rust" => :build # for cryptography depends_on "python@3.10" depends_on "six" resource "attrs" do url "https://files.pythonhosted.org/packages/d7/77/ebb15fc26d0f815839ecd897b919ed6d85c050feeb83e100e020df9153d2/attrs-21.4.0.tar.gz" sha256 "626ba8234211db98e869df76230a137c4c40a12d72445c45d5f5b716f076e2fd" end resource "aws-sam-translator" do url "https://files.pythonhosted.org/packages/b1/ce/402ea474888505f956bba9a5b224d2662d5a4071925ad38079eb3506bd90/aws-sam-translator-1.45.0.tar.gz" sha256 "bf321ab62aa1731d3e471fd55de6f5d1ab07dfc169cd254aa523dd9ad30246f9" end resource "aws-xray-sdk" do url "https://files.pythonhosted.org/packages/49/26/927206007f1ac57b0801046dc9baed8df9ccbdc7622b79bdaf0c193e8051/aws-xray-sdk-2.9.0.tar.gz" sha256 "b0cd972db218d4d8f7b53ad806fc6184626b924c4997ae58fc9f2a8cd1281568" end resource "boto3" do url "https://files.pythonhosted.org/packages/04/dd/c32878e575c1c67c5f732c0f8a36e50a7dcd79b37e964a13e10b68582e63/boto3-1.23.10.tar.gz" sha256 "2a4395e3241c20eef441d7443a5e6eaa0ee3f7114653fb9d9cef41587526f7bd" end resource "botocore" do url "https://files.pythonhosted.org/packages/af/c8/37c491b2a4198943e74d6a1792f1a18a70fd0e0e40a9cb0694cc7751a342/botocore-1.26.10.tar.gz" sha256 "5df2cf7ebe34377470172bd0bbc582cf98c5cbd02da0909a14e9e2885ab3ae9c" end resource "certifi" do url "https://files.pythonhosted.org/packages/07/10/75277f313d13a2b74fc56e29239d5c840c2bf09f17bf25c02b35558812c6/certifi-2022.5.18.1.tar.gz" sha256 "9c5705e395cd70084351dd8ad5c41e65655e08ce46f2ec9cf6c2c08390f71eb7" end resource "cffi" do url "https://files.pythonhosted.org/packages/00/9e/92de7e1217ccc3d5f352ba21e52398372525765b2e0c4530e6eb2ba9282a/cffi-1.15.0.tar.gz" sha256 "920f0d66a896c2d99f0adbb391f990a84091179542c205fa53ce5787aff87954" end resource "cfn-lint" do url "https://files.pythonhosted.org/packages/fa/92/8e1f7db6d746f02ab36fe2918c51aefa8fadd74ca73c3917a8b9c12992f8/cfn-lint-0.60.1.tar.gz" sha256 "834b7cc7e7211c02dbe9fa3e0fafa035d16af2fe806977afb6d00666022b133e" end resource "charset-normalizer" do url "https://files.pythonhosted.org/packages/56/31/7bcaf657fafb3c6db8c787a865434290b726653c912085fbd371e9b92e1c/charset-normalizer-2.0.12.tar.gz" sha256 "2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597" end resource "click" do url "https://files.pythonhosted.org/packages/59/87/84326af34517fca8c58418d148f2403df25303e02736832403587318e9e8/click-8.1.3.tar.gz" sha256 "7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e" end resource "cryptography" do url "https://files.pythonhosted.org/packages/51/05/bb2b681f6a77276fc423d04187c39dafdb65b799c8d87b62ca82659f9ead/cryptography-37.0.2.tar.gz" sha256 "f224ad253cc9cea7568f49077007d2263efa57396a2f2f78114066fd54b5c68e" end resource "docker" do url "https://files.pythonhosted.org/packages/ab/d2/45ea0ee13c6cffac96c32ac36db0299932447a736660537ec31ec3a6d877/docker-5.0.3.tar.gz" sha256 "d916a26b62970e7c2f554110ed6af04c7ccff8e9f81ad17d0d40c75637e227fb" end resource "ecdsa" do url "https://files.pythonhosted.org/packages/bf/3d/3d909532ad541651390bf1321e097404cbd39d1d89c2046f42a460220fb3/ecdsa-0.17.0.tar.gz" sha256 "b9f500bb439e4153d0330610f5d26baaf18d17b8ced1bc54410d189385ea68aa" end resource "Flask" do url "https://files.pythonhosted.org/packages/d3/3c/94f38d4db919a9326a706ad56f05a7e6f0c8f7b7d93e2997cca54d3bc14b/Flask-2.1.2.tar.gz" sha256 "315ded2ddf8a6281567edb27393010fe3406188bafbfe65a3339d5787d89e477" end resource "Flask-Cors" do url "https://files.pythonhosted.org/packages/cf/25/e3b2553d22ed542be807739556c69621ad2ab276ae8d5d2560f4ed20f652/Flask-Cors-3.0.10.tar.gz" sha256 "b60839393f3b84a0f3746f6cdca56c1ad7426aa738b70d6c61375857823181de" end resource "future" do url "https://files.pythonhosted.org/packages/45/0b/38b06fd9b92dc2b68d58b75f900e97884c45bedd2ff83203d933cf5851c9/future-0.18.2.tar.gz" sha256 "b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d" end resource "graphql-core" do url "https://files.pythonhosted.org/packages/61/9e/798c1cfc5b03e98f068a793c2d2f1fd94f76ba50521f3812ff1a4e3c29d2/graphql-core-3.2.1.tar.gz" sha256 "9d1bf141427b7d54be944587c8349df791ce60ade2e3cccaf9c56368c133c201" end resource "idna" do url "https://files.pythonhosted.org/packages/62/08/e3fc7c8161090f742f504f40b1bccbfc544d4a4e09eb774bf40aafce5436/idna-3.3.tar.gz" sha256 "9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d" end resource "itsdangerous" do url "https://files.pythonhosted.org/packages/7f/a1/d3fb83e7a61fa0c0d3d08ad0a94ddbeff3731c05212617dff3a94e097f08/itsdangerous-2.1.2.tar.gz" sha256 "5dbbc68b317e5e42f327f9021763545dc3fc3bfe22e6deb96aaf1fc38874156a" end resource "Jinja2" do url "https://files.pythonhosted.org/packages/7a/ff/75c28576a1d900e87eb6335b063fab47a8ef3c8b4d88524c4bf78f670cce/Jinja2-3.1.2.tar.gz" sha256 "31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852" end resource "jmespath" do url "https://files.pythonhosted.org/packages/06/7e/44686b986ef9ca6069db224651baaa8300b93af2a085a5b135997bf659b3/jmespath-1.0.0.tar.gz" sha256 "a490e280edd1f57d6de88636992d05b71e97d69a26a19f058ecf7d304474bf5e" end resource "jschema-to-python" do url "https://files.pythonhosted.org/packages/1d/7f/5ae3d97ddd86ec33323231d68453afd504041efcfd4f4dde993196606849/jschema_to_python-1.2.3.tar.gz" sha256 "76ff14fe5d304708ccad1284e4b11f96a658949a31ee7faed9e0995279549b91" end resource "jsondiff" do url "https://files.pythonhosted.org/packages/dd/13/2b691afe0a90fb930a32b8fc1b0fd6b5bdeaed459a32c5a58dc6654342da/jsondiff-2.0.0.tar.gz" sha256 "2795844ef075ec8a2b8d385c4d59f5ea48b08e7180fce3cb2787be0db00b1fb4" end resource "jsonpatch" do url "https://files.pythonhosted.org/packages/21/67/83452af2a6db7c4596d1e2ecaa841b9a900980103013b867f2865e5e1cf0/jsonpatch-1.32.tar.gz" sha256 "b6ddfe6c3db30d81a96aaeceb6baf916094ffa23d7dd5fa2c13e13f8b6e600c2" end resource "jsonpickle" do url "https://files.pythonhosted.org/packages/65/09/50bc3aabaeba15b319737560b41f3b6acddf6f10011b9869c796683886aa/jsonpickle-2.2.0.tar.gz" sha256 "7b272918b0554182e53dc340ddd62d9b7f902fec7e7b05620c04f3ccef479a0e" end resource "jsonpointer" do url "https://files.pythonhosted.org/packages/a0/6c/c52556b957a0f904e7c45585444feef206fe5cb1ff656303a1d6d922a53b/jsonpointer-2.3.tar.gz" sha256 "97cba51526c829282218feb99dab1b1e6bdf8efd1c43dc9d57be093c0d69c99a" end resource "jsonschema" do url "https://files.pythonhosted.org/packages/69/11/a69e2a3c01b324a77d3a7c0570faa372e8448b666300c4117a516f8b1212/jsonschema-3.2.0.tar.gz" sha256 "c8a85b28d377cc7737e46e2d9f2b4f44ee3c0e1deac6bf46ddefc7187d30797a" end resource "junit-xml-2" do url "https://files.pythonhosted.org/packages/4d/f2/a99adf9deb57949b81ff8e113edf971da1840251794a6f4184d61faa5a65/junit-xml-2-1.9.tar.gz" sha256 "3b8d9635c5215f754c7807104f6493e3ea3bc9481e2d33db294560da3a1b00f7" end resource "MarkupSafe" do url "https://files.pythonhosted.org/packages/1d/97/2288fe498044284f39ab8950703e88abbac2abbdf65524d576157af70556/MarkupSafe-2.1.1.tar.gz" sha256 "7f91197cc9e48f989d12e4e6fbc46495c446636dfc81b9ccf50bb0ec74b91d4b" end resource "networkx" do url "https://files.pythonhosted.org/packages/4a/e2/1f9d6cf8562cf2bde58c102db70fe48d2d9652ec256f86bab6b279601b0d/networkx-2.8.2.tar.gz" sha256 "ae99c9b0d35e5b4a62cf1cfea01e5b3633d8d02f4a0ead69685b6e7de5b85eab" end resource "openapi-schema-validator" do url "https://files.pythonhosted.org/packages/69/0d/7ec64ebe984c6c0bb3fe239775bed72c94bcdcf954d091c2565eaf613445/openapi-schema-validator-0.2.3.tar.gz" sha256 "2c64907728c3ef78e23711c8840a423f0b241588c9ed929855e4b2d1bb0cf5f2" end resource "openapi-spec-validator" do url "https://files.pythonhosted.org/packages/37/41/199441b0ae1f9522ce511fd65cbcd9e8634aed733bd0ab2a9235fe29dec6/openapi-spec-validator-0.4.0.tar.gz" sha256 "97f258850afc97b048f7c2653855e0f88fa66ac103c2be5077c7960aca2ad49a" end resource "pbr" do url "https://files.pythonhosted.org/packages/96/9f/f4bc832eeb4ae723b86372277da56a5643b0ad472a95314e8f516a571bb0/pbr-5.9.0.tar.gz" sha256 "e8dca2f4b43560edef58813969f52a56cef023146cbb8931626db80e6c1c4308" end resource "pyasn1" do url "https://files.pythonhosted.org/packages/a4/db/fffec68299e6d7bad3d504147f9094830b704527a7fc098b721d38cc7fa7/pyasn1-0.4.8.tar.gz" sha256 "aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba" end resource "pycparser" do url "https://files.pythonhosted.org/packages/5e/0b/95d387f5f4433cb0f53ff7ad859bd2c6051051cebbb564f139a999ab46de/pycparser-2.21.tar.gz" sha256 "e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206" end resource "pyparsing" do url "https://files.pythonhosted.org/packages/71/22/207523d16464c40a0310d2d4d8926daffa00ac1f5b1576170a32db749636/pyparsing-3.0.9.tar.gz" sha256 "2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb" end resource "pyrsistent" do url "https://files.pythonhosted.org/packages/42/ac/455fdc7294acc4d4154b904e80d964cc9aae75b087bbf486be04df9f2abd/pyrsistent-0.18.1.tar.gz" sha256 "d4d61f8b993a7255ba714df3aca52700f8125289f84f704cf80916517c46eb96" end resource "python-dateutil" do url "https://files.pythonhosted.org/packages/4c/c4/13b4776ea2d76c115c1d1b84579f3764ee6d57204f6be27119f13a61d0a9/python-dateutil-2.8.2.tar.gz" sha256 "0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86" end resource "python-jose" do url "https://files.pythonhosted.org/packages/e4/19/b2c86504116dc5f0635d29f802da858404d77d930a25633d2e86a64a35b3/python-jose-3.3.0.tar.gz" sha256 "55779b5e6ad599c6336191246e95eb2293a9ddebd555f796a65f838f07e5d78a" end resource "pytz" do url "https://files.pythonhosted.org/packages/2f/5f/a0f653311adff905bbcaa6d3dfaf97edcf4d26138393c6ccd37a484851fb/pytz-2022.1.tar.gz" sha256 "1e760e2fe6a8163bc0b3d9a19c4f84342afa0a2affebfaa84b01b978a02ecaa7" end resource "PyYAML" do url "https://files.pythonhosted.org/packages/36/2b/61d51a2c4f25ef062ae3f74576b01638bebad5e045f747ff12643df63844/PyYAML-6.0.tar.gz" sha256 "68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2" end resource "requests" do url "https://files.pythonhosted.org/packages/60/f3/26ff3767f099b73e0efa138a9998da67890793bfa475d8278f84a30fec77/requests-2.27.1.tar.gz" sha256 "68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61" end resource "responses" do url "https://files.pythonhosted.org/packages/6d/db/b949a6bf2a75c64caea0a6b39d05e433aa2e51bea78ae9d5dda1110b31a5/responses-0.21.0.tar.gz" sha256 "b82502eb5f09a0289d8e209e7bad71ef3978334f56d09b444253d5ad67bf5253" end resource "rsa" do url "https://files.pythonhosted.org/packages/8c/ee/4022542e0fed77dd6ddade38e1e4dea3299f873b7fd4e6d78319953b0f83/rsa-4.8.tar.gz" sha256 "5c6bd9dc7a543b7fe4304a631f8a8a3b674e2bbfc49c2ae96200cdbe55df6b17" end resource "s3transfer" do url "https://files.pythonhosted.org/packages/7e/19/f82e4af435a19b28bdbfba63f338ea20a264f4df4beaf8f2ab9bfa34072b/s3transfer-0.5.2.tar.gz" sha256 "95c58c194ce657a5f4fb0b9e60a84968c808888aed628cd98ab8771fe1db98ed" end resource "sarif-om" do url "https://files.pythonhosted.org/packages/ba/de/bbdd93fe456d4011500784657c5e4a31e3f4fcbb276255d4db1213aed78c/sarif_om-1.0.4.tar.gz" sha256 "cd5f416b3083e00d402a92e449a7ff67af46f11241073eea0461802a3b5aef98" end resource "sshpubkeys" do url "https://files.pythonhosted.org/packages/a3/b9/e5b76b4089007dcbe9a7e71b1976d3c0f27e7110a95a13daf9620856c220/sshpubkeys-3.3.1.tar.gz" sha256 "3020ed4f8c846849299370fbe98ff4157b0ccc1accec105e07cfa9ae4bb55064" end resource "urllib3" do url "https://files.pythonhosted.org/packages/1b/a5/4eab74853625505725cefdf168f48661b2cd04e7843ab836f3f63abf81da/urllib3-1.26.9.tar.gz" sha256 "aabaf16477806a5e1dd19aa41f8c2b7950dd3c746362d7e3223dbe6de6ac448e" end resource "websocket-client" do url "https://files.pythonhosted.org/packages/7c/de/9f5354b4b37df453b7d664f587124c70a75c81805095d491d39f5b591818/websocket-client-1.3.2.tar.gz" sha256 "50b21db0058f7a953d67cc0445be4b948d7fc196ecbeb8083d68d94628e4abf6" end resource "Werkzeug" do url "https://files.pythonhosted.org/packages/10/cf/97eb1a3847c01ae53e8376bc21145555ac95279523a935963dc8ff96c50b/Werkzeug-2.1.2.tar.gz" sha256 "1ce08e8093ed67d638d63879fd1ba3735817f7a80de3674d293f5984f25fb6e6" end resource "wrapt" do url "https://files.pythonhosted.org/packages/11/eb/e06e77394d6cf09977d92bff310cb0392930c08a338f99af6066a5a98f92/wrapt-1.14.1.tar.gz" sha256 "380a85cf89e0e69b7cfbe2ea9f765f004ff419f34194018a6827ac0e3edfed4d" end resource "xmltodict" do url "https://files.pythonhosted.org/packages/39/0d/40df5be1e684bbaecdb9d1e0e40d5d482465de6b00cbb92b84ee5d243c7f/xmltodict-0.13.0.tar.gz" sha256 "341595a488e3e01a85a9d8911d8912fd922ede5fecc4dce437eb4b6c8d037e56" end def install virtualenv_install_with_resources end service do run [opt_bin/"moto_server"] keep_alive true working_dir var log_path var/"log/moto.log" error_log_path var/"log/moto.log" end test do port = free_port pid = fork do exec bin/"moto_server", "--port=#{port}" end # keep trying to connect until the server is up curl_cmd = "curl --silent 127.0.0.1:#{port}/" ohai curl_cmd output = "" exitstatus = 7 loop do sleep 1 output = `#{curl_cmd}` exitstatus = $CHILD_STATUS.exitstatus break if exitstatus != 7 # CURLE_COULDNT_CONNECT end assert_equal exitstatus, 0 expected_output = <<~EOS <ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01"><Owner><ID>bcaf1ffd86f41161ca5fb16fd081034f</ID><DisplayName>webfile</DisplayName></Owner><Buckets></Buckets></ListAllMyBucketsResult> EOS assert_equal expected_output.strip, output.strip ensure Process.kill "TERM", pid Process.wait pid end end
class Moto < Formula include Language::Python::Virtualenv desc "Mock AWS services" homepage "http://getmoto.org/" url "https://files.pythonhosted.org/packages/7d/f5/a59e6c586ee3e22992b43a8ba162aad45f4da83eacfc11851cac4591365b/moto-3.0.5.tar.gz" sha256 "85f2ece0ad0305aa13a39139ce648ab3afe1c04cb32ac1db8d5e5e9117d4d10e" license "Apache-2.0" bottle do sha256 cellar: :any, arm64_monterey: "fc504b7104bdcdc7166d60ac1a98ff24040965b959048dac4683b300aa395293" sha256 cellar: :any, arm64_big_sur: "4fd070b1a01c697c2d44924b5450568ddc80e30649be33fef1f6478925c1d8ec" sha256 cellar: :any, monterey: "b21a1af03a730dc9e8277bfe7ea462d5849ea7decddc0123c25e864c8db9270e" sha256 cellar: :any, big_sur: "61ac83c456ecb91a59f1c90f49a6582746daf7a68a0fe2c95c43fd4ad2300d4c" sha256 cellar: :any, catalina: "ab69d7170e6588684d6bbb28c536c3196afa66f467b125df1d64d79dfd52b9a1" sha256 cellar: :any_skip_relocation, x86_64_linux: "9aeeaab0f80222c7edaeba5cebd2a7e60954eb69caa914c23f163c381de2b868" end depends_on "rust" => :build # for cryptography depends_on "python@3.10" depends_on "six" resource "attrs" do url "https://files.pythonhosted.org/packages/d7/77/ebb15fc26d0f815839ecd897b919ed6d85c050feeb83e100e020df9153d2/attrs-21.4.0.tar.gz" sha256 "626ba8234211db98e869df76230a137c4c40a12d72445c45d5f5b716f076e2fd" end resource "aws-sam-translator" do url "https://files.pythonhosted.org/packages/f2/76/2b5c76cc8ae4d3373a793059b2073af1bb5f37189532dacd4788d2d142d3/aws-sam-translator-1.42.0.tar.gz" sha256 "8a7976c0ee2fca004a590e17d3551a49c8d8ba14ed0cb3674ea270d41d0dcd5b" end resource "aws-xray-sdk" do url "https://files.pythonhosted.org/packages/49/26/927206007f1ac57b0801046dc9baed8df9ccbdc7622b79bdaf0c193e8051/aws-xray-sdk-2.9.0.tar.gz" sha256 "b0cd972db218d4d8f7b53ad806fc6184626b924c4997ae58fc9f2a8cd1281568" end resource "boto3" do url "https://files.pythonhosted.org/packages/bd/c5/beaf8233d437106d84be4cabaca840d565f213c6053f93a0bf7fab166642/boto3-1.21.8.tar.gz" sha256 "f2ce641957c1782e382548ced4a447189e45851bbe58c1f6752ff2b661527de7" end resource "botocore" do url "https://files.pythonhosted.org/packages/d5/1a/46a4f7676b15abb03d830724c1567dd0e1d13b7f33903a0a8cbe25d32d97/botocore-1.24.8.tar.gz" sha256 "a5431d806dc75fb1844463d921759fcd8d387674443af8d7fd0867f296b02759" end resource "certifi" do url "https://files.pythonhosted.org/packages/6c/ae/d26450834f0acc9e3d1f74508da6df1551ceab6c2ce0766a593362d6d57f/certifi-2021.10.8.tar.gz" sha256 "78884e7c1d4b00ce3cea67b44566851c4343c120abd683433ce934a68ea58872" end resource "cffi" do url "https://files.pythonhosted.org/packages/00/9e/92de7e1217ccc3d5f352ba21e52398372525765b2e0c4530e6eb2ba9282a/cffi-1.15.0.tar.gz" sha256 "920f0d66a896c2d99f0adbb391f990a84091179542c205fa53ce5787aff87954" end resource "cfn-lint" do url "https://files.pythonhosted.org/packages/ba/82/70a44ade5615b8b0482b46535d4cbe76366f99c48a94c4fc6c1fccb7bf42/cfn-lint-0.58.2.tar.gz" sha256 "484484e0a849b4f5d621bc55b1af7b46104370a2c1629b49376ab8281787e9eb" end resource "charset-normalizer" do url "https://files.pythonhosted.org/packages/56/31/7bcaf657fafb3c6db8c787a865434290b726653c912085fbd371e9b92e1c/charset-normalizer-2.0.12.tar.gz" sha256 "2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597" end resource "click" do url "https://files.pythonhosted.org/packages/dd/cf/706c1ad49ab26abed0b77a2f867984c1341ed7387b8030a6aa914e2942a0/click-8.0.4.tar.gz" sha256 "8458d7b1287c5fb128c90e23381cf99dcde74beaf6c7ff6384ce84d6fe090adb" end resource "cryptography" do url "https://files.pythonhosted.org/packages/f9/4b/1cf8e281f7ae4046a59e5e39dd7471d46db9f61bb564fddbff9084c4334f/cryptography-36.0.1.tar.gz" sha256 "53e5c1dc3d7a953de055d77bef2ff607ceef7a2aac0353b5d630ab67f7423638" end resource "docker" do url "https://files.pythonhosted.org/packages/ab/d2/45ea0ee13c6cffac96c32ac36db0299932447a736660537ec31ec3a6d877/docker-5.0.3.tar.gz" sha256 "d916a26b62970e7c2f554110ed6af04c7ccff8e9f81ad17d0d40c75637e227fb" end resource "ecdsa" do url "https://files.pythonhosted.org/packages/bf/3d/3d909532ad541651390bf1321e097404cbd39d1d89c2046f42a460220fb3/ecdsa-0.17.0.tar.gz" sha256 "b9f500bb439e4153d0330610f5d26baaf18d17b8ced1bc54410d189385ea68aa" end resource "Flask" do url "https://files.pythonhosted.org/packages/84/9d/66347e6b3e2eb78647392d3969c23bdc2d8b2fdc32bd078c817c15cb81ad/Flask-2.0.3.tar.gz" sha256 "e1120c228ca2f553b470df4a5fa927ab66258467526069981b3eb0a91902687d" end resource "Flask-Cors" do url "https://files.pythonhosted.org/packages/cf/25/e3b2553d22ed542be807739556c69621ad2ab276ae8d5d2560f4ed20f652/Flask-Cors-3.0.10.tar.gz" sha256 "b60839393f3b84a0f3746f6cdca56c1ad7426aa738b70d6c61375857823181de" end resource "future" do url "https://files.pythonhosted.org/packages/45/0b/38b06fd9b92dc2b68d58b75f900e97884c45bedd2ff83203d933cf5851c9/future-0.18.2.tar.gz" sha256 "b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d" end resource "graphql-core" do url "https://files.pythonhosted.org/packages/0c/15/0e13d80b86cca5c1bd1d311344f5d1eabe036e5a472a38f0048d68cce40d/graphql-core-3.2.0.tar.gz" sha256 "86e2a0be008bfde19ef78388de8a725a1d942a9190ca431c24a60837973803ce" end resource "idna" do url "https://files.pythonhosted.org/packages/62/08/e3fc7c8161090f742f504f40b1bccbfc544d4a4e09eb774bf40aafce5436/idna-3.3.tar.gz" sha256 "9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d" end resource "itsdangerous" do url "https://files.pythonhosted.org/packages/82/00/89037083314067f1605233f6f30b94fdddc89d18e283b30b0c5be9e7f801/itsdangerous-2.1.0.tar.gz" sha256 "d848fcb8bc7d507c4546b448574e8a44fc4ea2ba84ebf8d783290d53e81992f5" end resource "Jinja2" do url "https://files.pythonhosted.org/packages/91/a5/429efc6246119e1e3fbf562c00187d04e83e54619249eb732bb423efa6c6/Jinja2-3.0.3.tar.gz" sha256 "611bb273cd68f3b993fabdc4064fc858c5b47a973cb5aa7999ec1ba405c87cd7" end resource "jmespath" do url "https://files.pythonhosted.org/packages/3c/56/3f325b1eef9791759784aa5046a8f6a1aff8f7c898a2e34506771d3b99d8/jmespath-0.10.0.tar.gz" sha256 "b85d0567b8666149a93172712e68920734333c0ce7e89b78b3e987f71e5ed4f9" end resource "jschema-to-python" do url "https://files.pythonhosted.org/packages/1d/7f/5ae3d97ddd86ec33323231d68453afd504041efcfd4f4dde993196606849/jschema_to_python-1.2.3.tar.gz" sha256 "76ff14fe5d304708ccad1284e4b11f96a658949a31ee7faed9e0995279549b91" end resource "jsondiff" do url "https://files.pythonhosted.org/packages/21/c6/57158093587de0ab578da6f27467e00b037d63b3538204fc27860d427144/jsondiff-1.3.1.tar.gz" sha256 "04cfaebd4a5e5738948ab615710dc3ee98efbdf851255fd3977c4c2ee59e7312" end resource "jsonpatch" do url "https://files.pythonhosted.org/packages/21/67/83452af2a6db7c4596d1e2ecaa841b9a900980103013b867f2865e5e1cf0/jsonpatch-1.32.tar.gz" sha256 "b6ddfe6c3db30d81a96aaeceb6baf916094ffa23d7dd5fa2c13e13f8b6e600c2" end resource "jsonpickle" do url "https://files.pythonhosted.org/packages/35/0e/fe3ce0869add0213a1b45eef746cafb79ca45255a60ec918630c159e3490/jsonpickle-2.1.0.tar.gz" sha256 "84684cfc5338a534173c8dd69809e40f2865d0be1f8a2b7af8465e5b968dcfa9" end resource "jsonpointer" do url "https://files.pythonhosted.org/packages/29/7f/e6b5930e6dd1f461ad412dfc40bc94e5235011f6bbf73cafa8074617c203/jsonpointer-2.2.tar.gz" sha256 "f09f8deecaaa5aea65b5eb4f67ca4e54e1a61f7a11c75085e360fe6feb6a48bf" end resource "jsonschema" do url "https://files.pythonhosted.org/packages/69/11/a69e2a3c01b324a77d3a7c0570faa372e8448b666300c4117a516f8b1212/jsonschema-3.2.0.tar.gz" sha256 "c8a85b28d377cc7737e46e2d9f2b4f44ee3c0e1deac6bf46ddefc7187d30797a" end resource "junit-xml-2" do url "https://files.pythonhosted.org/packages/4d/f2/a99adf9deb57949b81ff8e113edf971da1840251794a6f4184d61faa5a65/junit-xml-2-1.9.tar.gz" sha256 "3b8d9635c5215f754c7807104f6493e3ea3bc9481e2d33db294560da3a1b00f7" end resource "MarkupSafe" do url "https://files.pythonhosted.org/packages/62/0f/52c009332fdadd484e898dc8f2acca0663c1031b3517070fd34ad9c1b64e/MarkupSafe-2.1.0.tar.gz" sha256 "80beaf63ddfbc64a0452b841d8036ca0611e049650e20afcb882f5d3c266d65f" end resource "networkx" do url "https://files.pythonhosted.org/packages/97/ae/7497bc5e1c84af95e585e3f98585c9f06c627fac6340984c4243053e8f44/networkx-2.6.3.tar.gz" sha256 "c0946ed31d71f1b732b5aaa6da5a0388a345019af232ce2f49c766e2d6795c51" end resource "pbr" do url "https://files.pythonhosted.org/packages/51/da/eb358ed53257a864bf9deafba25bc3d6b8d41b0db46da4e7317500b1c9a5/pbr-5.8.1.tar.gz" sha256 "66bc5a34912f408bb3925bf21231cb6f59206267b7f63f3503ef865c1a292e25" end resource "pyasn1" do url "https://files.pythonhosted.org/packages/a4/db/fffec68299e6d7bad3d504147f9094830b704527a7fc098b721d38cc7fa7/pyasn1-0.4.8.tar.gz" sha256 "aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba" end resource "pycparser" do url "https://files.pythonhosted.org/packages/5e/0b/95d387f5f4433cb0f53ff7ad859bd2c6051051cebbb564f139a999ab46de/pycparser-2.21.tar.gz" sha256 "e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206" end resource "pyrsistent" do url "https://files.pythonhosted.org/packages/42/ac/455fdc7294acc4d4154b904e80d964cc9aae75b087bbf486be04df9f2abd/pyrsistent-0.18.1.tar.gz" sha256 "d4d61f8b993a7255ba714df3aca52700f8125289f84f704cf80916517c46eb96" end resource "python-dateutil" do url "https://files.pythonhosted.org/packages/4c/c4/13b4776ea2d76c115c1d1b84579f3764ee6d57204f6be27119f13a61d0a9/python-dateutil-2.8.2.tar.gz" sha256 "0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86" end resource "python-jose" do url "https://files.pythonhosted.org/packages/e4/19/b2c86504116dc5f0635d29f802da858404d77d930a25633d2e86a64a35b3/python-jose-3.3.0.tar.gz" sha256 "55779b5e6ad599c6336191246e95eb2293a9ddebd555f796a65f838f07e5d78a" end resource "pytz" do url "https://files.pythonhosted.org/packages/e3/8e/1cde9d002f48a940b9d9d38820aaf444b229450c0854bdf15305ce4a3d1a/pytz-2021.3.tar.gz" sha256 "acad2d8b20a1af07d4e4c9d2e9285c5ed9104354062f275f3fcd88dcef4f1326" end resource "PyYAML" do url "https://files.pythonhosted.org/packages/36/2b/61d51a2c4f25ef062ae3f74576b01638bebad5e045f747ff12643df63844/PyYAML-6.0.tar.gz" sha256 "68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2" end resource "requests" do url "https://files.pythonhosted.org/packages/60/f3/26ff3767f099b73e0efa138a9998da67890793bfa475d8278f84a30fec77/requests-2.27.1.tar.gz" sha256 "68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61" end resource "responses" do url "https://files.pythonhosted.org/packages/03/a5/186653e51cb20fe3ac793403334d4d077fbb7bb18a9c5c2fce8304d5a2e2/responses-0.18.0.tar.gz" sha256 "380cad4c1c1dc942e5e8a8eaae0b4d4edf708f4f010db8b7bcfafad1fcd254ff" end resource "rsa" do url "https://files.pythonhosted.org/packages/8c/ee/4022542e0fed77dd6ddade38e1e4dea3299f873b7fd4e6d78319953b0f83/rsa-4.8.tar.gz" sha256 "5c6bd9dc7a543b7fe4304a631f8a8a3b674e2bbfc49c2ae96200cdbe55df6b17" end resource "s3transfer" do url "https://files.pythonhosted.org/packages/7e/19/f82e4af435a19b28bdbfba63f338ea20a264f4df4beaf8f2ab9bfa34072b/s3transfer-0.5.2.tar.gz" sha256 "95c58c194ce657a5f4fb0b9e60a84968c808888aed628cd98ab8771fe1db98ed" end resource "sarif-om" do url "https://files.pythonhosted.org/packages/ba/de/bbdd93fe456d4011500784657c5e4a31e3f4fcbb276255d4db1213aed78c/sarif_om-1.0.4.tar.gz" sha256 "cd5f416b3083e00d402a92e449a7ff67af46f11241073eea0461802a3b5aef98" end resource "sshpubkeys" do url "https://files.pythonhosted.org/packages/a3/b9/e5b76b4089007dcbe9a7e71b1976d3c0f27e7110a95a13daf9620856c220/sshpubkeys-3.3.1.tar.gz" sha256 "3020ed4f8c846849299370fbe98ff4157b0ccc1accec105e07cfa9ae4bb55064" end resource "urllib3" do url "https://files.pythonhosted.org/packages/b0/b1/7bbf5181f8e3258efae31702f5eab87d8a74a72a0aa78bc8c08c1466e243/urllib3-1.26.8.tar.gz" sha256 "0e7c33d9a63e7ddfcb86780aac87befc2fbddf46c58dbb487e0855f7ceec283c" end resource "websocket-client" do url "https://files.pythonhosted.org/packages/8d/12/cd10d050f7714ccc675b486cdcbbaed54c782a5b77da2bb82e5c7b31fb40/websocket-client-1.3.1.tar.gz" sha256 "6278a75065395418283f887de7c3beafb3aa68dada5cacbe4b214e8d26da499b" end resource "Werkzeug" do url "https://files.pythonhosted.org/packages/6c/a8/60514fade2318e277453c9588545d0c335ea3ea6440ce5cdabfca7f73117/Werkzeug-2.0.3.tar.gz" sha256 "b863f8ff057c522164b6067c9e28b041161b4be5ba4d0daceeaa50a163822d3c" end resource "wrapt" do url "https://files.pythonhosted.org/packages/eb/f6/d81ccf43ac2a3c80ddb6647653ac8b53ce2d65796029369923be06b815b8/wrapt-1.13.3.tar.gz" sha256 "1fea9cd438686e6682271d36f3481a9f3636195578bab9ca3382e2f5f01fc185" end resource "xmltodict" do url "https://files.pythonhosted.org/packages/58/40/0d783e14112e064127063fbf5d1fe1351723e5dfe9d6daad346a305f6c49/xmltodict-0.12.0.tar.gz" sha256 "50d8c638ed7ecb88d90561beedbf720c9b4e851a9fa6c47ebd64e99d166d8a21" end def install virtualenv_install_with_resources end service do run [opt_bin/"moto_server"] keep_alive true working_dir var log_path var/"log/moto.log" error_log_path var/"log/moto.log" end test do port = free_port pid = fork do exec bin/"moto_server", "--port=#{port}" end # keep trying to connect until the server is up curl_cmd = "curl --silent 127.0.0.1:#{port}/" ohai curl_cmd output = "" exitstatus = 7 loop do sleep 1 output = `#{curl_cmd}` exitstatus = $CHILD_STATUS.exitstatus break if exitstatus != 7 # CURLE_COULDNT_CONNECT end assert_equal exitstatus, 0 expected_output = <<~EOS <ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01"><Owner><ID>bcaf1ffd86f41161ca5fb16fd081034f</ID><DisplayName>webfile</DisplayName></Owner><Buckets></Buckets></ListAllMyBucketsResult> EOS assert_equal expected_output.strip, output.strip ensure Process.kill "TERM", pid Process.wait pid end end moto 3.0.6 Closes #96355. Signed-off-by: Thierry Moisan <8bf87a6c4caed0437859f8c8fafc6782533e4540@gmail.com> Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com> class Moto < Formula include Language::Python::Virtualenv desc "Mock AWS services" homepage "http://getmoto.org/" url "https://files.pythonhosted.org/packages/c5/d0/6e42772040657ae8a88f05b95344315d1cd4774abfded68a03c3b8638737/moto-3.0.6.tar.gz" sha256 "53ab3b6647382f61ad5aef8351ccba3712fa9595b7826883e4a38a4ac5c9b5a7" license "Apache-2.0" bottle do sha256 cellar: :any, arm64_monterey: "fc504b7104bdcdc7166d60ac1a98ff24040965b959048dac4683b300aa395293" sha256 cellar: :any, arm64_big_sur: "4fd070b1a01c697c2d44924b5450568ddc80e30649be33fef1f6478925c1d8ec" sha256 cellar: :any, monterey: "b21a1af03a730dc9e8277bfe7ea462d5849ea7decddc0123c25e864c8db9270e" sha256 cellar: :any, big_sur: "61ac83c456ecb91a59f1c90f49a6582746daf7a68a0fe2c95c43fd4ad2300d4c" sha256 cellar: :any, catalina: "ab69d7170e6588684d6bbb28c536c3196afa66f467b125df1d64d79dfd52b9a1" sha256 cellar: :any_skip_relocation, x86_64_linux: "9aeeaab0f80222c7edaeba5cebd2a7e60954eb69caa914c23f163c381de2b868" end depends_on "rust" => :build # for cryptography depends_on "python@3.10" depends_on "six" resource "attrs" do url "https://files.pythonhosted.org/packages/d7/77/ebb15fc26d0f815839ecd897b919ed6d85c050feeb83e100e020df9153d2/attrs-21.4.0.tar.gz" sha256 "626ba8234211db98e869df76230a137c4c40a12d72445c45d5f5b716f076e2fd" end resource "aws-sam-translator" do url "https://files.pythonhosted.org/packages/f2/76/2b5c76cc8ae4d3373a793059b2073af1bb5f37189532dacd4788d2d142d3/aws-sam-translator-1.42.0.tar.gz" sha256 "8a7976c0ee2fca004a590e17d3551a49c8d8ba14ed0cb3674ea270d41d0dcd5b" end resource "aws-xray-sdk" do url "https://files.pythonhosted.org/packages/49/26/927206007f1ac57b0801046dc9baed8df9ccbdc7622b79bdaf0c193e8051/aws-xray-sdk-2.9.0.tar.gz" sha256 "b0cd972db218d4d8f7b53ad806fc6184626b924c4997ae58fc9f2a8cd1281568" end resource "boto3" do url "https://files.pythonhosted.org/packages/a4/1f/ab159d65cd9c4524945fe8ba776fd0bfa6b5325c5db7cb831f9ce4baee2f/boto3-1.21.13.tar.gz" sha256 "16fae86d0c4993fd5112128bb4622a879f02363bccd045153cc0bbd7722cc9a5" end resource "botocore" do url "https://files.pythonhosted.org/packages/d8/7c/31b6e0a0524dc4f92872cd4147f8a3ec80ef4ff7855feee443f89722430c/botocore-1.24.13.tar.gz" sha256 "46e51f56f1c5784e4245e036503635fa71b722775657b6e1acf21ec5b906974c" end resource "certifi" do url "https://files.pythonhosted.org/packages/6c/ae/d26450834f0acc9e3d1f74508da6df1551ceab6c2ce0766a593362d6d57f/certifi-2021.10.8.tar.gz" sha256 "78884e7c1d4b00ce3cea67b44566851c4343c120abd683433ce934a68ea58872" end resource "cffi" do url "https://files.pythonhosted.org/packages/00/9e/92de7e1217ccc3d5f352ba21e52398372525765b2e0c4530e6eb2ba9282a/cffi-1.15.0.tar.gz" sha256 "920f0d66a896c2d99f0adbb391f990a84091179542c205fa53ce5787aff87954" end resource "cfn-lint" do url "https://files.pythonhosted.org/packages/ba/82/70a44ade5615b8b0482b46535d4cbe76366f99c48a94c4fc6c1fccb7bf42/cfn-lint-0.58.2.tar.gz" sha256 "484484e0a849b4f5d621bc55b1af7b46104370a2c1629b49376ab8281787e9eb" end resource "charset-normalizer" do url "https://files.pythonhosted.org/packages/56/31/7bcaf657fafb3c6db8c787a865434290b726653c912085fbd371e9b92e1c/charset-normalizer-2.0.12.tar.gz" sha256 "2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597" end resource "click" do url "https://files.pythonhosted.org/packages/dd/cf/706c1ad49ab26abed0b77a2f867984c1341ed7387b8030a6aa914e2942a0/click-8.0.4.tar.gz" sha256 "8458d7b1287c5fb128c90e23381cf99dcde74beaf6c7ff6384ce84d6fe090adb" end resource "cryptography" do url "https://files.pythonhosted.org/packages/f9/4b/1cf8e281f7ae4046a59e5e39dd7471d46db9f61bb564fddbff9084c4334f/cryptography-36.0.1.tar.gz" sha256 "53e5c1dc3d7a953de055d77bef2ff607ceef7a2aac0353b5d630ab67f7423638" end resource "docker" do url "https://files.pythonhosted.org/packages/ab/d2/45ea0ee13c6cffac96c32ac36db0299932447a736660537ec31ec3a6d877/docker-5.0.3.tar.gz" sha256 "d916a26b62970e7c2f554110ed6af04c7ccff8e9f81ad17d0d40c75637e227fb" end resource "ecdsa" do url "https://files.pythonhosted.org/packages/bf/3d/3d909532ad541651390bf1321e097404cbd39d1d89c2046f42a460220fb3/ecdsa-0.17.0.tar.gz" sha256 "b9f500bb439e4153d0330610f5d26baaf18d17b8ced1bc54410d189385ea68aa" end resource "Flask" do url "https://files.pythonhosted.org/packages/84/9d/66347e6b3e2eb78647392d3969c23bdc2d8b2fdc32bd078c817c15cb81ad/Flask-2.0.3.tar.gz" sha256 "e1120c228ca2f553b470df4a5fa927ab66258467526069981b3eb0a91902687d" end resource "Flask-Cors" do url "https://files.pythonhosted.org/packages/cf/25/e3b2553d22ed542be807739556c69621ad2ab276ae8d5d2560f4ed20f652/Flask-Cors-3.0.10.tar.gz" sha256 "b60839393f3b84a0f3746f6cdca56c1ad7426aa738b70d6c61375857823181de" end resource "future" do url "https://files.pythonhosted.org/packages/45/0b/38b06fd9b92dc2b68d58b75f900e97884c45bedd2ff83203d933cf5851c9/future-0.18.2.tar.gz" sha256 "b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d" end resource "graphql-core" do url "https://files.pythonhosted.org/packages/0c/15/0e13d80b86cca5c1bd1d311344f5d1eabe036e5a472a38f0048d68cce40d/graphql-core-3.2.0.tar.gz" sha256 "86e2a0be008bfde19ef78388de8a725a1d942a9190ca431c24a60837973803ce" end resource "idna" do url "https://files.pythonhosted.org/packages/62/08/e3fc7c8161090f742f504f40b1bccbfc544d4a4e09eb774bf40aafce5436/idna-3.3.tar.gz" sha256 "9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d" end resource "itsdangerous" do url "https://files.pythonhosted.org/packages/82/00/89037083314067f1605233f6f30b94fdddc89d18e283b30b0c5be9e7f801/itsdangerous-2.1.0.tar.gz" sha256 "d848fcb8bc7d507c4546b448574e8a44fc4ea2ba84ebf8d783290d53e81992f5" end resource "Jinja2" do url "https://files.pythonhosted.org/packages/91/a5/429efc6246119e1e3fbf562c00187d04e83e54619249eb732bb423efa6c6/Jinja2-3.0.3.tar.gz" sha256 "611bb273cd68f3b993fabdc4064fc858c5b47a973cb5aa7999ec1ba405c87cd7" end resource "jmespath" do url "https://files.pythonhosted.org/packages/3c/56/3f325b1eef9791759784aa5046a8f6a1aff8f7c898a2e34506771d3b99d8/jmespath-0.10.0.tar.gz" sha256 "b85d0567b8666149a93172712e68920734333c0ce7e89b78b3e987f71e5ed4f9" end resource "jschema-to-python" do url "https://files.pythonhosted.org/packages/1d/7f/5ae3d97ddd86ec33323231d68453afd504041efcfd4f4dde993196606849/jschema_to_python-1.2.3.tar.gz" sha256 "76ff14fe5d304708ccad1284e4b11f96a658949a31ee7faed9e0995279549b91" end resource "jsondiff" do url "https://files.pythonhosted.org/packages/21/c6/57158093587de0ab578da6f27467e00b037d63b3538204fc27860d427144/jsondiff-1.3.1.tar.gz" sha256 "04cfaebd4a5e5738948ab615710dc3ee98efbdf851255fd3977c4c2ee59e7312" end resource "jsonpatch" do url "https://files.pythonhosted.org/packages/21/67/83452af2a6db7c4596d1e2ecaa841b9a900980103013b867f2865e5e1cf0/jsonpatch-1.32.tar.gz" sha256 "b6ddfe6c3db30d81a96aaeceb6baf916094ffa23d7dd5fa2c13e13f8b6e600c2" end resource "jsonpickle" do url "https://files.pythonhosted.org/packages/35/0e/fe3ce0869add0213a1b45eef746cafb79ca45255a60ec918630c159e3490/jsonpickle-2.1.0.tar.gz" sha256 "84684cfc5338a534173c8dd69809e40f2865d0be1f8a2b7af8465e5b968dcfa9" end resource "jsonpointer" do url "https://files.pythonhosted.org/packages/29/7f/e6b5930e6dd1f461ad412dfc40bc94e5235011f6bbf73cafa8074617c203/jsonpointer-2.2.tar.gz" sha256 "f09f8deecaaa5aea65b5eb4f67ca4e54e1a61f7a11c75085e360fe6feb6a48bf" end resource "jsonschema" do url "https://files.pythonhosted.org/packages/69/11/a69e2a3c01b324a77d3a7c0570faa372e8448b666300c4117a516f8b1212/jsonschema-3.2.0.tar.gz" sha256 "c8a85b28d377cc7737e46e2d9f2b4f44ee3c0e1deac6bf46ddefc7187d30797a" end resource "junit-xml-2" do url "https://files.pythonhosted.org/packages/4d/f2/a99adf9deb57949b81ff8e113edf971da1840251794a6f4184d61faa5a65/junit-xml-2-1.9.tar.gz" sha256 "3b8d9635c5215f754c7807104f6493e3ea3bc9481e2d33db294560da3a1b00f7" end resource "MarkupSafe" do url "https://files.pythonhosted.org/packages/62/0f/52c009332fdadd484e898dc8f2acca0663c1031b3517070fd34ad9c1b64e/MarkupSafe-2.1.0.tar.gz" sha256 "80beaf63ddfbc64a0452b841d8036ca0611e049650e20afcb882f5d3c266d65f" end resource "networkx" do url "https://files.pythonhosted.org/packages/9e/9e/3d67df5d543ffd743f4ccb12c9c90929e4f48136e3062e15a6d971d91202/networkx-2.7.1.tar.gz" sha256 "d1194ba753e5eed07cdecd1d23c5cd7a3c772099bd8dbd2fea366788cf4de7ba" end resource "pbr" do url "https://files.pythonhosted.org/packages/51/da/eb358ed53257a864bf9deafba25bc3d6b8d41b0db46da4e7317500b1c9a5/pbr-5.8.1.tar.gz" sha256 "66bc5a34912f408bb3925bf21231cb6f59206267b7f63f3503ef865c1a292e25" end resource "pyasn1" do url "https://files.pythonhosted.org/packages/a4/db/fffec68299e6d7bad3d504147f9094830b704527a7fc098b721d38cc7fa7/pyasn1-0.4.8.tar.gz" sha256 "aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba" end resource "pycparser" do url "https://files.pythonhosted.org/packages/5e/0b/95d387f5f4433cb0f53ff7ad859bd2c6051051cebbb564f139a999ab46de/pycparser-2.21.tar.gz" sha256 "e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206" end resource "pyrsistent" do url "https://files.pythonhosted.org/packages/42/ac/455fdc7294acc4d4154b904e80d964cc9aae75b087bbf486be04df9f2abd/pyrsistent-0.18.1.tar.gz" sha256 "d4d61f8b993a7255ba714df3aca52700f8125289f84f704cf80916517c46eb96" end resource "python-dateutil" do url "https://files.pythonhosted.org/packages/4c/c4/13b4776ea2d76c115c1d1b84579f3764ee6d57204f6be27119f13a61d0a9/python-dateutil-2.8.2.tar.gz" sha256 "0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86" end resource "python-jose" do url "https://files.pythonhosted.org/packages/e4/19/b2c86504116dc5f0635d29f802da858404d77d930a25633d2e86a64a35b3/python-jose-3.3.0.tar.gz" sha256 "55779b5e6ad599c6336191246e95eb2293a9ddebd555f796a65f838f07e5d78a" end resource "pytz" do url "https://files.pythonhosted.org/packages/e3/8e/1cde9d002f48a940b9d9d38820aaf444b229450c0854bdf15305ce4a3d1a/pytz-2021.3.tar.gz" sha256 "acad2d8b20a1af07d4e4c9d2e9285c5ed9104354062f275f3fcd88dcef4f1326" end resource "PyYAML" do url "https://files.pythonhosted.org/packages/36/2b/61d51a2c4f25ef062ae3f74576b01638bebad5e045f747ff12643df63844/PyYAML-6.0.tar.gz" sha256 "68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2" end resource "requests" do url "https://files.pythonhosted.org/packages/60/f3/26ff3767f099b73e0efa138a9998da67890793bfa475d8278f84a30fec77/requests-2.27.1.tar.gz" sha256 "68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61" end resource "responses" do url "https://files.pythonhosted.org/packages/03/a5/186653e51cb20fe3ac793403334d4d077fbb7bb18a9c5c2fce8304d5a2e2/responses-0.18.0.tar.gz" sha256 "380cad4c1c1dc942e5e8a8eaae0b4d4edf708f4f010db8b7bcfafad1fcd254ff" end resource "rsa" do url "https://files.pythonhosted.org/packages/8c/ee/4022542e0fed77dd6ddade38e1e4dea3299f873b7fd4e6d78319953b0f83/rsa-4.8.tar.gz" sha256 "5c6bd9dc7a543b7fe4304a631f8a8a3b674e2bbfc49c2ae96200cdbe55df6b17" end resource "s3transfer" do url "https://files.pythonhosted.org/packages/7e/19/f82e4af435a19b28bdbfba63f338ea20a264f4df4beaf8f2ab9bfa34072b/s3transfer-0.5.2.tar.gz" sha256 "95c58c194ce657a5f4fb0b9e60a84968c808888aed628cd98ab8771fe1db98ed" end resource "sarif-om" do url "https://files.pythonhosted.org/packages/ba/de/bbdd93fe456d4011500784657c5e4a31e3f4fcbb276255d4db1213aed78c/sarif_om-1.0.4.tar.gz" sha256 "cd5f416b3083e00d402a92e449a7ff67af46f11241073eea0461802a3b5aef98" end resource "sshpubkeys" do url "https://files.pythonhosted.org/packages/a3/b9/e5b76b4089007dcbe9a7e71b1976d3c0f27e7110a95a13daf9620856c220/sshpubkeys-3.3.1.tar.gz" sha256 "3020ed4f8c846849299370fbe98ff4157b0ccc1accec105e07cfa9ae4bb55064" end resource "urllib3" do url "https://files.pythonhosted.org/packages/b0/b1/7bbf5181f8e3258efae31702f5eab87d8a74a72a0aa78bc8c08c1466e243/urllib3-1.26.8.tar.gz" sha256 "0e7c33d9a63e7ddfcb86780aac87befc2fbddf46c58dbb487e0855f7ceec283c" end resource "websocket-client" do url "https://files.pythonhosted.org/packages/8d/12/cd10d050f7714ccc675b486cdcbbaed54c782a5b77da2bb82e5c7b31fb40/websocket-client-1.3.1.tar.gz" sha256 "6278a75065395418283f887de7c3beafb3aa68dada5cacbe4b214e8d26da499b" end resource "Werkzeug" do url "https://files.pythonhosted.org/packages/6c/a8/60514fade2318e277453c9588545d0c335ea3ea6440ce5cdabfca7f73117/Werkzeug-2.0.3.tar.gz" sha256 "b863f8ff057c522164b6067c9e28b041161b4be5ba4d0daceeaa50a163822d3c" end resource "wrapt" do url "https://files.pythonhosted.org/packages/eb/f6/d81ccf43ac2a3c80ddb6647653ac8b53ce2d65796029369923be06b815b8/wrapt-1.13.3.tar.gz" sha256 "1fea9cd438686e6682271d36f3481a9f3636195578bab9ca3382e2f5f01fc185" end resource "xmltodict" do url "https://files.pythonhosted.org/packages/58/40/0d783e14112e064127063fbf5d1fe1351723e5dfe9d6daad346a305f6c49/xmltodict-0.12.0.tar.gz" sha256 "50d8c638ed7ecb88d90561beedbf720c9b4e851a9fa6c47ebd64e99d166d8a21" end def install virtualenv_install_with_resources end service do run [opt_bin/"moto_server"] keep_alive true working_dir var log_path var/"log/moto.log" error_log_path var/"log/moto.log" end test do port = free_port pid = fork do exec bin/"moto_server", "--port=#{port}" end # keep trying to connect until the server is up curl_cmd = "curl --silent 127.0.0.1:#{port}/" ohai curl_cmd output = "" exitstatus = 7 loop do sleep 1 output = `#{curl_cmd}` exitstatus = $CHILD_STATUS.exitstatus break if exitstatus != 7 # CURLE_COULDNT_CONNECT end assert_equal exitstatus, 0 expected_output = <<~EOS <ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01"><Owner><ID>bcaf1ffd86f41161ca5fb16fd081034f</ID><DisplayName>webfile</DisplayName></Owner><Buckets></Buckets></ListAllMyBucketsResult> EOS assert_equal expected_output.strip, output.strip ensure Process.kill "TERM", pid Process.wait pid end end
class Mpfr < Formula desc "C library for multiple-precision floating-point computations" homepage "http://www.mpfr.org/" # Upstream is down a lot, so use mirrors url "https://mirrors.ocf.berkeley.edu/debian/pool/main/m/mpfr4/mpfr4_3.1.5.orig.tar.xz" mirror "https://ftp.gnu.org/gnu/mpfr/mpfr-3.1.5.tar.xz" sha256 "015fde82b3979fbe5f83501986d328331ba8ddf008c1ff3da3c238f49ca062bc" bottle do cellar :any sha256 "563898b76509b25a1c7ed09c3f541310569d7c124f1edc84638ecec75e507698" => :sierra sha256 "f9ae415a51042ad963dfd8d6171556b0119a27edbe894614c0e3a2e4398515c4" => :el_capitan sha256 "ca737c71556161c37563b78305aa93c6663cde07f06d94e4d7de091983327c48" => :yosemite end option "32-bit" depends_on "gmp" fails_with :clang do build 421 cause <<-EOS.undent clang build 421 segfaults while building in superenv; see https://github.com/Homebrew/homebrew/issues/15061 EOS end def install ENV.m32 if build.build_32_bit? system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}", "--disable-silent-rules" system "make" system "make", "check" system "make", "install" end test do (testpath/"test.c").write <<-EOS.undent #include <gmp.h> #include <mpfr.h> int main() { mpfr_t x; mpfr_init(x); mpfr_clear(x); return 0; } EOS system ENV.cc, "test.c", "-lgmp", "-lmpfr", "-o", "test" system "./test" end end mpfr: remove 32-bit option class Mpfr < Formula desc "C library for multiple-precision floating-point computations" homepage "http://www.mpfr.org/" # Upstream is down a lot, so use mirrors url "https://mirrors.ocf.berkeley.edu/debian/pool/main/m/mpfr4/mpfr4_3.1.5.orig.tar.xz" mirror "https://ftp.gnu.org/gnu/mpfr/mpfr-3.1.5.tar.xz" sha256 "015fde82b3979fbe5f83501986d328331ba8ddf008c1ff3da3c238f49ca062bc" bottle do cellar :any sha256 "563898b76509b25a1c7ed09c3f541310569d7c124f1edc84638ecec75e507698" => :sierra sha256 "f9ae415a51042ad963dfd8d6171556b0119a27edbe894614c0e3a2e4398515c4" => :el_capitan sha256 "ca737c71556161c37563b78305aa93c6663cde07f06d94e4d7de091983327c48" => :yosemite end depends_on "gmp" fails_with :clang do build 421 cause <<-EOS.undent clang build 421 segfaults while building in superenv; see https://github.com/Homebrew/homebrew/issues/15061 EOS end def install system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}", "--disable-silent-rules" system "make" system "make", "check" system "make", "install" end test do (testpath/"test.c").write <<-EOS.undent #include <gmp.h> #include <mpfr.h> int main() { mpfr_t x; mpfr_init(x); mpfr_clear(x); return 0; } EOS system ENV.cc, "test.c", "-lgmp", "-lmpfr", "-o", "test" system "./test" end end
class Mpfr < Formula desc "C library for multiple-precision floating-point computations" homepage "https://www.mpfr.org/" url "https://ftp.gnu.org/gnu/mpfr/mpfr-4.0.1.tar.xz" mirror "https://ftpmirror.gnu.org/mpfr/mpfr-4.0.1.tar.xz" sha256 "67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e" bottle do cellar :any sha256 "223ac973eb796b275cf751111c458dc1466f82f302e96ca764ea091309d1a963" => :high_sierra sha256 "a29b4585cb97715cdab177ea586b3fbee2c578248b115e3b86505724f2b0fc76" => :sierra sha256 "33b9a9b53120eae11bf2d241d0285f1bb0410ff133d2ecc1d4df07846da93018" => :el_capitan end depends_on "gmp" def install system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}", "--disable-silent-rules" system "make" system "make", "check" system "make", "install" end test do (testpath/"test.c").write <<~EOS #include <mpfr.h> #include <math.h> #include <stdlib.h> int main() { mpfr_t x, y; mpfr_inits2 (256, x, y, NULL); mpfr_set_ui (x, 2, MPFR_RNDN); mpfr_root (y, x, 2, MPFR_RNDN); mpfr_pow_si (x, y, 4, MPFR_RNDN); mpfr_add_si (y, x, -4, MPFR_RNDN); mpfr_abs (y, y, MPFR_RNDN); if (fabs(mpfr_get_d (y, MPFR_RNDN)) > 1.e-30) abort(); return 0; } EOS system ENV.cc, "test.c", "-L#{lib}", "-L#{Formula["gmp"].opt_lib}", "-lgmp", "-lmpfr", "-o", "test" system "./test" end end mpfr: update 4.0.1 bottle. class Mpfr < Formula desc "C library for multiple-precision floating-point computations" homepage "https://www.mpfr.org/" url "https://ftp.gnu.org/gnu/mpfr/mpfr-4.0.1.tar.xz" mirror "https://ftpmirror.gnu.org/mpfr/mpfr-4.0.1.tar.xz" sha256 "67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e" bottle do cellar :any sha256 "a51f47143ac39b4e9073946b08e846adf2509a4447555aa4c9dceea363d8e429" => :mojave sha256 "223ac973eb796b275cf751111c458dc1466f82f302e96ca764ea091309d1a963" => :high_sierra sha256 "a29b4585cb97715cdab177ea586b3fbee2c578248b115e3b86505724f2b0fc76" => :sierra sha256 "33b9a9b53120eae11bf2d241d0285f1bb0410ff133d2ecc1d4df07846da93018" => :el_capitan end depends_on "gmp" def install system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}", "--disable-silent-rules" system "make" system "make", "check" system "make", "install" end test do (testpath/"test.c").write <<~EOS #include <mpfr.h> #include <math.h> #include <stdlib.h> int main() { mpfr_t x, y; mpfr_inits2 (256, x, y, NULL); mpfr_set_ui (x, 2, MPFR_RNDN); mpfr_root (y, x, 2, MPFR_RNDN); mpfr_pow_si (x, y, 4, MPFR_RNDN); mpfr_add_si (y, x, -4, MPFR_RNDN); mpfr_abs (y, y, MPFR_RNDN); if (fabs(mpfr_get_d (y, MPFR_RNDN)) > 1.e-30) abort(); return 0; } EOS system ENV.cc, "test.c", "-L#{lib}", "-L#{Formula["gmp"].opt_lib}", "-lgmp", "-lmpfr", "-o", "test" system "./test" end end
class Mpop < Formula desc "POP3 client" homepage "http://mpop.sourceforge.net/" url "https://downloads.sourceforge.net/project/mpop/mpop/1.2.5/mpop-1.2.5.tar.xz" sha256 "01612b5fc60dcbd5368b7cc2e0fce6c141c2e835d4646f8d7214d9898a901158" bottle do cellar :any sha256 "2d03238722efe5532d69ef80bf86e700664f1d6cadbc3ff4c2a1b4ac203fef3c" => :sierra sha256 "6aaf347d5917c4366b7572ff6ac48e5cf7be653a1dc34347503f64c6d5b38d4d" => :el_capitan sha256 "55de4c36ac34e22563d5adf327a50e9859e7ba6a848254d3f9f226791086bf72" => :yosemite sha256 "6152acd7293ead40fce85a67e9e451d15ddfa71775e688e08aef11d9565005ae" => :mavericks end depends_on "pkg-config" => :build depends_on "openssl" def install system "./configure", "--prefix=#{prefix}", "--disable-dependency-tracking" system "make", "install" end test do assert_match version.to_s, shell_output("#{bin}/mpop --version") end end mpop 1.2.6 Closes #6926. Signed-off-by: ilovezfs <fbd54dbbcf9e596abad4ccdc4dfc17f80ebeaee2@icloud.com> class Mpop < Formula desc "POP3 client" homepage "http://mpop.sourceforge.net/" url "https://downloads.sourceforge.net/project/mpop/mpop/1.2.6/mpop-1.2.6.tar.xz" sha256 "9fec7a9dd08fc0f04bf6178bc651b036d1fe0e46903146f38a8d182887e9315c" bottle do cellar :any sha256 "2d03238722efe5532d69ef80bf86e700664f1d6cadbc3ff4c2a1b4ac203fef3c" => :sierra sha256 "6aaf347d5917c4366b7572ff6ac48e5cf7be653a1dc34347503f64c6d5b38d4d" => :el_capitan sha256 "55de4c36ac34e22563d5adf327a50e9859e7ba6a848254d3f9f226791086bf72" => :yosemite sha256 "6152acd7293ead40fce85a67e9e451d15ddfa71775e688e08aef11d9565005ae" => :mavericks end depends_on "pkg-config" => :build depends_on "openssl" def install system "./configure", "--prefix=#{prefix}", "--disable-dependency-tracking" system "make", "install" end test do assert_match version.to_s, shell_output("#{bin}/mpop --version") end end
mtoc 927.0.2 (new formula) mtoc is a Mach-O to PE binary converter. It enables Tianocore UEFI build on macOS. Closes #51730. Signed-off-by: Bo Anderson <1d6e1cf70ec6f9ab28d3ea4b27a49a77654d370e@boanderson.me> class Mtoc < Formula desc "Mach-O to PE/COFF binary converter" homepage "https://opensource.apple.com/source/cctools/cctools-927.0.2/" url "https://opensource.apple.com/tarballs/cctools/cctools-927.0.2.tar.gz" sha256 "3d5d35e7120aac187de306019d4b53b3b08dd7ebf48764fcd5c8cefef40b3dbf" depends_on "llvm" => :build def install # Conflicts with _structs.h in macOS 10.13 - 10.15 SDK File.delete "include/mach/i386/_structs.h" system "make", "-C", "libstuff", "EFITOOLS=efitools" system "make", "-C", "efitools" bin.install "efitools/mtoc.NEW" => "mtoc" man1.install "man/mtoc.1" end test do (testpath/"test.c").write <<~EOS __attribute__((naked)) int start() {} EOS args = %W[ -nostdlib -Wl,-preload -Wl,-e,_start -seg1addr 0x1000 -o #{testpath}/test #{testpath}/test.c ] system "cc", *args system "#{bin}/mtoc", "#{testpath}/test", "#{testpath}/test.pe" end end
require 'formula' class Mutt < Formula homepage 'http://www.mutt.org/' url 'ftp://ftp.mutt.org/mutt/devel/mutt-1.5.22.tar.gz' sha1 '728a114cb3a44df373dbf1292fc34dd8321057dc' head do url 'http://dev.mutt.org/hg/mutt#default', :using => :hg resource 'html' do url 'http://dev.mutt.org/doc/manual.html', :using => :nounzip end depends_on :autoconf depends_on :automake end conflicts_with 'signing-party', :because => 'mutt installs private copies of pgpring and pgpewrap' conflicts_with 'tin', :because => 'both install mmdf.5 and mbox.5 man pages' option "with-debug", "Build with debug option enabled" option "with-trash-patch", "Apply trash folder patch" option "with-s-lang", "Build against slang instead of ncurses" option "with-ignore-thread-patch", "Apply ignore-thread patch" option "with-pgp-verbose-mime-patch", "Apply PGP verbose mime patch" option "with-confirm-attachment-patch", "Apply confirm attachment patch" depends_on 'tokyo-cabinet' depends_on 's-lang' => :optional def patches urls = [ ['with-trash-patch', 'http://patch-tracker.debian.org/patch/series/dl/mutt/1.5.21-6.4/features/trash-folder'], # original source for this went missing, patch sourced from Arch at # https://aur.archlinux.org/packages/mutt-ignore-thread/ ['with-ignore-thread-patch', 'https://gist.github.com/mistydemeo/5522742/raw/1439cc157ab673dc8061784829eea267cd736624/ignore-thread-1.5.21.patch'], ['with-pgp-verbose-mime-patch', 'http://patch-tracker.debian.org/patch/series/dl/mutt/1.5.21-6.4/features-old/patch-1.5.4.vk.pgp_verbose_mime'], ['with-confirm-attachment-patch', 'https://gist.github.com/tlvince/5741641/raw/c926ca307dc97727c2bd88a84dcb0d7ac3bb4bf5/mutt-attach.patch'], ] p = [] urls.each do |u| p << u[1] if build.include? u[0] end return p end def install args = ["--disable-dependency-tracking", "--disable-warnings", "--prefix=#{prefix}", "--with-ssl", "--with-sasl", "--with-gss", "--enable-imap", "--enable-smtp", "--enable-pop", "--enable-hcache", "--with-tokyocabinet", # This is just a trick to keep 'make install' from trying to chgrp # the mutt_dotlock file (which we can't do if we're running as an # unpriviledged user) "--with-homespool=.mbox"] args << "--with-slang" if build.with? 's-lang' if build.with? 'debug' args << "--enable-debug" else args << "--disable-debug" end if build.head? system "./prepare", *args else system "./configure", *args end system "make" system "make", "install" (share/'doc/mutt').install resource('html') if build.head? end end mutt: don't conflict with non-conflicting signing-party Mutt can coexist with signing-party if signing-party is brewed with the --with-rename-pgpring option. Closes Homebrew/homebrew#25382. Signed-off-by: Mike McQuaid <a17fed27eaa842282862ff7c1b9c8395a26ac320@mikemcquaid.com> require 'formula' class Mutt < Formula homepage 'http://www.mutt.org/' url 'ftp://ftp.mutt.org/mutt/devel/mutt-1.5.22.tar.gz' sha1 '728a114cb3a44df373dbf1292fc34dd8321057dc' head do url 'http://dev.mutt.org/hg/mutt#default', :using => :hg resource 'html' do url 'http://dev.mutt.org/doc/manual.html', :using => :nounzip end depends_on :autoconf depends_on :automake end if Tab.for_name('signing-party').used_options.include? 'with-rename-pgpring' conflicts_with 'signing-party', :because => 'mutt installs a private copy of pgpring' end conflicts_with 'tin', :because => 'both install mmdf.5 and mbox.5 man pages' option "with-debug", "Build with debug option enabled" option "with-trash-patch", "Apply trash folder patch" option "with-s-lang", "Build against slang instead of ncurses" option "with-ignore-thread-patch", "Apply ignore-thread patch" option "with-pgp-verbose-mime-patch", "Apply PGP verbose mime patch" option "with-confirm-attachment-patch", "Apply confirm attachment patch" depends_on 'tokyo-cabinet' depends_on 's-lang' => :optional def patches urls = [ ['with-trash-patch', 'http://patch-tracker.debian.org/patch/series/dl/mutt/1.5.21-6.4/features/trash-folder'], # original source for this went missing, patch sourced from Arch at # https://aur.archlinux.org/packages/mutt-ignore-thread/ ['with-ignore-thread-patch', 'https://gist.github.com/mistydemeo/5522742/raw/1439cc157ab673dc8061784829eea267cd736624/ignore-thread-1.5.21.patch'], ['with-pgp-verbose-mime-patch', 'http://patch-tracker.debian.org/patch/series/dl/mutt/1.5.21-6.4/features-old/patch-1.5.4.vk.pgp_verbose_mime'], ['with-confirm-attachment-patch', 'https://gist.github.com/tlvince/5741641/raw/c926ca307dc97727c2bd88a84dcb0d7ac3bb4bf5/mutt-attach.patch'], ] p = [] urls.each do |u| p << u[1] if build.include? u[0] end return p end def install args = ["--disable-dependency-tracking", "--disable-warnings", "--prefix=#{prefix}", "--with-ssl", "--with-sasl", "--with-gss", "--enable-imap", "--enable-smtp", "--enable-pop", "--enable-hcache", "--with-tokyocabinet", # This is just a trick to keep 'make install' from trying to chgrp # the mutt_dotlock file (which we can't do if we're running as an # unpriviledged user) "--with-homespool=.mbox"] args << "--with-slang" if build.with? 's-lang' if build.with? 'debug' args << "--enable-debug" else args << "--disable-debug" end if build.head? system "./prepare", *args else system "./configure", *args end system "make" system "make", "install" (share/'doc/mutt').install resource('html') if build.head? end end
class Mypy < Formula desc "Experimental optional static type checker for Python" homepage "http://www.mypy-lang.org/" url "https://github.com/python/mypy.git", tag: "v0.790", revision: "69a055a7632e2444fcb2bfb022d04f4546358d50" license "MIT" head "https://github.com/python/mypy.git" bottle do cellar :any_skip_relocation sha256 "71cb98934edc50c8f316f01351c8ae7fc87e499fa2eb0b7165925cf4f8b28673" => :big_sur sha256 "6d523ee731b6bf6d32b2d797febe42a601d73c3cb81404eb7c3b9f7a03cd068d" => :catalina sha256 "35091518b7c3e42e17787f3638b345a569309107fc28aa14726e0944afce7528" => :mojave sha256 "f734d492ebba9796caf3a5a06b720feac0106f2ce60c8950506bc7234eeb4898" => :high_sierra end depends_on "sphinx-doc" => :build depends_on "python@3.8" resource "mypy-extensions" do url "https://files.pythonhosted.org/packages/63/60/0582ce2eaced55f65a4406fc97beba256de4b7a95a0034c6576458c6519f/mypy_extensions-0.4.3.tar.gz" sha256 "2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8" end resource "psutil" do url "https://files.pythonhosted.org/packages/c4/b8/3512f0e93e0db23a71d82485ba256071ebef99b227351f0f5540f744af41/psutil-5.7.0.tar.gz" sha256 "685ec16ca14d079455892f25bd124df26ff9137664af445563c1bd36629b5e0e" end resource "sphinx-rtd-theme" do url "https://files.pythonhosted.org/packages/ed/73/7e550d6e4cf9f78a0e0b60b9d93dba295389c3d271c034bf2ea3463a79f9/sphinx_rtd_theme-0.4.3.tar.gz" sha256 "728607e34d60456d736cc7991fd236afb828b21b82f956c5ea75f94c8414040a" end resource "typed-ast" do url "https://files.pythonhosted.org/packages/18/09/b6a6b14bb8c5ec4a24fe0cf0160aa0b784fd55a6fd7f8da602197c5c461e/typed_ast-1.4.1.tar.gz" sha256 "8c8aaad94455178e3187ab22c8b01a3837f8ee50e09cf31f1ba129eb293ec30b" end resource "typing-extensions" do url "https://files.pythonhosted.org/packages/6a/28/d32852f2af6b5ead85d396249d5bdf450833f3a69896d76eb480d9c5e406/typing_extensions-3.7.4.2.tar.gz" sha256 "79ee589a3caca649a9bfd2a8de4709837400dfa00b6cc81962a1e6a1815969ae" end def install python3 = Formula["python@3.8"].opt_bin/"python3" xy = Language::Python.major_minor_version python3 # https://github.com/python/mypy/issues/2593 version_static = buildpath/"mypy/version_static.py" version_static.write "__version__ = '#{version}'\n" inreplace "docs/source/conf.py", "mypy.version", "mypy.version_static" (buildpath/"docs/sphinx-rtd-theme").install resource("sphinx-rtd-theme") # Inject sphinx_rtd_theme's path into sys.path inreplace "docs/source/conf.py", "sys.path.insert(0, os.path.abspath('../..'))", "sys.path[:0] = [os.path.abspath('../..'), os.path.abspath('../sphinx-rtd-theme')]" system "make", "-C", "docs", "html" doc.install Dir["docs/build/html/*"] rm version_static ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python#{xy}/site-packages" resources.each do |r| r.stage do system python3, *Language::Python.setup_install_args(libexec/"vendor") end end ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python#{xy}/site-packages" ENV["MYPY_USE_MYPYC"] = "1" system python3, *Language::Python.setup_install_args(libexec) bin.install Dir[libexec/"bin/*"] bin.env_script_all_files(libexec/"bin", PYTHONPATH: ENV["PYTHONPATH"]) end test do (testpath/"broken.py").write <<~EOS def p() -> None: print('hello') a = p() EOS output = pipe_output("#{bin}/mypy broken.py 2>&1") assert_match '"p" does not return a value', output end end mypy: update 0.790 bottle. class Mypy < Formula desc "Experimental optional static type checker for Python" homepage "http://www.mypy-lang.org/" url "https://github.com/python/mypy.git", tag: "v0.790", revision: "69a055a7632e2444fcb2bfb022d04f4546358d50" license "MIT" head "https://github.com/python/mypy.git" bottle do cellar :any_skip_relocation sha256 "71cb98934edc50c8f316f01351c8ae7fc87e499fa2eb0b7165925cf4f8b28673" => :big_sur sha256 "40b7bd713f7a25ef1aa11685dade753077de79779c7c99bfe2665195ecb90316" => :arm64_big_sur sha256 "6d523ee731b6bf6d32b2d797febe42a601d73c3cb81404eb7c3b9f7a03cd068d" => :catalina sha256 "35091518b7c3e42e17787f3638b345a569309107fc28aa14726e0944afce7528" => :mojave sha256 "f734d492ebba9796caf3a5a06b720feac0106f2ce60c8950506bc7234eeb4898" => :high_sierra end depends_on "sphinx-doc" => :build depends_on "python@3.8" resource "mypy-extensions" do url "https://files.pythonhosted.org/packages/63/60/0582ce2eaced55f65a4406fc97beba256de4b7a95a0034c6576458c6519f/mypy_extensions-0.4.3.tar.gz" sha256 "2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8" end resource "psutil" do url "https://files.pythonhosted.org/packages/c4/b8/3512f0e93e0db23a71d82485ba256071ebef99b227351f0f5540f744af41/psutil-5.7.0.tar.gz" sha256 "685ec16ca14d079455892f25bd124df26ff9137664af445563c1bd36629b5e0e" end resource "sphinx-rtd-theme" do url "https://files.pythonhosted.org/packages/ed/73/7e550d6e4cf9f78a0e0b60b9d93dba295389c3d271c034bf2ea3463a79f9/sphinx_rtd_theme-0.4.3.tar.gz" sha256 "728607e34d60456d736cc7991fd236afb828b21b82f956c5ea75f94c8414040a" end resource "typed-ast" do url "https://files.pythonhosted.org/packages/18/09/b6a6b14bb8c5ec4a24fe0cf0160aa0b784fd55a6fd7f8da602197c5c461e/typed_ast-1.4.1.tar.gz" sha256 "8c8aaad94455178e3187ab22c8b01a3837f8ee50e09cf31f1ba129eb293ec30b" end resource "typing-extensions" do url "https://files.pythonhosted.org/packages/6a/28/d32852f2af6b5ead85d396249d5bdf450833f3a69896d76eb480d9c5e406/typing_extensions-3.7.4.2.tar.gz" sha256 "79ee589a3caca649a9bfd2a8de4709837400dfa00b6cc81962a1e6a1815969ae" end def install python3 = Formula["python@3.8"].opt_bin/"python3" xy = Language::Python.major_minor_version python3 # https://github.com/python/mypy/issues/2593 version_static = buildpath/"mypy/version_static.py" version_static.write "__version__ = '#{version}'\n" inreplace "docs/source/conf.py", "mypy.version", "mypy.version_static" (buildpath/"docs/sphinx-rtd-theme").install resource("sphinx-rtd-theme") # Inject sphinx_rtd_theme's path into sys.path inreplace "docs/source/conf.py", "sys.path.insert(0, os.path.abspath('../..'))", "sys.path[:0] = [os.path.abspath('../..'), os.path.abspath('../sphinx-rtd-theme')]" system "make", "-C", "docs", "html" doc.install Dir["docs/build/html/*"] rm version_static ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python#{xy}/site-packages" resources.each do |r| r.stage do system python3, *Language::Python.setup_install_args(libexec/"vendor") end end ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python#{xy}/site-packages" ENV["MYPY_USE_MYPYC"] = "1" system python3, *Language::Python.setup_install_args(libexec) bin.install Dir[libexec/"bin/*"] bin.env_script_all_files(libexec/"bin", PYTHONPATH: ENV["PYTHONPATH"]) end test do (testpath/"broken.py").write <<~EOS def p() -> None: print('hello') a = p() EOS output = pipe_output("#{bin}/mypy broken.py 2>&1") assert_match '"p" does not return a value', output end end
class Nali < Formula desc "Tool for querying IP geographic information and CDN provider" homepage "https://github.com/zu1k/nali" url "https://github.com/zu1k/nali/archive/v0.4.7.tar.gz" sha256 "a1116c889f423a29b2c9e3ae84fe7787e80538a2ad1e6f4b6be31db5d4f7a0e7" license "MIT" head "https://github.com/zu1k/nali.git", branch: "master" bottle do sha256 cellar: :any_skip_relocation, arm64_monterey: "ff5b4a5b63e41068fb53d1b64ce5731a4ae0beb7a9195a7e8d3797dea12cb8ec" sha256 cellar: :any_skip_relocation, arm64_big_sur: "c1a88f6d3a194e8809aff3158847b291623ef17f1b812faac4e790daaab08987" sha256 cellar: :any_skip_relocation, monterey: "191ae60904bfcf17d5eede4f1ebca9905a7ccf200b0ad33dd1e0bb7379cf5950" sha256 cellar: :any_skip_relocation, big_sur: "838721f7469b809baf29137ad32fcde22cdfc708079b87429bb2dd032dba8bb5" sha256 cellar: :any_skip_relocation, catalina: "bd10ed0576a21abe2198bc995e9fa9eb130e1827558213fc77982afe7f8e66c8" sha256 cellar: :any_skip_relocation, x86_64_linux: "ff99592469a9843ae3f40632617d6b649e9f47c02bf2b01f3954d0ad43656da7" end depends_on "go" => :build def install system "go", "build", *std_go_args(ldflags: "-s -w") (bash_completion/"nali").write Utils.safe_popen_read(bin/"nali", "completion", "bash") (fish_completion/"nali.fish").write Utils.safe_popen_read(bin/"nali", "completion", "fish") (zsh_completion/"_nali").write Utils.safe_popen_read(bin/"nali", "completion", "zsh") end test do ip = "1.1.1.1" # Default database used by program is in Chinese, while downloading an English one # requires an third-party account. # This example reads "US APNIC&CloudFlare Public DNS Server". assert_match "#{ip} [美国 APNIC&CloudFlare公共DNS服务器]", shell_output("#{bin}/nali #{ip}") end end nali 0.4.8 Closes #105238. Signed-off-by: Sean Molenaar <2b250e3fea88cfef248b497ad5fc17f7dc435154@users.noreply.github.com> Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com> class Nali < Formula desc "Tool for querying IP geographic information and CDN provider" homepage "https://github.com/zu1k/nali" url "https://github.com/zu1k/nali/archive/v0.4.8.tar.gz" sha256 "ce6a0be171839640634047f90fb40eafda17dd4439329df0caf110ce186bfc91" license "MIT" head "https://github.com/zu1k/nali.git", branch: "master" bottle do sha256 cellar: :any_skip_relocation, arm64_monterey: "ff5b4a5b63e41068fb53d1b64ce5731a4ae0beb7a9195a7e8d3797dea12cb8ec" sha256 cellar: :any_skip_relocation, arm64_big_sur: "c1a88f6d3a194e8809aff3158847b291623ef17f1b812faac4e790daaab08987" sha256 cellar: :any_skip_relocation, monterey: "191ae60904bfcf17d5eede4f1ebca9905a7ccf200b0ad33dd1e0bb7379cf5950" sha256 cellar: :any_skip_relocation, big_sur: "838721f7469b809baf29137ad32fcde22cdfc708079b87429bb2dd032dba8bb5" sha256 cellar: :any_skip_relocation, catalina: "bd10ed0576a21abe2198bc995e9fa9eb130e1827558213fc77982afe7f8e66c8" sha256 cellar: :any_skip_relocation, x86_64_linux: "ff99592469a9843ae3f40632617d6b649e9f47c02bf2b01f3954d0ad43656da7" end depends_on "go" => :build def install system "go", "build", *std_go_args(ldflags: "-s -w") (bash_completion/"nali").write Utils.safe_popen_read(bin/"nali", "completion", "bash") (fish_completion/"nali.fish").write Utils.safe_popen_read(bin/"nali", "completion", "fish") (zsh_completion/"_nali").write Utils.safe_popen_read(bin/"nali", "completion", "zsh") end test do ip = "1.1.1.1" # Default database used by program is in Chinese, while downloading an English one # requires an third-party account. # This example reads "US APNIC&CloudFlare Public DNS Server". assert_match "#{ip} [美国 APNIC&CloudFlare公共DNS服务器]", shell_output("#{bin}/nali #{ip}") end end
class Nano < Formula desc "Free (GNU) replacement for the Pico text editor" homepage "https://www.nano-editor.org/" url "https://www.nano-editor.org/dist/v4/nano-4.1.tar.gz" sha256 "094a67b9cd651d359de03d79b407b499a18a577221ebc002b56763b0346fbb6f" bottle do sha256 "34a92e5858a02623f53514fed225a4f040551c647e7765a5489cc2918778f512" => :mojave sha256 "4cc90703d5be90a2ea09e3eef3113aca2a571c57d3fe98e22cfcc650502654d4" => :high_sierra sha256 "b7c6484f5c048b70814ba74560c04dcbcc8834e96d941f7b1efc7eda85b62e8c" => :sierra end depends_on "pkg-config" => :build depends_on "gettext" depends_on "ncurses" def install system "./configure", "--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}", "--sysconfdir=#{etc}", "--enable-color", "--enable-extra", "--enable-multibuffer", "--enable-nanorc", "--enable-utf8" system "make", "install" doc.install "doc/sample.nanorc" end test do system "#{bin}/nano", "--version" end end nano: update 4.1 bottle. class Nano < Formula desc "Free (GNU) replacement for the Pico text editor" homepage "https://www.nano-editor.org/" url "https://www.nano-editor.org/dist/v4/nano-4.1.tar.gz" sha256 "094a67b9cd651d359de03d79b407b499a18a577221ebc002b56763b0346fbb6f" bottle do sha256 "ac94340edf8159d0a5b6ae36f3176fe364d7c58bd976a90a41b9cde91e60e231" => :mojave sha256 "59282009b7a5b3ae393ebe71327b47827bd88f7f6d04d38a4569109ccffdacce" => :high_sierra sha256 "709bd58771764b3b96c058262b7271d82833fe6bc4a6cfd0f19a67848d36e855" => :sierra end depends_on "pkg-config" => :build depends_on "gettext" depends_on "ncurses" def install system "./configure", "--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}", "--sysconfdir=#{etc}", "--enable-color", "--enable-extra", "--enable-multibuffer", "--enable-nanorc", "--enable-utf8" system "make", "install" doc.install "doc/sample.nanorc" end test do system "#{bin}/nano", "--version" end end
class Nano < Formula desc "Free (GNU) replacement for the Pico text editor" homepage "https://www.nano-editor.org/" url "https://www.nano-editor.org/dist/v2.8/nano-2.8.7.tar.gz" sha256 "a49a888c20f09a17c7f1049d1fda619472c92eedcb25fd4be5f088a51cc392a5" bottle do sha256 "e77f5b3c877c2c35f9875915ee83ae14467cf70d7862bd3a59bb87dc302d43d1" => :sierra sha256 "3be1d0b7f071967470084cd301ce6600cd4b006e1b103d7d5c9d3295b8972621" => :el_capitan sha256 "233fc92c904683c0079b78649e030b045fcd1238648be9e4cdebf2338d9f1494" => :yosemite end head do url "https://git.savannah.gnu.org/git/nano.git" depends_on "automake" => :build depends_on "autoconf" => :build end depends_on "pkg-config" => :build depends_on "gettext" depends_on "ncurses" def install system "./autogen.sh" if build.head? system "./configure", "--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}", "--sysconfdir=#{etc}", "--enable-color", "--enable-extra", "--enable-multibuffer", "--enable-nanorc", "--enable-utf8" system "make", "install" doc.install "doc/sample.nanorc" end test do system "#{bin}/nano", "--version" end end nano: update 2.8.7 bottle. class Nano < Formula desc "Free (GNU) replacement for the Pico text editor" homepage "https://www.nano-editor.org/" url "https://www.nano-editor.org/dist/v2.8/nano-2.8.7.tar.gz" sha256 "a49a888c20f09a17c7f1049d1fda619472c92eedcb25fd4be5f088a51cc392a5" bottle do sha256 "5b84f256231301bddf7e079cbd2845ce12911ef0c9dc05870e5c50d86babd5c8" => :sierra sha256 "2ab25ffe79af65eedc41445497600c0a5723c2e196886155f9f5beb0f5eada92" => :el_capitan sha256 "8ea801434cc2dd837f5a0f147030d850106d26ddf9740d97f23e6275ab57222b" => :yosemite end head do url "https://git.savannah.gnu.org/git/nano.git" depends_on "automake" => :build depends_on "autoconf" => :build end depends_on "pkg-config" => :build depends_on "gettext" depends_on "ncurses" def install system "./autogen.sh" if build.head? system "./configure", "--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}", "--sysconfdir=#{etc}", "--enable-color", "--enable-extra", "--enable-multibuffer", "--enable-nanorc", "--enable-utf8" system "make", "install" doc.install "doc/sample.nanorc" end test do system "#{bin}/nano", "--version" end end
class Navi < Formula desc "Interactive cheatsheet tool for the command-line" homepage "https://github.com/denisidoro/navi" url "https://github.com/denisidoro/navi/archive/v2.13.0.tar.gz" sha256 "995c3a9ecb11964cbccbdfb63bbda037e4ee4e7e6e4c08da8e93c41b2ec1d830" license "Apache-2.0" bottle do cellar :any_skip_relocation sha256 "dcfc006389ea6eeac0a8688f34021a1fffba6519a1b4dbed0b87bfae47579a6a" => :big_sur sha256 "171dd5b3887c1728a16cdb1169c49c2ed1440647ad4541aa9afae6ac60dbfad1" => :catalina sha256 "a55e7861b4604c1ba8acac766cd1b89a83a6d0ee644def396f89baae26a5aff0" => :mojave sha256 "14297fa981aa825970ca6ea22369faea3056ca2c381a45195195698fa060d71c" => :high_sierra end depends_on "rust" => :build depends_on "fzf" def install system "cargo", "install", *std_cargo_args end test do assert_match "navi " + version, shell_output("#{bin}/navi --version") (testpath/"cheats/test.cheat").write "% test\n\n# foo\necho bar\n\n# lorem\necho ipsum\n" assert_match "bar", shell_output("export RUST_BACKTRACE=1; #{bin}/navi --path #{testpath}/cheats best foo") end end navi: update 2.13.0 bottle. class Navi < Formula desc "Interactive cheatsheet tool for the command-line" homepage "https://github.com/denisidoro/navi" url "https://github.com/denisidoro/navi/archive/v2.13.0.tar.gz" sha256 "995c3a9ecb11964cbccbdfb63bbda037e4ee4e7e6e4c08da8e93c41b2ec1d830" license "Apache-2.0" bottle do cellar :any_skip_relocation sha256 "a94ea1dcff5e8b1cbb0592c5819a7fd00abe6107d08cb1fea13b8af8a42ff465" => :big_sur sha256 "3740e04566dd7ce662e03a23365f46613f0d41c3637f0887c1044e596d018da6" => :catalina sha256 "c7c23013821b2a5c3e4f435ae98a90f7f228f1b61f96f867bf40de7dfe291ef8" => :mojave end depends_on "rust" => :build depends_on "fzf" def install system "cargo", "install", *std_cargo_args end test do assert_match "navi " + version, shell_output("#{bin}/navi --version") (testpath/"cheats/test.cheat").write "% test\n\n# foo\necho bar\n\n# lorem\necho ipsum\n" assert_match "bar", shell_output("export RUST_BACKTRACE=1; #{bin}/navi --path #{testpath}/cheats best foo") end end
class Ncdu < Formula desc "NCurses Disk Usage" homepage "https://dev.yorhel.nl/ncdu" url "https://dev.yorhel.nl/download/ncdu-1.15.1.tar.gz" sha256 "b02ddc4dbf1db139cc6fbbe2f54a282770380f0ca5c17089855eab52a9ea3fb0" bottle do cellar :any_skip_relocation sha256 "994f7f4e9624a0984ec7c37b5b15b9ae5c24663ebffaba19b0979f4e99919fee" => :catalina sha256 "f7908eaf47c7842b15e56e17279583f4c938a9c920e1bae41f05d3e5506a99fb" => :mojave sha256 "d094385dbfd71831c5f2b03f0817a06df9471a44f5437aaf577676d2723bc865" => :high_sierra end head do url "https://g.blicky.net/ncdu.git" depends_on "autoconf" => :build depends_on "automake" => :build end uses_from_macos "ncurses" def install system "autoreconf", "-i" if build.head? system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}" # Older linuxes does not have this constant in /usr/include/linux/magic.h inreplace "src/dir_scan.c", "CGROUP2_SUPER_MAGIC", "0x63677270" unless OS.mac? system "make", "install" end test do assert_match version.to_s, shell_output("#{bin}/ncdu -v") end end ncdu: remove inreplace (#20533) class Ncdu < Formula desc "NCurses Disk Usage" homepage "https://dev.yorhel.nl/ncdu" url "https://dev.yorhel.nl/download/ncdu-1.15.1.tar.gz" sha256 "b02ddc4dbf1db139cc6fbbe2f54a282770380f0ca5c17089855eab52a9ea3fb0" bottle do cellar :any_skip_relocation sha256 "994f7f4e9624a0984ec7c37b5b15b9ae5c24663ebffaba19b0979f4e99919fee" => :catalina sha256 "f7908eaf47c7842b15e56e17279583f4c938a9c920e1bae41f05d3e5506a99fb" => :mojave sha256 "d094385dbfd71831c5f2b03f0817a06df9471a44f5437aaf577676d2723bc865" => :high_sierra end head do url "https://g.blicky.net/ncdu.git" depends_on "autoconf" => :build depends_on "automake" => :build end uses_from_macos "ncurses" def install system "autoreconf", "-i" if build.head? system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}" system "make", "install" end test do assert_match version.to_s, shell_output("#{bin}/ncdu -v") end end
class Ndpi < Formula desc "Deep Packet Inspection (DPI) library" homepage "http://www.ntop.org/products/ndpi/" url "https://github.com/ntop/nDPI/archive/2.0.tar.gz" sha256 "a42a60ebd64bc8606f780204222893027f6dce0e3b460d7be655e5e065f5f3fa" head "https://github.com/ntop/nDPI.git", :branch => "dev" bottle do cellar :any sha256 "e0b6695cab0cadeac7383e7a86fae6795e5def53411ae6167668ac6b8f97231b" => :sierra sha256 "ed0fcd50c950d724e1b32158c09832e0e04c5918b5e42d8131dd7f09ee655002" => :el_capitan sha256 "71c9b7939c80c3854944d81f308e519f92e9f8d0e2a65e5a30ac78222c54d15d" => :yosemite end depends_on "autoconf" => :build depends_on "automake" => :build depends_on "pkg-config" => :build depends_on "libtool" => :build depends_on "json-c" def install system "./autogen.sh" system "./configure", "--prefix=#{prefix}" system "make" system "make", "install" end test do system bin/"ndpiReader", "-i", test_fixtures("test.pcap") end end Revert "ndpi: fix checksum" This reverts commit dd177fb2e22cb61977b7888223947dbaa23103e7. class Ndpi < Formula desc "Deep Packet Inspection (DPI) library" homepage "http://www.ntop.org/products/ndpi/" url "https://github.com/ntop/nDPI/archive/2.0.tar.gz" sha256 "90ae6e4de83bda5bb7405207020c1e0be364841510fdf5f0a2d48974e1a3fbcb" head "https://github.com/ntop/nDPI.git", :branch => "dev" bottle do cellar :any sha256 "e0b6695cab0cadeac7383e7a86fae6795e5def53411ae6167668ac6b8f97231b" => :sierra sha256 "ed0fcd50c950d724e1b32158c09832e0e04c5918b5e42d8131dd7f09ee655002" => :el_capitan sha256 "71c9b7939c80c3854944d81f308e519f92e9f8d0e2a65e5a30ac78222c54d15d" => :yosemite end depends_on "autoconf" => :build depends_on "automake" => :build depends_on "pkg-config" => :build depends_on "libtool" => :build depends_on "json-c" def install system "./autogen.sh" system "./configure", "--prefix=#{prefix}" system "make" system "make", "install" end test do system bin/"ndpiReader", "-i", test_fixtures("test.pcap") end end
class Neko < Formula desc "High-level, dynamically typed programming language" homepage "https://nekovm.org/" url "https://github.com/HaxeFoundation/neko/archive/v2-3-0/neko-2.3.0.tar.gz" sha256 "850e7e317bdaf24ed652efeff89c1cb21380ca19f20e68a296c84f6bad4ee995" revision 1 head "https://github.com/HaxeFoundation/neko.git" bottle do cellar :any rebuild 1 sha256 "85b136ca63c944258f90bb2c429e0d698f26c1f18e4061b775f8499ec5dc5bf7" => :catalina sha256 "9fa6b1793f214b603e14a557521d22f7fabb1fea0a4794f2272269791431f744" => :mojave sha256 "0a3ce8e9c8caaa2cd0d3e32f7fd43d68f17240de051222f8c0090e2b2e4ce161" => :high_sierra end depends_on "cmake" => :build depends_on "ninja" => :build depends_on "pkg-config" => :build depends_on "bdw-gc" depends_on "mbedtls" depends_on "openssl@1.1" depends_on "pcre" unless OS.mac? depends_on "apr" depends_on "apr-util" depends_on "httpd" # On mac, neko uses carbon. On Linux it uses gtk2 depends_on "gtk+" depends_on "pango" depends_on "sqlite" end def install args = std_cmake_args unless OS.mac? args << "-DAPR_LIBRARY=#{Formula["apr"].libexec}/lib" args << "-DAPR_INCLUDE_DIR=#{Formula["apr"].libexec}/include/apr-1" args << "-DAPRUTIL_LIBRARY=#{Formula["apr-util"].libexec}/lib" args << "-DAPRUTIL_INCLUDE_DIR=#{Formula["apr-util"].libexec}/include/apr-1" end # Let cmake download its own copy of MariaDBConnector during build and statically link it. # It is because there is no easy way to define we just need any one of mariadb, mariadb-connector-c, # mysql, and mysql-client. system "cmake", ".", "-G", "Ninja", "-DSTATIC_DEPS=MariaDBConnector", "-DRELOCATABLE=OFF", "-DRUN_LDCONFIG=OFF", *args system "ninja", "install" end def caveats s = "" if HOMEBREW_PREFIX.to_s != "/usr/local" s << <<~EOS You must add the following line to your .bashrc or equivalent: export NEKOPATH="#{HOMEBREW_PREFIX}/lib/neko" EOS end s end test do ENV["NEKOPATH"] = "#{HOMEBREW_PREFIX}/lib/neko" system "#{bin}/neko", "-version" end end neko: update 2.3.0_1 bottle. Closes #17393. Signed-off-by: Dawid Dziurla <c4a7db180859322ef5630a1dfc2805b5bc97fc25@gmail.com> class Neko < Formula desc "High-level, dynamically typed programming language" homepage "https://nekovm.org/" url "https://github.com/HaxeFoundation/neko/archive/v2-3-0/neko-2.3.0.tar.gz" sha256 "850e7e317bdaf24ed652efeff89c1cb21380ca19f20e68a296c84f6bad4ee995" revision 1 head "https://github.com/HaxeFoundation/neko.git" bottle do cellar :any rebuild 1 sha256 "85b136ca63c944258f90bb2c429e0d698f26c1f18e4061b775f8499ec5dc5bf7" => :catalina sha256 "9fa6b1793f214b603e14a557521d22f7fabb1fea0a4794f2272269791431f744" => :mojave sha256 "0a3ce8e9c8caaa2cd0d3e32f7fd43d68f17240de051222f8c0090e2b2e4ce161" => :high_sierra sha256 "274d8c1066e52416bfb4005af46d66842a1a4832c15ba0dc2d67bf6a96382020" => :x86_64_linux end depends_on "cmake" => :build depends_on "ninja" => :build depends_on "pkg-config" => :build depends_on "bdw-gc" depends_on "mbedtls" depends_on "openssl@1.1" depends_on "pcre" unless OS.mac? depends_on "apr" depends_on "apr-util" depends_on "httpd" # On mac, neko uses carbon. On Linux it uses gtk2 depends_on "gtk+" depends_on "pango" depends_on "sqlite" end def install args = std_cmake_args unless OS.mac? args << "-DAPR_LIBRARY=#{Formula["apr"].libexec}/lib" args << "-DAPR_INCLUDE_DIR=#{Formula["apr"].libexec}/include/apr-1" args << "-DAPRUTIL_LIBRARY=#{Formula["apr-util"].libexec}/lib" args << "-DAPRUTIL_INCLUDE_DIR=#{Formula["apr-util"].libexec}/include/apr-1" end # Let cmake download its own copy of MariaDBConnector during build and statically link it. # It is because there is no easy way to define we just need any one of mariadb, mariadb-connector-c, # mysql, and mysql-client. system "cmake", ".", "-G", "Ninja", "-DSTATIC_DEPS=MariaDBConnector", "-DRELOCATABLE=OFF", "-DRUN_LDCONFIG=OFF", *args system "ninja", "install" end def caveats s = "" if HOMEBREW_PREFIX.to_s != "/usr/local" s << <<~EOS You must add the following line to your .bashrc or equivalent: export NEKOPATH="#{HOMEBREW_PREFIX}/lib/neko" EOS end s end test do ENV["NEKOPATH"] = "#{HOMEBREW_PREFIX}/lib/neko" system "#{bin}/neko", "-version" end end
class Newt < Formula homepage 'https://fedorahosted.org/newt/' url 'https://fedorahosted.org/releases/n/e/newt/newt-0.52.18.tar.gz' sha1 '2992c926bd3699ff0d6fd7549d4a8a018e3ac8fd' bottle do cellar :any sha1 "447b7cdf5ba5fb0be6bcaa80a9c30a5112071a87" => :yosemite sha1 "07bcf73d646dd489d10d68ded6811aa5a7d5ea57" => :mavericks sha1 "599600fa6e92c38dbaa7bb6e1138eda04a4c5bf1" => :mountain_lion end depends_on 'gettext' depends_on 'popt' depends_on 's-lang' depends_on :python => :optional # build dylibs with -dynamiclib; version libraries patch :p0 do url "https://trac.macports.org/export/132914/trunk/dports/devel/libnewt/files/patch-Makefile.in.diff" sha1 "f366a650ed100317344a3e7f49981a6dca1f4889" end def install args = ["--prefix=#{prefix}", "--without-tcl"] args << "--without-python" if build.without? 'python' inreplace "Makefile.in" do |s| # name libraries correctly # https://bugzilla.redhat.com/show_bug.cgi?id=1192285 s.gsub! "libnewt.$(SOEXT).$(SONAME)", "libnewt.$(SONAME).dylib" s.gsub! "libnewt.$(SOEXT).$(VERSION)", "libnewt.$(VERSION).dylib" # don't link to libpython.dylib # causes https://github.com/Homebrew/homebrew/issues/30252 # https://bugzilla.redhat.com/show_bug.cgi?id=1192286 s.gsub! "`$$pyconfig --ldflags`", '"-undefined dynamic_lookup"' s.gsub! "`$$pyconfig --libs`", '""' end system "./configure", *args system "make", "install" end end newt 0.52.18: Fix for Linuxbrew Closes Linuxbrew/linuxbrew#285 class Newt < Formula homepage 'https://fedorahosted.org/newt/' url 'https://fedorahosted.org/releases/n/e/newt/newt-0.52.18.tar.gz' sha1 '2992c926bd3699ff0d6fd7549d4a8a018e3ac8fd' bottle do cellar :any sha1 "447b7cdf5ba5fb0be6bcaa80a9c30a5112071a87" => :yosemite sha1 "07bcf73d646dd489d10d68ded6811aa5a7d5ea57" => :mavericks sha1 "599600fa6e92c38dbaa7bb6e1138eda04a4c5bf1" => :mountain_lion end depends_on 'gettext' depends_on 'popt' depends_on 's-lang' depends_on :python => :optional # build dylibs with -dynamiclib; version libraries patch :p0 do url "https://trac.macports.org/export/132914/trunk/dports/devel/libnewt/files/patch-Makefile.in.diff" sha1 "f366a650ed100317344a3e7f49981a6dca1f4889" end if OS.mac? def install args = ["--prefix=#{prefix}", "--without-tcl"] args << "--without-python" if build.without? 'python' inreplace "Makefile.in" do |s| # name libraries correctly # https://bugzilla.redhat.com/show_bug.cgi?id=1192285 s.gsub! "libnewt.$(SOEXT).$(SONAME)", "libnewt.$(SONAME).dylib" s.gsub! "libnewt.$(SOEXT).$(VERSION)", "libnewt.$(VERSION).dylib" # don't link to libpython.dylib # causes https://github.com/Homebrew/homebrew/issues/30252 # https://bugzilla.redhat.com/show_bug.cgi?id=1192286 s.gsub! "`$$pyconfig --ldflags`", '"-undefined dynamic_lookup"' s.gsub! "`$$pyconfig --libs`", '""' end if OS.mac? system "./configure", *args system "make", "install" end end
class Nfpm < Formula desc "Simple deb and rpm packager" homepage "https://nfpm.goreleaser.com/" url "https://github.com/goreleaser/nfpm/archive/v2.19.1.tar.gz" sha256 "e74ac198d2487946eba4a98bd90b89860568dfe0408046955122a6ff5ad17d6d" license "MIT" head "https://github.com/goreleaser/nfpm.git", branch: "master" bottle do sha256 cellar: :any_skip_relocation, arm64_monterey: "2adecaec6d8630f75e8dbb0ae234b0adcbb3149efa8ac5ae49da9f9a8dae17df" sha256 cellar: :any_skip_relocation, arm64_big_sur: "cb0e57d9ddbc83f7f355748183b8aea049bd3b7bc8a4aa89907b72cecee32107" sha256 cellar: :any_skip_relocation, monterey: "967a2da3ae6f632f38a6406d4605cc2b78cea63ff8ddb71f00fa1d440aa751d3" sha256 cellar: :any_skip_relocation, big_sur: "30061e26530637c5848fc199fbb29b8b0fdf10917dc1cca19214efbd65b65c7c" sha256 cellar: :any_skip_relocation, catalina: "77d60c61a0340925ccb5f22131a29eac6aa8fb5ea94f26b45ca4c0b2dc970141" sha256 cellar: :any_skip_relocation, x86_64_linux: "e1235de303770c4a1923aab01c37791f47d5f4854a0f3a16b740e8d820b1c567" end depends_on "go" => :build def install system "go", "build", *std_go_args(ldflags: "-X main.version=v#{version}"), "./cmd/nfpm" end test do assert_match version.to_s, shell_output("#{bin}/nfpm --version 2>&1") system bin/"nfpm", "init" assert_match "nfpm example config file", File.read(testpath/"nfpm.yaml") # remove the generated default one # and use stubbed one for another test File.delete(testpath/"nfpm.yaml") (testpath/"nfpm.yaml").write <<~EOS name: "foo" arch: "amd64" platform: "linux" version: "v1.0.0" section: "default" priority: "extra" EOS system bin/"nfpm", "pkg", "--packager", "deb", "--target", "." assert_predicate testpath/"foo_1.0.0_amd64.deb", :exist? end end nfpm: update 2.19.1 bottle. class Nfpm < Formula desc "Simple deb and rpm packager" homepage "https://nfpm.goreleaser.com/" url "https://github.com/goreleaser/nfpm/archive/v2.19.1.tar.gz" sha256 "e74ac198d2487946eba4a98bd90b89860568dfe0408046955122a6ff5ad17d6d" license "MIT" head "https://github.com/goreleaser/nfpm.git", branch: "master" bottle do sha256 cellar: :any_skip_relocation, arm64_monterey: "475a33a464317145f28c3d7c5897945cca1fe0bc98cd13bf2996af46822ddf6e" sha256 cellar: :any_skip_relocation, arm64_big_sur: "bfcbe69a214225d2895ab031152c25674f0b301dda2ecffda9f16b2149487108" sha256 cellar: :any_skip_relocation, monterey: "85886b41ef75f783a8f298b918ca2df48ec16aa68e43aea196e3867b96fb8a5d" sha256 cellar: :any_skip_relocation, big_sur: "7e6acb6806967369cbdff70c3dd1f0113b708417d7d31cf5e84727f5115bf566" sha256 cellar: :any_skip_relocation, catalina: "e8fec781ec17faf6a4467fdca6f19c4933d42075accb2f75043f662ceeb9a34e" sha256 cellar: :any_skip_relocation, x86_64_linux: "8f6b5d2839b509900d2c9d435bff524f0518eedfa96ca9fea3c5a6ddbf33ee6e" end depends_on "go" => :build def install system "go", "build", *std_go_args(ldflags: "-X main.version=v#{version}"), "./cmd/nfpm" end test do assert_match version.to_s, shell_output("#{bin}/nfpm --version 2>&1") system bin/"nfpm", "init" assert_match "nfpm example config file", File.read(testpath/"nfpm.yaml") # remove the generated default one # and use stubbed one for another test File.delete(testpath/"nfpm.yaml") (testpath/"nfpm.yaml").write <<~EOS name: "foo" arch: "amd64" platform: "linux" version: "v1.0.0" section: "default" priority: "extra" EOS system bin/"nfpm", "pkg", "--packager", "deb", "--target", "." assert_predicate testpath/"foo_1.0.0_amd64.deb", :exist? end end
class Nfpm < Formula desc "Simple deb and rpm packager" homepage "https://nfpm.goreleaser.com/" url "https://github.com/goreleaser/nfpm/archive/v2.2.4.tar.gz" sha256 "afff55ac4cb4875c6d42bb9f2eed96e942d39ebb7e3c26b27b8ef415ba3525b8" license "MIT" head "https://github.com/goreleaser/nfpm.git" bottle do sha256 cellar: :any_skip_relocation, arm64_big_sur: "b5865bf3035ba42cf8006693de37fa8186ce9a1b9bff4e747023f6e046e84b44" sha256 cellar: :any_skip_relocation, big_sur: "402e53dc2b7b5862650700d448d892a2871520824f1cff960c49a71024e2c2c9" sha256 cellar: :any_skip_relocation, catalina: "1adb3b0950732117f0fde089b6be96688d90f2d5bc69322fa77c45559a481b8a" sha256 cellar: :any_skip_relocation, mojave: "f443bac7b2f5fac7623ef365a9629c35321d83f48c374212356e847d410d3feb" end depends_on "go" => :build def install system "go", "build", "-ldflags", "-X main.version=v#{version}", *std_go_args, "./cmd/nfpm" end test do assert_match version.to_s, shell_output("#{bin}/nfpm --version 2>&1") system bin/"nfpm", "init" assert_match "nfpm example config file", File.read(testpath/"nfpm.yaml") # remove the generated default one # and use stubbed one for another test File.delete(testpath/"nfpm.yaml") (testpath/"nfpm.yaml").write <<~EOS name: "foo" arch: "amd64" platform: "linux" version: "v1.0.0" section: "default" priority: "extra" EOS system bin/"nfpm", "pkg", "--packager", "deb", "--target", "." assert_predicate testpath/"foo_1.0.0_amd64.deb", :exist? end end nfpm: update 2.2.4 bottle. class Nfpm < Formula desc "Simple deb and rpm packager" homepage "https://nfpm.goreleaser.com/" url "https://github.com/goreleaser/nfpm/archive/v2.2.4.tar.gz" sha256 "afff55ac4cb4875c6d42bb9f2eed96e942d39ebb7e3c26b27b8ef415ba3525b8" license "MIT" head "https://github.com/goreleaser/nfpm.git" bottle do sha256 cellar: :any_skip_relocation, arm64_big_sur: "f480e6586278f8e3871e7d5fd2002e83d9076db04af961ed660c3ff75d3e6594" sha256 cellar: :any_skip_relocation, big_sur: "f4edad78176b2b73c91231fa33c0b10b1e8b3a7b5fa9522d040a32f5ada70f0f" sha256 cellar: :any_skip_relocation, catalina: "f0b0c1091201fe254c14078114c41e2fcead584509d2faeefccaece5fa210aee" sha256 cellar: :any_skip_relocation, mojave: "75fec197442bd4d34a177a11af910efbd15362011fde5f0c5734dfe7a3ef9f4c" end depends_on "go" => :build def install system "go", "build", "-ldflags", "-X main.version=v#{version}", *std_go_args, "./cmd/nfpm" end test do assert_match version.to_s, shell_output("#{bin}/nfpm --version 2>&1") system bin/"nfpm", "init" assert_match "nfpm example config file", File.read(testpath/"nfpm.yaml") # remove the generated default one # and use stubbed one for another test File.delete(testpath/"nfpm.yaml") (testpath/"nfpm.yaml").write <<~EOS name: "foo" arch: "amd64" platform: "linux" version: "v1.0.0" section: "default" priority: "extra" EOS system bin/"nfpm", "pkg", "--packager", "deb", "--target", "." assert_predicate testpath/"foo_1.0.0_amd64.deb", :exist? end end
class Nfpm < Formula desc "Simple deb and rpm packager" homepage "https://nfpm.goreleaser.com/" url "https://github.com/goreleaser/nfpm/archive/v2.7.1.tar.gz" sha256 "827cafe1647d68e5db7c959922f83503df7f3b2e06221e184bfa0f53455eace6" license "MIT" head "https://github.com/goreleaser/nfpm.git", branch: "master" bottle do sha256 cellar: :any_skip_relocation, arm64_monterey: "73d70d1b73cd42c036810496f632da3f1dac3b123194aa5e267a06bc15220fa9" sha256 cellar: :any_skip_relocation, arm64_big_sur: "c96419d99b4fd4f9abd0a5fc56d472932df3b8de93a3ef9f0583502be2a8566e" sha256 cellar: :any_skip_relocation, monterey: "d5b622559f6adf62dca768f86cb6048437e49c174312c0d1ca026aa1b82a303b" sha256 cellar: :any_skip_relocation, big_sur: "830b51685767b1340fc2bbebd8c694aa095a3bf0b463f63cc5a16ebdc956a794" sha256 cellar: :any_skip_relocation, catalina: "acc1c9f143ae7c704cf30a0af6982b1dbcaa04f66e5cc07b71918f9a8e0a988f" sha256 cellar: :any_skip_relocation, mojave: "acad9d91d9bdccb3ea583f1d4e17fac7d1e2e9964546d311fa858538f32fd293" sha256 cellar: :any_skip_relocation, x86_64_linux: "59322fd2abc65f45e44dfeee49eef49b34b0d05e5de68b6f20570fc986ddabb4" end depends_on "go" => :build def install system "go", "build", "-ldflags", "-X main.version=v#{version}", *std_go_args, "./cmd/nfpm" end test do assert_match version.to_s, shell_output("#{bin}/nfpm --version 2>&1") system bin/"nfpm", "init" assert_match "nfpm example config file", File.read(testpath/"nfpm.yaml") # remove the generated default one # and use stubbed one for another test File.delete(testpath/"nfpm.yaml") (testpath/"nfpm.yaml").write <<~EOS name: "foo" arch: "amd64" platform: "linux" version: "v1.0.0" section: "default" priority: "extra" EOS system bin/"nfpm", "pkg", "--packager", "deb", "--target", "." assert_predicate testpath/"foo_1.0.0_amd64.deb", :exist? end end nfpm 2.8.0 Closes #88943. Signed-off-by: Thierry Moisan <8bf87a6c4caed0437859f8c8fafc6782533e4540@gmail.com> Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com> class Nfpm < Formula desc "Simple deb and rpm packager" homepage "https://nfpm.goreleaser.com/" url "https://github.com/goreleaser/nfpm/archive/v2.8.0.tar.gz" sha256 "a296c454de21ecb96ed3cdc507de710d196e08a339d9ab24cebc53f4c1b0b7df" license "MIT" head "https://github.com/goreleaser/nfpm.git", branch: "master" bottle do sha256 cellar: :any_skip_relocation, arm64_monterey: "73d70d1b73cd42c036810496f632da3f1dac3b123194aa5e267a06bc15220fa9" sha256 cellar: :any_skip_relocation, arm64_big_sur: "c96419d99b4fd4f9abd0a5fc56d472932df3b8de93a3ef9f0583502be2a8566e" sha256 cellar: :any_skip_relocation, monterey: "d5b622559f6adf62dca768f86cb6048437e49c174312c0d1ca026aa1b82a303b" sha256 cellar: :any_skip_relocation, big_sur: "830b51685767b1340fc2bbebd8c694aa095a3bf0b463f63cc5a16ebdc956a794" sha256 cellar: :any_skip_relocation, catalina: "acc1c9f143ae7c704cf30a0af6982b1dbcaa04f66e5cc07b71918f9a8e0a988f" sha256 cellar: :any_skip_relocation, mojave: "acad9d91d9bdccb3ea583f1d4e17fac7d1e2e9964546d311fa858538f32fd293" sha256 cellar: :any_skip_relocation, x86_64_linux: "59322fd2abc65f45e44dfeee49eef49b34b0d05e5de68b6f20570fc986ddabb4" end depends_on "go" => :build def install system "go", "build", "-ldflags", "-X main.version=v#{version}", *std_go_args, "./cmd/nfpm" end test do assert_match version.to_s, shell_output("#{bin}/nfpm --version 2>&1") system bin/"nfpm", "init" assert_match "nfpm example config file", File.read(testpath/"nfpm.yaml") # remove the generated default one # and use stubbed one for another test File.delete(testpath/"nfpm.yaml") (testpath/"nfpm.yaml").write <<~EOS name: "foo" arch: "amd64" platform: "linux" version: "v1.0.0" section: "default" priority: "extra" EOS system bin/"nfpm", "pkg", "--packager", "deb", "--target", "." assert_predicate testpath/"foo_1.0.0_amd64.deb", :exist? end end
class Node < Formula desc "Platform built on V8 to build network applications" homepage "https://nodejs.org/" url "https://nodejs.org/dist/v18.7.0/node-v18.7.0.tar.xz" sha256 "8834a33c92dfe6ba8903e6715caeaa25dff4657e703c54cd06ec113493e2c3c2" license "MIT" head "https://github.com/nodejs/node.git", branch: "main" livecheck do url "https://nodejs.org/dist/" regex(%r{href=["']?v?(\d+(?:\.\d+)+)/?["' >]}i) end bottle do sha256 cellar: :any, arm64_monterey: "8b420368d645afc4bd782ac72c3e4204b46a1fc1c2708e05920972b32e3f76e9" sha256 cellar: :any, arm64_big_sur: "47895583cb2fd1f3ed6479242e17f4e1058787895e5ae8a851ed18e21783999e" sha256 cellar: :any, monterey: "505665694e612fdf11b2c3ada51463d38ad1b9157f068d19fda7a5cf07aeea97" sha256 cellar: :any, big_sur: "0788b7bf9767fa05b8e2d9b0a3ef83e03a42df402b6284308f1c93e6c0de4c49" sha256 cellar: :any, catalina: "c6a5e2b83886eec06116f02ebc092e45f530b8b10149f883acc1752716380e7d" sha256 cellar: :any_skip_relocation, x86_64_linux: "c9bded069b73b6f88b8ea4859ca307cf76c19a8fcf22ce9e04ba0ae539a452ed" end depends_on "pkg-config" => :build depends_on "python@3.10" => :build depends_on "brotli" depends_on "c-ares" depends_on "icu4c" depends_on "libnghttp2" depends_on "libuv" depends_on "openssl@1.1" uses_from_macos "python", since: :catalina uses_from_macos "zlib" on_macos do depends_on "llvm" => [:build, :test] if DevelopmentTools.clang_build_version <= 1100 end on_linux do depends_on "gcc" end fails_with :clang do build 1100 cause <<~EOS error: calling a private constructor of class 'v8::internal::(anonymous namespace)::RegExpParserImpl<uint8_t>' EOS end fails_with gcc: "5" # We track major/minor from upstream Node releases. # We will accept *important* npm patch releases when necessary. resource "npm" do url "https://registry.npmjs.org/npm/-/npm-8.15.0.tgz" sha256 "6bdf219336595f7bffde7cb3996fffc96fcc2bdac3f1952491937d6a9d89db92" end def install ENV.remove "HOMEBREW_LIBRARY_PATHS", Formula["llvm"].opt_lib ENV.llvm_clang if OS.mac? && (DevelopmentTools.clang_build_version <= 1100) # make sure subprocesses spawned by make are using our Python 3 ENV["PYTHON"] = which("python3") # Never install the bundled "npm", always prefer our # installation from tarball for better packaging control. args = %W[ --prefix=#{prefix} --without-npm --without-corepack --with-intl=system-icu --shared-libuv --shared-nghttp2 --shared-openssl --shared-zlib --shared-brotli --shared-cares --shared-libuv-includes=#{Formula["libuv"].include} --shared-libuv-libpath=#{Formula["libuv"].lib} --shared-nghttp2-includes=#{Formula["libnghttp2"].include} --shared-nghttp2-libpath=#{Formula["libnghttp2"].lib} --shared-openssl-includes=#{Formula["openssl@1.1"].include} --shared-openssl-libpath=#{Formula["openssl@1.1"].lib} --shared-brotli-includes=#{Formula["brotli"].include} --shared-brotli-libpath=#{Formula["brotli"].lib} --shared-cares-includes=#{Formula["c-ares"].include} --shared-cares-libpath=#{Formula["c-ares"].lib} --openssl-use-def-ca-store ] args << "--tag=head" if build.head? # Enabling LTO errors on Linux with: # terminate called after throwing an instance of 'std::out_of_range' # Pre-Catalina macOS also can't build with LTO # LTO is unpleasant if you have to build from source. args << "--enable-lto" if MacOS.version >= :catalina && build.bottle? system "./configure", *args system "make", "install" # Allow npm to find Node before installation has completed. ENV.prepend_path "PATH", bin bootstrap = buildpath/"npm_bootstrap" bootstrap.install resource("npm") # These dirs must exists before npm install. mkdir_p libexec/"lib" system "node", bootstrap/"bin/npm-cli.js", "install", "-ddd", "--global", "--prefix=#{libexec}", resource("npm").cached_download # The `package.json` stores integrity information about the above passed # in `cached_download` npm resource, which breaks `npm -g outdated npm`. # This copies back over the vanilla `package.json` to fix this issue. cp bootstrap/"package.json", libexec/"lib/node_modules/npm" # These symlinks are never used & they've caused issues in the past. rm_rf libexec/"share" bash_completion.install bootstrap/"lib/utils/completion.sh" => "npm" end def post_install node_modules = HOMEBREW_PREFIX/"lib/node_modules" node_modules.mkpath # Kill npm but preserve all other modules across node updates/upgrades. rm_rf node_modules/"npm" cp_r libexec/"lib/node_modules/npm", node_modules # This symlink doesn't hop into homebrew_prefix/bin automatically so # we make our own. This is a small consequence of our # bottle-npm-and-retain-a-private-copy-in-libexec setup # All other installs **do** symlink to homebrew_prefix/bin correctly. # We ln rather than cp this because doing so mimics npm's normal install. ln_sf node_modules/"npm/bin/npm-cli.js", HOMEBREW_PREFIX/"bin/npm" ln_sf node_modules/"npm/bin/npx-cli.js", HOMEBREW_PREFIX/"bin/npx" # Create manpage symlinks (or overwrite the old ones) %w[man1 man5 man7].each do |man| # Dirs must exist first: https://github.com/Homebrew/legacy-homebrew/issues/35969 mkdir_p HOMEBREW_PREFIX/"share/man/#{man}" # still needed to migrate from copied file manpages to symlink manpages rm_f Dir[HOMEBREW_PREFIX/"share/man/#{man}/{npm.,npm-,npmrc.,package.json.,npx.}*"] ln_sf Dir[node_modules/"npm/man/#{man}/{npm,package-,shrinkwrap-,npx}*"], HOMEBREW_PREFIX/"share/man/#{man}" end (node_modules/"npm/npmrc").atomic_write("prefix = #{HOMEBREW_PREFIX}\n") end test do # Make sure Mojave does not have `CC=llvm_clang`. ENV.clang if OS.mac? path = testpath/"test.js" path.write "console.log('hello');" output = shell_output("#{bin}/node #{path}").strip assert_equal "hello", output output = shell_output("#{bin}/node -e 'console.log(new Intl.NumberFormat(\"en-EN\").format(1234.56))'").strip assert_equal "1,234.56", output output = shell_output("#{bin}/node -e 'console.log(new Intl.NumberFormat(\"de-DE\").format(1234.56))'").strip assert_equal "1.234,56", output # make sure npm can find node ENV.prepend_path "PATH", opt_bin ENV.delete "NVM_NODEJS_ORG_MIRROR" assert_equal which("node"), opt_bin/"node" assert_predicate HOMEBREW_PREFIX/"bin/npm", :exist?, "npm must exist" assert_predicate HOMEBREW_PREFIX/"bin/npm", :executable?, "npm must be executable" npm_args = ["-ddd", "--cache=#{HOMEBREW_CACHE}/npm_cache", "--build-from-source"] system HOMEBREW_PREFIX/"bin/npm", *npm_args, "install", "npm@latest" system HOMEBREW_PREFIX/"bin/npm", *npm_args, "install", "ref-napi" unless head? assert_predicate HOMEBREW_PREFIX/"bin/npx", :exist?, "npx must exist" assert_predicate HOMEBREW_PREFIX/"bin/npx", :executable?, "npx must be executable" assert_match "< hello >", shell_output("#{HOMEBREW_PREFIX}/bin/npx --yes cowsay hello") end end node: update 18.7.0 bottle. class Node < Formula desc "Platform built on V8 to build network applications" homepage "https://nodejs.org/" url "https://nodejs.org/dist/v18.7.0/node-v18.7.0.tar.xz" sha256 "8834a33c92dfe6ba8903e6715caeaa25dff4657e703c54cd06ec113493e2c3c2" license "MIT" head "https://github.com/nodejs/node.git", branch: "main" livecheck do url "https://nodejs.org/dist/" regex(%r{href=["']?v?(\d+(?:\.\d+)+)/?["' >]}i) end bottle do sha256 cellar: :any, arm64_monterey: "5bc3bbc7796679a30ef86748accee8170fad11bccea0fcc1fc129f2a51b4b6fa" sha256 cellar: :any, arm64_big_sur: "e29c164c7303516f06817f5b5aeec5e857b53d2f35d20d0eaeb32081a97d3ca9" sha256 cellar: :any, monterey: "cbcfe985fe9bdc27d487144feffd68e8ae0fdc247c312588ad3cf52e80e02183" sha256 cellar: :any, big_sur: "ce4293b284db54f3a1144728a7b0c8226c9fe026847cda4aad50b7a52ca87c1e" sha256 cellar: :any, catalina: "da43d1de42d234e2385bcbc97b12c63b7592aa7e5489ee02c97e6773487d7888" sha256 cellar: :any_skip_relocation, x86_64_linux: "151dbd4c085946efe2da970d1fbd4859393a7ce72ba7ad68aa0a6b33572ccccf" end depends_on "pkg-config" => :build depends_on "python@3.10" => :build depends_on "brotli" depends_on "c-ares" depends_on "icu4c" depends_on "libnghttp2" depends_on "libuv" depends_on "openssl@1.1" uses_from_macos "python", since: :catalina uses_from_macos "zlib" on_macos do depends_on "llvm" => [:build, :test] if DevelopmentTools.clang_build_version <= 1100 end on_linux do depends_on "gcc" end fails_with :clang do build 1100 cause <<~EOS error: calling a private constructor of class 'v8::internal::(anonymous namespace)::RegExpParserImpl<uint8_t>' EOS end fails_with gcc: "5" # We track major/minor from upstream Node releases. # We will accept *important* npm patch releases when necessary. resource "npm" do url "https://registry.npmjs.org/npm/-/npm-8.15.0.tgz" sha256 "6bdf219336595f7bffde7cb3996fffc96fcc2bdac3f1952491937d6a9d89db92" end def install ENV.remove "HOMEBREW_LIBRARY_PATHS", Formula["llvm"].opt_lib ENV.llvm_clang if OS.mac? && (DevelopmentTools.clang_build_version <= 1100) # make sure subprocesses spawned by make are using our Python 3 ENV["PYTHON"] = which("python3") # Never install the bundled "npm", always prefer our # installation from tarball for better packaging control. args = %W[ --prefix=#{prefix} --without-npm --without-corepack --with-intl=system-icu --shared-libuv --shared-nghttp2 --shared-openssl --shared-zlib --shared-brotli --shared-cares --shared-libuv-includes=#{Formula["libuv"].include} --shared-libuv-libpath=#{Formula["libuv"].lib} --shared-nghttp2-includes=#{Formula["libnghttp2"].include} --shared-nghttp2-libpath=#{Formula["libnghttp2"].lib} --shared-openssl-includes=#{Formula["openssl@1.1"].include} --shared-openssl-libpath=#{Formula["openssl@1.1"].lib} --shared-brotli-includes=#{Formula["brotli"].include} --shared-brotli-libpath=#{Formula["brotli"].lib} --shared-cares-includes=#{Formula["c-ares"].include} --shared-cares-libpath=#{Formula["c-ares"].lib} --openssl-use-def-ca-store ] args << "--tag=head" if build.head? # Enabling LTO errors on Linux with: # terminate called after throwing an instance of 'std::out_of_range' # Pre-Catalina macOS also can't build with LTO # LTO is unpleasant if you have to build from source. args << "--enable-lto" if MacOS.version >= :catalina && build.bottle? system "./configure", *args system "make", "install" # Allow npm to find Node before installation has completed. ENV.prepend_path "PATH", bin bootstrap = buildpath/"npm_bootstrap" bootstrap.install resource("npm") # These dirs must exists before npm install. mkdir_p libexec/"lib" system "node", bootstrap/"bin/npm-cli.js", "install", "-ddd", "--global", "--prefix=#{libexec}", resource("npm").cached_download # The `package.json` stores integrity information about the above passed # in `cached_download` npm resource, which breaks `npm -g outdated npm`. # This copies back over the vanilla `package.json` to fix this issue. cp bootstrap/"package.json", libexec/"lib/node_modules/npm" # These symlinks are never used & they've caused issues in the past. rm_rf libexec/"share" bash_completion.install bootstrap/"lib/utils/completion.sh" => "npm" end def post_install node_modules = HOMEBREW_PREFIX/"lib/node_modules" node_modules.mkpath # Kill npm but preserve all other modules across node updates/upgrades. rm_rf node_modules/"npm" cp_r libexec/"lib/node_modules/npm", node_modules # This symlink doesn't hop into homebrew_prefix/bin automatically so # we make our own. This is a small consequence of our # bottle-npm-and-retain-a-private-copy-in-libexec setup # All other installs **do** symlink to homebrew_prefix/bin correctly. # We ln rather than cp this because doing so mimics npm's normal install. ln_sf node_modules/"npm/bin/npm-cli.js", HOMEBREW_PREFIX/"bin/npm" ln_sf node_modules/"npm/bin/npx-cli.js", HOMEBREW_PREFIX/"bin/npx" # Create manpage symlinks (or overwrite the old ones) %w[man1 man5 man7].each do |man| # Dirs must exist first: https://github.com/Homebrew/legacy-homebrew/issues/35969 mkdir_p HOMEBREW_PREFIX/"share/man/#{man}" # still needed to migrate from copied file manpages to symlink manpages rm_f Dir[HOMEBREW_PREFIX/"share/man/#{man}/{npm.,npm-,npmrc.,package.json.,npx.}*"] ln_sf Dir[node_modules/"npm/man/#{man}/{npm,package-,shrinkwrap-,npx}*"], HOMEBREW_PREFIX/"share/man/#{man}" end (node_modules/"npm/npmrc").atomic_write("prefix = #{HOMEBREW_PREFIX}\n") end test do # Make sure Mojave does not have `CC=llvm_clang`. ENV.clang if OS.mac? path = testpath/"test.js" path.write "console.log('hello');" output = shell_output("#{bin}/node #{path}").strip assert_equal "hello", output output = shell_output("#{bin}/node -e 'console.log(new Intl.NumberFormat(\"en-EN\").format(1234.56))'").strip assert_equal "1,234.56", output output = shell_output("#{bin}/node -e 'console.log(new Intl.NumberFormat(\"de-DE\").format(1234.56))'").strip assert_equal "1.234,56", output # make sure npm can find node ENV.prepend_path "PATH", opt_bin ENV.delete "NVM_NODEJS_ORG_MIRROR" assert_equal which("node"), opt_bin/"node" assert_predicate HOMEBREW_PREFIX/"bin/npm", :exist?, "npm must exist" assert_predicate HOMEBREW_PREFIX/"bin/npm", :executable?, "npm must be executable" npm_args = ["-ddd", "--cache=#{HOMEBREW_CACHE}/npm_cache", "--build-from-source"] system HOMEBREW_PREFIX/"bin/npm", *npm_args, "install", "npm@latest" system HOMEBREW_PREFIX/"bin/npm", *npm_args, "install", "ref-napi" unless head? assert_predicate HOMEBREW_PREFIX/"bin/npx", :exist?, "npx must exist" assert_predicate HOMEBREW_PREFIX/"bin/npx", :executable?, "npx must be executable" assert_match "< hello >", shell_output("#{HOMEBREW_PREFIX}/bin/npx --yes cowsay hello") end end
class Node < Formula desc "Platform built on V8 to build network applications" homepage "https://nodejs.org/" url "https://nodejs.org/dist/v10.2.1/node-v10.2.1.tar.xz" sha256 "2109063607dd4b23c8e05973d190c83d5e2ee9ea48fd406f43f8de7afd17b9ce" head "https://github.com/nodejs/node.git" bottle do sha256 "01eff48831be2d988a3c963ccf4b24f3783098b8903acf393bd7e85ef9aaaf29" => :high_sierra sha256 "e2c3f4541c056fbad01625529bbf97c632fa9fc71e397361543c32db217d2f5f" => :sierra sha256 "3defb84cbc38b31ffd7a24cb96a8a275d744db5a85bd67f99eb1bf696ee67534" => :el_capitan end option "with-debug", "Build with debugger hooks" option "with-openssl@1.1", "Build against Homebrew's OpenSSL instead of the bundled OpenSSL" option "without-npm", "npm will not be installed" option "without-completion", "npm bash completion will not be installed" option "without-icu4c", "Build with small-icu (English only) instead of system-icu (all locales)" deprecated_option "enable-debug" => "with-debug" deprecated_option "with-openssl" => "with-openssl@1.1" depends_on "python@2" => :build depends_on "pkg-config" => :build depends_on "icu4c" => :recommended depends_on "openssl@1.1" => :optional # Per upstream - "Need g++ 4.8 or clang++ 3.4". fails_with :clang if MacOS.version <= :snow_leopard fails_with :gcc_4_0 fails_with :gcc ("4.3".."4.7").each do |n| fails_with :gcc => n end # We track major/minor from upstream Node releases. # We will accept *important* npm patch releases when necessary. resource "npm" do url "https://registry.npmjs.org/npm/-/npm-5.6.0.tgz" sha256 "b1f0de3767136c1d7b4b0f10e6eb2fb3397e2fe11e4c9cddcd0030ad1af9eddd" end def install # Reduce memory usage below 4 GB for Circle CI. ENV["MAKEFLAGS"] = "-j8" if ENV["CIRCLECI"] # Never install the bundled "npm", always prefer our # installation from tarball for better packaging control. args = %W[--prefix=#{prefix} --without-npm] args << "--debug" if build.with? "debug" args << "--with-intl=system-icu" if build.with? "icu4c" args << "--shared-openssl" if build.with? "openssl@1.1" args << "--tag=head" if build.head? system "./configure", *args system "make", "install" if build.with? "npm" # Allow npm to find Node before installation has completed. ENV.prepend_path "PATH", bin bootstrap = buildpath/"npm_bootstrap" bootstrap.install resource("npm") system "node", bootstrap/"bin/npm-cli.js", "install", "-ddd", "--global", "--prefix=#{libexec}", resource("npm").cached_download # The `package.json` stores integrity information about the above passed # in `cached_download` npm resource, which breaks `npm -g outdated npm`. # This copies back over the vanilla `package.json` to fix this issue. cp bootstrap/"package.json", libexec/"lib/node_modules/npm" # These symlinks are never used & they've caused issues in the past. rm_rf libexec/"share" # suppress incorrect node 10 incompatibility warning from npm # remove during next npm upgrade (to npm 5.9+ or npm 6.0+) inreplace libexec/"lib/node_modules/npm/lib/utils/unsupported.js", "{ver: '9', min: '9.0.0'}", "{ver: '9', min: '9.0.0'}, {ver: '10', min: '10.0.0'}" if build.with? "completion" bash_completion.install \ bootstrap/"lib/utils/completion.sh" => "npm" end end end def post_install return if build.without? "npm" node_modules = HOMEBREW_PREFIX/"lib/node_modules" node_modules.mkpath # Kill npm but preserve all other modules across node updates/upgrades. rm_rf node_modules/"npm" cp_r libexec/"lib/node_modules/npm", node_modules # This symlink doesn't hop into homebrew_prefix/bin automatically so # we make our own. This is a small consequence of our # bottle-npm-and-retain-a-private-copy-in-libexec setup # All other installs **do** symlink to homebrew_prefix/bin correctly. # We ln rather than cp this because doing so mimics npm's normal install. ln_sf node_modules/"npm/bin/npm-cli.js", HOMEBREW_PREFIX/"bin/npm" ln_sf node_modules/"npm/bin/npx-cli.js", HOMEBREW_PREFIX/"bin/npx" # Let's do the manpage dance. It's just a jump to the left. # And then a step to the right, with your hand on rm_f. %w[man1 man5 man7].each do |man| # Dirs must exist first: https://github.com/Homebrew/legacy-homebrew/issues/35969 mkdir_p HOMEBREW_PREFIX/"share/man/#{man}" rm_f Dir[HOMEBREW_PREFIX/"share/man/#{man}/{npm.,npm-,npmrc.,package.json.,npx.}*"] cp Dir[libexec/"lib/node_modules/npm/man/#{man}/{npm,package.json,npx}*"], HOMEBREW_PREFIX/"share/man/#{man}" end (node_modules/"npm/npmrc").atomic_write("prefix = #{HOMEBREW_PREFIX}\n") end def caveats if build.without? "npm" <<~EOS Homebrew has NOT installed npm. If you later install it, you should supplement your NODE_PATH with the npm module folder: #{HOMEBREW_PREFIX}/lib/node_modules EOS end end test do path = testpath/"test.js" path.write "console.log('hello');" output = shell_output("#{bin}/node #{path}").strip assert_equal "hello", output output = shell_output("#{bin}/node -e 'console.log(new Intl.NumberFormat(\"en-EN\").format(1234.56))'").strip assert_equal "1,234.56", output if build.with? "icu4c" output = shell_output("#{bin}/node -e 'console.log(new Intl.NumberFormat(\"de-DE\").format(1234.56))'").strip assert_equal "1.234,56", output end if build.with? "npm" # make sure npm can find node ENV.prepend_path "PATH", opt_bin ENV.delete "NVM_NODEJS_ORG_MIRROR" assert_equal which("node"), opt_bin/"node" assert_predicate HOMEBREW_PREFIX/"bin/npm", :exist?, "npm must exist" assert_predicate HOMEBREW_PREFIX/"bin/npm", :executable?, "npm must be executable" npm_args = ["-ddd", "--cache=#{HOMEBREW_CACHE}/npm_cache", "--build-from-source"] system "#{HOMEBREW_PREFIX}/bin/npm", *npm_args, "install", "npm@latest" system "#{HOMEBREW_PREFIX}/bin/npm", *npm_args, "install", "bufferutil" unless head? assert_predicate HOMEBREW_PREFIX/"bin/npx", :exist?, "npx must exist" assert_predicate HOMEBREW_PREFIX/"bin/npx", :executable?, "npx must be executable" assert_match "< hello >", shell_output("#{HOMEBREW_PREFIX}/bin/npx cowsay hello") end end end node: update 10.2.1 bottle for Linuxbrew. class Node < Formula desc "Platform built on V8 to build network applications" homepage "https://nodejs.org/" url "https://nodejs.org/dist/v10.2.1/node-v10.2.1.tar.xz" sha256 "2109063607dd4b23c8e05973d190c83d5e2ee9ea48fd406f43f8de7afd17b9ce" head "https://github.com/nodejs/node.git" bottle do sha256 "01eff48831be2d988a3c963ccf4b24f3783098b8903acf393bd7e85ef9aaaf29" => :high_sierra sha256 "e2c3f4541c056fbad01625529bbf97c632fa9fc71e397361543c32db217d2f5f" => :sierra sha256 "3defb84cbc38b31ffd7a24cb96a8a275d744db5a85bd67f99eb1bf696ee67534" => :el_capitan sha256 "7ec2877a095f0ab51691370aca06e7ad1c528f510a813b180788063904bd6409" => :x86_64_linux end option "with-debug", "Build with debugger hooks" option "with-openssl@1.1", "Build against Homebrew's OpenSSL instead of the bundled OpenSSL" option "without-npm", "npm will not be installed" option "without-completion", "npm bash completion will not be installed" option "without-icu4c", "Build with small-icu (English only) instead of system-icu (all locales)" deprecated_option "enable-debug" => "with-debug" deprecated_option "with-openssl" => "with-openssl@1.1" depends_on "python@2" => :build depends_on "pkg-config" => :build depends_on "icu4c" => :recommended depends_on "openssl@1.1" => :optional # Per upstream - "Need g++ 4.8 or clang++ 3.4". fails_with :clang if MacOS.version <= :snow_leopard fails_with :gcc_4_0 fails_with :gcc ("4.3".."4.7").each do |n| fails_with :gcc => n end # We track major/minor from upstream Node releases. # We will accept *important* npm patch releases when necessary. resource "npm" do url "https://registry.npmjs.org/npm/-/npm-5.6.0.tgz" sha256 "b1f0de3767136c1d7b4b0f10e6eb2fb3397e2fe11e4c9cddcd0030ad1af9eddd" end def install # Reduce memory usage below 4 GB for Circle CI. ENV["MAKEFLAGS"] = "-j8" if ENV["CIRCLECI"] # Never install the bundled "npm", always prefer our # installation from tarball for better packaging control. args = %W[--prefix=#{prefix} --without-npm] args << "--debug" if build.with? "debug" args << "--with-intl=system-icu" if build.with? "icu4c" args << "--shared-openssl" if build.with? "openssl@1.1" args << "--tag=head" if build.head? system "./configure", *args system "make", "install" if build.with? "npm" # Allow npm to find Node before installation has completed. ENV.prepend_path "PATH", bin bootstrap = buildpath/"npm_bootstrap" bootstrap.install resource("npm") system "node", bootstrap/"bin/npm-cli.js", "install", "-ddd", "--global", "--prefix=#{libexec}", resource("npm").cached_download # The `package.json` stores integrity information about the above passed # in `cached_download` npm resource, which breaks `npm -g outdated npm`. # This copies back over the vanilla `package.json` to fix this issue. cp bootstrap/"package.json", libexec/"lib/node_modules/npm" # These symlinks are never used & they've caused issues in the past. rm_rf libexec/"share" # suppress incorrect node 10 incompatibility warning from npm # remove during next npm upgrade (to npm 5.9+ or npm 6.0+) inreplace libexec/"lib/node_modules/npm/lib/utils/unsupported.js", "{ver: '9', min: '9.0.0'}", "{ver: '9', min: '9.0.0'}, {ver: '10', min: '10.0.0'}" if build.with? "completion" bash_completion.install \ bootstrap/"lib/utils/completion.sh" => "npm" end end end def post_install return if build.without? "npm" node_modules = HOMEBREW_PREFIX/"lib/node_modules" node_modules.mkpath # Kill npm but preserve all other modules across node updates/upgrades. rm_rf node_modules/"npm" cp_r libexec/"lib/node_modules/npm", node_modules # This symlink doesn't hop into homebrew_prefix/bin automatically so # we make our own. This is a small consequence of our # bottle-npm-and-retain-a-private-copy-in-libexec setup # All other installs **do** symlink to homebrew_prefix/bin correctly. # We ln rather than cp this because doing so mimics npm's normal install. ln_sf node_modules/"npm/bin/npm-cli.js", HOMEBREW_PREFIX/"bin/npm" ln_sf node_modules/"npm/bin/npx-cli.js", HOMEBREW_PREFIX/"bin/npx" # Let's do the manpage dance. It's just a jump to the left. # And then a step to the right, with your hand on rm_f. %w[man1 man5 man7].each do |man| # Dirs must exist first: https://github.com/Homebrew/legacy-homebrew/issues/35969 mkdir_p HOMEBREW_PREFIX/"share/man/#{man}" rm_f Dir[HOMEBREW_PREFIX/"share/man/#{man}/{npm.,npm-,npmrc.,package.json.,npx.}*"] cp Dir[libexec/"lib/node_modules/npm/man/#{man}/{npm,package.json,npx}*"], HOMEBREW_PREFIX/"share/man/#{man}" end (node_modules/"npm/npmrc").atomic_write("prefix = #{HOMEBREW_PREFIX}\n") end def caveats if build.without? "npm" <<~EOS Homebrew has NOT installed npm. If you later install it, you should supplement your NODE_PATH with the npm module folder: #{HOMEBREW_PREFIX}/lib/node_modules EOS end end test do path = testpath/"test.js" path.write "console.log('hello');" output = shell_output("#{bin}/node #{path}").strip assert_equal "hello", output output = shell_output("#{bin}/node -e 'console.log(new Intl.NumberFormat(\"en-EN\").format(1234.56))'").strip assert_equal "1,234.56", output if build.with? "icu4c" output = shell_output("#{bin}/node -e 'console.log(new Intl.NumberFormat(\"de-DE\").format(1234.56))'").strip assert_equal "1.234,56", output end if build.with? "npm" # make sure npm can find node ENV.prepend_path "PATH", opt_bin ENV.delete "NVM_NODEJS_ORG_MIRROR" assert_equal which("node"), opt_bin/"node" assert_predicate HOMEBREW_PREFIX/"bin/npm", :exist?, "npm must exist" assert_predicate HOMEBREW_PREFIX/"bin/npm", :executable?, "npm must be executable" npm_args = ["-ddd", "--cache=#{HOMEBREW_CACHE}/npm_cache", "--build-from-source"] system "#{HOMEBREW_PREFIX}/bin/npm", *npm_args, "install", "npm@latest" system "#{HOMEBREW_PREFIX}/bin/npm", *npm_args, "install", "bufferutil" unless head? assert_predicate HOMEBREW_PREFIX/"bin/npx", :exist?, "npx must exist" assert_predicate HOMEBREW_PREFIX/"bin/npx", :executable?, "npx must be executable" assert_match "< hello >", shell_output("#{HOMEBREW_PREFIX}/bin/npx cowsay hello") end end end
class Nspr < Formula desc "Platform-neutral API for system-level and libc-like functions" homepage "https://developer.mozilla.org/docs/Mozilla/Projects/NSPR" url "https://archive.mozilla.org/pub/nspr/releases/v4.22/src/nspr-4.22.tar.gz" sha256 "c9e4b6cc24856ec93202fe13704b38b38ba219f0f2aeac93090ce2b6c696d430" bottle do cellar :any sha256 "bf4d5e07f501ef6ac4b5c5fd64451ffc2110ff9256b6fd76614a7e6310e464fe" => :catalina sha256 "44b8d6ae65760da94e14b9bb742378c81b72821abd6ac4bb0be88c218234210a" => :mojave sha256 "5a466d443e42a227e6c6d972725558068a2121ee69a2807af993837281c0bcd1" => :high_sierra sha256 "f8e389b885ebef82929c0b6afc8b0ffbccbebb98f7267d81cad3e0d6d177f8c0" => :sierra end def install ENV.deparallelize cd "nspr" do # Fixes a bug with linking against CoreFoundation, needed to work with SpiderMonkey # See: https://openradar.appspot.com/7209349 inreplace "pr/src/Makefile.in", "-framework CoreServices -framework CoreFoundation", "" args = %W[ --disable-debug --prefix=#{prefix} --enable-strip --with-pthreads --enable-ipv6 --enable-macos-target=#{MacOS.version} --enable-64bit ] system "./configure", *args # Remove the broken (for anyone but Firefox) install_name inreplace "config/autoconf.mk", "-install_name @executable_path/$@ ", "-install_name #{lib}/$@ " system "make" system "make", "install" (bin/"compile-et.pl").unlink (bin/"prerr.properties").unlink end end test do system "#{bin}/nspr-config", "--version" end end nspr 4.23 Closes #45542. Signed-off-by: FX Coudert <c329953660db96eae534be5bbf1a735c2baf69b5@gmail.com> class Nspr < Formula desc "Platform-neutral API for system-level and libc-like functions" homepage "https://developer.mozilla.org/docs/Mozilla/Projects/NSPR" url "https://archive.mozilla.org/pub/nspr/releases/v4.23/src/nspr-4.23.tar.gz" sha256 "4b9d821037faf5723da901515ed9cac8b23ef1ea3729022259777393453477a4" bottle do cellar :any sha256 "bf4d5e07f501ef6ac4b5c5fd64451ffc2110ff9256b6fd76614a7e6310e464fe" => :catalina sha256 "44b8d6ae65760da94e14b9bb742378c81b72821abd6ac4bb0be88c218234210a" => :mojave sha256 "5a466d443e42a227e6c6d972725558068a2121ee69a2807af993837281c0bcd1" => :high_sierra sha256 "f8e389b885ebef82929c0b6afc8b0ffbccbebb98f7267d81cad3e0d6d177f8c0" => :sierra end def install ENV.deparallelize cd "nspr" do # Fixes a bug with linking against CoreFoundation, needed to work with SpiderMonkey # See: https://openradar.appspot.com/7209349 inreplace "pr/src/Makefile.in", "-framework CoreServices -framework CoreFoundation", "" args = %W[ --disable-debug --prefix=#{prefix} --enable-strip --with-pthreads --enable-ipv6 --enable-macos-target=#{MacOS.version} --enable-64bit ] system "./configure", *args # Remove the broken (for anyone but Firefox) install_name inreplace "config/autoconf.mk", "-install_name @executable_path/$@ ", "-install_name #{lib}/$@ " system "make" system "make", "install" (bin/"compile-et.pl").unlink (bin/"prerr.properties").unlink end end test do system "#{bin}/nspr-config", "--version" end end
class Nspr < Formula desc "Platform-neutral API for system-level and libc-like functions" homepage "https://developer.mozilla.org/docs/Mozilla/Projects/NSPR" url "https://archive.mozilla.org/pub/nspr/releases/v4.26/src/nspr-4.26.tar.gz" sha256 "fc9d142d85b74ffd2e6374a0c9016f3f2dac074225e24df3070e5a72d31b773d" bottle do cellar :any sha256 "70c30f08abf5a0499dcbe9d97061bd2c48d25ffaff0d435e8d7eede589f4c046" => :catalina sha256 "039c4d5ad25a611c6c62bd6542e1faa505a9fb4c4c43ac742b8ecaa947f85dd5" => :mojave sha256 "d94d9687669abfc4f85f2a275c5ab7bbb0f3f49873d6939a2def529910182459" => :high_sierra end def install ENV.deparallelize cd "nspr" do # Fixes a bug with linking against CoreFoundation, needed to work with SpiderMonkey # See: https://openradar.appspot.com/7209349 inreplace "pr/src/Makefile.in", "-framework CoreServices -framework CoreFoundation", "" args = %W[ --disable-debug --prefix=#{prefix} --enable-strip --with-pthreads --enable-ipv6 --enable-macos-target=#{MacOS.version} --enable-64bit ] system "./configure", *args # Remove the broken (for anyone but Firefox) install_name inreplace "config/autoconf.mk", "-install_name @executable_path/$@ ", "-install_name #{lib}/$@ " system "make" system "make", "install" (bin/"compile-et.pl").unlink (bin/"prerr.properties").unlink end end test do system "#{bin}/nspr-config", "--version" end end nspr: add license class Nspr < Formula desc "Platform-neutral API for system-level and libc-like functions" homepage "https://developer.mozilla.org/docs/Mozilla/Projects/NSPR" url "https://archive.mozilla.org/pub/nspr/releases/v4.26/src/nspr-4.26.tar.gz" sha256 "fc9d142d85b74ffd2e6374a0c9016f3f2dac074225e24df3070e5a72d31b773d" license "MPL-2.0" bottle do cellar :any sha256 "70c30f08abf5a0499dcbe9d97061bd2c48d25ffaff0d435e8d7eede589f4c046" => :catalina sha256 "039c4d5ad25a611c6c62bd6542e1faa505a9fb4c4c43ac742b8ecaa947f85dd5" => :mojave sha256 "d94d9687669abfc4f85f2a275c5ab7bbb0f3f49873d6939a2def529910182459" => :high_sierra end def install ENV.deparallelize cd "nspr" do # Fixes a bug with linking against CoreFoundation, needed to work with SpiderMonkey # See: https://openradar.appspot.com/7209349 inreplace "pr/src/Makefile.in", "-framework CoreServices -framework CoreFoundation", "" args = %W[ --disable-debug --prefix=#{prefix} --enable-strip --with-pthreads --enable-ipv6 --enable-macos-target=#{MacOS.version} --enable-64bit ] system "./configure", *args # Remove the broken (for anyone but Firefox) install_name inreplace "config/autoconf.mk", "-install_name @executable_path/$@ ", "-install_name #{lib}/$@ " system "make" system "make", "install" (bin/"compile-et.pl").unlink (bin/"prerr.properties").unlink end end test do system "#{bin}/nspr-config", "--version" end end
require 'formula' class Nspr < Formula url 'http://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.8.8/src/nspr-4.8.8.tar.gz' homepage 'http://www.mozilla.org/projects/nspr/' sha256 '92f3f4ded2ee313e396c180d5445cc3c718ff347d86c06b7bf14a1b5e049d4c9' def install ENV.deparallelize Dir.chdir "mozilla/nsprpub" do # Fixes a bug with linking against CoreFoundation, needed to work with SpiderMonkey # See: http://openradar.appspot.com/7209349 target_frameworks = (Hardware.is_32_bit? or MacOS.leopard?) ? "-framework Carbon" : "" inreplace "pr/src/Makefile.in", "-framework CoreServices -framework CoreFoundation", target_frameworks args = ["--prefix=#{prefix}", "--disable-debug", "--enable-strip", "--enable-optimize"] args << "--enable-64bit" if MacOS.prefer_64_bit? system "./configure", *args # Remove the broken (for anyone but Firefox) install_name inreplace "config/autoconf.mk", "-install_name @executable_path/$@ ", "-install_name #{lib}/$@ " system "make" system "make install" end end end nspr: install pkg-config file Some configure scripts are checking for nspr via pkg-config since most Linux distros seem to add that to their package. Closes Homebrew/homebrew#9705. Note: upstream has been asked several times over the last few years to provide pkg-config files, but nothing has come of it. Signed-off-by: Jack Nagel <43386ce32af96f5c56f2a88e458cb94cebee3751@gmail.com> require 'formula' class Nspr < Formula url 'http://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.8.8/src/nspr-4.8.8.tar.gz' homepage 'http://www.mozilla.org/projects/nspr/' sha256 '92f3f4ded2ee313e396c180d5445cc3c718ff347d86c06b7bf14a1b5e049d4c9' def install ENV.deparallelize Dir.chdir "mozilla/nsprpub" do # Fixes a bug with linking against CoreFoundation, needed to work with SpiderMonkey # See: http://openradar.appspot.com/7209349 target_frameworks = (Hardware.is_32_bit? or MacOS.leopard?) ? "-framework Carbon" : "" inreplace "pr/src/Makefile.in", "-framework CoreServices -framework CoreFoundation", target_frameworks args = ["--prefix=#{prefix}", "--disable-debug", "--enable-strip", "--enable-optimize"] args << "--enable-64bit" if MacOS.prefer_64_bit? system "./configure", *args # Remove the broken (for anyone but Firefox) install_name inreplace "config/autoconf.mk", "-install_name @executable_path/$@ ", "-install_name #{lib}/$@ " system "make" system "make install" (lib+'pkgconfig/nspr.pc').write pkg_file end end def pkg_file; <<-EOF prefix=#{HOMEBREW_PREFIX} exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include/nspr Name: NSPR Description: Netscape Portable Runtime Version: 4.8.8 Libs: -L${libdir} -lplds4 -lplc4 -lnspr4 Cflags: -I${includedir} EOF end end
class Odin < Formula desc "Programming language with focus on simplicity, performance and modern systems" homepage "https://odin-lang.org/" url "https://github.com/odin-lang/Odin.git", tag: "dev-2022-11", revision: "382bd87667a275f9b276886f7c1e8caac4dda5f6" version "2022-11" license "BSD-3-Clause" head "https://github.com/odin-lang/Odin.git", branch: "master" bottle do sha256 cellar: :any, arm64_monterey: "59aa458fabfac60adbe9229556022f2139ee1c99925bf242b518b62402809ae8" sha256 cellar: :any, arm64_big_sur: "b4db4322d91a616173a3454d46d40ac15c37b52ce4b4a38effdf26f7dd6bfaf5" sha256 cellar: :any, monterey: "31613eb73b14283a127ab6b1975715c802c34e4e0636a785816440669d1f0e63" sha256 cellar: :any, big_sur: "be00af3f548d58d94f073fbceb562f83996c1be39fc6335ba507e848cc11fbac" sha256 cellar: :any, catalina: "3576c9ff57989433ebd7de0d113bfdf84b11052a27a9d741bb298760da44a02e" sha256 cellar: :any_skip_relocation, x86_64_linux: "8d75acd24a5e331c4426513dd948f85d05fba4003cd3dd74f41451ac20f3e921" end depends_on "llvm@14" fails_with gcc: "5" # LLVM is built with GCC def install llvm = deps.map(&:to_formula).find { |f| f.name.match?(/^llvm(@\d+(\.\d+)*)?$/) } # Keep version number consistent and reproducible for tagged releases. # Issue ref: https://github.com/odin-lang/Odin/issues/1772 inreplace "build_odin.sh", "dev-$(date +\"%Y-%m\")", "dev-#{version}" unless build.head? system "make", "release" libexec.install "odin", "core", "shared" (bin/"odin").write <<~EOS #!/bin/bash export PATH="#{llvm.opt_bin}:$PATH" exec -a odin "#{libexec}/odin" "$@" EOS pkgshare.install "examples" end test do assert_match version.to_s, shell_output("#{bin}/odin version") (testpath/"hellope.odin").write <<~EOS package main import "core:fmt" main :: proc() { fmt.println("Hellope!"); } EOS system "#{bin}/odin", "build", "hellope.odin", "-file" assert_equal "Hellope!\n", shell_output("./hellope.bin") end end odin: update 2022-11 bottle. class Odin < Formula desc "Programming language with focus on simplicity, performance and modern systems" homepage "https://odin-lang.org/" url "https://github.com/odin-lang/Odin.git", tag: "dev-2022-11", revision: "382bd87667a275f9b276886f7c1e8caac4dda5f6" version "2022-11" license "BSD-3-Clause" head "https://github.com/odin-lang/Odin.git", branch: "master" bottle do sha256 cellar: :any, arm64_ventura: "733feaa92759d2b66cfc61a503011bb10cf3b83c8377000e952453e6388c4db6" sha256 cellar: :any, arm64_monterey: "59aa458fabfac60adbe9229556022f2139ee1c99925bf242b518b62402809ae8" sha256 cellar: :any, arm64_big_sur: "b4db4322d91a616173a3454d46d40ac15c37b52ce4b4a38effdf26f7dd6bfaf5" sha256 cellar: :any, monterey: "31613eb73b14283a127ab6b1975715c802c34e4e0636a785816440669d1f0e63" sha256 cellar: :any, big_sur: "be00af3f548d58d94f073fbceb562f83996c1be39fc6335ba507e848cc11fbac" sha256 cellar: :any, catalina: "3576c9ff57989433ebd7de0d113bfdf84b11052a27a9d741bb298760da44a02e" sha256 cellar: :any_skip_relocation, x86_64_linux: "8d75acd24a5e331c4426513dd948f85d05fba4003cd3dd74f41451ac20f3e921" end depends_on "llvm@14" fails_with gcc: "5" # LLVM is built with GCC def install llvm = deps.map(&:to_formula).find { |f| f.name.match?(/^llvm(@\d+(\.\d+)*)?$/) } # Keep version number consistent and reproducible for tagged releases. # Issue ref: https://github.com/odin-lang/Odin/issues/1772 inreplace "build_odin.sh", "dev-$(date +\"%Y-%m\")", "dev-#{version}" unless build.head? system "make", "release" libexec.install "odin", "core", "shared" (bin/"odin").write <<~EOS #!/bin/bash export PATH="#{llvm.opt_bin}:$PATH" exec -a odin "#{libexec}/odin" "$@" EOS pkgshare.install "examples" end test do assert_match version.to_s, shell_output("#{bin}/odin version") (testpath/"hellope.odin").write <<~EOS package main import "core:fmt" main :: proc() { fmt.println("Hellope!"); } EOS system "#{bin}/odin", "build", "hellope.odin", "-file" assert_equal "Hellope!\n", shell_output("./hellope.bin") end end
require 'formula' class Opam < Formula homepage 'https://github.com/OCamlPro/opam' url 'https://github.com/OCamlPro/opam/archive/0.9.5.tar.gz' sha1 '73afb82f16052badd5c7eea0d24a01029ab21c67' head 'https://github.com/OCamlPro/opam.git' depends_on "objective-caml" def install system "./configure", "--prefix=#{prefix}" system "make" system "make install" bash_completion.install "shell/opam_completion.sh" zsh_completion.install "shell/opam_completion_zsh.sh" end def test system "#{bin}/opam --help" end def caveats; <<-EOS.undent OPAM uses ~/.opam by default for its package database, so you need to initialize it first by running (as a normal user): $ opam init Run the following to initialize your environmnent variables: $ eval `opam config env` To export the needed variables every time, add them to your dotfiles. * On Bash, add them to `~/.bash_profile`. * On Zsh, add them to `~/.zprofile` instead. Documentation and tutorials are available at http://opam.ocamlpro.com, or via 'man opam' and 'opam --help'. EOS end end opam: fix ymlink support for packages See OCamlPro/opam#520 for details Closes Homebrew/homebrew#18376. Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com> require 'formula' class Opam < Formula homepage 'https://github.com/OCamlPro/opam' url 'https://github.com/OCamlPro/opam/archive/0.9.5.tar.gz' sha1 '73afb82f16052badd5c7eea0d24a01029ab21c67' head 'https://github.com/OCamlPro/opam.git' depends_on "objective-caml" def patches [ # patch to fix symlink issue in #520 "https://github.com/OCamlPro/opam/commit/db5129d42fd70cb80ee33040d42f0103d9cc51ea.diff" ] end def install system "./configure", "--prefix=#{prefix}" system "make" system "make install" bash_completion.install "shell/opam_completion.sh" zsh_completion.install "shell/opam_completion_zsh.sh" end def test system "#{bin}/opam --help" end def caveats; <<-EOS.undent OPAM uses ~/.opam by default for its package database, so you need to initialize it first by running (as a normal user): $ opam init Run the following to initialize your environmnent variables: $ eval `opam config env` To export the needed variables every time, add them to your dotfiles. * On Bash, add them to `~/.bash_profile`. * On Zsh, add them to `~/.zprofile` instead. Documentation and tutorials are available at http://opam.ocamlpro.com, or via 'man opam' and 'opam --help'. EOS end end
class Opus < Formula desc "Audio codec" homepage "https://www.opus-codec.org/" url "https://archive.mozilla.org/pub/opus/opus-1.3.1.tar.gz" sha256 "65b58e1e25b2a114157014736a3d9dfeaad8d41be1c8179866f144a2fb44ff9d" bottle do cellar :any sha256 "4e444558492eff0e4d82646c868d76b63eb2aeb6e35a26712a3cdf17655b17bd" => :catalina sha256 "787bf9b6d56f63cc3d0cf0f7f17affeb85b6496b32bf9a200f57431c886ae4a5" => :mojave sha256 "187884409b33deb371002701b6ffb790c1832fecbe6b8e79e437039dae87aff8" => :high_sierra sha256 "e547bc31c413575fdf2ae68a8e29d1c3835bac45d8ea629f3a194b397c48e581" => :sierra end head do url "https://gitlab.xiph.org/xiph/opus.git" depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build end def install system "./autogen.sh" if build.head? system "./configure", "--disable-dependency-tracking", "--disable-doc", "--prefix=#{prefix}" system "make", "install" end test do (testpath/"test.cpp").write <<~EOS #include <opus.h> int main(int argc, char **argv) { int err = 0; opus_int32 rate = 48000; int channels = 2; int app = OPUS_APPLICATION_AUDIO; OpusEncoder *enc; int ret; enc = opus_encoder_create(rate, channels, app, &err); if (!(err < 0)) { err = opus_encoder_ctl(enc, OPUS_SET_BITRATE(OPUS_AUTO)); if (!(err < 0)) { opus_encoder_destroy(enc); return 0; } } return err; } EOS system ENV.cxx, "-I#{include}/opus", "-L#{lib}", "-lopus", testpath/"test.cpp", "-o", "test" system "./test" end end opus: update 1.3.1 bottle. class Opus < Formula desc "Audio codec" homepage "https://www.opus-codec.org/" url "https://archive.mozilla.org/pub/opus/opus-1.3.1.tar.gz" sha256 "65b58e1e25b2a114157014736a3d9dfeaad8d41be1c8179866f144a2fb44ff9d" bottle do cellar :any rebuild 1 sha256 "5cb191f66da0ef2b8d03985c79cb18a59506aaba8a01cc0b1a821c293e88d576" => :catalina sha256 "21fa4c22a63bccc5e188dabb9c85af63a57d19582c4f616716bccb063e2befec" => :mojave sha256 "8b45ac09baae56bdc2c7ee224d5a1ae68efb826a9aec2220e0b27e8ce633b8aa" => :high_sierra end head do url "https://gitlab.xiph.org/xiph/opus.git" depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build end def install system "./autogen.sh" if build.head? system "./configure", "--disable-dependency-tracking", "--disable-doc", "--prefix=#{prefix}" system "make", "install" end test do (testpath/"test.cpp").write <<~EOS #include <opus.h> int main(int argc, char **argv) { int err = 0; opus_int32 rate = 48000; int channels = 2; int app = OPUS_APPLICATION_AUDIO; OpusEncoder *enc; int ret; enc = opus_encoder_create(rate, channels, app, &err); if (!(err < 0)) { err = opus_encoder_ctl(enc, OPUS_SET_BITRATE(OPUS_AUTO)); if (!(err < 0)) { opus_encoder_destroy(enc); return 0; } } return err; } EOS system ENV.cxx, "-I#{include}/opus", "-L#{lib}", "-lopus", testpath/"test.cpp", "-o", "test" system "./test" end end
class Otf2 < Formula desc "Open Trace Format 2 file handling library" homepage "https://www.vi-hps.org/projects/score-p/" url "https://www.vi-hps.org/cms/upload/packages/otf2/otf2-2.2.tar.gz" sha256 "d0519af93839dc778eddca2ce1447b1ee23002c41e60beac41ea7fe43117172d" revision 2 bottle do sha256 arm64_big_sur: "8c8c0f0f92d88b2439cdcb808ba2318a3cd54b7c929a6743a473105fd177fe38" sha256 big_sur: "bb192fd9ff10ead28b7025a1aa426b7cba4149dac8de2a873efa28f6ca804dbc" sha256 catalina: "9bbb9997272253be31bcefb9b398b6d46725ff18bc6d5097c16e59fab6fece0f" sha256 mojave: "befb628ab3134837d2d6f442ac9b12da47d813adb5b13f8839c66993c0b0e6cf" sha256 high_sierra: "5866bf0afb7c3fb48e718d209019f1ac3574c221c862b2e35ea9ea907ed91008" end depends_on "sphinx-doc" => :build depends_on "gcc" depends_on "open-mpi" depends_on "python@3.9" resource "future" do url "https://files.pythonhosted.org/packages/45/0b/38b06fd9b92dc2b68d58b75f900e97884c45bedd2ff83203d933cf5851c9/future-0.18.2.tar.gz" sha256 "b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d" end def install python3 = Formula["python@3.9"].opt_bin/"python3" xy = Language::Python.major_minor_version python3 ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python#{xy}/site-packages" resource("future").stage do system python3, *Language::Python.setup_install_args(libexec/"vendor") end ENV["PYTHON"] = python3 ENV["SPHINX"] = Formula["sphinx-doc"].opt_bin/"sphinx-build" system "./configure", "--disable-debug", "--disable-dependency-tracking", "--disable-silent-rules", "--prefix=#{prefix}" system "make" system "make", "install" end test do cp_r "#{share}/doc/otf2/examples", testpath workdir = testpath/"examples" chdir "#{testpath}/examples" do # build serial tests system "make", "serial", "mpi", "pthread" %w[ otf2_mpi_reader_example otf2_mpi_reader_example_cc otf2_mpi_writer_example otf2_pthread_writer_example otf2_reader_example otf2_writer_example ].each { |p| assert_predicate workdir/p, :exist? } system "./otf2_writer_example" assert_predicate workdir/"ArchivePath/ArchiveName.otf2", :exist? system "./otf2_reader_example" rm_rf "./ArchivePath" system Formula["open-mpi"].opt_bin/"mpirun", "-n", "2", "./otf2_mpi_writer_example" assert_predicate workdir/"ArchivePath/ArchiveName.otf2", :exist? (0...2).each do |n| assert_predicate workdir/"ArchivePath/ArchiveName/#{n}.evt", :exist? end system Formula["open-mpi"].opt_bin/"mpirun", "-n", "2", "./otf2_mpi_reader_example" system "./otf2_reader_example" rm_rf "./ArchivePath" system "./otf2_pthread_writer_example" assert_predicate workdir/"ArchivePath/ArchiveName.otf2", :exist? system "./otf2_reader_example" end end end otf2: update 2.2_2 bottle. class Otf2 < Formula desc "Open Trace Format 2 file handling library" homepage "https://www.vi-hps.org/projects/score-p/" url "https://www.vi-hps.org/cms/upload/packages/otf2/otf2-2.2.tar.gz" sha256 "d0519af93839dc778eddca2ce1447b1ee23002c41e60beac41ea7fe43117172d" revision 2 bottle do sha256 arm64_big_sur: "8c8c0f0f92d88b2439cdcb808ba2318a3cd54b7c929a6743a473105fd177fe38" sha256 big_sur: "bb192fd9ff10ead28b7025a1aa426b7cba4149dac8de2a873efa28f6ca804dbc" sha256 catalina: "9bbb9997272253be31bcefb9b398b6d46725ff18bc6d5097c16e59fab6fece0f" sha256 mojave: "befb628ab3134837d2d6f442ac9b12da47d813adb5b13f8839c66993c0b0e6cf" sha256 high_sierra: "5866bf0afb7c3fb48e718d209019f1ac3574c221c862b2e35ea9ea907ed91008" sha256 x86_64_linux: "54c4baed62904eccb3e9f7ee92e561470e49d44a1f16f0a8a891cda54709e555" end depends_on "sphinx-doc" => :build depends_on "gcc" depends_on "open-mpi" depends_on "python@3.9" resource "future" do url "https://files.pythonhosted.org/packages/45/0b/38b06fd9b92dc2b68d58b75f900e97884c45bedd2ff83203d933cf5851c9/future-0.18.2.tar.gz" sha256 "b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d" end def install python3 = Formula["python@3.9"].opt_bin/"python3" xy = Language::Python.major_minor_version python3 ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python#{xy}/site-packages" resource("future").stage do system python3, *Language::Python.setup_install_args(libexec/"vendor") end ENV["PYTHON"] = python3 ENV["SPHINX"] = Formula["sphinx-doc"].opt_bin/"sphinx-build" system "./configure", "--disable-debug", "--disable-dependency-tracking", "--disable-silent-rules", "--prefix=#{prefix}" system "make" system "make", "install" end test do cp_r "#{share}/doc/otf2/examples", testpath workdir = testpath/"examples" chdir "#{testpath}/examples" do # build serial tests system "make", "serial", "mpi", "pthread" %w[ otf2_mpi_reader_example otf2_mpi_reader_example_cc otf2_mpi_writer_example otf2_pthread_writer_example otf2_reader_example otf2_writer_example ].each { |p| assert_predicate workdir/p, :exist? } system "./otf2_writer_example" assert_predicate workdir/"ArchivePath/ArchiveName.otf2", :exist? system "./otf2_reader_example" rm_rf "./ArchivePath" system Formula["open-mpi"].opt_bin/"mpirun", "-n", "2", "./otf2_mpi_writer_example" assert_predicate workdir/"ArchivePath/ArchiveName.otf2", :exist? (0...2).each do |n| assert_predicate workdir/"ArchivePath/ArchiveName/#{n}.evt", :exist? end system Formula["open-mpi"].opt_bin/"mpirun", "-n", "2", "./otf2_mpi_reader_example" system "./otf2_reader_example" rm_rf "./ArchivePath" system "./otf2_pthread_writer_example" assert_predicate workdir/"ArchivePath/ArchiveName.otf2", :exist? system "./otf2_reader_example" end end end
class Pari < Formula desc "Computer algebra system designed for fast computations in number theory" homepage "https://pari.math.u-bordeaux.fr/" url "https://pari.math.u-bordeaux.fr/pub/pari/unix/pari-2.9.1.tar.gz" mirror "https://mirrors.kernel.org/debian/pool/main/p/pari/pari_2.9.1.orig.tar.gz" sha256 "dc510f96686463c1ade7c2a6e16fa9466fd4af6a65fddf9822ba07d7d2e70767" depends_on "gmp" depends_on "readline" depends_on :x11 def install readline = Formula["readline"].opt_prefix gmp = Formula["gmp"].opt_prefix system "./Configure", "--prefix=#{prefix}", "--with-gmp=#{gmp}", "--with-readline=#{readline}" # make needs to be done in two steps system "make", "all" system "make", "install" end test do (testpath/"math.tex").write "$k_{n+1} = n^2 + k_n^2 - k_{n-1}$" system bin/"tex2mail", testpath/"math.tex" end end pari: add 2.9.1 bottle. class Pari < Formula desc "Computer algebra system designed for fast computations in number theory" homepage "https://pari.math.u-bordeaux.fr/" url "https://pari.math.u-bordeaux.fr/pub/pari/unix/pari-2.9.1.tar.gz" mirror "https://mirrors.kernel.org/debian/pool/main/p/pari/pari_2.9.1.orig.tar.gz" sha256 "dc510f96686463c1ade7c2a6e16fa9466fd4af6a65fddf9822ba07d7d2e70767" bottle do sha256 "e2708ec11078a54cad2991356a4fed959afb1fdb4b2a58bea5debcd1c729a93e" => :sierra sha256 "d97c361da5c314a298eff855bd7a30d87cffa6b1ac222dc30200ef652aa3a183" => :el_capitan sha256 "f660e2526e6a5103bcb5a3c5dc99ab6a8af51399a63285df9fe503cf82727076" => :yosemite end depends_on "gmp" depends_on "readline" depends_on :x11 def install readline = Formula["readline"].opt_prefix gmp = Formula["gmp"].opt_prefix system "./Configure", "--prefix=#{prefix}", "--with-gmp=#{gmp}", "--with-readline=#{readline}" # make needs to be done in two steps system "make", "all" system "make", "install" end test do (testpath/"math.tex").write "$k_{n+1} = n^2 + k_n^2 - k_{n-1}$" system bin/"tex2mail", testpath/"math.tex" end end
require 'formula' class Pcre <Formula url 'ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.11.tar.bz2' homepage 'http://www.pcre.org/' md5 'ef907b8792ec7f90f0dcd773848f0b3b' def options [["--universal", "Build a universal binary."]] end def install fails_with_llvm "Bus error in ld on SL 10.6.4" ENV.universal_binary if ARGV.include? "--universal" system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}", "--enable-utf8", "--enable-unicode-properties", "--enable-pcregrep-libz", "--enable-pcregrep-libbz2" system "make test" system "make install" end end pcre 8.12 require 'formula' class Pcre <Formula url 'ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.12.tar.bz2' homepage 'http://www.pcre.org/' md5 'f14a9fef3c92f3fc6c5ac92d7a2c7eb3' def options [["--universal", "Build a universal binary."]] end def install fails_with_llvm "Bus error in ld on SL 10.6.4" ENV.universal_binary if ARGV.include? "--universal" system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}", "--enable-utf8", "--enable-unicode-properties", "--enable-pcregrep-libz", "--enable-pcregrep-libbz2" system "make test" system "make install" end end
class Pdal < Formula desc "Point data abstraction library" homepage "http://www.pdal.io/" url "https://github.com/PDAL/PDAL/archive/1.1.0.tar.gz" sha256 "70e0c84035b3fdc75c4eb72dde62a7a2138171d249f2a607170f79d5cafe589d" head "https://github.com/PDAL/PDAL.git" bottle do sha256 "4f0596b4cfeea17cf857777cdf60772708c54a6669f85a89c5548ba6b3309a76" => :sierra sha256 "21dc2f8487f310e9ccafbb625639c2fb795ff915b5ace70272c1f101760d05da" => :el_capitan sha256 "7b7d7a29d450d3e6f4a8abce3b3ac24900419d753e3b64726d4991fe6e0219b7" => :yosemite sha256 "cd3a166ed19422b0cc9eba5de4e37031cc8c1cfe29973373c54d48e72e2f68b2" => :mavericks end depends_on "cmake" => :build depends_on "gdal" depends_on "laszip" => :optional if MacOS.version < :mavericks depends_on "boost" => "c++11" else depends_on "boost" end def install ENV.cxx11 if MacOS.version < :mavericks args = std_cmake_args if build.with? "laszip" args << "-DWITH_LASZIP=TRUE" else args << "-DWITH_LASZIP=FALSE" end system "cmake", ".", *args system "make", "install" doc.install "examples", "test" end test do system bin/"pdal", "info", doc/"test/data/las/interesting.las" end end pdal 1.3.0 Closes #4405. Signed-off-by: ilovezfs <fbd54dbbcf9e596abad4ccdc4dfc17f80ebeaee2@icloud.com> class Pdal < Formula desc "Point data abstraction library" homepage "http://www.pdal.io/" url "https://github.com/PDAL/PDAL/archive/1.3.0.tar.gz" sha256 "48d48b1fc2a2ce2cf6fba5b28f2455b94a1ccc33148ee0a3c79a4dc041641557" head "https://github.com/PDAL/PDAL.git" bottle do sha256 "4f0596b4cfeea17cf857777cdf60772708c54a6669f85a89c5548ba6b3309a76" => :sierra sha256 "21dc2f8487f310e9ccafbb625639c2fb795ff915b5ace70272c1f101760d05da" => :el_capitan sha256 "7b7d7a29d450d3e6f4a8abce3b3ac24900419d753e3b64726d4991fe6e0219b7" => :yosemite sha256 "cd3a166ed19422b0cc9eba5de4e37031cc8c1cfe29973373c54d48e72e2f68b2" => :mavericks end depends_on "cmake" => :build depends_on "gdal" depends_on "laszip" => :optional if MacOS.version < :mavericks depends_on "boost" => "c++11" else depends_on "boost" end def install ENV.cxx11 if MacOS.version < :mavericks args = std_cmake_args if build.with? "laszip" args << "-DWITH_LASZIP=TRUE" else args << "-DWITH_LASZIP=FALSE" end system "cmake", ".", *args system "make", "install" doc.install "examples", "test" end test do system bin/"pdal", "info", doc/"test/data/las/interesting.las" end end
class Pdal < Formula desc "Point data abstraction library" homepage "https://www.pdal.io/" url "https://github.com/PDAL/PDAL/archive/1.7.2.tar.gz" sha256 "cedfefbe54ca61cbb33d100d619c53873d84f480ff53deec2cf6dd91580f6a61" head "https://github.com/PDAL/PDAL.git" bottle do sha256 "9d05cf0f554fead70d78c89b153cd70b424d7682ee0842770e6dfdbc1dea300d" => :high_sierra sha256 "a3ca061671f7a7883a7c0aa5497676356fd449283e8b18d65830ae4c30b8e995" => :sierra sha256 "4d68eb0946cbe5853fbc80229e3b40d1f9eeb0d16fdef5a70724733fb46b5d0e" => :el_capitan end depends_on "cmake" => :build depends_on "gdal" depends_on "hdf5" depends_on "laszip" depends_on "numpy" depends_on "pcl" depends_on "postgresql" def install system "cmake", ".", *std_cmake_args, "-DWITH_LASZIP=TRUE", "-DBUILD_PLUGIN_GREYHOUND=ON", "-DBUILD_PLUGIN_ICEBRIDGE=ON", "-DBUILD_PLUGIN_PCL=ON", "-DBUILD_PLUGIN_PGPOINTCLOUD=ON", "-DBUILD_PLUGIN_PYTHON=ON", "-DBUILD_PLUGIN_SQLITE=ON" system "make", "install" doc.install "examples", "test" end test do system bin/"pdal", "info", doc/"test/data/las/interesting.las" end end pdal: revision for hdf5 class Pdal < Formula desc "Point data abstraction library" homepage "https://www.pdal.io/" url "https://github.com/PDAL/PDAL/archive/1.7.2.tar.gz" sha256 "cedfefbe54ca61cbb33d100d619c53873d84f480ff53deec2cf6dd91580f6a61" revision 1 head "https://github.com/PDAL/PDAL.git" bottle do sha256 "9d05cf0f554fead70d78c89b153cd70b424d7682ee0842770e6dfdbc1dea300d" => :high_sierra sha256 "a3ca061671f7a7883a7c0aa5497676356fd449283e8b18d65830ae4c30b8e995" => :sierra sha256 "4d68eb0946cbe5853fbc80229e3b40d1f9eeb0d16fdef5a70724733fb46b5d0e" => :el_capitan end depends_on "cmake" => :build depends_on "gdal" depends_on "hdf5" depends_on "laszip" depends_on "numpy" depends_on "pcl" depends_on "postgresql" def install system "cmake", ".", *std_cmake_args, "-DWITH_LASZIP=TRUE", "-DBUILD_PLUGIN_GREYHOUND=ON", "-DBUILD_PLUGIN_ICEBRIDGE=ON", "-DBUILD_PLUGIN_PCL=ON", "-DBUILD_PLUGIN_PGPOINTCLOUD=ON", "-DBUILD_PLUGIN_PYTHON=ON", "-DBUILD_PLUGIN_SQLITE=ON" system "make", "install" doc.install "examples", "test" end test do system bin/"pdal", "info", doc/"test/data/las/interesting.las" end end
class Pdal < Formula desc "Point data abstraction library" homepage "https://www.pdal.io/" url "https://github.com/PDAL/PDAL/archive/1.6.tar.gz" sha256 "66baf8510225b34ee24021731758251cd70657dd578c210ae86c78d158f283eb" revision 2 head "https://github.com/PDAL/PDAL.git" bottle do sha256 "f40210764a91dea38d8383abe8858975bc97fc407e0be936f9947a5090ee1391" => :high_sierra sha256 "7a801114b043934f4b1aaa4c8242e13858a7cf4bbff6e9ce010cb24c7f4547e5" => :sierra sha256 "49ada132c5b3918bec11e713329fe82cb4e4cecf35218e385d6d7e46858081bc" => :el_capitan end depends_on "cmake" => :build depends_on "gdal" depends_on "hdf5" depends_on "laszip" depends_on "pcl" depends_on "postgresql" def install system "cmake", ".", *std_cmake_args, "-DWITH_LASZIP=TRUE", "-DBUILD_PLUGIN_GREYHOUND=ON", "-DBUILD_PLUGIN_ICEBRIDGE=ON", "-DBUILD_PLUGIN_PCL=ON", "-DBUILD_PLUGIN_PGPOINTCLOUD=ON", "-DBUILD_PLUGIN_PYTHON=ON", "-DBUILD_PLUGIN_SQLITE=ON" system "make", "install" doc.install "examples", "test" end test do system bin/"pdal", "info", doc/"test/data/las/interesting.las" end end pdal: revision for laszip Closes #25831. Signed-off-by: ilovezfs <fbd54dbbcf9e596abad4ccdc4dfc17f80ebeaee2@icloud.com> class Pdal < Formula desc "Point data abstraction library" homepage "https://www.pdal.io/" url "https://github.com/PDAL/PDAL/archive/1.6.tar.gz" sha256 "66baf8510225b34ee24021731758251cd70657dd578c210ae86c78d158f283eb" revision 3 head "https://github.com/PDAL/PDAL.git" bottle do sha256 "f40210764a91dea38d8383abe8858975bc97fc407e0be936f9947a5090ee1391" => :high_sierra sha256 "7a801114b043934f4b1aaa4c8242e13858a7cf4bbff6e9ce010cb24c7f4547e5" => :sierra sha256 "49ada132c5b3918bec11e713329fe82cb4e4cecf35218e385d6d7e46858081bc" => :el_capitan end depends_on "cmake" => :build depends_on "gdal" depends_on "hdf5" depends_on "laszip" depends_on "pcl" depends_on "postgresql" def install system "cmake", ".", *std_cmake_args, "-DWITH_LASZIP=TRUE", "-DBUILD_PLUGIN_GREYHOUND=ON", "-DBUILD_PLUGIN_ICEBRIDGE=ON", "-DBUILD_PLUGIN_PCL=ON", "-DBUILD_PLUGIN_PGPOINTCLOUD=ON", "-DBUILD_PLUGIN_PYTHON=ON", "-DBUILD_PLUGIN_SQLITE=ON" system "make", "install" doc.install "examples", "test" end test do system bin/"pdal", "info", doc/"test/data/las/interesting.las" end end
class Peco < Formula desc "Simplistic interactive filtering tool" homepage "https://github.com/peco/peco" url "https://github.com/peco/peco/archive/v0.5.8.tar.gz" sha256 "90d87503265c12f8583f5c6bc19c83eba7a2e15219a6339d5041628aa48c4705" license "MIT" head "https://github.com/peco/peco.git" bottle do cellar :any_skip_relocation sha256 "02aee47d2d6e04c17c5a8a0c0d4391004175b00d2c01550b37bec09be865953a" => :catalina sha256 "f2c6e54d44a476bdfcab73c53789fceceeda94101e1b537525af870b1995a5aa" => :mojave sha256 "fb083704e02c7b00b740039da5a93c505ac4448b3e568fc04756902c28d68202" => :high_sierra end depends_on "go" => :build def install system "make", "build" system "go", "build", *std_go_args, "cmd/peco/peco.go" end test do system "#{bin}/peco", "--version" end end peco: update 0.5.8 bottle. class Peco < Formula desc "Simplistic interactive filtering tool" homepage "https://github.com/peco/peco" url "https://github.com/peco/peco/archive/v0.5.8.tar.gz" sha256 "90d87503265c12f8583f5c6bc19c83eba7a2e15219a6339d5041628aa48c4705" license "MIT" head "https://github.com/peco/peco.git" bottle do cellar :any_skip_relocation sha256 "6b90dff9eb546601c85d7a4b50056bf0209470617b489c60e92cd6799c80d74c" => :big_sur sha256 "02aee47d2d6e04c17c5a8a0c0d4391004175b00d2c01550b37bec09be865953a" => :catalina sha256 "f2c6e54d44a476bdfcab73c53789fceceeda94101e1b537525af870b1995a5aa" => :mojave sha256 "fb083704e02c7b00b740039da5a93c505ac4448b3e568fc04756902c28d68202" => :high_sierra end depends_on "go" => :build def install system "make", "build" system "go", "build", *std_go_args, "cmd/peco/peco.go" end test do system "#{bin}/peco", "--version" end end
class Pick < Formula desc "Utility to choose one option from a set of choices" homepage "https://github.com/calleerlandsson/pick" url "https://github.com/calleerlandsson/pick/releases/download/v2.0.1/pick-2.0.1.tar.gz" sha256 "4a596b8f40a316bc4e2c0d8e8842810d7a7b69d464a410e4ee2a6574e01629e3" bottle do cellar :any_skip_relocation sha256 "031300bf0b980a312fd1030fbcceb10c425511e8b3e904649d4ea5b055c065e5" => :high_sierra sha256 "26311a99440c4610cb4c80cadb73c66d0680ff8943de83eee200bd40869aaef9" => :sierra sha256 "9d861efcf16ede16963643921f58e4f38a8bf2903b20c51533ce98f691750977" => :el_capitan end def install system "./configure", "--disable-dependency-tracking", "--disable-silent-rules", "--prefix=#{prefix}" system "make", "check" system "make", "install" end test do system "#{bin}/pick", "-v" end end pick: update 2.0.1 bottle. class Pick < Formula desc "Utility to choose one option from a set of choices" homepage "https://github.com/calleerlandsson/pick" url "https://github.com/calleerlandsson/pick/releases/download/v2.0.1/pick-2.0.1.tar.gz" sha256 "4a596b8f40a316bc4e2c0d8e8842810d7a7b69d464a410e4ee2a6574e01629e3" bottle do cellar :any_skip_relocation sha256 "b929f5739b2bd0ab8df7ea5d941899fec265bc576fcc1660b3e16a3dc95a1f3a" => :high_sierra sha256 "1633f9112356cfa6a70f6aca24e38f20e371a109234a7381993bb44b1a9caa9f" => :sierra sha256 "29fe7c34922662f10555594fb3f817863d872aea289d51ddc2f98ba8921e2674" => :el_capitan end def install system "./configure", "--disable-dependency-tracking", "--disable-silent-rules", "--prefix=#{prefix}" system "make", "check" system "make", "install" end test do system "#{bin}/pick", "-v" end end
class Pike < Formula desc "Dynamic programming language" homepage "https://pike.lysator.liu.se" url "https://pike.lysator.liu.se/pub/pike/all/8.0.438/Pike-v8.0.438.tar.gz" sha256 "3865f8a4c9ba95c006602f24cc6ad0c07e9f936135d2346e21da627807a90ca0" revision 1 bottle do sha256 "0251c2e968307aec3ce415c257e897e76b2968055334764407711dcf191c78ff" => :sierra sha256 "d631d66fbaa6053e9cf6fe9ecab1af00db0dc504c3cd4b86962e54ab7269f9d9" => :el_capitan sha256 "44fc539a915050d3521b91f87f387937f3727179a89f4a51bec9973ac98f1bf5" => :yosemite end option "with-gettext", "Include Gettext support" option "with-gdbm", "Include Gdbm support" option "with-gtk2", "Include GTK2 support" option "with-mysql", "Include Mysql support" option "with-pcre", "Include Regexp.PCRE support" option "with-sdl", "Include SDL support" option "with-sane", "Include Sane support" option "with-pdf", "Include PDF support" option "with-gl", "Include GL support" option "with-all", "Include all features" depends_on "nettle" depends_on "gmp" depends_on "pcre" depends_on :x11 => :optional depends_on "libtiff" => :recommended # optional dependencies depends_on "gettext" if build.with?("gettext") || build.with?("all") depends_on "gdbm" if build.with?("gdbm") || build.with?("all") depends_on "gtk+" if build.with?("gtk2") || build.with?("all") depends_on "mysql" if build.with?("mysql") || build.with?("all") depends_on "sdl" if build.with?("sdl") || build.with?("all") depends_on "sane-backends" if build.with?("sane") || build.with?("all") depends_on "pdflib-lite" if build.with?("pdf") || build.with?("all") depends_on "mesalib-glw" if build.with?("gl") || build.with?("all") def install args = ["--prefix=#{prefix}", "--without-bundles"] if MacOS.prefer_64_bit? ENV.append "CFLAGS", "-m64" args << "--with-abi=64" else ENV.append "CFLAGS", "-m32" args << "--with-abi=32" end ENV.deparallelize system "make", "CONFIGUREARGS='" + args.join(" ") + "'" # installation is complicated by some of brew's standard patterns. # hopefully these notes explain the reasons for diverging from # the path that most other formulae use. # # item 1 # # basically, pike already installs itself naturally as brew would want # it; that is, if prefix=/Cellar, installation would create # /Cellar/pike/ver/bin and so forth. We could just go with that, but it's # possible that homebrew might change its layout and then the formula # would no longer work. # # so, rather than guessing at it, we do this alternate gyration, forcing # pike to install in a slightly nonstandard way (for pike, at least) # # item 2 # # a second problem crops up because the during installation, the link # function tries to pull in stuff from lib/, which is really more like # what one would expect share or libexec in homebrew might be: pike # specific files, rather than shared libraries. we could approach this # in a similar fashion, but the result would be a really odd arrangement # for anyone remotely familar with standard pike installs. # # because there's no way to override the keg.link command, this formula # installs the whole pike install into prefix/libexec and then links the # man page and binary back into prefix/share and prefix/bin. not so # elegant, but that's the way brew works. system "make", "install", "prefix=#{libexec}", "exec_prefix=#{libexec}", "share_prefix=#{libexec}/share", "lib_prefix=#{libexec}/lib", "man_prefix=#{libexec}/man", "include_path=#{libexec}/include", "INSTALLARGS=--traditional" bin.install_symlink "#{libexec}/bin/pike" share.install_symlink "#{libexec}/share/man" end test do path = testpath/"test.pike" path.write <<-EOS.undent int main() { for (int i=0; i<10; i++) { write("%d", i); } return 0; } EOS assert_equal "0123456789", shell_output("#{bin}/pike #{path}").strip end end pike: update 8.0.438_1 bottle. class Pike < Formula desc "Dynamic programming language" homepage "https://pike.lysator.liu.se" url "https://pike.lysator.liu.se/pub/pike/all/8.0.438/Pike-v8.0.438.tar.gz" sha256 "3865f8a4c9ba95c006602f24cc6ad0c07e9f936135d2346e21da627807a90ca0" revision 1 bottle do sha256 "d968101e005e78ac529b9b7bb29cfe546e2dc8231ac2d3d7282ac1f3185751c8" => :high_sierra sha256 "0251c2e968307aec3ce415c257e897e76b2968055334764407711dcf191c78ff" => :sierra sha256 "d631d66fbaa6053e9cf6fe9ecab1af00db0dc504c3cd4b86962e54ab7269f9d9" => :el_capitan sha256 "44fc539a915050d3521b91f87f387937f3727179a89f4a51bec9973ac98f1bf5" => :yosemite end option "with-gettext", "Include Gettext support" option "with-gdbm", "Include Gdbm support" option "with-gtk2", "Include GTK2 support" option "with-mysql", "Include Mysql support" option "with-pcre", "Include Regexp.PCRE support" option "with-sdl", "Include SDL support" option "with-sane", "Include Sane support" option "with-pdf", "Include PDF support" option "with-gl", "Include GL support" option "with-all", "Include all features" depends_on "nettle" depends_on "gmp" depends_on "pcre" depends_on :x11 => :optional depends_on "libtiff" => :recommended # optional dependencies depends_on "gettext" if build.with?("gettext") || build.with?("all") depends_on "gdbm" if build.with?("gdbm") || build.with?("all") depends_on "gtk+" if build.with?("gtk2") || build.with?("all") depends_on "mysql" if build.with?("mysql") || build.with?("all") depends_on "sdl" if build.with?("sdl") || build.with?("all") depends_on "sane-backends" if build.with?("sane") || build.with?("all") depends_on "pdflib-lite" if build.with?("pdf") || build.with?("all") depends_on "mesalib-glw" if build.with?("gl") || build.with?("all") def install args = ["--prefix=#{prefix}", "--without-bundles"] if MacOS.prefer_64_bit? ENV.append "CFLAGS", "-m64" args << "--with-abi=64" else ENV.append "CFLAGS", "-m32" args << "--with-abi=32" end ENV.deparallelize system "make", "CONFIGUREARGS='" + args.join(" ") + "'" # installation is complicated by some of brew's standard patterns. # hopefully these notes explain the reasons for diverging from # the path that most other formulae use. # # item 1 # # basically, pike already installs itself naturally as brew would want # it; that is, if prefix=/Cellar, installation would create # /Cellar/pike/ver/bin and so forth. We could just go with that, but it's # possible that homebrew might change its layout and then the formula # would no longer work. # # so, rather than guessing at it, we do this alternate gyration, forcing # pike to install in a slightly nonstandard way (for pike, at least) # # item 2 # # a second problem crops up because the during installation, the link # function tries to pull in stuff from lib/, which is really more like # what one would expect share or libexec in homebrew might be: pike # specific files, rather than shared libraries. we could approach this # in a similar fashion, but the result would be a really odd arrangement # for anyone remotely familar with standard pike installs. # # because there's no way to override the keg.link command, this formula # installs the whole pike install into prefix/libexec and then links the # man page and binary back into prefix/share and prefix/bin. not so # elegant, but that's the way brew works. system "make", "install", "prefix=#{libexec}", "exec_prefix=#{libexec}", "share_prefix=#{libexec}/share", "lib_prefix=#{libexec}/lib", "man_prefix=#{libexec}/man", "include_path=#{libexec}/include", "INSTALLARGS=--traditional" bin.install_symlink "#{libexec}/bin/pike" share.install_symlink "#{libexec}/share/man" end test do path = testpath/"test.pike" path.write <<-EOS.undent int main() { for (int i=0; i<10; i++) { write("%d", i); } return 0; } EOS assert_equal "0123456789", shell_output("#{bin}/pike #{path}").strip end end
class Pipx < Formula desc "Execute binaries from Python packages in isolated environments" homepage "https://github.com/pipxproject/pipx" url "https://files.pythonhosted.org/packages/34/19/e79e0a9836187e0b576da06859314887715c3adf4c6e2b4b4d5629f5a04f/pipx-0.16.1.0.tar.gz" sha256 "22b9a0f0536e6b4e7ae030d33cbe34528c3f7ad1615d0c3795f2e5ac4db9d76d" license "MIT" head "https://github.com/pipxproject/pipx.git" bottle do sha256 cellar: :any_skip_relocation, arm64_big_sur: "7175a21e5bf6045390b320c5eb5e88351bd7b3ac56fd7406390d45ac69876c59" sha256 cellar: :any_skip_relocation, big_sur: "07c91b1e0ba3aaf7e285b21b2535c8c6a8d5adbf9558d119ec0c8538ea7477b1" sha256 cellar: :any_skip_relocation, catalina: "80b40dd15aba425da48c79134bd2d4cd52cefbb19fe7caec4d8c61b2d9fffe50" sha256 cellar: :any_skip_relocation, mojave: "beaba00c300b58c6208375b34e95890515c77842508fb3b8e92ac16076e4001f" end depends_on "python@3.9" resource "argcomplete" do url "https://files.pythonhosted.org/packages/cb/53/d2e3d11726367351b00c8f078a96dacb7f57aef2aca0d3b6c437afc56b55/argcomplete-1.12.2.tar.gz" sha256 "de0e1282330940d52ea92a80fea2e4b9e0da1932aaa570f84d268939d1897b04" end resource "click" do url "https://files.pythonhosted.org/packages/27/6f/be940c8b1f1d69daceeb0032fee6c34d7bd70e3e649ccac0951500b4720e/click-7.1.2.tar.gz" sha256 "d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a" end resource "colorama" do url "https://files.pythonhosted.org/packages/1f/bb/5d3246097ab77fa083a61bd8d3d527b7ae063c7d8e8671b1cf8c4ec10cbe/colorama-0.4.4.tar.gz" sha256 "5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b" end resource "packaging" do url "https://files.pythonhosted.org/packages/86/3c/bcd09ec5df7123abcf695009221a52f90438d877a2f1499453c6938f5728/packaging-20.9.tar.gz" sha256 "5b327ac1320dc863dca72f4514ecc086f31186744b84a230374cc1fd776feae5" end resource "pyparsing" do url "https://files.pythonhosted.org/packages/c1/47/dfc9c342c9842bbe0036c7f763d2d6686bcf5eb1808ba3e170afdb282210/pyparsing-2.4.7.tar.gz" sha256 "c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1" end resource "userpath" do url "https://files.pythonhosted.org/packages/f0/1b/d2bccd0b855484e3b419c0d87990e6f588793fb7b233d8ea26fa620936fb/userpath-1.4.2.tar.gz" sha256 "dd4b5496e4ef2c1a3bbb103ffefa7738fa4ba15f23580918bb9f949dcd61a8a7" end def install xy = Language::Python.major_minor_version "python3" ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python#{xy}/site-packages" resources.each do |r| r.stage do system "python3", *Language::Python.setup_install_args(libexec) end end system "python3", *Language::Python.setup_install_args(libexec) (bin/"pipx").write_env_script(libexec/"bin/pipx", PYTHONPATH: ENV["PYTHONPATH"]) (bin/"register-python-argcomplete").write_env_script(libexec/"bin/register-python-argcomplete", PYTHONPATH: ENV["PYTHONPATH"]) end test do assert_match "PIPX_HOME", shell_output("#{bin}/pipx --help") system "#{bin}/pipx", "install", "csvkit" assert_true FileTest.exist?("#{testpath}/.local/bin/csvjoin") system "#{bin}/pipx", "uninstall", "csvkit" assert_no_match Regexp.new("csvjoin"), shell_output("#{bin}/pipx list") end end pipx: update 0.16.1.0 bottle. class Pipx < Formula desc "Execute binaries from Python packages in isolated environments" homepage "https://github.com/pipxproject/pipx" url "https://files.pythonhosted.org/packages/34/19/e79e0a9836187e0b576da06859314887715c3adf4c6e2b4b4d5629f5a04f/pipx-0.16.1.0.tar.gz" sha256 "22b9a0f0536e6b4e7ae030d33cbe34528c3f7ad1615d0c3795f2e5ac4db9d76d" license "MIT" head "https://github.com/pipxproject/pipx.git" bottle do sha256 cellar: :any_skip_relocation, arm64_big_sur: "bab02779c5da9216dbc21812e5786dce16e6c0f79457575fd78037ed96bd6cd0" sha256 cellar: :any_skip_relocation, big_sur: "9c07a40553cfa635460d685e72ec0fc29192a0c50167d6c5ee8a441db3065453" sha256 cellar: :any_skip_relocation, catalina: "abc0c5222a5ddafa0230be3df0e96251b10731ac139a776b367486fccf817ace" sha256 cellar: :any_skip_relocation, mojave: "85019ec96f1cf0aa890a9424522755a3beb3a69d6ef508293cf9292895acd1b9" end depends_on "python@3.9" resource "argcomplete" do url "https://files.pythonhosted.org/packages/cb/53/d2e3d11726367351b00c8f078a96dacb7f57aef2aca0d3b6c437afc56b55/argcomplete-1.12.2.tar.gz" sha256 "de0e1282330940d52ea92a80fea2e4b9e0da1932aaa570f84d268939d1897b04" end resource "click" do url "https://files.pythonhosted.org/packages/27/6f/be940c8b1f1d69daceeb0032fee6c34d7bd70e3e649ccac0951500b4720e/click-7.1.2.tar.gz" sha256 "d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a" end resource "colorama" do url "https://files.pythonhosted.org/packages/1f/bb/5d3246097ab77fa083a61bd8d3d527b7ae063c7d8e8671b1cf8c4ec10cbe/colorama-0.4.4.tar.gz" sha256 "5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b" end resource "packaging" do url "https://files.pythonhosted.org/packages/86/3c/bcd09ec5df7123abcf695009221a52f90438d877a2f1499453c6938f5728/packaging-20.9.tar.gz" sha256 "5b327ac1320dc863dca72f4514ecc086f31186744b84a230374cc1fd776feae5" end resource "pyparsing" do url "https://files.pythonhosted.org/packages/c1/47/dfc9c342c9842bbe0036c7f763d2d6686bcf5eb1808ba3e170afdb282210/pyparsing-2.4.7.tar.gz" sha256 "c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1" end resource "userpath" do url "https://files.pythonhosted.org/packages/f0/1b/d2bccd0b855484e3b419c0d87990e6f588793fb7b233d8ea26fa620936fb/userpath-1.4.2.tar.gz" sha256 "dd4b5496e4ef2c1a3bbb103ffefa7738fa4ba15f23580918bb9f949dcd61a8a7" end def install xy = Language::Python.major_minor_version "python3" ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python#{xy}/site-packages" resources.each do |r| r.stage do system "python3", *Language::Python.setup_install_args(libexec) end end system "python3", *Language::Python.setup_install_args(libexec) (bin/"pipx").write_env_script(libexec/"bin/pipx", PYTHONPATH: ENV["PYTHONPATH"]) (bin/"register-python-argcomplete").write_env_script(libexec/"bin/register-python-argcomplete", PYTHONPATH: ENV["PYTHONPATH"]) end test do assert_match "PIPX_HOME", shell_output("#{bin}/pipx --help") system "#{bin}/pipx", "install", "csvkit" assert_true FileTest.exist?("#{testpath}/.local/bin/csvjoin") system "#{bin}/pipx", "uninstall", "csvkit" assert_no_match Regexp.new("csvjoin"), shell_output("#{bin}/pipx list") end end
class Pnpm < Formula require "language/node" desc "📦🚀 Fast, disk space efficient package manager" homepage "https://pnpm.js.org" url "https://registry.npmjs.org/pnpm/-/pnpm-5.3.0.tgz" sha256 "afbb61ea8be6b48c57eeb00a62049468be8a64a032ffecf53c73bef0d9f3efc4" license "MIT" bottle do cellar :any_skip_relocation sha256 "9c9c85fa26f5bb369ffcd5cd44da68da46115e978714c047ba7e6439b03b7cb8" => :catalina sha256 "b3efdfc6c62704ed71fc66b38926f43924bb1347f224cc9c554ca1087c33f4e7" => :mojave sha256 "a36bfca5a0b2ab1bf83d748a1922b14e95dd2668805388c43919906c5e803ad7" => :high_sierra end depends_on "node" def install system "npm", "install", *Language::Node.std_npm_install_args(libexec) bin.install_symlink Dir["#{libexec}/bin/*"] end test do system "#{bin}/pnpm", "init", "-y" assert_predicate testpath/"package.json", :exist?, "package.json must exist" end end pnpm 5.4.0 Closes #57859. Signed-off-by: chenrui <5fd29470147430022ff146db88de16ee91dea376@gmail.com> Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com> class Pnpm < Formula require "language/node" desc "📦🚀 Fast, disk space efficient package manager" homepage "https://pnpm.js.org" url "https://registry.npmjs.org/pnpm/-/pnpm-5.4.0.tgz" sha256 "95fb74f63686e2d4ed729190bf34215fd1346e9c29870538edc40510e1ac3cf7" license "MIT" bottle do cellar :any_skip_relocation sha256 "9c9c85fa26f5bb369ffcd5cd44da68da46115e978714c047ba7e6439b03b7cb8" => :catalina sha256 "b3efdfc6c62704ed71fc66b38926f43924bb1347f224cc9c554ca1087c33f4e7" => :mojave sha256 "a36bfca5a0b2ab1bf83d748a1922b14e95dd2668805388c43919906c5e803ad7" => :high_sierra end depends_on "node" def install system "npm", "install", *Language::Node.std_npm_install_args(libexec) bin.install_symlink Dir["#{libexec}/bin/*"] end test do system "#{bin}/pnpm", "init", "-y" assert_predicate testpath/"package.json", :exist?, "package.json must exist" end end