aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorCharlie Sharpsteen2012-05-23 14:05:24 -0700
committerCharlie Sharpsteen2012-05-23 14:31:51 -0700
commit3358a5467401127d2f288acd3e7d66931b1c86b0 (patch)
tree6c604188ff2991e68d9cb8c72b44a69beb2435be /Library/Formula
parentbe02a97a84e8dd52ddb8f7bad8ef38c79e545546 (diff)
downloadhomebrew-3358a5467401127d2f288acd3e7d66931b1c86b0.tar.bz2
DiffPDF: Update to 2.0.0
Also, use a Requirement that references the Poppler Tab to figure out if Qt support is present.
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/diffpdf.rb76
1 files changed, 53 insertions, 23 deletions
diff --git a/Library/Formula/diffpdf.rb b/Library/Formula/diffpdf.rb
index a76260b1d..2728de1b2 100644
--- a/Library/Formula/diffpdf.rb
+++ b/Library/Formula/diffpdf.rb
@@ -1,17 +1,31 @@
require 'formula'
-def poppler_has_qt4?
- poppler = Formula.factory('poppler')
- not Dir[poppler.include + '**/*qt4.h'].empty?
+class PopplerQt4 < Requirement
+ def satisfied?
+ poppler = Tab.for_formula 'poppler'
+ poppler.installed_with? '--with-qt4'
+ end
+
+ def fatal?
+ true
+ end
+
+ def message; <<-EOS.undent
+ DiffPDF requires the Poppler-Qt4 bindings but Poppler was not installed
+ with support for Qt. Please reinstall Poppler using the `--with-qt4`
+ option.
+ EOS
+ end
end
class Diffpdf < Formula
homepage 'http://www.qtrac.eu/diffpdf.html'
- url 'http://www.qtrac.eu/diffpdf-1.8.0.tar.gz'
- md5 'bfede6ebd3cc4993c50aec5b90628807'
+ url 'http://www.qtrac.eu/diffpdf-2.0.0.tar.gz'
+ md5 '88b5346cdbfb024a9ad751c7e9a0eee4'
depends_on 'qt'
depends_on 'poppler'
+ depends_on PopplerQt4.new
# The location of Poppler library/include paths is hardcoded in the project file
# which causes builds to fail if Homebrew is not installed to /usr/local.
@@ -20,15 +34,9 @@ class Diffpdf < Formula
end
def install
- unless poppler_has_qt4?
- onoe <<-EOS.undent
- Could not locate header files for poppler-qt4. This probably means that Poppler
- was not installed with support for Qt. Try reinstalling Poppler using the
- `--with-qt4` option.
- EOS
- exit 1
- end
-
+ # The 2.0 sources shipped without translation files. Generate them so that
+ # compilation does not fail.
+ system 'lrelease', 'diffpdf.pro'
# Generate makefile and disable .app creation
system 'qmake -spec macx-g++ CONFIG-=app_bundle'
system 'make'
@@ -41,25 +49,47 @@ end
__END__
diff --git a/diffpdf.pro b/diffpdf.pro
-index 1566ed7..7d37a3d 100644
+index 8b511b6..2079247 100644
--- a/diffpdf.pro
+++ b/diffpdf.pro
-@@ -17,15 +17,6 @@ HEADERS += sequence_matcher.hpp
- SOURCES += sequence_matcher.cpp
- SOURCES += main.cpp
- RESOURCES += resources.qrc
--LIBS += -lpoppler-qt4
+@@ -31,36 +31,7 @@ LIBS += -lpoppler-qt4
+ win32 {
+ CONFIG += release
+ }
-exists($(HOME)/opt/poppler018/) {
- message(Using locally built Poppler library)
+- INCLUDEPATH += $(HOME)/opt/poppler018/include/poppler/cpp
- INCLUDEPATH += $(HOME)/opt/poppler018/include/poppler/qt4
- LIBS += -Wl,-rpath -Wl,$(HOME)/opt/poppler018/lib -Wl,-L$(HOME)/opt/poppler018/lib
-} else {
-- exists(/usr/include/poppler/qt4) {
-- INCLUDEPATH += /usr/include/poppler/qt4
+- exists(/poppler_lib) {
+- message(Using locally built Poppler library on Windows)
+- INCLUDEPATH += /c/poppler_lib/include/poppler/cpp
+- INCLUDEPATH += /c/poppler_lib/include/poppler/qt4
+- LIBS += -Wl,-rpath -Wl,/c/poppler_lib/bin -Wl,-L/c/poppler_lib/bin
- } else {
-- INCLUDEPATH += /usr/local/include/poppler/qt4
+- exists(/usr/include/poppler/qt4) {
+- INCLUDEPATH += /usr/include/poppler/cpp
+- INCLUDEPATH += /usr/include/poppler/qt4
+- } else {
+- INCLUDEPATH += /usr/local/include/poppler/cpp
+- INCLUDEPATH += /usr/local/include/poppler/qt4
+- }
- }
-}
+-#exists($(HOME)/opt/podofo09/) {
+-# message(Using locally built PoDoFo library)
+-# INCLUDEPATH += $(HOME)/opt/podofo09/include/poppler/cpp
+-# INCLUDEPATH += $(HOME)/opt/podofo09/include/poppler/qt4
+-# LIBS += -Wl,-rpath -Wl,$(HOME)/opt/podofo09/lib64 -Wl,-L$(HOME)/opt/podofo09/lib64
+-#} else {
+-# exists(/usr/include/podofo) {
+-# INCLUDEPATH += /usr/include/podofo
+-# } else {
+-# INCLUDEPATH += /usr/local/include/podofo
+-# }
+-#}
+
+LIBS += -L$$quote(HOMEBREW_PREFIX/lib) -lpoppler-qt4
++INCLUDEPATH += $$quote(HOMEBREW_PREFIX/include/poppler/cpp)
+INCLUDEPATH += $$quote(HOMEBREW_PREFIX/include/poppler/qt4)