-
-
Notifications
You must be signed in to change notification settings - Fork 128
/
RELEASE-LINUX.rb
executable file
·101 lines (78 loc) · 2.39 KB
/
RELEASE-LINUX.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
98
99
100
#!/usr/bin/ruby
$qt = ""
#$qt = "/opt/Qt5.8.0"
require 'fileutils'
load 'version.rb'
$workdir = "_release"
$dstdir = $workdir + "/#{$product_name}"
$dstdir_iconengines = $dstdir + "/iconengines"
$dstdir_imageformats = $dstdir + "/imageformats"
$dstdir_platforms = $dstdir + "/platforms"
$dstdir_platforminputcontexts = $dstdir + "/platforminputcontexts"
$arch = "x86-32bit"
$libicu = "/usr/lib/i386-linux-gnu"
if `uname -a` =~ /(x86_64)|(amd64)/
$arch = "x86-64bit"
$libicu = "/usr/lib/x86_64-linux-gnu"
elsif `uname -a` =~ /armv7l/
$arch = "raspberrypi"
$libicu = "/usr/lib/arm-linux-gnueabihf"
end
FileUtils.rm_rf($workdir)
FileUtils.mkpath($dstdir)
FileUtils.cp("_bin/#{$product_name}", $dstdir)
`strip #{$dstdir}/#{$product_name}`
#FileUtils.cp("#{$product_name}_ja.qm", $dstdir)
if $qt != ""
def cp_qt_lib(name)
libname = "lib" + name + ".so.5"
src = $qt + "/lib/" + libname
FileUtils.cp(src, $dstdir)
`strip #{$dstdir}/#{libname}`
end
FileUtils.mkpath($dstdir_iconengines)
FileUtils.mkpath($dstdir_imageformats)
FileUtils.mkpath($dstdir_platforms)
FileUtils.mkpath($dstdir_platforminputcontexts)
cp_qt_lib("Qt5Core")
cp_qt_lib("Qt5Gui")
cp_qt_lib("Qt5Svg")
cp_qt_lib("Qt5Widgets")
cp_qt_lib("Qt5Xml")
cp_qt_lib("Qt5Network")
cp_qt_lib("Qt5DBus")
cp_qt_lib("Qt5XcbQpa")
def cp_qt_imageformat(name)
libname = "lib" + name + ".so"
src = $qt + "/plugins/imageformats/" + libname
FileUtils.cp(src, $dstdir_imageformats)
`strip #{$dstdir_imageformats}/#{libname}`
end
cp_qt_imageformat("qgif")
cp_qt_imageformat("qicns")
cp_qt_imageformat("qico")
cp_qt_imageformat("qjpeg")
cp_qt_imageformat("qsvg")
def cp_qt_iconengine(name)
libname = "lib" + name + ".so"
src = $qt + "/plugins/iconengines/" + libname
FileUtils.cp(src, $dstdir_iconengines)
`strip #{$dstdir_iconengines}/#{libname}`
end
cp_qt_iconengine("qsvgicon")
src = $qt + "/plugins/platforms/libqxcb.so"
FileUtils.cp(src, $dstdir_platforms)
src = $qt + "/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so"
FileUtils.cp(src, $dstdir_platforminputcontexts)
def cp_libicu(name)
src = $libicu + "/libicu" + name + ".so.52"
FileUtils.cp(src, $dstdir)
end
cp_libicu("data")
cp_libicu("i18n")
cp_libicu("uc")
end
FileUtils.cp_r("LinuxDesktop", $dstdir)
Dir.chdir($workdir) {
`tar zcvf #{$product_name}-#{$version_a}.#{$version_b}.#{$version_c}-linux-#{$arch}.tar.gz #{$product_name}`
}