logstash: fix version

- Fix https://github.com/Homebrew/homebrew-core/issues/66907
- use platform independent URL
- remove URL check for `/-oss-/` from test
- build from source
- remove `bottle :unneeded`
- use openjdk@8
- remove from style exception allowlist

Closes #66908.

Co-authored-by: Alexander Bayandin <a.bayandin@gmail.com>
Co-authored-by: Seeker <meaningseeking@protonmail.com>
Signed-off-by: Alexander Bayandin <864213+bayandin@users.noreply.github.com>
Signed-off-by: Francois-Xavier Coudert <fxcoudert@gmail.com>
master
carlocab 2020-12-14 16:19:40 +00:00 committed by Francois-Xavier Coudert
parent 3ddce15d89
commit 0c35496f59
2 changed files with 16 additions and 17 deletions

View File

@ -1,9 +1,10 @@
class Logstash < Formula
desc "Tool for managing events and logs"
homepage "https://www.elastic.co/products/logstash"
url "https://artifacts.elastic.co/downloads/logstash/logstash-oss-7.10.1-darwin-x86_64.tar.gz"
sha256 "8e5b8d2557029de9278361a8bb5ef86144a0d2176bb9c586a4170434e7ba15db"
url "https://github.com/elastic/logstash/archive/v7.10.1.tar.gz"
sha256 "9f4732d3c324d27ed348060eccf38840ec74f6baf155ef5f7347346b714a1c58"
license "Apache-2.0"
version_scheme 1
head "https://github.com/elastic/logstash.git"
livecheck do
@ -11,19 +12,19 @@ class Logstash < Formula
regex(/^v?(\d+(?:\.\d+)+)$/i)
end
bottle :unneeded
depends_on "openjdk@11"
depends_on "openjdk@8"
def install
if build.head?
# Build the package from source
system "rake", "artifact:tar"
# Extract the package to the current directory
mkdir "tar"
system "tar", "--strip-components=1", "-xf", Dir["build/logstash-*.tar.gz"].first, "-C", "tar"
cd "tar"
end
# remove non open source files
rm_rf "x-pack"
ENV["OSS"] = "true"
# Build the package from source
system "rake", "artifact:no_bundle_jdk_tar"
# Extract the package to the current directory
mkdir "tar"
system "tar", "--strip-components=1", "-xf", Dir["build/logstash-*.tar.gz"].first, "-C", "tar"
cd "tar"
inreplace "bin/logstash",
%r{^\. "\$\(cd `dirname \$\{SOURCEPATH\}`/\.\.; pwd\)/bin/logstash\.lib\.sh"},
@ -42,7 +43,7 @@ class Logstash < Formula
(libexec/"config").rmtree
bin.install libexec/"bin/logstash", libexec/"bin/logstash-plugin"
bin.env_script_all_files(libexec/"bin", Language::Java.java_home_env("11"))
bin.env_script_all_files(libexec/"bin", Language::Java.overridable_java_home_env("1.8"))
end
def post_install
@ -88,7 +89,6 @@ class Logstash < Formula
end
test do
assert_includes(stable.url, "-oss-")
# workaround https://github.com/elastic/logstash/issues/6378
(testpath/"config").mkpath
["jvm.options", "log4j2.properties", "startup.options"].each do |f|

View File

@ -9,6 +9,5 @@
"gcore",
"cspice",
"x264",
"vifm",
"logstash"
"vifm"
]