Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions srcpkgs/visual-studio-code/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Template file for 'visual-studio-code'
pkgname=visual-studio-code
version=1.131.0
revision=1
archs="x86_64 aarch64 armv7l"
# The bundled Electron binary is excluded from the automatic shlib scan (see
# skiprdeps below), so its runtime dependencies have to be listed by hand.
depends="alsa-lib at-spi2-atk at-spi2-core atk cairo dbus-libs eudev-libudev
expat glib gtk+3 libX11 libXcomposite libXdamage libXext libXfixes libXrandr
libcups libgbm libsecret libxcb libxkbcommon nspr nss pango xdg-utils"
short_desc="Microsoft-branded build of Visual Studio Code"
maintainer="omemoji <me@omemoji.com>"
license="custom:Microsoft-Software-License"
homepage="https://code.visualstudio.com/"
_baseurl="https://update.code.visualstudio.com/${version}"
repository=nonfree
restricted=yes
nostrip=yes
noshlibprovides=yes
create_wrksrc=yes
# Upstream's deb/rpm install to /usr/share/code, and bin/code falls back to that
# path when it cannot resolve its own location; keep the layout as shipped.
ignore_elf_dirs="/usr/share/code"
# The bundled Electron and the MSAL broker link against libraries that ship
# inside this package; they are not resolvable through the shlib map.
skiprdeps="/usr/share/code/code
/usr/share/code/resources/app/extensions/microsoft-authentication/dist/libmsalruntime.so
/usr/share/code/resources/app/extensions/microsoft-authentication/dist/msal-node-runtime.node"

case "$XBPS_TARGET_MACHINE" in
x86_64)
_debarch=amd64
distfiles="${_baseurl}/linux-deb-x64/stable>code-${version}-${_debarch}.deb"
checksum=fe2ed2d94ccc694f49d9084846c0be78ba56c42810355fa3999160079bb53c9a
;;
aarch64)
_debarch=arm64
distfiles="${_baseurl}/linux-deb-arm64/stable>code-${version}-${_debarch}.deb"
checksum=b57f73e4a8a4524bf2a796757f64bd7b594515dd8dabae9b8cd07b1beb204d9c
;;
armv7l)
_debarch=armhf
distfiles="${_baseurl}/linux-deb-armhf/stable>code-${version}-${_debarch}.deb"
checksum=d52ffec8d83eabd500c795007ef3ac286277ff9a1ee014a2797dd215ad3cd4af
;;
esac

do_install() {
vcopy usr /

# The SUID helper is only used when unprivileged user namespaces are
# unavailable; Electron falls back to the namespace sandbox otherwise.
chmod 4755 "${DESTDIR}/usr/share/code/chrome-sandbox"

# Same symlink upstream's postinst creates.
vmkdir usr/bin
ln -s /usr/share/code/bin/code "${DESTDIR}/usr/bin/code"

# /usr/share/appdata is deprecated in favour of /usr/share/metainfo, and
# Void looks for zsh completions in site-functions.
vmkdir usr/share/metainfo
mv "${DESTDIR}"/usr/share/appdata/code.appdata.xml \
"${DESTDIR}"/usr/share/metainfo/
vcompletion usr/share/zsh/vendor-completions/_code zsh code
rm -rf "${DESTDIR}"/usr/share/appdata \
"${DESTDIR}"/usr/share/zsh/vendor-completions

vlicense usr/share/code/resources/app/LICENSE.rtf LICENSE.rtf
}
2 changes: 2 additions & 0 deletions srcpkgs/visual-studio-code/update
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
site="https://update.code.visualstudio.com/api/update/linux-deb-x64/stable/latest"
pattern='"productVersion":"\K[\d.]+'