Skip to content

Commit

Permalink
apache-opennlp 2.5.2
Browse files Browse the repository at this point in the history
apache-opennlp: add build patch

Signed-off-by: Rui Chen <rui@chenrui.dev>
  • Loading branch information
BrewTestBot authored and chenrui333 committed Dec 27, 2024
1 parent c182892 commit 584bad0
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions Formula/a/apache-opennlp.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
class ApacheOpennlp < Formula
desc "Machine learning toolkit for processing natural language text"
homepage "https://opennlp.apache.org/"
url "https://www.apache.org/dyn/closer.lua?path=opennlp/opennlp-2.5.1/apache-opennlp-2.5.1-bin.tar.gz"
mirror "https://archive.apache.org/dist/opennlp/opennlp-2.5.1/apache-opennlp-2.5.1-bin.tar.gz"
sha256 "2b47d41e2b45073fd785bb65923623d877f0f605cb390eee1470964772a4191a"
url "https://www.apache.org/dyn/closer.lua?path=opennlp/opennlp-2.5.2/apache-opennlp-2.5.2-bin.tar.gz"
mirror "https://archive.apache.org/dist/opennlp/opennlp-2.5.2/apache-opennlp-2.5.2-bin.tar.gz"
sha256 "d515781b1444038dad6433ee8414f535bac3b244f126b3b5479a5b021bf22246"
license "Apache-2.0"

bottle do
Expand All @@ -12,7 +12,13 @@ class ApacheOpennlp < Formula

depends_on "openjdk"

# build patch to remove quote for `$HEAP`, upstream pr ref, https://github.com/apache/opennlp/pull/734
patch :DATA

def install
# Remove Windows scripts
rm(Dir["bin/*.bat"])

libexec.install Dir["*"]
(bin/"opennlp").write_env_script libexec/"bin/opennlp", JAVA_HOME: Formula["openjdk"].opt_prefix,
OPENNLP_HOME: libexec
Expand All @@ -22,3 +28,15 @@ def install
assert_equal "Hello , friends", pipe_output("#{bin}/opennlp SimpleTokenizer", "Hello, friends").lines.first.chomp
end
end

__END__
diff --git a/bin/opennlp b/bin/opennlp
index 8375e2d..c1c2984 100755
--- a/bin/opennlp
+++ b/bin/opennlp
@@ -58,4 +58,4 @@ if [ -n "$JAVA_HEAP" ] ; then
HEAP="-Xmx$JAVA_HEAP"
fi

-$JAVACMD "$HEAP" -Dlog4j.configurationFile="$OPENNLP_HOME/conf/log4j2.xml" -cp "$CLASSPATH" opennlp.tools.cmdline.CLI "$@"
+$JAVACMD $HEAP -Dlog4j.configurationFile="$OPENNLP_HOME/conf/log4j2.xml" -cp "$CLASSPATH" opennlp.tools.cmdline.CLI "$@"

0 comments on commit 584bad0

Please sign in to comment.