Package Details: code-server 4.121.0-1

Git Clone URL: https://aur.archlinux.org/code-server.git (read-only, click to copy)
Package Base: code-server
Description: VS Code in the browser
Upstream URL: https://github.com/coder/code-server
Keywords: code coder.com visual-studio-code vscode
Licenses: MIT
Submitter: hvksmr1996
Maintainer: coadler (ash, cdrci)
Last Packager: ash
Votes: 25
Popularity: 0.001710
First Submitted: 2019-03-11 14:32 (UTC)
Last Updated: 2026-05-20 23:39 (UTC)

Latest Comments

« First ‹ Previous 1 2 3 4

tinywrkb commented on 2019-07-09 19:51 (UTC) (edited on 2019-07-10 10:54 (UTC) by tinywrkb)

@coadler, see the diff if you want to build from source instead of pulling the binary release. This needs some testing to confirm nothing is broken.
I'm not really using coder-server or vscode ATM and only evaluated coder-server today to see how well it works. It looks fine on my system but it be wiser to test this more thoroughly. Don't feel compelled to convert the package if you thing the it would be too much of a hassle to maintain it.

diff --git a/PKGBUILD b/PKGBUILD
index 1e44b7a..e99ff48 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,22 +1,56 @@
 # Maintainer: Colin Adler <cadler@coder.com>

 pkgname=code-server
-pkgver=1.1156_vsc1.33.1
-pkgrel=0
-pkgdesc="Run VS Code on a remote server"
+_pkgver=1.1156-vsc1.33.1
+pkgver=${_pkgver//-/_}
+pkgrel=1
+pkgdesc='Run VS Code on a remote server'
 arch=('x86_64')
-url="https://github.com/cdr/code-server"
-license=(MIT)
-depends=(glibc net-tools)
-_ghtag=${pkgver//_/-}
-_dirname=code-server${_ghtag}-linux-x64
-source=(${url}/releases/download/${_ghtag}/${_dirname}.tar.gz)
-sha512sums=('60e9f6cecf7681899a71cda7fcb7acb3d8e0b50ee819f3971d9f207a816e4273162d1374e143dd61e9029c3c7add73d33db98df7bab882758d1968188fd83dee')
-options=('!strip')
+url='https://coder.com/'
+license=('MIT')
+depends=('net-tools')
+makedepends=('git' 'npm' 'yarn' 'python2' 'ts-node')
+source=("${pkgname}::git+https://github.com/cdr/${pkgname}.git#tag=${_pkgver}")
+sha256sums=('SKIP')
+options=(!strip)

-package() {
-  cd "$srcdir"/${_dirname}
+prepare() {
+   # set build environment
+
+   # yarn
+   # yarn fails if it can't access ~/.yarnrc so point HOME to srcdir
+   export HOME="${srcdir}"
+   #export YARN_USE_YARNRC="${srcdir}"/yarnrc
+   export YARN_CACHE_FOLDER="${srcdir}"/yarn-cache
+   export YARN_PREFIX="${srcdir}"/yarn
+
+   # npm
+   # ignore user npm settings
+   unset NPM_CONFIG_USERCONFIG

-  install -Dm755 code-server "$pkgdir"/usr/bin/code-server
-  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+   export NPM_CONFIG_CACHE="${srcdir}"/npm-cache
+   export NPM_CONFIG_DEVDIR="${srcdir}"/node-gyp
+   export NPM_CONFIG_PREFIX="${srcdir}"/node
+
+   # get the right nodejs version
+   npm install -g n
+   export NODE_PATH=${srcdir}/node/lib/node_modules
+   export PATH=${srcdir}/node/bin:${PATH}
+   export N_PREFIX=${srcdir}/node
+   n $(cat "${srcdir}"/${pkgname}/.node-version)
+}
+
+build() {
+   cd ${pkgname}
+   yarn
+   npm rebuild
+   NODE_ENV=production VERSION=${_pkgver} yarn task build:server:binary
+   yarn task package ${_pkgver}
+}
+
+package() {
+   cd ${pkgname}
+   install -Dm755 release/${pkgname}${_pkgver}-linux-x64/${pkgname} "${pkgdir}"/usr/bin/${pkgname}
+   install -Dm644 release/${pkgname}${_pkgver}-linux-x64/README.md "${pkgdir}"/usr/share/doc/${pkgname}/README.md
+   install -Dm644 release/${pkgname}${_pkgver}-linux-x64/LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
 }

fmartingr commented on 2019-03-18 10:33 (UTC)

Hey, thanks for maintaining this! One suggestion, maybe you should consider adding net-tools to the dependencies. Recently installed on a server and came around this: https://github.com/codercom/code-server/issues/217

hvksmr1996 commented on 2019-03-13 13:22 (UTC) (edited on 2019-03-13 14:38 (UTC) by hvksmr1996)

UPDATE: Fixed


OLD CONTENT:

I don't know how to fix this:

_third_party_main.js:5
    throw 'Invalid Nexe binary';
    ^
Invalid Nexe binary

Upon further examination, it is because the binary looses data during package() (with install command) which only happen when copying files from fakeroot environment to real one (It does not occur when I download and copy code-server directly). I've tried everything. If anyone has any idea how to workaround this, please let me know.