2011-05-04 20:25:00 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
def poppler_has_qt4?
|
|
|
|
poppler = Formula.factory('poppler')
|
|
|
|
not Dir[poppler.include + '**/*qt4.h'].empty?
|
|
|
|
end
|
|
|
|
|
|
|
|
class Diffpdf < Formula
|
|
|
|
homepage 'http://www.qtrac.eu/diffpdf.html'
|
2012-01-27 08:49:53 +00:00
|
|
|
url 'http://www.qtrac.eu/diffpdf-1.8.0.tar.gz'
|
|
|
|
md5 'bfede6ebd3cc4993c50aec5b90628807'
|
2011-05-04 20:25:00 +00:00
|
|
|
|
|
|
|
depends_on 'qt'
|
|
|
|
depends_on 'poppler'
|
|
|
|
|
2011-10-05 06:37:40 +00:00
|
|
|
def patches
|
2011-10-05 06:47:26 +00:00
|
|
|
# Fix library and header search paths.
|
2011-10-05 06:37:40 +00:00
|
|
|
DATA
|
|
|
|
end
|
|
|
|
|
2011-05-04 20:25:00 +00:00
|
|
|
def install
|
|
|
|
if poppler_has_qt4?
|
|
|
|
# Generate makefile and disable .app creation
|
|
|
|
system 'qmake -spec macx-g++ CONFIG-=app_bundle'
|
|
|
|
system 'make'
|
|
|
|
|
|
|
|
bin.install 'diffpdf'
|
|
|
|
man1.install 'diffpdf.1'
|
|
|
|
else
|
|
|
|
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
|
|
|
|
end
|
|
|
|
end
|
2011-10-05 06:37:40 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
|
2011-10-05 06:47:26 +00:00
|
|
|
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.
|
2011-10-05 06:37:40 +00:00
|
|
|
|
|
|
|
diff --git a/diffpdf.pro b/diffpdf.pro
|
2012-01-27 08:49:53 +00:00
|
|
|
index 1566ed7..7d37a3d 100644
|
2011-10-05 06:37:40 +00:00
|
|
|
--- a/diffpdf.pro
|
|
|
|
+++ b/diffpdf.pro
|
2012-01-27 08:49:53 +00:00
|
|
|
@@ -17,15 +17,6 @@ HEADERS += sequence_matcher.hpp
|
2011-10-05 06:47:26 +00:00
|
|
|
SOURCES += sequence_matcher.cpp
|
2011-10-05 06:37:40 +00:00
|
|
|
SOURCES += main.cpp
|
|
|
|
RESOURCES += resources.qrc
|
2011-10-05 06:47:26 +00:00
|
|
|
-LIBS += -lpoppler-qt4
|
2012-01-27 08:49:53 +00:00
|
|
|
-exists($(HOME)/opt/poppler018/) {
|
2011-10-05 06:37:40 +00:00
|
|
|
- message(Using locally built Poppler library)
|
2012-01-27 08:49:53 +00:00
|
|
|
- INCLUDEPATH += $(HOME)/opt/poppler018/include/poppler/qt4
|
|
|
|
- LIBS += -Wl,-rpath -Wl,$(HOME)/opt/poppler018/lib -Wl,-L$(HOME)/opt/poppler018/lib
|
2011-10-05 06:37:40 +00:00
|
|
|
-} else {
|
|
|
|
- exists(/usr/include/poppler/qt4) {
|
|
|
|
- INCLUDEPATH += /usr/include/poppler/qt4
|
|
|
|
- } else {
|
|
|
|
- INCLUDEPATH += /usr/local/include/poppler/qt4
|
|
|
|
- }
|
|
|
|
-}
|
2012-01-27 08:49:53 +00:00
|
|
|
+
|
|
|
|
+LIBS += -L$$quote(HOMEBREW_PREFIX/lib) -lpoppler-qt4
|
2011-10-05 06:47:26 +00:00
|
|
|
+INCLUDEPATH += $$quote(HOMEBREW_PREFIX/include/poppler/qt4)
|