aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/qpdf.rb
blob: 5b0ca10f51f844668bc084318b61ff440ae07bf5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require 'formula'

class Qpdf < Formula
  homepage 'http://qpdf.sourceforge.net/'
  url 'http://downloads.sourceforge.net/project/qpdf/qpdf/5.0.1/qpdf-5.0.1.tar.gz'
  sha1 '41a4bd91bfbc2d3585ea229b53bfd1183186b1b3'

  depends_on 'pcre'

  # Fix building using Clang and libc++
  # https://github.com/qpdf/qpdf/issues/19
  def patches
    'https://github.com/qpdf/qpdf/pull/21.diff'
  end

  def install
    # find Homebrew's libpcre
    ENV.append 'LDFLAGS', "-L#{HOMEBREW_PREFIX}/lib"

    system "./configure", "--prefix=#{prefix}"
    system "make"
    system "make install"
  end

  test do
    system "#{bin}/qpdf", "--version"
  end
end