-
Notifications
You must be signed in to change notification settings - Fork 33
/
base_kde_formula.rb
97 lines (89 loc) · 2.25 KB
/
base_kde_formula.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
97
require 'formula'
class BaseKdeFormula < Formula
def self.kde_build_deps
depends_on 'cmake' => :build
depends_on 'automoc4' => :build
end
def kdedir
"/usr/local/kde4"
end
def kdelibs_prefix
Formula.factory('kdelibs').prefix
end
def qjson_prefix
Formula.factory('qjson').prefix
end
def gettext_prefix
Formula.factory('gettext').prefix
end
def docbook_prefix
Formula.factory('docbook').prefix
end
def docbook_dtd
"#{docbook_prefix}/docbook/xml/4.5"
end
def docbook_xsl
"#{Formula.factory('docbook-xsl').prefix}/docbook-xsl"
end
def extra_cmake_args
end
def extra_prefix_path
end
def kde_default_cmake_args
raise "std_cmake_parameters has changed... #{std_cmake_parameters}, prefix is #{prefix}" if std_cmake_parameters != "-DCMAKE_INSTALL_PREFIX='#{prefix}' -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -Wno-dev"
s = extra_prefix_path
if s.nil?
s = kdedir
else
s += ":#{kdedir}"
end
cmake_args = [
'..',
#"-DCMAKE_FIND_FRAMEWORK=LAST",
"-DCMAKE_INSTALL_PREFIX=#{kdedir}",
#'-DCMAKE_BUILD_TYPE=None',
'-Wdev --trace --debug-output',
'-DKDE_DEFAULT_HOME=Library/Preferences/KDE',
#"-DCMAKE_OSX_ARCHITECTURES='#{build_arch}'",
#"-DCMAKE_PREFIX_PATH=#{s}:#{qjson_prefix}:#{gettext_prefix}",
#"-DCMAKE_PREFIX_PATH=#{s}:#{gettext_prefix}",
"-DCMAKE_PREFIX_PATH=#{gettext_prefix}",
"-DDOCBOOKXML_CURRENTDTD_DIR=#{docbook_dtd}",
"-DDOCBOOKXSL_DIR=#{docbook_xsl}",
"-DBUILD_doc=FALSE",
"-DBUNDLE_INSTALL_DIR=#{bin}"
]
if extra_cmake_args.class == String
cmake_args += extra_cmake_args.split
elsif extra_cmake_args.class == Array
cmake_args += extra_cmake_args
end
cmake_args
end
def build_arch
if ARGV.build_universal?
'i386;x86_64'
elsif MacOS.prefer_64_bit?
'x86_64'
else
'i386'
end
end
def default_install
ENV.x11
ENV['MAKEFLAGS'] = "-j4"
mkdir 'build'
cd 'build'
system "cmake", *kde_default_cmake_args
system "make"
system "make install"
touch "#{prefix}/.installed"
end
def install
default_install
end
def caveats; <<-EOS.undent
Remember to run brew linkapps.
EOS
end
end