88 lines
2.8 KiB
Ruby
88 lines
2.8 KiB
Ruby
class Ghostscript < Formula
|
|
desc "Interpreter for PostScript and PDF"
|
|
homepage "https://www.ghostscript.com/"
|
|
url "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs922/ghostscript-9.22.tar.xz"
|
|
sha256 "c1f862e6f40f997dbe3feba89355e8cb05d55818994e10f4932b0dd9b627d1bb"
|
|
|
|
bottle do
|
|
sha256 "dec4d99345c0d402cd78e12fc2b6d1c2efa9fc9e207480bb665b60cbcfef1c21" => :high_sierra
|
|
sha256 "45a8136781fc46574f134114b7db8417994406c81160211ad4e7252b17154810" => :sierra
|
|
sha256 "f935b2fc2d7a5dc580e530f4e571bca53ed2423633461e1a8c34957990258adf" => :el_capitan
|
|
end
|
|
|
|
head do
|
|
# Can't use shallow clone. Doing so = fatal errors.
|
|
url "https://git.ghostscript.com/ghostpdl.git", :shallow => false
|
|
|
|
depends_on "autoconf" => :build
|
|
depends_on "automake" => :build
|
|
depends_on "libtool" => :build
|
|
end
|
|
|
|
patch :DATA # Uncomment macOS-specific make vars
|
|
|
|
depends_on "pkg-config" => :build
|
|
depends_on "little-cms2"
|
|
depends_on :x11 => :optional
|
|
|
|
# https://sourceforge.net/projects/gs-fonts/
|
|
resource "fonts" do
|
|
url "https://downloads.sourceforge.net/project/gs-fonts/gs-fonts/8.11%20%28base%2035%2C%20GPL%29/ghostscript-fonts-std-8.11.tar.gz"
|
|
sha256 "0eb6f356119f2e49b2563210852e17f57f9dcc5755f350a69a46a0d641a0c401"
|
|
end
|
|
|
|
def install
|
|
args = %W[
|
|
--prefix=#{prefix}
|
|
--disable-cups
|
|
--disable-compile-inits
|
|
--disable-gtk
|
|
--disable-fontconfig
|
|
--without-libidn
|
|
]
|
|
args << "--without-x" if build.without? "x11"
|
|
|
|
if build.head?
|
|
system "./autogen.sh", *args
|
|
else
|
|
system "./configure", *args
|
|
end
|
|
|
|
# Install binaries and libraries
|
|
system "make", "install"
|
|
system "make", "install-so"
|
|
|
|
(pkgshare/"fonts").install resource("fonts")
|
|
(man/"de").rmtree
|
|
end
|
|
|
|
test do
|
|
ps = test_fixtures("test.ps")
|
|
assert_match /Hello World!/, shell_output("#{bin}/ps2ascii #{ps}")
|
|
end
|
|
end
|
|
|
|
__END__
|
|
diff --git a/base/unix-dll.mak b/base/unix-dll.mak
|
|
index ae2d7d8..4f4daed 100644
|
|
--- a/base/unix-dll.mak
|
|
+++ b/base/unix-dll.mak
|
|
@@ -64,12 +64,12 @@ GS_SONAME_MAJOR_MINOR=$(GS_SONAME_BASE)$(GS_SOEXT)$(SO_LIB_VERSION_SEPARATOR)$(G
|
|
|
|
|
|
# MacOS X
|
|
-#GS_SOEXT=dylib
|
|
-#GS_SONAME=$(GS_SONAME_BASE).$(GS_SOEXT)
|
|
-#GS_SONAME_MAJOR=$(GS_SONAME_BASE).$(GS_VERSION_MAJOR).$(GS_SOEXT)
|
|
-#GS_SONAME_MAJOR_MINOR=$(GS_SONAME_BASE).$(GS_VERSION_MAJOR).$(GS_VERSION_MINOR).$(GS_SOEXT)
|
|
+GS_SOEXT=dylib
|
|
+GS_SONAME=$(GS_SONAME_BASE).$(GS_SOEXT)
|
|
+GS_SONAME_MAJOR=$(GS_SONAME_BASE).$(GS_VERSION_MAJOR).$(GS_SOEXT)
|
|
+GS_SONAME_MAJOR_MINOR=$(GS_SONAME_BASE).$(GS_VERSION_MAJOR).$(GS_VERSION_MINOR).$(GS_SOEXT)
|
|
#LDFLAGS_SO=-dynamiclib -flat_namespace
|
|
-#LDFLAGS_SO_MAC=-dynamiclib -install_name $(GS_SONAME_MAJOR_MINOR)
|
|
+LDFLAGS_SO_MAC=-dynamiclib -install_name __PREFIX__/lib/$(GS_SONAME_MAJOR_MINOR)
|
|
#LDFLAGS_SO=-dynamiclib -install_name $(FRAMEWORK_NAME)
|
|
|
|
GS_SO=$(BINDIR)/$(GS_SONAME)
|
|
|