Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

tidy-html5 4.9.25 #39010

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Library/Formula/tidy-html5.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class TidyHtml5 < Formula
homepage "http://www.html-tidy.org/"
url "https://github.com/htacg/tidy-html5/archive/4.9.26.tar.gz"
sha256 "28674745db53b6ef1aa4b8466e6e231915dcd596672ec40515d0ab53ee0c33f6"

Copy link
Member

Choose a reason for hiding this comment

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

Needs a sha256 declared.

depends_on "cmake" => :build

def install
cd "build/cmake"
Copy link
Member

Choose a reason for hiding this comment

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

Is it necessary to change directory here? What happens if just run in the root of the repo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually it is, according to tidy's docs. Can confirm: removing that line will cause a build failure.

   def install
-    cd "build/cmake"
-    system "cmake", "../..", *std_cmake_args
+    system "cmake", *std_cmake_args
     system "make"
     system "make", "install"
   end
==> Downloading https://github.com/htacg/tidy-html5/archive/4.9.26.tar.gz
Already downloaded: /Library/Caches/Homebrew/tidy-html5-4.9.26.tar.gz
==> cmake -DCMAKE_C_FLAGS_RELEASE= -DCMAKE_CXX_FLAGS_RELEASE= -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/tidy-html5/4.9.26 -DCMAKE_BUILD_T
==> make
warning: failed to load external entity "../documentation/tidy1.xsl"
cannot parse ../documentation/tidy1.xsl
make[2]: *** [man] Error 4
make[1]: *** [CMakeFiles/man.dir/all] Error 2
make: *** [all] Error 2
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1

READ THIS: https://git.io/brew-troubleshooting

Copy link
Member

Choose a reason for hiding this comment

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

Weird, thanks.

system "cmake", "../..", *std_cmake_args
system "make"
system "make", "install"
end

test do
output = pipe_output(bin/"tidy5 -q", "<!doctype html><title></title>")
assert_match /^<!DOCTYPE html>/, output
assert_match /HTML Tidy for HTML5/, output
end
end
Copy link
Member

Choose a reason for hiding this comment

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

Can a test be added to do something more substantial than e.g. --version or --help? See cmake.rb for an example of an application formula with a good test and tinyxml2.rb for an example of a library formula with a good test. Thanks!