blob: 03a8c49c8a8127a9e556d89354327321e1e11adb (
plain)
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
# Maintainer: David Čuček <observ33r@gmail.com>
pkgname="code-translucent"
pkgver=1.88.1
pkgrel=2
pkgdesc="The Open Source build of Visual Studio Code (vscode) editor with translucent window, official marketplace, unblocked proprietary features and wayland support!"
arch=(
"x86_64"
"i686"
"aarch64"
"armv7h"
)
url="https://github.com/microsoft/vscode"
license=("MIT")
conflicts=("code-oss")
provides=("code-oss")
depends=(
"libxkbfile"
"gtk3"
"nss"
"libsecret"
"alsa-lib"
"gcc-libs"
"libnotify"
"libxss"
"glibc"
)
optdepends=(
"libdbusmenu-glib: Needed for KDE global menu"
"x11-ssh-askpass: SSH authentication"
"icu69: Needed for live share"
)
makedepends=(
"git"
"gulp"
"npm"
"python"
"yarn"
"nodejs-lts-hydrogen"
)
source=(
"${pkgname}::git+${url}.git#tag=${pkgver}"
"build-with-chroot.sh"
"translucent.patch"
"product.json"
"code-oss.sh"
)
sha512sums=(
"SKIP"
"9de3f195e711814e1e457e8ccb6383c6000bc83ee707f2bc138fe66c3cf6c35a6e9c755594afb5fbf8c4f05c3c87f7f3b8714e7947b62094ead6f5f1b81f5b24"
"d60f2f67a39600238a5660b756c0f9ccf5aa922a7ef5ff4368c12c3bd55d4ecdf018fa98f3769428093bd8909ae0bbe185d9d87067076c5ce12518ddd517fdb9"
"03a6e858307ac35e0ff0cb4e235234a5932a837ca412540edf8206c93766b831f43e134ab29e2ca364bd9792f50d289c250f2ccbe432e2faed1cdd78ccb7aa62"
"6234842d41d9cb6cdd27766e35804644c59a39b43a92f2243b18525dc69d954d1e9dcd4297538de3dfd26051c7035d1ebb04f849a69208afa8214e42160c18dd"
)
case "${CARCH}" in
"i686")
_vscode_arch="ia32"
;;
"x86_64")
_vscode_arch="x64"
;;
"aarch64")
_vscode_arch="arm64"
;;
"armv7h")
_vscode_arch="arm"
;;
*)
_vscode_arch="DUMMY"
;;
esac
prepare() {
cd "${srcdir}/${pkgname}"
# Apply patch to source
patch -p1 < "../translucent.patch"
# Replace product json
cp --update=all "../product.json" "."
# Set the commit and build date
local _commit="$(git rev-parse HEAD)"
local _datestamp="$(date -u -Is | sed 's/\+00:00/Z/')"
sed -e "s|@COMMIT@|${_commit}|" -e "s|@DATE@|${_datestamp}|" -i "product.json"
# Patch appdata and desktop file
sed -i 's|/usr/share/@@NAME@@/@@NAME@@|@@NAME@@|g
s|@@NAME_SHORT@@|Code|g
s|@@NAME_LONG@@|Code - OSS|g
s|@@NAME@@|code-oss|g
s|@@ICON@@|code|g
s|@@EXEC@@|/usr/bin/code-oss|g
s|@@LICENSE@@|MIT|g
s|@@URLPROTOCOL@@|vscode|g
s|inode/directory;||' "resources/linux/code"{.appdata.xml,-workspace.xml,.desktop,-url-handler.desktop}
sed -i 's|MimeType=.*|MimeType=x-scheme-handler/code-oss;|' "resources/linux/code-url-handler.desktop"
# Add completitions for code-oss
cp "resources/completions/bash/code" "resources/completions/bash/code-oss"
cp "resources/completions/zsh/_code" "resources/completions/zsh/_code-oss"
# Patch completitions with correct names
sed -i 's|@@APPNAME@@|code-oss|g' "resources/completions/"{bash/code-oss,zsh/_code-oss}
}
build() {
cd "${srcdir}/${pkgname}"
yarn install --arch="${_vscode_arch}"
gulp --max_old_space_size=8192 --openssl-legacy-provider vscode-linux-"${_vscode_arch}"-min
}
package() {
local _pkgdir="${srcdir}/${pkgname}"
local _appdir="${srcdir}/VSCode-linux-${_vscode_arch}"
install -Dm 644 "${_appdir}/resources/app/LICENSE.txt" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
install -Dm 644 "${_appdir}/resources/app/ThirdPartyNotices.txt" "${pkgdir}/usr/share/licenses/${pkgname}/ThirdPartyNotices.txt"
install -Dm 644 "${_pkgdir}/resources/linux/code.appdata.xml" "${pkgdir}/usr/share/metainfo/code-oss.appdata.xml"
install -Dm 644 "${_pkgdir}/resources/linux/code-workspace.xml" "${pkgdir}/usr/share/mime/packages/code-oss-workspace.xml"
install -Dm 644 "${_pkgdir}/resources/linux/code.desktop" "${pkgdir}/usr/share/applications/code-oss.desktop"
install -Dm 644 "${_pkgdir}/resources/linux/code-url-handler.desktop" "${pkgdir}/usr/share/applications/code-oss-url-handler.desktop"
install -Dm 644 "${_pkgdir}/resources/linux/code.png" "${pkgdir}/usr/share/icons/code.png"
install -Dm 644 "${_appdir}/resources/completions/bash/code-oss" "${pkgdir}/usr/share/bash-completion/completions/code-oss"
install -Dm 644 "${_appdir}/resources/completions/zsh/_code-oss" "${pkgdir}/usr/share/zsh/site-functions/_code-oss"
install -dm 755 "${pkgdir}/opt/${pkgname}"
cp --recursive --no-preserve=ownership --preserve=mode "${_appdir}/"* "${pkgdir}/opt/${pkgname}"
install -Dm 755 "${srcdir}/code-oss.sh" "${pkgdir}/usr/bin/code-oss"
}
|