Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-editors/vscode/, app-editors/vscode/files/
Date: Thu, 27 May 2021 07:27:03
Message-Id: 1622100410.f611be487a31ee398da4275c436a761c5d59511a.juippis@gentoo
1 commit: f611be487a31ee398da4275c436a761c5d59511a
2 Author: Adel KARA SLIMANE <adel <AT> karaslimane <DOT> com>
3 AuthorDate: Fri May 7 00:43:58 2021 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Thu May 27 07:26:50 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f611be48
7
8 app-editors/vscode: New package
9
10 Visual Studio Code is a lightweight but powerful source code editor which
11 runs on your desktop and is available for Windows, macOS and Linux. It
12 comes with built-in support for JavaScript, TypeScript and Node.js and has
13 a rich ecosystem of extensions for other languages (such as C++, C#, Java,
14 Python, PHP, Go) and runtimes (such as .NET and Unity).
15
16 Closes: https://bugs.gentoo.org/657628
17 Closes: https://github.com/gentoo/gentoo/pull/20710
18 Signed-off-by: Adel KARA SLIMANE <adel.ks <AT> zegrapher.com>
19 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
20
21 app-editors/vscode/Manifest | 3 +
22 .../vscode/files/vscode-url-handler.desktop | 12 +++
23 app-editors/vscode/files/vscode.desktop | 18 ++++
24 app-editors/vscode/metadata.xml | 23 +++++
25 app-editors/vscode/vscode-1.56.2.ebuild | 105 +++++++++++++++++++++
26 5 files changed, 161 insertions(+)
27
28 diff --git a/app-editors/vscode/Manifest b/app-editors/vscode/Manifest
29 new file mode 100644
30 index 00000000000..8d4c4f054dd
31 --- /dev/null
32 +++ b/app-editors/vscode/Manifest
33 @@ -0,0 +1,3 @@
34 +DIST vscode-1.56.2-amd64.tar.gz 104824843 BLAKE2B 608cc74daad0534a91d3c6200827b82efa0c2a9634c3cd9f031d4744a35f25c5201a7310011d6dfe57f761845e79574d068678a4500650c47d8404d2bd810f4d SHA512 35ef320b92a66d05a8c2b61a81978d659245f37ef0b2f05002083386a265a232ed163dcc06ddee9bc2bc8f1205fa80e7841268bf66fdddcabe4a8ed35fb50a35
35 +DIST vscode-1.56.2-arm.tar.gz 95395040 BLAKE2B e948f09a97a39f898276fe4bbc9f7f35fa96b833732a48058e402aaa0246790d79c5422f5e209c842b94c6c46d19b657cdeefa9caa1e255331f81e91e0760c69 SHA512 4486d030d2d611aa0d29a156ba5c2beb2bd0ab1950684c7bdea44460fb05f3a18b62419c346d99a84cd71bb595f7802dab10730b40600879e442ee3181129e6f
36 +DIST vscode-1.56.2-arm64.tar.gz 110174990 BLAKE2B 3b512136911b3ca431fbf71951655490c85f1c7cc707c6ddea3fd4d41b956fbf33dd8264e279d1d6e69564506aefcd9588397665133a3a34997d916605c9aa73 SHA512 bc3fb6b78e33286486411aa78b538693c371b309e86a84ee7361a2fd78d2d8e0dd4e9dd761f9278ced4e3a31a532e2534cdde001635935dfda92dfab85eb9e51
37
38 diff --git a/app-editors/vscode/files/vscode-url-handler.desktop b/app-editors/vscode/files/vscode-url-handler.desktop
39 new file mode 100644
40 index 00000000000..ec5bb1732c3
41 --- /dev/null
42 +++ b/app-editors/vscode/files/vscode-url-handler.desktop
43 @@ -0,0 +1,12 @@
44 +[Desktop Entry]
45 +Name=Visual Studio Code - URL Handler
46 +Comment=Editing evolved
47 +GenericName=Code Editor
48 +Exec=/usr/bin/vscode --open-url %U
49 +Icon=vscode
50 +Type=Application
51 +NoDisplay=true
52 +StartupNotify=true
53 +Categories=Utility;TextEditor;Development;IDE;
54 +MimeType=x-scheme-handler/vscode;
55 +Keywords=vscode;
56
57 diff --git a/app-editors/vscode/files/vscode.desktop b/app-editors/vscode/files/vscode.desktop
58 new file mode 100644
59 index 00000000000..31711273999
60 --- /dev/null
61 +++ b/app-editors/vscode/files/vscode.desktop
62 @@ -0,0 +1,18 @@
63 +[Desktop Entry]
64 +Name=Visual Studio Code
65 +Comment=Editing evolved
66 +GenericName=Code Editor
67 +Exec=/usr/bin/vscode --unity-launch %F
68 +Icon=vscode
69 +Type=Application
70 +StartupNotify=false
71 +StartupWMClass=Code
72 +Categories=Utility;TextEditor;Development;IDE;
73 +MimeType=text/plain;inode/directory;application/x-code-workspace;
74 +Actions=new-empty-window;
75 +Keywords=vscode;
76 +
77 +[Desktop Action new-empty-window]
78 +Name=New Empty Window
79 +Exec=/usr/bin/vscode --new-window %F
80 +Icon=vscode
81
82 diff --git a/app-editors/vscode/metadata.xml b/app-editors/vscode/metadata.xml
83 new file mode 100644
84 index 00000000000..9aea48978a9
85 --- /dev/null
86 +++ b/app-editors/vscode/metadata.xml
87 @@ -0,0 +1,23 @@
88 +<?xml version="1.0" encoding="UTF-8"?>
89 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
90 +<pkgmetadata>
91 + <maintainer type="person" proxied="yes">
92 + <email>adel.ks@×××××××××.com</email>
93 + <name>Adel KARA SLIMANE</name>
94 + </maintainer>
95 + <maintainer type="project" proxied="proxy">
96 + <email>proxy-maint@g.o</email>
97 + <name>Proxy Maintainers</name>
98 + </maintainer>
99 + <longdescription>
100 + Visual Studio Code is a lightweight but powerful source code editor which
101 + runs on your desktop and is available for Windows, macOS and Linux. It
102 + comes with built-in support for JavaScript, TypeScript and Node.js and has
103 + a rich ecosystem of extensions for other languages (such as C++, C#, Java,
104 + Python, PHP, Go) and runtimes (such as .NET and Unity).
105 + </longdescription>
106 + <upstream>
107 + <remote-id type="github">microsoft/vscode</remote-id>
108 + <bugs-to>https://github.com/microsoft/vscode/issues</bugs-to>
109 + </upstream>
110 +</pkgmetadata>
111
112 diff --git a/app-editors/vscode/vscode-1.56.2.ebuild b/app-editors/vscode/vscode-1.56.2.ebuild
113 new file mode 100644
114 index 00000000000..9f849c2af23
115 --- /dev/null
116 +++ b/app-editors/vscode/vscode-1.56.2.ebuild
117 @@ -0,0 +1,105 @@
118 +# Copyright 1999-2021 Gentoo Authors
119 +# Distributed under the terms of the GNU General Public License v2
120 +
121 +EAPI=7
122 +
123 +inherit desktop pax-utils xdg
124 +
125 +DESCRIPTION="Multiplatform Visual Studio Code from Microsoft"
126 +HOMEPAGE="https://code.visualstudio.com"
127 +SRC_URI="
128 + amd64? ( https://update.code.visualstudio.com/${PV}/linux-x64/stable -> ${P}-amd64.tar.gz )
129 + arm? ( https://update.code.visualstudio.com/${PV}/linux-armhf/stable -> ${P}-arm.tar.gz )
130 + arm64? ( https://update.code.visualstudio.com/${PV}/linux-arm64/stable -> ${P}-arm64.tar.gz )
131 +"
132 +
133 +RESTRICT="mirror strip bindist"
134 +
135 +LICENSE="
136 + Apache-2.0
137 + BSD
138 + BSD-1
139 + BSD-2
140 + BSD-4
141 + CC-BY-4.0
142 + ISC
143 + LGPL-2.1+
144 + Microsoft-vscode
145 + MIT
146 + MPL-2.0
147 + openssl
148 + PYTHON
149 + TextMate-bundle
150 + Unlicense
151 + UoI-NCSA
152 + W3C
153 +"
154 +SLOT="0"
155 +KEYWORDS="-* ~amd64 ~arm ~arm64"
156 +IUSE=""
157 +
158 +RDEPEND="
159 + app-accessibility/at-spi2-atk
160 + app-crypt/libsecret[crypt]
161 + dev-libs/nss
162 + media-libs/alsa-lib
163 + media-libs/libpng:0/16
164 + x11-libs/cairo
165 + x11-libs/gtk+:3
166 + x11-libs/libnotify
167 + x11-libs/libxkbcommon
168 + x11-libs/libxkbfile
169 + x11-libs/libXScrnSaver
170 + x11-libs/libXtst
171 + x11-libs/pango
172 +"
173 +
174 +QA_PREBUILT="
175 + /opt/vscode/code
176 + /opt/vscode/libEGL.so
177 + /opt/vscode/libffmpeg.so
178 + /opt/vscode/libGLESv2.so
179 + /opt/vscode/libvulkan.so*
180 + /opt/vscode/chrome-sandbox
181 + /opt/vscode/libvk_swiftshader.so
182 + /opt/vscode/swiftshader/libEGL.so
183 + /opt/vscode/swiftshader/libGLESv2.so
184 + /opt/vscode/resources/app/extensions/*
185 + /opt/vscode/resources/app/node_modules.asar.unpacked/*
186 +"
187 +
188 +pkg_setup() {
189 + if use amd64; then
190 + S="${WORKDIR}/VSCode-linux-x64"
191 + elif use arm; then
192 + S="${WORKDIR}/VSCode-linux-armhf"
193 + elif use arm64; then
194 + S="${WORKDIR}/VSCode-linux-arm64"
195 + else
196 + die "Visual Studio Code only supports amd64, arm and arm64"
197 + fi
198 +}
199 +
200 +src_install() {
201 + # Cleanup
202 + rm -r "${S}/resources/app/LICENSES.chromium.html" "${S}/resources/app/LICENSE.rtf" "${S}/resources/app/licenses" || die
203 +
204 + # Install
205 + pax-mark m code
206 + insinto "/opt/${PN}"
207 + doins -r *
208 + fperms +x /opt/${PN}/{,bin/}code
209 + fperms +x /opt/${PN}/chrome-sandbox
210 + fperms -R +x /opt/${PN}/resources/app/out/vs/base/node
211 + fperms +x /opt/${PN}/resources/app/node_modules.asar.unpacked/vscode-ripgrep/bin/rg
212 + dosym "../../opt/${PN}/bin/code" "usr/bin/vscode"
213 + domenu "${FILESDIR}/vscode.desktop"
214 + domenu "${FILESDIR}/vscode-url-handler.desktop"
215 + newicon "resources/app/resources/linux/code.png" "vscode.png"
216 +}
217 +
218 +pkg_postinst() {
219 + xdg_pkg_postinst
220 + elog "You may want to install some additional utils, check in:"
221 + elog "https://code.visualstudio.com/Docs/setup#_additional-tools"
222 +}