commit:     cc604bbc4fc673227b634e4f857b5976116b64df
Author:     Leonardo Hernández Hernández <leohdz172 <AT> proton <DOT> me>
AuthorDate: Wed Nov  1 18:52:42 2023 +0000
Commit:     Leonardo Hernandez <leohdz172 <AT> proton <DOT> me>
CommitDate: Wed Nov  1 18:52:42 2023 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=cc604bbc

www-apps/code-server-bin: add 4.18.0

Signed-off-by: Leonardo Hernández Hernández <leohdz172 <AT> proton.me>

 www-apps/code-server-bin/Manifest                  |   2 +
 .../code-server-bin/code-server-bin-4.18.0.ebuild  | 101 +++++++++++++++++++++
 2 files changed, 103 insertions(+)

diff --git a/www-apps/code-server-bin/Manifest 
b/www-apps/code-server-bin/Manifest
index afe2c2f335..de9403ff91 100644
--- a/www-apps/code-server-bin/Manifest
+++ b/www-apps/code-server-bin/Manifest
@@ -10,3 +10,5 @@ DIST code-server-bin-4.17.0-amd64.tar.gz 96605967 BLAKE2B 
631bb923170d4530596d31
 DIST code-server-bin-4.17.0-arm64.tar.gz 95927302 BLAKE2B 
8953ef7979eb35ddadc4238f631c385a2343fef93501e83387b6cb85575c5bb2dbbcd895bb11c0eb4ebf39980eebd4f93eef21881c1aa9c931605134e84a1df4
 SHA512 
6448e715a5541e38bf0bc75eafe6c2c5edc6e4628350531b0021139aaa40bd13dface37f79bad6009cd1932695468043953fede5507e9c7b6825ca7ae33c6f90
 DIST code-server-bin-4.17.1-amd64.tar.gz 96252118 BLAKE2B 
6509997725e316454538ba470aee204119b2cd3dcdb3d4c4e774691f512253111b5bde3d2eb84731ae05c0ff61fcaa422c8cde5004a3e173c363353deffd0d2e
 SHA512 
0c47af00c8e9d6d04ab218836ed1f2cc71ef94bd4c83aa1fdd670b9b967747cdae856290bf7a3fcde0b27b2117dd287a9bd711366d22b80304fe2031449f82c8
 DIST code-server-bin-4.17.1-arm64.tar.gz 96460530 BLAKE2B 
a7150628b67183cb0e8350a4718e99c0e42c18217221846ed18c50545cdac4a5e94cdeb45580de35cbaf35d6abae5d981e3ba96006fc133861084171bf1db04a
 SHA512 
a4181d1560e0d3d4ef3af5d7cf186d312b807cf81c708816132891c4453d0884ebbd9130363ec688168e4b226d061c0c3af4eab6b78cb067b2246e6a99aab8eb
+DIST code-server-bin-4.18.0-amd64.tar.gz 96325604 BLAKE2B 
b227866908496cebb44dbe779433751e406b5e6fcd787eb4e04618bccfef512452f0bfc9adbb431eb7834b6ce88f7383d038e8810ef11f5ec37dca7055a0677d
 SHA512 
ebd3538defcebb166627a55993ddff1825400fb7172f46f80afbeeb0333912f5cf2919d9b36305d761686d49c59333c90e3160c1365a5a57c2b223ceb1b2e341
+DIST code-server-bin-4.18.0-arm64.tar.gz 96445800 BLAKE2B 
4504f71005f090a5317990e5559f7806b5d8135c511c25d037f58d5fba154c8463c69bf174bb975b307907983f3b042350b035efe5962518124709e159e35da5
 SHA512 
357de541a23b2cec3a2ec66b6093e55f1cc7793544f84609b60f83395a78497a7b1471a566418c57f2411b3e895a6ffb859649a65d046784824be1fccac2520b

