Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Tweaked dependency
Browse files Browse the repository at this point in the history
- Made all dependencies required
    Including `jansson` and `libyaml` should not hurt so much as they
    have no runtime dependency.
    Though `docutils` and `libxml2` are a bit heavy as they require
    Python, they will bring a better user experience.

- Applied `brew audit`

- Adjusted `.travis.yml`
  • Loading branch information
equal-l2 authored and KazuakiM committed Feb 23, 2021
1 parent 7638b64 commit 82db2cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ before_install:
fi
install:
- brew install --HEAD --debug --verbose --with-docutils --with-jansson --with-libyaml ./universal-ctags.rb
- brew install --HEAD --debug --verbose ./universal-ctags.rb

script:
- ctags --version
Expand Down
15 changes: 7 additions & 8 deletions universal-ctags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@ class UniversalCtags < Formula
desc "Maintained ctags implementation"
homepage "https://github.com/universal-ctags/ctags"
head "https://github.com/universal-ctags/ctags.git"
option "without-xml", "Compile without libxml2"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "docutils" => :build
depends_on "pkg-config" => :build
depends_on "docutils" => :optional
depends_on "jansson" => :optional
depends_on "libyaml" => :optional
conflicts_with "ctags", :because => "this formula installs the same executable as the ctags formula"
depends_on "jansson"
depends_on "libyaml"
uses_from_macos "libxml2"
conflicts_with "ctags", because: "this formula installs the same executable as the ctags formula"

def install
opts = []
opts << "--disable-xml" if build.without? "xml"
if build.with?("docutils") && OS.linux?
if OS.linux?
py_formula = Formula["docutils"].recursive_dependencies.map(&:name).find { |n| n.include?("python") }
py_ldflags = `#{Formula[py_formula].opt_bin}/python3-config --ldflags`
opts << "PYTHON_EXTRA_LDFLAGS=#{py_ldflags.chomp}"
Expand Down Expand Up @@ -55,6 +54,6 @@ def caveats
}
EOS
system "#{bin}/ctags", "-R", "."
assert_match /func.*test\.c/, File.read("tags")
assert_match(/func.*test\.c/, File.read("tags"))
end
end

0 comments on commit 82db2cf

Please sign in to comment.