homebrew-core/Formula/fig2dev.rb

65 lines
1.8 KiB
Ruby

class Fig2dev < Formula
desc "Translates figures generated by xfig to other formats"
homepage "https://mcj.sourceforge.io/"
url "https://downloads.sourceforge.net/project/mcj/fig2dev-3.2.8.tar.xz"
sha256 "931258ae43950d0931ddcea13ce6554d2cd7fc3c93585aebf74e393bb14fe27d"
license "MIT"
livecheck do
url :stable
regex(%r{url=.*?/fig2dev[._-]v?(\d+(?:\.\d+)+[a-z]?)\.t}i)
end
bottle do
sha256 arm64_big_sur: "95b7c74801a014788a54d560cfbbcf02097ec130c55741d53bf6736bc6ef0f50"
sha256 big_sur: "09824b751f1163b65751face98b86efe09817f6f5ad70aa5f27122edf2c38366"
sha256 catalina: "5a83656ea1633db4434c171ff87c2207395ad1a21dd96b6fad66fe1017d06d0f"
sha256 mojave: "30502ec9c6c26a00f8e775a515a546cfadb30b5a92e44f06474bca5c1a48dc72"
end
depends_on "ghostscript"
depends_on "libpng"
depends_on "netpbm"
# fix `'endian.h' file not found`
# commit ref, https://sourceforge.net/p/mcj/fig2dev/ci/3897c8034f2eecfa99c645f2b8efa400505a9e27/
# remove in next release
patch :DATA
def install
args = %W[
--prefix=#{prefix}
--disable-dependency-tracking
--disable-silent-rules
--enable-transfig
--without-xpm
--without-x
]
system "./configure", *args
system "make", "install"
# Install a fig file for testing
pkgshare.install "fig2dev/tests/data/patterns.fig"
end
test do
system "#{bin}/fig2dev", "-L", "png", "#{pkgshare}/patterns.fig", "patterns.png"
assert_predicate testpath/"patterns.png", :exist?, "Failed to create PNG"
end
end
__END__
diff --git a/fig2dev/dev/genemf.h b/fig2dev/dev/genemf.h
index 46e0964..4e0d215 100644
--- a/fig2dev/dev/genemf.h
+++ b/fig2dev/dev/genemf.h
@@ -30,8 +30,6 @@
#include "config.h"
#endif
-#include <endian.h>
-
typedef unsigned char uchar;
typedef unsigned short TCHAR;