diff --git a/www-apps/code-server-bin/code-server-bin-4.18.0.ebuild 
b/www-apps/code-server-bin/code-server-bin-4.18.0.ebuild
new file mode 100644
index 0000000000..56d038b6d0
--- /dev/null
+++ b/www-apps/code-server-bin/code-server-bin-4.18.0.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MY_PN="${PN/-bin/}"
+MY_P="${MY_PN}-${PV}"
+BASE_URI="https://github.com/coder/${MY_PN}/releases/download/v${PV}/${MY_P}-linux";
+
+inherit systemd
+
+DESCRIPTION="VS Code in the browser (binary version with unbundled node and 
ripgrep)"
+HOMEPAGE="https://coder.com/";
+SRC_URI="
+       amd64? ( ${BASE_URI}-amd64.tar.gz -> ${P}-amd64.tar.gz )
+       arm64? ( ${BASE_URI}-arm64.tar.gz -> ${P}-arm64.tar.gz )
+"
+S="${WORKDIR}/${MY_P}-linux-${ARCH}"
+
+LICENSE="MIT ISC BSD Apache-2.0 BSD-2 PYTHON 0BSD"
+LICENSE+=" LGPL-2.1+"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64"
+RESTRICT="test"
+
+RDEPEND="
+       app-crypt/libsecret
+       >=net-libs/nodejs-18.0.0[ssl]
+       sys-apps/ripgrep
+       virtual/krb5
+"
+
+PATCHES=( "${FILESDIR}/${PN}-node.patch" )
+
+DOCS=( README.md ThirdPartyNotices.txt )
+
+QA_PREBUILT="*"
+
+# Relative
+VSCODE_MODULES="lib/vscode/node_modules"
+QA_PRESTRIPPED="
+       
opt/${PN}/node_modules/@node-rs/argon2-linux-x64-musl/argon2.linux-x64-musl.node
+       
opt/${PN}/${VSCODE_MODULES}/@parcel/watcher/prebuilds/linux-x64/node.napi.musl.node
+       
opt/${PN}/${VSCODE_MODULES}/@parcel/watcher/prebuilds/linux-x64/node.napi.glibc.node
+"
+
+src_prepare() {
+       default
+
+       # We remove as much precompiled code as we can,
+       # node modules not written in JS cannot be removed
+       # thus "-bin".
+
+       # use system node
+       rm ./lib/node || die "Failed to remove bundled nodejs"
+
+       # remove bundled ripgrep binary
+       rm ./"${VSCODE_MODULES}"/@vscode/ripgrep/bin/rg \
+               || die "Failed to remove bundled ripgrep"
+
+       # Only required at build time
+       find "${S}" -type l -name python3 -delete || die
+
+       # not needed
+       rm ./postinstall.sh || die
+
+       # For windows
+       rm -r ./"${VSCODE_MODULES}"/@parcel/watcher/prebuilds/win32-x64 || die
+
+       if [[ $ELIBC != "musl" ]]; then
+               rm 
./"${VSCODE_MODULES}"/@parcel/watcher/prebuilds/linux-x64/node.napi.musl.node 
|| die
+       elif [[ $ELIBC != "glibc" ]]; then
+               rm 
./"${VSCODE_MODULES}"/@parcel/watcher/prebuilds/linux-x64/node.napi.glibc.node 
|| die
+               rm 
./"${VSCODE_MODULES}"/@parcel/watcher/prebuilds/darwin-x64/node.napi.glibc.node 
|| die
+               rm 
./"${VSCODE_MODULES}"/@parcel/watcher/prebuilds/darwin-arm64/node.napi.glibc.node
 || die
+       fi
+
+       rm -r ./lib/vscode/extensions/node_modules/.bin || die
+}
+
+src_install() {
+       einstalldocs
+
+       insinto "/opt/${PN}"
+       doins -r .
+       fperms +x "/opt/${PN}/bin/${MY_PN}"
+       dosym -r "/opt/${PN}/bin/${MY_PN}" "/opt/${PN}/bin/${PN}"
+       dosym -r "/opt/${PN}/bin/${PN}" "/usr/bin/${PN}"
+
+       dosym -r "/usr/bin/rg" \
+               "/opt/${PN}/${VSCODE_MODULES}/@vscode/ripgrep/bin/rg"
+
+       systemd_douserunit "${FILESDIR}/${PN}.service"
+       newinitd "${FILESDIR}/${PN}.rc" "${PN}"
+       newconfd "${FILESDIR}/${PN}.conf" "${PN}"
+}
+
+pkg_postinst() {
+       elog "When using code-server systemd service run it as a user"
+       elog "For example: 'systemctl --user enable --now code-server'"
+}

Reply via email to