Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global: --with-universal-ctags #8309

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions Formula/global.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ class Global < Formula
end

option "with-ctags", "Enable Exuberant Ctags as a plug-in parser"
option "with-universal-ctags", "Enable Universal Ctags as a plug-in parser"
option "with-pygments", "Enable Pygments as a plug-in parser (should enable exuberent-ctags too)"
option "with-sqlite3", "Use SQLite3 API instead of BSD/DB API for making tag files"

deprecated_option "with-exuberant-ctags" => "with-ctags"

depends_on "ctags" => :optional
depends_on "universal-ctags/universal-ctags/universal-ctags" => :optional
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want homebrew/core formulae depending on non-Homebrew organisation taps as options. Could this be submitted to homebrew/core?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MikeMcQuaid The universal-ctags tap mentions,

When Universal Ctags has a tagged release, this formula should be moved to the official Homebrew repository. This repo should then be deleted.

Indeed, universal ctags still has no tagged release. I'll check with the maintainers on the status of that. Is a tagged release a prerequisite for submitting to homebrew/core?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is, yep.


skip_clean "lib/gtags"

Expand All @@ -52,6 +54,10 @@ def install
args << "--with-exuberant-ctags=#{Formula["ctags"].opt_bin}/ctags"
end

if build.with? "universal-ctags"
args << "--with-universal-ctags=#{Formula["universal-ctags"].opt_bin}/ctags"
end

if build.with? "pygments"
ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages"
pygments_args = %W[build install --prefix=#{libexec}]
Expand All @@ -78,7 +84,7 @@ def install
int c2func (void) { return 0; }
void cfunc (void) {int cvar = c2func(); }")
EOS
if build.with?("pygments") || build.with?("ctags")
if build.with?("pygments") || build.with?("ctags") || build.with?("universal-ctags")
(testpath/"test.py").write <<-EOS
def py2func ():
return 0
Expand All @@ -88,7 +94,7 @@ def pyfunc ():
end
if build.with? "pygments"
assert shell_output("#{bin}/gtags --gtagsconf=#{share}/gtags/gtags.conf --gtagslabel=pygments .")
if build.with? "ctags"
if build.with?("ctags") || build.with?("universal-ctags")
assert_match "test.c", shell_output("#{bin}/global -d cfunc")
assert_match "test.c", shell_output("#{bin}/global -d c2func")
assert_match "test.c", shell_output("#{bin}/global -r c2func")
Expand Down