70 lines
2.8 KiB
Ruby
70 lines
2.8 KiB
Ruby
class Cherrytree < Formula
|
|
desc "Hierarchical note taking application featuring rich text and syntax highlighting"
|
|
homepage "https://www.giuspen.com/cherrytree/"
|
|
url "https://www.giuspen.com/software/cherrytree_0.99.40.tar.xz"
|
|
sha256 "8460284d76d6a1fd555a13903abb10e0473757f6ce09a98c10220de9713bb3ed"
|
|
license "GPL-3.0-or-later"
|
|
|
|
livecheck do
|
|
url :homepage
|
|
regex(/href=.*?cherrytree[._-]v?(\d+(?:\.\d+)+)\.t/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 arm64_big_sur: "feb590d9d00456a398ee29513f7ff62ca11f0e449b6e742cbc6b691ac698798f"
|
|
sha256 big_sur: "159969d7a15b143f6dbec2c428a70915cab6dc674b074b0a736ee462399f286e"
|
|
sha256 catalina: "3df82c0d9cf2ce224b2630874d0f206cbd076940854a66bc5e564dd1aa8c0196"
|
|
sha256 mojave: "418bec62eff92314782beceaa0eeb5519dbc25682ea551824e32bb8247af2830"
|
|
end
|
|
|
|
depends_on "cmake" => :build
|
|
depends_on "ninja" => :build
|
|
depends_on "pkg-config" => :build
|
|
depends_on "python@3.9" => :build
|
|
depends_on "adwaita-icon-theme"
|
|
depends_on "fmt"
|
|
depends_on "gspell"
|
|
depends_on "gtksourceviewmm3"
|
|
depends_on "libxml++"
|
|
depends_on "spdlog"
|
|
depends_on "uchardet"
|
|
|
|
uses_from_macos "curl"
|
|
|
|
def install
|
|
system "cmake", ".", "-DBUILD_TESTING=''", "-GNinja", *std_cmake_args
|
|
system "ninja"
|
|
system "ninja", "install"
|
|
end
|
|
|
|
test do
|
|
(testpath/"homebrew.ctd").write <<~EOS
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<cherrytree>
|
|
<bookmarks list=""/>
|
|
<node name="rich text" unique_id="1" prog_lang="custom-colors" tags="" readonly="0" custom_icon_id="0" is_bold="0" foreground="" ts_creation="1611952177" ts_lastsave="1611952932">
|
|
<rich_text>this is a </rich_text>
|
|
<rich_text weight="heavy">simple</rich_text>
|
|
<rich_text> </rich_text>
|
|
<rich_text foreground="#ffff00000000">command line</rich_text>
|
|
<rich_text> </rich_text>
|
|
<rich_text style="italic">test</rich_text>
|
|
<rich_text> </rich_text>
|
|
<rich_text family="monospace">for</rich_text>
|
|
<rich_text> </rich_text>
|
|
<rich_text link="webs https://brew.sh/">homebrew</rich_text>
|
|
</node>
|
|
<node name="code" unique_id="2" prog_lang="python3" tags="" readonly="0" custom_icon_id="0" is_bold="0" foreground="" ts_creation="1611952391" ts_lastsave="1611952667">
|
|
<rich_text>print('hello world')</rich_text>
|
|
</node>
|
|
</cherrytree>
|
|
EOS
|
|
system "#{bin}/cherrytree", testpath/"homebrew.ctd", "--export_to_txt_dir", testpath, "--export_single_file"
|
|
assert_predicate testpath/"homebrew.ctd.txt", :exist?
|
|
assert_match "rich text", (testpath/"homebrew.ctd.txt").read
|
|
assert_match "this is a simple command line test for homebrew", (testpath/"homebrew.ctd.txt").read
|
|
assert_match "code", (testpath/"homebrew.ctd.txt").read
|
|
assert_match "print('hello world')", (testpath/"homebrew.ctd.txt").read
|
|
end
|
|
end
|