-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sh
74 lines (51 loc) · 2.38 KB
/
build.sh
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
#!/bin/bash
set -e;
echo "Installing NVM and NodeJS";
. ./setup_nvm.sh;
echo "Retrieving latest Visual Studio Code sources into [code]";
git clone "https://github.com/Microsoft/vscode.git" code;
echo "Setting current owner as owner of code folder";
chown ${USER:=$(/usr/bin/id -run)}:$USER -R code;
echo "Synchronizing overlays folder";
rsync -avh ./overlays/ ./code/;
echo "Entering code directory";
cd code;
extra_links="-I$compiler_root_directory/usr/include/libsecret-1 -I$compiler_root_directory/usr/include/glib-2.0 -I$compiler_root_directory/usr/lib/${ARCHIE_HEADERS_GNU_TRIPLET}/glib-2.0/include";
export CC="$CC $extra_links"
export CXX="$CXX $extra_links"
CHILD_CONCURRENCY=1 yarn;
echo "Changing default telemetry settings"
REPLACEMENT="s/'default': true/'default': false/"
sed -i -E "$REPLACEMENT" src/vs/platform/telemetry/common/telemetryService.ts
echo "Running hygiene";
npm run gulp -- hygiene;
echo "Running monaco-compile-check";
npm run monaco-compile-check;
# echo "Executing strict-null-check";
# npm run strict-null-check;
echo "Compiling VS Code for $ARCHIE_ELECTRON_ARCH";
npm run gulp -- vscode-linux-$ARCHIE_ELECTRON_ARCH-min --allowEmpty;
echo "Patching resources/linux/debian/postinst.template"
sed -i "s/code-oss/vscodium/" resources/linux/debian/postinst.template
echo "Undoing telemetry"
TELEMETRY_URLS="(dc\.services\.visualstudio\.com)|(vortex\.data\.microsoft\.com)"
REPLACEMENT="s/$TELEMETRY_URLS/0\.0\.0\.0/g"
grep -rl --exclude-dir=.git -E $TELEMETRY_URLS . | xargs sed -i -E $REPLACEMENT
echo "Starting vscode-linux-$ARCHIE_ELECTRON_ARCH-build-deb";
yarn run gulp vscode-linux-$ARCHIE_ELECTRON_ARCH-build-deb;
echo "Starting vscode-linux-$ARCHIE_ELECTRON_ARCH-build-rpm";
yarn run gulp vscode-linux-$ARCHIE_ELECTRON_ARCH-build-rpm;
echo "Leaving code directory";
cd ..;
echo "Creating output directory";
mkdir output;
echo "Moving deb packages for release";
mv ./code/.build/linux/deb/$ARCHIE_ARCH/deb/*.deb /root/output;
echo "Moving rpm packages for release";
mv ./code/.build/linux/rpm/$ARCHIE_RPM_ARCH/rpmbuild/RPMS/$ARCHIE_RPM_ARCH/*.rpm /root/output;
echo "Extracting deb archive";
dpkg -x /root/output/*.deb output/extracted;
cd output/extracted;
echo "Binary components of output --------------------------------------------------"
find . -type f -exec file {} ";" | grep ELF
echo "------------------------------------------------------------------------------"