File INSTALL.sh of Package chromium-ffmpeg-extra (Revision 21)
Currently displaying revision 21 , Show latest
142
1
2
set -x
3
while getopts s:o:l:i: option
4
do
5
case "${option}" in
6
s) STAGEDIR=${OPTARG};;
7
o) OUTPUTDIR=${OPTARG};;
8
l) LIBDIR=${OPTARG};;
9
i) ICUDATAFILE=${OPTARG};;
10
esac
11
done
12
SHLIB_PERMS="755"
13
PROGNAME="chrome"
14
PACKAGE="chromium-browser"
15
MENUNAME="Chromium Web Browser"
16
CHANNEL="stable"
17
INSTALLDIR="${LIBDIR}/chromium"
18
19
install -m 755 -d \
20
"${STAGEDIR}/${INSTALLDIR}" \
21
"${STAGEDIR}/usr/bin" \
22
"${STAGEDIR}/usr/share/applications" \
23
"${STAGEDIR}/usr/share/metainfo" \
24
"${STAGEDIR}/usr/share/man/man1"
25
26
# app
27
buildfile="${OUTPUTDIR}/${PROGNAME}"
28
install -m 755 "${buildfile}" "${STAGEDIR}/${INSTALLDIR}/${PROGNAME}"
29
30
# crashpad
31
buildfile="${OUTPUTDIR}/chrome_crashpad_handler"
32
install -m 755 "${buildfile}" "${STAGEDIR}/${INSTALLDIR}/chrome_crashpad_handler"
33
34
# resources
35
install -m 644 "${OUTPUTDIR}/resources.pak" "${STAGEDIR}/${INSTALLDIR}/"
36
install -m 644 "${OUTPUTDIR}/chrome_100_percent.pak" "${STAGEDIR}/${INSTALLDIR}/"
37
install -m 644 "${OUTPUTDIR}/chrome_200_percent.pak" "${STAGEDIR}/${INSTALLDIR}/"
38
39
# ICU data file; Necessary when the GN icu_use_data_file flag is true.
40
if [ "x$ICUDATAFILE" == "xtrue" ]; then
41
install -m 644 "${OUTPUTDIR}/icudtl.dat" "${STAGEDIR}/${INSTALLDIR}/"
42
fi
43
44
# V8 snapshot files; Necessary when the GN v8_use_external_startup_data flag
45
# is true.
46
# Use v8_context_snapshot.bin instead of snapshot_blob.bin if it is available.
47
# TODO(crbug.com/764576): Unship snapshot_blob.bin on ChromeOS and drop this branch
48
install -m 644 "${OUTPUTDIR}/v8_context_snapshot.bin" "${STAGEDIR}/${INSTALLDIR}/"
49
50
# l10n paks
51
install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/locales/"
52
find "${OUTPUTDIR}/locales" -type f -name '*.pak' -print -exec \
53
cp -a {} "${STAGEDIR}/${INSTALLDIR}/locales/" \;
54
find "${STAGEDIR}/${INSTALLDIR}/locales" -type f -print -exec chmod 644 {} \;
55
56
# ANGLE
57
if [ -f "${OUTPUTDIR}/libEGL.so" ]; then
58
for file in libEGL.so libGLESv2.so;
59
do
60
buildfile="${OUTPUTDIR}/${file}"
61
install -m ${SHLIB_PERMS} "${buildfile}" "${STAGEDIR}/${INSTALLDIR}/${file}"
62
done
63
fi
64
65
# ANGLE's libvulkan library
66
if [ -f "${OUTPUTDIR}/libvulkan.so.1" ]; then
67
file="libvulkan.so.1"
68
buildfile="${OUTPUTDIR}/${file}"
69
install -m 755 "${buildfile}" "${STAGEDIR}/${INSTALLDIR}/${file}"
70
fi
71
72
# SwiftShader ES
73
if [ -f "${OUTPUTDIR}/swiftshader/libEGL.so" ]; then
74
install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/swiftshader/"
75
for file in libEGL.so libGLESv2.so;
76
do
77
buildfile="${OUTPUTDIR}/swiftshader/${file}"
78
install -m ${SHLIB_PERMS} "${buildfile}" "${STAGEDIR}/${INSTALLDIR}/swiftshader/${file}"
79
done
80
fi
81
82
# SwiftShader VK
83
if [ -f "${OUTPUTDIR}/libvk_swiftshader.so" ]; then
84
install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/"
85
file="libvk_swiftshader.so"
86
buildfile="${OUTPUTDIR}/${file}"
87
install -m ${SHLIB_PERMS} "${buildfile}" "${STAGEDIR}/${INSTALLDIR}/${file}"
88
fi
89
sed -e 's|${ICD_LIBRARY_PATH}|./libvk_swiftshader.so|g' third_party/swiftshader/src/Vulkan/vk_swiftshader_icd.json.tmpl > ${OUTPUTDIR}/vk_swiftshader_icd.json
90
# Install the ICD json file to point ANGLE to libvk_swiftshader.so
91
install -m 644 "${OUTPUTDIR}/vk_swiftshader_icd.json" "${STAGEDIR}/${INSTALLDIR}/"
92
93
# default apps
94
if [ -d "${OUTPUTDIR}/default_apps" ]; then
95
cp -a "${OUTPUTDIR}/default_apps" "${STAGEDIR}/${INSTALLDIR}/"
96
find "${STAGEDIR}/${INSTALLDIR}/default_apps" -type d -exec chmod 755 '{}' \;
97
find "${STAGEDIR}/${INSTALLDIR}/default_apps" -type f -exec chmod 644 '{}' \;
98
fi
99
100
# launcher script and symlink
101
sed \
102
-e "s#@@PROGNAME@@#${PROGNAME}#g" \
103
-e "s#@@CHANNEL@@#${CHANNEL}#g" \
104
"chrome/installer/linux/common/wrapper" > "${STAGEDIR}/${INSTALLDIR}/chrome-wrapper"
105
chmod 755 "${STAGEDIR}/${INSTALLDIR}/chrome-wrapper"
106
ln -s "${INSTALLDIR}/chrome-wrapper" "${STAGEDIR}/usr/bin/${PACKAGE}"
107
108
# app icons
109
for size in 16 32;
110
do
111
icon="chrome/app/theme/default_100_percent/chromium/product_logo_${size}.png"
112
installpath="${STAGEDIR}/usr/share/icons/hicolor/${size}x${size}/apps/chromium-browser.png"
113
install -D -m 644 ${icon} ${installpath}
114
done
115
for size in 24 48 64 128 256;
116
do
117
icon="chrome/app/theme/chromium/product_logo_${size}.png"
118
installpath="${STAGEDIR}/usr/share/icons/hicolor/${size}x${size}/apps/chromium-browser.png"
119
install -D -m 644 ${icon} ${installpath}
120
done
121
122
# desktop integration
123
## AppData
124
install -m 644 "chrome/installer/linux/common/chromium-browser/chromium-browser.appdata.xml" \
125
"${STAGEDIR}/usr/share/metainfo/${PACKAGE}.appdata.xml"
126
127
## Desktop file
128
sed \
129
-e "s#@@MENUNAME@@#${MENUNAME}#g" \
130
-e "s#@@USR_BIN_SYMLINK_NAME@@#${PACKAGE}#g" \
131
-e "s#@@PACKAGE@@#${PACKAGE}#g" \
132
"chrome/installer/linux/common/desktop.template" > "${STAGEDIR}/usr/share/applications/${PACKAGE}.desktop"
133
chmod 644 "${STAGEDIR}/usr/share/applications/${PACKAGE}.desktop"
134
135
# documentation
136
sed \
137
-e "s#@@MENUNAME@@#${MENUNAME}#g" \
138
-e "s#@@PACKAGE@@#${PACKAGE}#g" \
139
"chrome/app/resources/manpage.1.in" > "${STAGEDIR}/usr/share/man/man1/${PACKAGE}.1"
140
gzip -9n "${STAGEDIR}/usr/share/man/man1/${PACKAGE}.1"
141
chmod 644 "${STAGEDIR}/usr/share/man/man1/${PACKAGE}.1.gz"
142