-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patholena.rb
96 lines (76 loc) · 2.94 KB
/
olena.rb
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Original formula by @glazzara
# Adapted from https://github.com/Homebrew/homebrew/pull/16092/files
class Olena < Formula
homepage 'http://olena.lrde.epita.fr'
#url 'http://www.lrde.epita.fr/dload/olena/2.0/olena-2.0a.tar.gz'
#version "2.0"
#sha1 'a9445bac1f30c9d999ad5ce70588745e153700dd'
url 'https://www.lrde.epita.fr/dload/olena/2.1/olena-2.1.tar.bz2'
version "2.1.0"
# sha1 '54f756b033a45d4c2fe1233c10fc43f99f9f552f'
option "without-scribo", "Omit building the Scribo header library"
option "without-cxx11", "Don't enable any standard C++11 build flags"
option "with-head-docs", "Attempt to make all the docs when building from HEAD"
head do
url 'https://github.com/glazzara/olena.git'
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "doxygen" => [:build, :optional] if build.with? "head-docs"
depends_on "hevea" => [:build, :optional] if build.with? "head-docs"
depends_on :tex => [:build, :optional] if build.with? "head-docs"
end
depends_on 'swig' => :recommended
depends_on "python" if not build.without? "swig"
depends_on 'fftw' => :optional
depends_on 'poppler' => :optional
depends_on 'libtiff' => :recommended
depends_on 'tesseract' => :recommended
depends_on 'graphicsmagick'
depends_on 'libxslt'
depends_on 'fop'
depends_on 'qt'
def install
ENV.cxx11 if not build.without? "cxx11"
ENV['CPPFLAGS'] = "-I#{Formula['graphicsmagick'].opt_prefix}/include/GraphicsMagick"
ENV['CPPFLAGS'] += " -DHAVE_SYS_TYPES_H=1"
ENV['CXXFLAGS'] = "-fno-strict-aliasing"
# Baseline arguments to .configure
cargs = [
"QT_PATH=#{Formula['qt'].opt_prefix}",
"MOC=#{Formula['qt'].opt_prefix}/bin/moc",
"UIC=#{Formula['qt'].opt_prefix}/bin/uic",
"RCC=#{Formula['qt'].opt_prefix}/bin/rcc",
"QMAKE=#{Formula['qt'].opt_prefix}/bin/qmake",
"--with-graphicsmagickxx=#{Formula['graphicsmagick'].opt_prefix}",
"--with-imagemagickxx=no"]
# Third-party imaging libraries
if not build.without? "libtiff"
cargs << "--with-tiff=#{Formula['libtiff'].opt_prefix}"
end
if not build.without? "tesseract"
cargs << "--with-tesseract=#{Formula['tesseract'].opt_prefix}"
end
# Swig-generated Python bindings
if not build.without? "swig"
cargs << "--enable-swilena"
cargs << "PYTHON=#{`which python`}"
end
# QT-backed Scribo UI
cargs << "--enable-scribo" if not build.without? "scribo"
# Heads are wise to strap first, always
if build.head?
if build.with? "head-docs"
system "./bootstrap"
else
system "./bootstrap", "--regen"
end
end
# configure/make/install
system "./configure", "--prefix=#{prefix}", *cargs
system "make"
system "make install"
# clean up logorrhea-inducing artifacts
rm_rf share/"doc/olena/milena/user-refman"
end
end