Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

New Formula: ghostscript-fonts #14949

Closed
wants to merge 4 commits into from

5 participants

@royhodgman

Some aspects of ImageMagick depend on ghostscript fonts, so this formula delivers only the fonts.

This entire formula is cherry picked from the ghostscript.rb Formula.

The inspiration for this came about when trying to work through issue #14609.

@adamv
Owner

If a full Ghostscript is installed after this, do things get weird?

@jacknagel
Owner

Note that this can be accessed from other code without creating a separate formula.

Something like

require Formula.path("ghostscript")
GhostscriptFonts.new.brew do
  ...
end
@royhodgman

@adamv I did a full ghostscript install after this and it seemed to go fine. It did however redownload the gs fonts archive from source forge.

@royhodgman

@jacknagel If the ghostscript fonts are a distinct download from the main ghostscript distribution and there is a use case for installing the fonts independently from ghostscript, do you think it makes sense to split the fonts out into their own formula and make the ghostscript formula list the fonts as a dependency instead?

@royhodgman

@adamv Nope. Never mind. I did that ghostscript install with a different homebrew prefix which did not have the ghostscipt fonts installed already. My mistake. When I installed ghostscript after installing the ghostscript-fonts formula there was an error with linking:

==> Installing ghostscript
==> Downloading http://downloads.ghostscript.com/public/ghostscript-9.06.tar.gz
Already downloaded: /Library/Caches/Homebrew/ghostscript-9.06.tar.gz
==> Patching
patching file base/unix-dll.mak
==> ./configure --prefix=/usr/local/Cellar/ghostscript/9.06 --disable-cups --disable-compile-inits --disable-gtk --w
==> make install
==> make install-so
==> Downloading http://downloads.sourceforge.net/project/gs-fonts/gs-fonts/8.11%20%28base%2035%2C%20GPL%29/ghostscri
Already downloaded: /Library/Caches/Homebrew/ghostscript-fonts-std-8.11.tar.gz
Warning: Could not link ghostscript. Unlinking...
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link ghostscript'
==> Summary
/usr/local/Cellar/ghostscript/9.06: 709 files, 50M, built in 2.2 minutes

but then when I ran "brew link ghostscript", it seems like things turned out ok:

Linking /usr/local/Cellar/ghostscript/9.06... 66 symlinks created

However, this makes me think that the right way to deal with this is to have two formulas, ghostscript, and ghostscript-fonts where ghostscript lists ghostscript-fonts as a dependency.

royhodgman added some commits
@royhodgman royhodgman New Formula: ghostscript-fonts
Some aspects of ImageMagick depend on ghostscript fonts, so this formula delivers only the fonts.

This entire formula is cherry picked from the ghostscript.rb Formula.

The inspiration for this came about when trying to work through issue #14609.
6069e75
@royhodgman royhodgman making ghostscript depend on ghostscript-fonts.
2aa5dac
@royhodgman royhodgman adding ghostscript-fonts optional dependency to imagemagick.
2fd27de
@royhodgman royhodgman adding ghostscript-fonts optional dependency to graphicsmagick.
32cd0a5
@royhodgman

Now ghostscript depends on ghostscript-fonts, and imagemagick and graphicsmagick have an optional dependency on ghostscript-fonts.

@samueljohn samueljohn commented on the diff
Library/Formula/imagemagick.rb
@@ -113,6 +115,9 @@ def caveats
<<-EOS.undent
Some tools will complain unless the ghostscript fonts are installed to:

Good work. I'd vote to just make the ghostscript-fonts a depends_on without an option and then we don't need this caveat at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@samueljohn

I like this split very much. In my opinion, the ghostscript-fonts should just be a dependency without any option or at least only with an option to deactivate (--disable-ghostscript-fonts).

@adamv
Owner

Looks like this needs to be rebased on master.

@mikemcquaid
Owner

Closing until rebased. Will reopen when done.

@mikemcquaid mikemcquaid closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 7, 2012
  1. @royhodgman

    New Formula: ghostscript-fonts

    royhodgman authored
    Some aspects of ImageMagick depend on ghostscript fonts, so this formula delivers only the fonts.
    
    This entire formula is cherry picked from the ghostscript.rb Formula.
    
    The inspiration for this came about when trying to work through issue #14609.
  2. @royhodgman
  3. @royhodgman
  4. @royhodgman
