csd 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +5 -1
- data/Rakefile +7 -7
- data/VERSION +1 -1
- data/bin/ai +1 -1
- data/csd.gemspec +21 -9
- data/lib/csd.rb +15 -8
- data/lib/csd/application/decklink.rb +27 -0
- data/lib/csd/application/decklink/about.yml +7 -0
- data/lib/csd/application/decklink/base.rb +62 -0
- data/lib/csd/application/default.rb +5 -1
- data/lib/csd/application/default/base.rb +10 -0
- data/lib/csd/application/minisip.rb +8 -5
- data/lib/csd/application/minisip/about.yml +1 -1
- data/lib/csd/application/minisip/base.rb +29 -90
- data/lib/csd/application/minisip/component.rb +8 -0
- data/lib/csd/application/minisip/component/core.rb +288 -0
- data/lib/csd/application/minisip/component/ffmpeg.rb +78 -0
- data/lib/csd/application/minisip/component/gnome.rb +48 -0
- data/lib/csd/application/minisip/component/hdviper.rb +49 -0
- data/lib/csd/application/minisip/component/plugins.rb +53 -0
- data/lib/csd/application/minisip/component/x264.rb +42 -0
- data/lib/csd/application/minisip/error.rb +11 -5
- data/lib/csd/application/minisip/options/common.rb +4 -4
- data/lib/csd/application/minisip/options/compile.rb +10 -16
- data/lib/csd/application/minisip/unix.rb +19 -159
- data/lib/csd/application/minisip/unix/darwin.rb +1 -11
- data/lib/csd/application/minisip/unix/linux.rb +1 -1
- data/lib/csd/application/minisip/unix/linux/debian.rb +6 -14
- data/lib/csd/application/minisip/unix/linux/debian/ubuntu10.rb +6 -4
- data/lib/csd/applications.rb +16 -21
- data/lib/csd/commands.rb +34 -7
- data/lib/csd/error.rb +27 -11
- data/lib/csd/extensions/core/kernel.rb +9 -19
- data/lib/csd/extensions/core/object.rb +1 -0
- data/lib/csd/extensions/core/string.rb +1 -1
- data/lib/csd/extensions/gem/platform.rb +9 -3
- data/lib/csd/options_parser.rb +3 -3
- data/lib/csd/user_interface/base.rb +8 -5
- data/lib/csd/user_interface/cli.rb +9 -1
- data/lib/csd/user_interface/silent.rb +7 -4
- data/lib/csd/vendor/zentest/zentest_assertions.rb +39 -35
- data/test/application/test_minisip.rb +65 -26
- data/test/functional/test_applications.rb +4 -4
- data/test/functional/test_commands.rb +26 -2
- data/test/helper.rb +9 -5
- data/test/unit/test_pathname.rb +1 -1
- data/test/unit/test_platform.rb +30 -0
- metadata +18 -6
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# -*- encoding: UTF-8 -*-
|
|
2
|
+
require 'csd/application/minisip/component/core'
|
|
3
|
+
require 'csd/application/minisip/component/ffmpeg'
|
|
4
|
+
require 'csd/application/minisip/component/gnome'
|
|
5
|
+
require 'csd/application/minisip/component/hdviper'
|
|
6
|
+
require 'csd/application/minisip/component/plugins'
|
|
7
|
+
require 'csd/application/minisip/component/x264'
|
|
8
|
+
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
# -*- encoding: UTF-8 -*-
|
|
2
|
+
|
|
3
|
+
module CSD
|
|
4
|
+
module Application
|
|
5
|
+
module Minisip
|
|
6
|
+
# This namespace is reserved for sub-components of this application. This is done for better readability and modularity
|
|
7
|
+
# (i.e. less risky to fail in production).
|
|
8
|
+
#
|
|
9
|
+
module Component
|
|
10
|
+
# This MiniSIP component is the very minisip source code itself.
|
|
11
|
+
#
|
|
12
|
+
module Core
|
|
13
|
+
|
|
14
|
+
# This is an +Array+ containing the names of the internal MiniSIP libraries. Note that they
|
|
15
|
+
# are sorted according to the sequence in which they need to be compiled (because they depend on each other).
|
|
16
|
+
#
|
|
17
|
+
LIBRARIES = %w{ libmutil libmnetutil libmcrypto libmikey libmsip libmstun libminisip minisip }
|
|
18
|
+
|
|
19
|
+
class << self
|
|
20
|
+
|
|
21
|
+
# This method processes the MiniSIP Core component and does everything needed for compiling it. Note that
|
|
22
|
+
# it is not responsible for checking depenencies here. It will just focus on compiling the internal MiniSIP libraries.
|
|
23
|
+
#
|
|
24
|
+
def compile
|
|
25
|
+
UI.debug "#{self}.compile was called"
|
|
26
|
+
ffmpeg_available = Cmd.run('ffmpeg -h', :internal => true, :die_on_failure => false).success?
|
|
27
|
+
if ffmpeg_available and Options.configure and !Options.reveal and libraries.include?('libminisip')
|
|
28
|
+
if Gem::Platform.local.debian?
|
|
29
|
+
# Note that FFmpeg must have been installed via apt-get or via the AI in order for this to work!
|
|
30
|
+
UI.info "Removing FFmpeg before re-compiling MiniSIP".green.bold
|
|
31
|
+
Cmd.run "sudo apt-get remove ffmpeg --yes", :announce_pwd => false
|
|
32
|
+
else
|
|
33
|
+
# On other linux distributions we don't know how to remove ffmpeg
|
|
34
|
+
raise Error::Minisip::Core::FFmpegInstalled, "Please remove ffmpeg from your system first, or run the #{CSD.executable} with --no-configure"
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
if Path.repository.directory? and !Options.reveal
|
|
38
|
+
UI.warn "The MiniSIP source code will not be downloaded, because the directory #{Path.repository.enquote} already exists."
|
|
39
|
+
else
|
|
40
|
+
checkout
|
|
41
|
+
modify_source_code
|
|
42
|
+
end
|
|
43
|
+
modify_dirlist
|
|
44
|
+
# We would like to re-compile MiniSIP no matter what options were given as command-line arguments.
|
|
45
|
+
compile_libraries
|
|
46
|
+
link_libraries
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# This method provides upfront information to the user about how the MiniSIP Core component will be processed.
|
|
50
|
+
#
|
|
51
|
+
def introduction
|
|
52
|
+
UI.info " MiniSIP".green.bold
|
|
53
|
+
# If the repository directory already exists, we indicate that here
|
|
54
|
+
download_text = Path.repository.directory? ? " - located at: " : " - downloading to: "
|
|
55
|
+
UI.info download_text.green + Path.repository.to_s.yellow
|
|
56
|
+
# Now let's present which libraries will be compiled with which commands
|
|
57
|
+
UI.info " - libraries to process: ".green + libraries.join(', ').yellow
|
|
58
|
+
UI.info " - with these commands: ".green + [('bootstrap' if Options.bootstrap), ('configure' if Options.configure), ('make' if Options.make), ('make install' if Options.make_install)].compact.join(', ').yellow
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Determines which libraries of MiniSIP should be processed, because the --only parameter might be set
|
|
62
|
+
# by the user, requesting for only a subset of the libraries.
|
|
63
|
+
#
|
|
64
|
+
def libraries
|
|
65
|
+
Options.only ? LIBRARIES.map { |lib| lib if Options.only.to_a.include?(lib) }.compact : LIBRARIES
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# This method downloads the minisip source code in the right version. If the <tt>Options.branch</tt>
|
|
69
|
+
# parameter is set to a branchname of the source code repository, that branch will be downloaded. Currently
|
|
70
|
+
# this function uses the intermediary Github repository to make sure that
|
|
71
|
+
# * the downloaded version is not a risky cutting-edge trunk
|
|
72
|
+
# * the download works even if the vendor's repository is down (again)
|
|
73
|
+
# That means that the Github repository (or any other intermediary repository) should be manually updated
|
|
74
|
+
# by an TTA AI developer, after having made sure that that source code version is working properly.
|
|
75
|
+
#
|
|
76
|
+
def checkout
|
|
77
|
+
Cmd.git_clone 'MiniSIP repository', 'http://github.com/csd/minisip.git', Path.repository
|
|
78
|
+
if Options.branch
|
|
79
|
+
Cmd.cd Path.repository, :internal => true
|
|
80
|
+
Cmd.run "git pull origin #{Options.branch}"
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Some places in the MiniSIP source code have to be modified before it can be compiled.
|
|
85
|
+
# In this case, an absolute path must be replaced with the current absolute prefix path.
|
|
86
|
+
# Furthermore, modifications of some constants will be done, because this is more compatible
|
|
87
|
+
# with the most recent FFmpeg version. In fact, MiniSIP won't compile if FFmpeg is present
|
|
88
|
+
# and this has not been modified.
|
|
89
|
+
# See http://www.howgeek.com/2010/03/01/ffmpeg-php-error-‘pix_fmt_rgba32’-undeclared-first-use-in-this-function
|
|
90
|
+
# and http://ffmpeg.org/doxygen/0.5/pixfmt_8h.html#33d341c4f443d24492a95fb7641d0986 for more information.
|
|
91
|
+
#
|
|
92
|
+
def modify_source_code
|
|
93
|
+
UI.info "Fixing MiniSIP OpenGL GUI source code".green.bold
|
|
94
|
+
Cmd.replace(Path.repository_open_gl_display, '/home/erik', Path.build)
|
|
95
|
+
if Options.ffmpeg_first
|
|
96
|
+
Cmd.replace(Path.repository_avcoder_cxx, 'PIX_FMT_RGBA32', 'PIX_FMT_RGB32')
|
|
97
|
+
Cmd.replace(Path.repository_avdecoder_cxx, 'PIX_FMT_RGBA32', 'PIX_FMT_RGB32')
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Usually, Ubuntu ignores <tt>/usr/local/share/aclocal</tt>. So we need to create a file called
|
|
102
|
+
# +dirlist+ in <tt>/usr/share/aclocal</tt> which contains the path to the other directory.
|
|
103
|
+
#
|
|
104
|
+
def modify_dirlist
|
|
105
|
+
Path.dirlist = Pathname.new File.join('/', 'usr', 'share', 'aclocal', 'dirlist')
|
|
106
|
+
if !Path.dirlist.file? and Gem::Platform.local.debian?
|
|
107
|
+
UI.info "Fixing broken Debian aclocal path".green.bold
|
|
108
|
+
Path.new_dirlist = Pathname.new File.join(Dir.mktmpdir, 'dirlist')
|
|
109
|
+
Cmd.touch_and_replace_content Path.new_dirlist, '/usr/local/share/aclocal'
|
|
110
|
+
Cmd.run "sudo mv #{Path.new_dirlist} #{Path.dirlist}", :announce_pwd => false
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
def link_libraries
|
|
115
|
+
UI.info "Linking shared MiniSIP libraries"
|
|
116
|
+
Cmd.run "sudo ldconfig #{Path.build_lib_libminisip_so}", :announce_pwd => false
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def libminisip_cpp_flags
|
|
120
|
+
if Options.ffmpeg_first
|
|
121
|
+
%{CPPFLAGS="-I#{Path.hdviper_x264} -I#{Path.hdviper_x264_test_x264api} -I#{Path.ffmpeg_libavutil} -I#{Path.ffmpeg_libavcodec} -I#{Path.ffmpeg_libswscale} -I#{Path.repository_grabber} -I#{Path.repository_decklinksdk}"}
|
|
122
|
+
else
|
|
123
|
+
%{CPPFLAGS="-I#{Path.hdviper_x264} -I#{Path.hdviper_x264_test_x264api} -I#{Path.repository_grabber} -I#{Path.repository_decklinksdk}"}
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
def libminisip_ld_flags
|
|
128
|
+
%{LDFLAGS="#{Path.hdviper_libx264api} #{Path.hdviper_libtidx264} -lpthread -lrt"}
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Iteratively processes the internal MiniSIP libraries (+bootstrap+, +configure+, +make+, +make install+).
|
|
132
|
+
#
|
|
133
|
+
def compile_libraries
|
|
134
|
+
create_build_dir
|
|
135
|
+
libraries.each do |library|
|
|
136
|
+
directory = Pathname.new(File.join(Path.repository, library))
|
|
137
|
+
if Cmd.cd(directory, :internal => true).success? or Options.reveal
|
|
138
|
+
UI.info "Processing MiniSIP -> #{library}".green.bold
|
|
139
|
+
bootstrap
|
|
140
|
+
configure library
|
|
141
|
+
make
|
|
142
|
+
make_install
|
|
143
|
+
else
|
|
144
|
+
UI.warn "Skipping MiniSIP library #{library} because it could not be found in #{directory.enquote}"
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Creates all build directories such as +lib+, +share+, +bin+, etc.
|
|
150
|
+
#
|
|
151
|
+
def create_build_dir
|
|
152
|
+
# In sudo mode, we don't need to create these. They already exist in the OS.
|
|
153
|
+
return unless Options.this_user
|
|
154
|
+
UI.info "Creating target build directories".green.bold
|
|
155
|
+
[Path.build, Path.build_include, Path.build_lib, Path.build_share, Path.build_share_aclocal].each { |target| Cmd.mkdir target }
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# This method runs the `bootstrap´ command in the current directory unless --no-bootstrap was given.
|
|
159
|
+
# It is only used for the internal MiniSIP libraries.
|
|
160
|
+
#
|
|
161
|
+
def bootstrap
|
|
162
|
+
bootstrap! if Options.bootstrap
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# This method forces running the `bootstrap´ command in the current directory.
|
|
166
|
+
# It is only used for the internal MiniSIP libraries.
|
|
167
|
+
#
|
|
168
|
+
def bootstrap!
|
|
169
|
+
if Options.this_user
|
|
170
|
+
Cmd.run(%Q{./bootstrap -I "#{Path.build_share_aclocal}"})
|
|
171
|
+
else
|
|
172
|
+
Cmd.run("./bootstrap")
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
def configure(name='')
|
|
177
|
+
configure! name if Options.configure
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
def configure!(name='')
|
|
181
|
+
individual_options = case name
|
|
182
|
+
when 'libminisip'
|
|
183
|
+
%Q{--enable-debug --enable-video --enable-opengl --disable-mil --enable-decklink --disable-sdl #{libminisip_cpp_flags} #{libminisip_ld_flags}}
|
|
184
|
+
when 'minisip'
|
|
185
|
+
%Q{--enable-debug --enable-video --enable-opengl --enable-textui}
|
|
186
|
+
else
|
|
187
|
+
''
|
|
188
|
+
end
|
|
189
|
+
common_options = Options.this_user ? %Q{--prefix="#{Path.build}" PKG_CONFIG_PATH="#{Path.build_lib_pkg_config}" ACLOCAL_FLAGS="#{Path.build_share_aclocal}" LD_LIBRARY_PATH="#{Path.build_lib}"} : ''
|
|
190
|
+
Cmd.run ['./configure', common_options, individual_options].join(' ')
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
def make
|
|
194
|
+
make! if Options.make
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
def make!
|
|
198
|
+
Cmd.run("make")
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
def make_install
|
|
202
|
+
make_install! if Options.make_install
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
def make_install!
|
|
206
|
+
if Options.this_user
|
|
207
|
+
Cmd.run("make install")
|
|
208
|
+
else
|
|
209
|
+
Cmd.run("sudo make install")
|
|
210
|
+
end
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
# Execute the MiniSIP GTK GUI.
|
|
214
|
+
#
|
|
215
|
+
def run_gtkgui
|
|
216
|
+
UI.info "Executing MiniSIP".green.bold
|
|
217
|
+
if Options.this_user
|
|
218
|
+
Cmd.run(Path.build_gtkgui, :die_on_failure => false, :announce_pwd => false)
|
|
219
|
+
else
|
|
220
|
+
Cmd.run('minisip_gtkgui')
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
def modify_libminisip_rules
|
|
225
|
+
if Path.repository_libminisip_rules_backup.file?
|
|
226
|
+
UI.warn "The libminisip rules seem to be fixed already, I won't touch them now. Delete #{Path.repository_libminisip_rules_backup.enquote} to enforce it."
|
|
227
|
+
else
|
|
228
|
+
Cmd.copy Path.repository_libminisip_rules, Path.repository_libminisip_rules_backup
|
|
229
|
+
Cmd.replace Path.repository_libminisip_rules, 'AUTOMATED_INSTALLER_PLACEHOLDER=""', [libminisip_cpp_flags, libminisip_ld_flags].join(' ')
|
|
230
|
+
end
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
# Iteratively makes debian packages of the internal MiniSIP libraries.
|
|
234
|
+
# TODO: Refactor this, it looks terribly sensitive.
|
|
235
|
+
# TODO: Check for GPL and LGLP license conflicts.
|
|
236
|
+
#
|
|
237
|
+
def package!
|
|
238
|
+
Cmd.mkdir(Path.packaging)
|
|
239
|
+
libraries.each do |library|
|
|
240
|
+
directory = Pathname.new(File.join(Path.repository, library))
|
|
241
|
+
next if Options.only and !Options.only.include?(library)
|
|
242
|
+
UI.info "Making #{library} with target dist".green.bold
|
|
243
|
+
if Cmd.cd(directory) or Options.reveal
|
|
244
|
+
Cmd.run("make dist")
|
|
245
|
+
|
|
246
|
+
tar_filename = File.basename(Dir[File.join(directory, '*.tar.gz')].first)
|
|
247
|
+
Cmd.move(File.join(directory, tar_filename.to_s), Path.packaging) if tar_filename or Options.reveal
|
|
248
|
+
|
|
249
|
+
if Cmd.cd(Path.packaging) or Options.reveal
|
|
250
|
+
Cmd.run("tar -xzf #{tar_filename}")
|
|
251
|
+
tar_dirname = File.basename(tar_filename.to_s, '.tar.gz')
|
|
252
|
+
if Cmd.cd(File.join(Path.packaging, tar_dirname))
|
|
253
|
+
Cmd.run("dpkg-buildpackage -rfakeroot")
|
|
254
|
+
if library == 'minisip'
|
|
255
|
+
if Cmd.cd(Path.packaging)
|
|
256
|
+
package = File.basename(Dir[File.join(Path.packaging, "#{library}*.deb")].first)
|
|
257
|
+
Cmd.run("sudo dpkg -i #{package}") if package or Options.reveal
|
|
258
|
+
end
|
|
259
|
+
else
|
|
260
|
+
if Cmd.cd(Path.packaging)
|
|
261
|
+
package = File.basename(Dir[File.join(Path.packaging, "#{library}0*.deb")].first)
|
|
262
|
+
Cmd.run("sudo dpkg -i #{package}") if package or Options.reveal
|
|
263
|
+
dev_package = File.basename(Dir[File.join(Path.packaging, "#{library}-dev*.deb")].first)
|
|
264
|
+
Cmd.run("sudo dpkg -i #{dev_package}") if dev_package or Options.reveal
|
|
265
|
+
end
|
|
266
|
+
end
|
|
267
|
+
else
|
|
268
|
+
UI.error "Could not enter #{File.join(Path.packaging, tar_dirname)}."
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
else
|
|
272
|
+
UI.error "Could not enter #{Path.packaging}."
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
else
|
|
276
|
+
UI.error "Could not enter #{directory}."
|
|
277
|
+
end
|
|
278
|
+
end
|
|
279
|
+
Cmd.cd '/'
|
|
280
|
+
Cmd.run('minisip_gtkgui')
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
end
|
|
284
|
+
end
|
|
285
|
+
end
|
|
286
|
+
end
|
|
287
|
+
end
|
|
288
|
+
end
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# -*- encoding: UTF-8 -*-
|
|
2
|
+
|
|
3
|
+
module CSD
|
|
4
|
+
module Application
|
|
5
|
+
module Minisip
|
|
6
|
+
module Component
|
|
7
|
+
module FFmpeg
|
|
8
|
+
class << self
|
|
9
|
+
|
|
10
|
+
def compile
|
|
11
|
+
UI.debug "#{self}.compile was called"
|
|
12
|
+
if Path.ffmpeg_repository.directory? and !Options.reveal
|
|
13
|
+
UI.warn "FFmpeg will not be processed because the directory #{Path.ffmpeg_repository.enquote} already exists."
|
|
14
|
+
else
|
|
15
|
+
checkout
|
|
16
|
+
modify_libavutil if Options.ffmpeg_first
|
|
17
|
+
make
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def introduction
|
|
22
|
+
if Path.ffmpeg_repository.directory?
|
|
23
|
+
UI.debug "There is no FFmpeg introduction, because the directory already exists: #{Path.ffmpeg_repository.enquote}"
|
|
24
|
+
else
|
|
25
|
+
UI.info " FFmpeg (incl. libswscale)".green.bold
|
|
26
|
+
UI.info " - downloading to: ".green + Path.ffmpeg_repository.to_s.yellow
|
|
27
|
+
UI.info " - compiling".green
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def checkout
|
|
32
|
+
Cmd.git_clone('ffmpeg repository', 'http://github.com/csd/ffmpeg.git', Path.ffmpeg_repository)
|
|
33
|
+
Cmd.git_clone('ffmpeg libswscale sub-repository', 'http://github.com/csd/libswscale.git', Path.ffmpeg_libswscale)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# This flag is needed in order for stdint.h (by default in /usr/include) to define the constant +UINT64_C+.
|
|
37
|
+
# If it does not do that, libavutil (part of FFmpeg) will not be accepted by +configure+ libminisip.
|
|
38
|
+
# See http://code.google.com/p/ffmpegsource/issues/detail?id=11 for more other examples of this problem.
|
|
39
|
+
#
|
|
40
|
+
# *NOTE*: This flag actually does not work! That's what brings us to the next method: modify_libavutil
|
|
41
|
+
#
|
|
42
|
+
def c_flags
|
|
43
|
+
%{CFLAGS="-D__STDC_CONSTANT_MACROS"}
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# The constant +UINT64_C+ has not been provided by the operating system even though the
|
|
47
|
+
# CFLAG "STDC_CONSTANT_MACROS" has been set. +UINT64_C+ should have been provided, but it was not.
|
|
48
|
+
# Thus we hack here and assume that this constant is set to "ULL", which is default for an ix386 architecture.
|
|
49
|
+
# In other words: This hack does not work on an amd-64 architecture. Yet it is only needed if FFmpeg
|
|
50
|
+
# is compiled _before_ MiniSIP.
|
|
51
|
+
#
|
|
52
|
+
def modify_libavutil
|
|
53
|
+
return
|
|
54
|
+
if Path.ffmpeg_libavutil_common_backup.file? and !Options.reveal
|
|
55
|
+
UI.warn "The libavutil common.h file seems to be fixed already, I won't touch it now. Delete #{Path.ffmpeg_libavutil_common_backup.enquote} to enforce it."
|
|
56
|
+
else
|
|
57
|
+
UI.info "Modifying the FFmpeg source code".green.bold
|
|
58
|
+
Cmd.copy Path.ffmpeg_libavutil_common, Path.ffmpeg_libavutil_common_backup
|
|
59
|
+
Cmd.replace Path.ffmpeg_libavutil_common, ' if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (a>>63) ^ 0x7FFFFFFF;', " // MODIFIED BY THE AUTOMATED INSTALLER\n // if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (a>>63) ^ 0x7FFFFFFF;\n if ((a+0x80000000u) & ~(0xFFFFFFFFULL)) return (a>>63) ^ 0x7FFFFFFF;"
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# This method compiles FFmpeg, given that FFmpeg was downloaded before.
|
|
64
|
+
#
|
|
65
|
+
def make
|
|
66
|
+
UI.info "Compiling and installing FFmpeg".green.bold
|
|
67
|
+
Cmd.cd Path.ffmpeg_repository, :internal => true
|
|
68
|
+
Cmd.run("#{c_flags} ./configure --enable-gpl --enable-libx264 --enable-x11grab")
|
|
69
|
+
Cmd.run('make')
|
|
70
|
+
Cmd.run('sudo checkinstall --pkgname=ffmpeg --pkgversion "99:-`git log -1 --pretty=format:%h`" --backup=no --default')
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# -*- encoding: UTF-8 -*-
|
|
2
|
+
|
|
3
|
+
module CSD
|
|
4
|
+
module Application
|
|
5
|
+
module Minisip
|
|
6
|
+
module Component
|
|
7
|
+
module Gnome
|
|
8
|
+
class << self
|
|
9
|
+
|
|
10
|
+
DESKTOP_ENTRY = %{
|
|
11
|
+
[Desktop Entry]
|
|
12
|
+
Encoding=UTF-8
|
|
13
|
+
Name=MiniSIP Client
|
|
14
|
+
GenericName=Video conferencing client
|
|
15
|
+
Comment=Have a video conference in high-definition
|
|
16
|
+
Exec=minisip_gtkgui
|
|
17
|
+
Icon=minisip_gnome
|
|
18
|
+
Terminal=false
|
|
19
|
+
Type=Application
|
|
20
|
+
StartupNotify=true
|
|
21
|
+
Categories=Application;Internet;Network;Chat;AudioVideo}
|
|
22
|
+
|
|
23
|
+
def compile
|
|
24
|
+
UI.debug "#{self}.compile was called"
|
|
25
|
+
return unless Gem::Platform.local.debian? # TODO: Actually, Ubuntu only, not Debian. But I'm not so sure.
|
|
26
|
+
if Options.this_user
|
|
27
|
+
# This command opens the bin directory in Debian/Ubuntu as to show where the executables are located in a single-user mode installation.
|
|
28
|
+
UI.info "Revealing user-specific MiniSIP exectutables"
|
|
29
|
+
Cmd.run "nautilus #{Path.build_bin}"
|
|
30
|
+
else
|
|
31
|
+
create_desktop_entry
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def create_desktop_entry
|
|
36
|
+
UI.info "Installing Gnome menu item".green.bold
|
|
37
|
+
Cmd.run("sudo cp #{Path.minisip_gnome_png} #{Path.minisip_gnome_pixmap}", :announce_pwd => false) unless Path.minisip_gnome_pixmap.file?
|
|
38
|
+
Path.new_desktop_entry = Pathname.new File.join(Dir.mktmpdir, 'minisip.desktop')
|
|
39
|
+
Cmd.touch_and_replace_content Path.new_desktop_entry, DESKTOP_ENTRY, :internal => true
|
|
40
|
+
Cmd.run "sudo mv #{Path.new_desktop_entry} #{Path.minisip_desktop_entry}", :announce_pwd => false
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# -*- encoding: UTF-8 -*-
|
|
2
|
+
|
|
3
|
+
module CSD
|
|
4
|
+
module Application
|
|
5
|
+
module Minisip
|
|
6
|
+
module Component
|
|
7
|
+
module HDVIPER
|
|
8
|
+
class << self
|
|
9
|
+
|
|
10
|
+
# This method processes HDVIPER.
|
|
11
|
+
#
|
|
12
|
+
def compile
|
|
13
|
+
UI.debug "#{self}.compile was called"
|
|
14
|
+
if Path.hdviper.directory? and !Options.reveal
|
|
15
|
+
UI.warn "HDVIPER will not be processed, because the directory #{Path.hdviper.enquote} already exists."
|
|
16
|
+
else
|
|
17
|
+
checkout
|
|
18
|
+
configure_and_make
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# This method informs about the HDVIPER process.
|
|
23
|
+
#
|
|
24
|
+
def introduction
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# This method downloads the HDVIPER source code.
|
|
28
|
+
#
|
|
29
|
+
def checkout
|
|
30
|
+
Cmd.git_clone('HDVIPER', 'http://github.com/csd/libraries.git', Path.hdviper)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# This method compiles HDVIPER, given that HDVIPER was downloaded before.
|
|
34
|
+
#
|
|
35
|
+
def configure_and_make
|
|
36
|
+
UI.info "Compiling HDVIPER".green.bold
|
|
37
|
+
Cmd.cd Path.hdviper_x264, :internal => true
|
|
38
|
+
Cmd.run('./configure')
|
|
39
|
+
Cmd.run('make')
|
|
40
|
+
Cmd.cd Path.hdviper_x264_test_x264api, :internal => true
|
|
41
|
+
Cmd.run('make')
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|