Package Details: vscodium 1.99.32562-1

Git Clone URL: https://aur.archlinux.org/vscodium.git (read-only, click to copy)
Package Base: vscodium
Description: Free/Libre Open Source Software Binaries of VSCode (git build from latest release).
Upstream URL: https://github.com/VSCodium/vscodium.git
Licenses: MIT
Conflicts: codium, vscodium, vscodium-bin, vscodium-git
Provides: codium, vscodium
Submitter: cedricroijakkers
Maintainer: cedricroijakkers (daiyam)
Last Packager: daiyam
Votes: 77
Popularity: 2.31
First Submitted: 2021-04-10 15:12 (UTC)
Last Updated: 2025-04-16 18:58 (UTC)

Pinned Comments

Latest Comments

« First ‹ Previous 1 2 3 4 5 6 7 8 9 10 11 12 Next › Last »

svallinn commented on 2022-08-18 21:38 (UTC) (edited on 2022-08-19 14:10 (UTC) by svallinn)

Here's the "final version" of the patch

I say final because I'm personally not doing any more changes

There's a whole lot of nitpicking in the comments, but don't worry, I tried to appease all of you

(no need to be cautious, it's just a PrivateBin instance -> https://privatebin.info/directory)

NOTE: Don't copy the text, click the "Save Paste" instead; that way trailing whitespace is preserved (there's a new line at the end of the file that is not reflected in the browser)

https://0.0g.gg/?f91e383298836c80#4yBqasNd77rJzPvjsnB4W8Vhep2fk2x5BHBkg4BdibvS

jonathon commented on 2022-08-18 20:36 (UTC) (edited on 2022-08-18 20:36 (UTC) by jonathon)

There's no need to have a git repo URL as a separate variable - it can be included in the source array (as in my diff). In any event, local variables should be prepended with an underscore (so _microsoft_url rather than microsoft_url).

willemw commented on 2022-08-18 19:22 (UTC)

command -v does not need the 2>&1 part.

_pkgver is only used once. You might as well remove the _pkgver variable and do the substitution inline (in source).

url still ends on .git which should be removed (url points to an HTML page).

(Not really necessary: I have seen some packages that put the word "git" into the variable name to make it clear it points to a git repo. So here, for example, _microsoft_giturl, or something like that. Extra/user-defined variables usually start with an _.)

eclairevoyant commented on 2022-08-18 18:44 (UTC) (edited on 2022-08-18 18:48 (UTC) by eclairevoyant)

@svallinn Might be cleaner if we can also fix the misaligned spaces from the PKGBUILD as part of your patch, I pasted the relevant lines here after fixing them.

-        # Install the correct version of NodeJS (read from .nvmrc)
-       nvm install $(cat .nvmrc)
-    # Install the correct version of NodeJS (read from .nvmrc)
+    nvm install "$(cat .nvmrc)"
     nvm use

     # Check if the correct version of node is being used
     if [[ "$(node --version)" != "$(cat .nvmrc)" ]]
     then
-       echo "Using the wrong version of NodeJS! Expected ["$(cat .nvmrc)"] but using ["$(node --version)"]."
-       exit 1
+        echo "Using the wrong version of NodeJS! Expected [$(cat .nvmrc)] but using [$(node --version)]."
+        exit 1
     fi

svallinn commented on 2022-08-18 15:10 (UTC) (edited on 2022-08-18 20:03 (UTC) by svallinn)

EDIT: This won't apply, because the code blocks don't persist whitespace properly here. I'll make it available on a pastebin shortly.

Here's my suggested diff for PKGBUILD. Pretty much includes everyone's suggestions, plus a RELEASE_VERSION env variable that fixes the broken extensions' issue that was related to eclairevoyant's comment.

diff --git a/PKGBUILD b/PKGBUILD
index a703b6e..399e0cb 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,15 +4,14 @@
 pkgname=vscodium
 # Make sure the pkgver matches the git tags in vscodium and vscode git repo's!
 pkgver='1.70.2.22230'