This page is out of date. Refresh to see the latest.
View
14 Library/Formula/ghostscript-fonts.rb
@@ -0,0 +1,14 @@
+require 'formula'
+
+class GhostscriptFonts < Formula
+ homepage 'http://sourceforge.net/projects/gs-fonts/'
+ url 'http://downloads.sourceforge.net/project/gs-fonts/gs-fonts/8.11%20%28base%2035%2C%20GPL%29/ghostscript-fonts-std-8.11.tar.gz'
+ sha1 '2a7198e8178b2e7dba87cb5794da515200b568f5'
+
+ def install
+
+ # install fonts into homebrew's share directory
+ (share+'ghostscript').install '../fonts'
+
+ end
+end
View
11 Library/Formula/ghostscript.rb
@@ -1,11 +1,5 @@
require 'formula'
-class GhostscriptFonts < Formula
- homepage 'http://sourceforge.net/projects/gs-fonts/'
- url 'http://downloads.sourceforge.net/project/gs-fonts/gs-fonts/8.11%20%28base%2035%2C%20GPL%29/ghostscript-fonts-std-8.11.tar.gz'
- sha1 '2a7198e8178b2e7dba87cb5794da515200b568f5'
-end
-
class Ghostscript < Formula
homepage 'http://www.ghostscript.com/'
url 'http://downloads.ghostscript.com/public/ghostscript-9.06.tar.gz'
@@ -24,6 +18,7 @@ class Ghostscript < Formula
depends_on 'jbig2dec'
depends_on 'little-cms2'
depends_on :libpng
+ depends_on 'ghostscript-fonts'
# Fix dylib names, per installation instructions
def patches
@@ -71,10 +66,6 @@ def install
system "make install-so"
end
- GhostscriptFonts.new.brew do
- (share+'ghostscript').install '../fonts'
- end
-
(man+'de').rmtree
end
end
View
2  Library/Formula/graphicsmagick.rb
@@ -16,6 +16,7 @@ class Graphicsmagick < Formula
head 'hg://http://graphicsmagick.hg.sourceforge.net:8000/hgroot/graphicsmagick/graphicsmagick'
option 'with-ghostscript', 'Compile against ghostscript (not recommended.)'
+ option 'with-ghostscript-fonts', 'Compile against just the ghostscript fonts.'
option 'use-tiff', 'Compile with libtiff support.'
option 'use-cms', 'Compile with little-cms support.'
option 'use-jpeg2000', 'Compile with jasper support.'
@@ -32,6 +33,7 @@ class Graphicsmagick < Formula
depends_on :x11 if build.include? 'with-x'
depends_on 'ghostscript' => :optional if ghostscript_srsly?
+ depends_on 'ghostscript-fonts' => :optional if build.include? 'with-ghostscript-fonts'
depends_on 'libtiff' => :optional if build.include? 'use-tiff'
depends_on 'little-cms2' => :optional if build.include? 'use-cms'
View
5 Library/Formula/imagemagick.rb
@@ -20,6 +20,7 @@ class Imagemagick < Formula
:using => UnsafeSubversionDownloadStrategy
option 'with-ghostscript', 'Compile against ghostscript (not recommended.)'
+ option 'with-ghostscript-fonts', 'Compile against just the ghostscript fonts.'
option 'use-tiff', 'Compile with libtiff support.'
option 'use-cms', 'Compile with little-cms support.'
option 'use-jpeg2000', 'Compile with jasper support.'
@@ -45,6 +46,7 @@ class Imagemagick < Formula
depends_on :freetype => :recommended unless build.include? 'without-freetype'
depends_on 'ghostscript' => :optional if ghostscript_srsly?
+ depends_on 'ghostscript-fonts' => :optional if build.include? 'with-ghostscript-fonts'
depends_on 'libtiff' => :optional if build.include? 'use-tiff'
depends_on 'little-cms' => :optional if build.include? 'use-cms'
@@ -113,6 +115,9 @@ def caveats
<<-EOS.undent
Some tools will complain unless the ghostscript fonts are installed to:

Good work. I'd vote to just make the ghostscript-fonts a depends_on without an option and then we don't need this caveat at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
#{HOMEBREW_PREFIX}/share/ghostscript/fonts
+ You can install just the ghostscript fonts (without the rest of ghostscript
+ by installing the 'ghostscript-fonts' formula, or by using the ---with-ghostscript-fonts'
+ option with this imagemagick.
EOS
end
end
Something went wrong with that request. Please try again.