homebrew-core/Formula/doxymacs.rb

59 lines
2.7 KiB
Ruby

class Doxymacs < Formula
desc "Elisp package for using doxygen under Emacs"
homepage "https://doxymacs.sourceforge.io/"
url "https://downloads.sourceforge.net/project/doxymacs/doxymacs/1.8.0/doxymacs-1.8.0.tar.gz"
sha256 "a23fd833bc3c21ee5387c62597610941e987f9d4372916f996bf6249cc495afa"
license "GPL-2.0"
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "4ffe57742c559c3ef80b3bf338d2903c7fc0137d4d9cc96f2b23bea2e0cab832"
sha256 cellar: :any_skip_relocation, big_sur: "761f34a12276f673ad5914b0b9caa8891eaab8fb213292a897e1000375a0370a"
sha256 cellar: :any_skip_relocation, catalina: "060a755f85149143e0aea876b488f98e685e320c7ced43d3ae87dfcbd4931f14"
sha256 cellar: :any_skip_relocation, mojave: "48298f0f0b797c18f3af78a77a0f09f9db3880dc9d85771794894da348aedf1c"
sha256 cellar: :any_skip_relocation, high_sierra: "29a4865170b12a2194c238c35ec5e0902b8e637e378f9013b7aef64fa21eb0fc"
sha256 cellar: :any_skip_relocation, sierra: "2fd3dc59a8c0c8fdccf8195265d320aaa7b5d67e9a81b5a085f27cc287e7370e"
sha256 cellar: :any_skip_relocation, el_capitan: "fb892db831aed57dbdcb2d3a81d78bd05c5b689376d4b7f14bffc56826205ce9"
sha256 cellar: :any_skip_relocation, yosemite: "09eb19921c2ecce5bb02b185c1040caef07d18706866006bdd5fa428bf6b8560"
sha256 cellar: :any_skip_relocation, x86_64_linux: "00c2ebbdf243dded3a23783b3a22ee3705a53dd0ba50c292dcb190bb5bcebc9a"
end
head do
url "https://git.code.sf.net/p/doxymacs/code.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
end
depends_on "doxygen"
depends_on "emacs"
def install
# Fix undefined symbols errors for _xmlCheckVersion and other symbols
ENV["SDKROOT"] = MacOS.sdk_path if MacOS.version <= :sierra
# https://sourceforge.net/p/doxymacs/support-requests/5/
ENV.append "CFLAGS", "-std=gnu89"
# Fix undefined symbol errors for _xmlCheckVersion, etc.
# This prevents a mismatch between /usr/bin/xml2-config and the SDK headers,
# which would cause the build system not to pass the LDFLAGS for libxml2.
ENV.prepend_path "PATH", "#{MacOS.sdk_path}/usr/bin"
system "./bootstrap" if build.head?
system "./configure", "--prefix=#{prefix}",
"--with-lispdir=#{elisp}",
"--disable-debug",
"--disable-dependency-tracking"
system "make", "install"
end
test do
(testpath/"test.el").write <<~EOS
(add-to-list 'load-path "#{elisp}")
(load "doxymacs")
(print doxymacs-version)
EOS
output = shell_output("emacs -Q --batch -l #{testpath}/test.el").strip
assert_equal "\"#{version}\"", output
end
end