+_pkgver="${pkgver%.*}"
 pkgrel=1
 pkgdesc="Free/Libre Open Source Software Binaries of VSCode (git build from latest release)."
 arch=('x86_64' 'aarch64' 'armv7h')
 # The vscodium repo that will be checked out.
 url='https://github.com/VSCodium/vscodium.git'
 # The vscode repo that will also be checked out.
-microsofturl='https://github.com/microsoft/vscode.git'
-# The tag of Microsoft that will be checked out, will be determined automatically, just like VSCodium itself does, with the following url
-stableversionurl='https://update.code.visualstudio.com/api/update/darwin/stable/lol'
+microsoft_url='https://github.com/microsoft/vscode.git'
 license=('MIT')

 depends=(
@@ -46,7 +45,7 @@ makedepends=(
 )
 source=(
     "git+${url}#tag=${pkgver}"
-    "git+${microsofturl}#tag="$(curl ${stableversionurl} 2>/dev/null | jq -r '.name')
+    "git+${microsoft_url}#tag=${_pkgver}"
     'vscodium.desktop'
 )
 sha256sums=(
@@ -98,19 +97,19 @@ build() {
     export SKIP_LINUX_PACKAGES="True"

     # Deactivate any pre-loaded nvm, and make sure we use our own in the current source directory
-    which nvm >/dev/null 2>&1 && nvm deactivate && nvm unload
+    command -v nvm >/dev/null 2>&1 && nvm deactivate && nvm unload
     export NVM_DIR="${srcdir}/.nvm"
     source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]]

-   # Install the correct version of NodeJS (read from .nvmrc)
-   nvm install $(cat .nvmrc)
+    # Install the correct version of NodeJS (read from .nvmrc)
+    nvm install $(cat .nvmrc)
     nvm use

     # Check if the correct version of node is being used
     if [[ "$(node --version)" != "$(cat .nvmrc)" ]]
     then
-       echo "Using the wrong version of NodeJS! Expected ["$(cat .nvmrc)"] but using ["$(node --version)"]."
-       exit 1
+        echo "Using the wrong version of NodeJS! Expected ["$(cat .nvmrc)"] but using ["$(node --version)"]."
+        exit 1
     fi

     # Build!
@@ -118,14 +117,14 @@ build() {
 }

 package() {
-    install -d -m755 ${pkgdir}/usr/bin
-    install -d -m755 ${pkgdir}/usr/share/{${pkgname},applications,pixmaps}
-    install -d -m755 ${pkgdir}/usr/share/licenses/${pkgname}
-    cp -r ${srcdir}/vscodium/LICENSE ${pkgdir}/usr/share/licenses/${pkgname}
-    cp -r ${srcdir}/vscodium/VSCode-linux-${_vscode_arch}/* ${pkgdir}/usr/share/${pkgname}
-    ln -s /usr/share/${pkgname}/bin/codium ${pkgdir}/usr/bin/codium
-    ln -s /usr/share/${pkgname}/bin/codium ${pkgdir}/usr/bin/vscodium
-    install -D -m644 vscodium.desktop ${pkgdir}/usr/share/applications/vscodium.desktop
-    install -D -m644 ${srcdir}/vscodium/VSCode-linux-${_vscode_arch}/resources/app/resources/linux/code.png \
-            ${pkgdir}/usr/share/pixmaps/vscodium.png
+    install -d -m755 "${pkgdir}"/usr/bin
+    install -d -m755 "${pkgdir}"/usr/share/{"${pkgname}",applications,pixmaps}
+    install -d -m755 "${pkgdir}"/usr/share/licenses/"${pkgname}"
+    cp -r "${srcdir}"/vscodium/LICENSE "${pkgdir}"/usr/share/licenses/"${pkgname}"
+    cp -r "${srcdir}"/vscodium/VSCode-linux-"${_vscode_arch}"/* "${pkgdir}"/usr/share/"${pkgname}"
+    ln -s /usr/share/"${pkgname}"/bin/codium "${pkgdir}"/usr/bin/codium
+    ln -s /usr/share/"${pkgname}"/bin/codium "${pkgdir}"/usr/bin/vscodium
+    install -D -m644 vscodium.desktop "${pkgdir}"/usr/share/applications/vscodium.desktop
+    install -D -m644 "${srcdir}"/vscodium/VSCode-linux-"${_vscode_arch}"/resources/app/resources/linux/code.png \
+            "${pkgdir}"/usr/share/pixmaps/vscodium.png
 }

willemw commented on 2022-08-18 11:49 (UTC)

makedepends packages are only for inside build(), not in, for example, source:

PKGBUILD: line 51: jq: command not found

You can specify the download path directly in source instead of moving the folder in prepare():

"$pkgname/vscode::git+https://github.com/microsoft/vscode.git#tag=${pkgver%.*}"

It is probably safe to remove the version number from glibc.

$srcdir, $pkgdir and the first $(cat .nvmrc) should be double-quoted.

The echo "Using the wrong version of NodeJS... line has double-quotes inside double-quotes. The inner quotes can be removed.

(Use command -v instead of which.)

jonathon commented on 2022-08-18 10:43 (UTC)

@willemw, that's cleaner again, let me edit my diff...

willemw commented on 2022-08-18 10:09 (UTC)

You could also maintain a single version number, for example:

pkgver=1.70.2.22230
_pkgver="${pkgver%.*}"

jonathon commented on 2022-08-18 09:49 (UTC) (edited on 2022-08-18 10:45 (UTC) by jonathon)

I don't understand the need for jq to determine the stable version - it's already available as part of the pkgver. You're also misusing the url field (which should be a webpage), and introducing useless variables. This can be tidied somewhat, e.g.:

(Edited to use the above replacement)

diff --git a/PKGBUILD b/PKGBUILD
index a703b6e..251b42f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,14 +5,9 @@ pkgname=vscodium
 # Make sure the pkgver matches the git tags in vscodium and vscode git repo's!
 pkgver='1.70.2.22230'
 pkgrel=1
-pkgdesc="Free/Libre Open Source Software Binaries of VSCode (git build from latest release)."
+pkgdesc="Free/Libre Open Source Software Binaries of VSCode"
 arch=('x86_64' 'aarch64' 'armv7h')
-# The vscodium repo that will be checked out.
-url='https://github.com/VSCodium/vscodium.git'
-# The vscode repo that will also be checked out.
-microsofturl='https://github.com/microsoft/vscode.git'
-# The tag of Microsoft that will be checked out, will be determined automatically, just like VSCodium itself does, with the following url
-stableversionurl='https://update.code.visualstudio.com/api/update/darwin/stable/lol'
+url='https://github.com/VSCodium/vscodium'
 license=('MIT')

 depends=(
@@ -45,8 +40,8 @@ makedepends=(
     'ripgrep'
 )
 source=(
-    "git+${url}#tag=${pkgver}"
-    "git+${microsofturl}#tag="$(curl ${stableversionurl} 2>/dev/null | jq -r '.name')
+    "git+${url}.git#tag=${pkgver}"
+    "git+https://github.com/microsoft/vscode.git#tag=${pkgver%.*}"
     'vscodium.desktop'
 )
 sha256sums=(

eclairevoyant commented on 2022-08-16 22:37 (UTC) (edited on 2022-08-16 22:42 (UTC) by eclairevoyant)

Looks like something is broken in the latest version because /usr/share/vscodium/resources/app/package.json doesn't have a version set. Should I report this to upstream? I don't see anything in the PKGBUILD that would cause this. I tried both chroot and non-chroot builds with the same result.

Also, version is set correctly in the previous recent version (1.70.1).