# Maintainer: D. Can Celasun pkgname=visual-studio-code-bin _pkgname=visual-studio-code pkgver=1.123.0 pkgrel=3 pkgdesc="Visual Studio Code (vscode): Editor for building and debugging modern web and cloud applications (official binary version)" arch=('x86_64' 'aarch64' 'armv7h') url="https://code.visualstudio.com/" license=('custom: commercial') provides=('code' 'vscode') conflicts=('code') # Upstream has signature verification for extensions and stripping breaks it # See https://github.com/microsoft/vscode/issues/223455#issuecomment-2610001754 options=(!strip) install=$pkgname.install # lsof: needed for terminal splitting, see https://github.com/Microsoft/vscode/issues/62991 # xdg-utils: needed for opening web links with xdg-open depends=(libxkbfile gnupg gtk3 libsecret nss gcc-libs libnotify libxss glibc lsof shared-mime-info xdg-utils alsa-lib) optdepends=('glib2: Needed for move to trash functionality' 'libdbusmenu-glib: Needed for KDE global menu' 'org.freedesktop.secrets: Needed for settings sync' # See https://github.com/MicrosoftDocs/live-share/issues/4650 'icu69: Needed for live share' ) source=(local://code.desktop.in local://code-url-handler.desktop.in local://code-workspace.xml.in local://${_pkgname}-bin.sh) source_x86_64=(code_x64_${pkgver}.tar.gz::https://update.code.visualstudio.com/${pkgver}/linux-x64/stable) source_aarch64=(code_arm64_${pkgver}.tar.gz::https://update.code.visualstudio.com/${pkgver}/linux-arm64/stable) source_armv7h=(code_armhf_${pkgver}.tar.gz::https://update.code.visualstudio.com/${pkgver}/linux-armhf/stable) sha256sums=('66f2ee8b20cab72c2ea01c366f4ad9a5881b3c147b372e2809864f2ac99f9f6b' 'fcd854e4c7a0e65e958549d84585186b3280da41bfdff29290820016ebd4ce4c' 'a62cd18b6f96e75f45a65a18054f3ba8c8e14f5fad20ea7bf832e8643f4fd99b' '8257a5ad82fa1f7dec11dfa064217b80df4cfec24f50cec7ca0ad62cf8295bfe') sha256sums_x86_64=('2fdef947717befd2e06854cbe01e99b4898f7752f25e12269c38023e63b93c8f') sha256sums_aarch64=('8dc142ebaf162808e5623bb7dd123aa6800a9e19b77cbd613b5e9a954c23c2fe') sha256sums_armv7h=('2eaa1f9e766277f2349554f2842ef21c3f85c73e1d481c4a27c9fe969daeb9c4') _set_meta_info() { sed 's/@@NAME_LONG@@/Visual Studio Code/g' "$1" |\ sed 's/@@NAME_SHORT@@/Code/g' |\ sed 's/@@NAME@@/code/g' |\ sed 's#@@EXEC@@#/usr/bin/code#g' |\ sed 's/@@ICON@@/visual-studio-code/g' |\ sed 's/@@URLPROTOCOL@@/vscode/g' } prepare() { _set_meta_info "${srcdir}/code.desktop.in" > "${srcdir}/code.desktop" _set_meta_info "${srcdir}/code-url-handler.desktop.in" > "${srcdir}/code-url-handler.desktop" _set_meta_info "${srcdir}/code-workspace.xml.in" > "${srcdir}/code-workspace.xml" } _pkg() { if [ "${CARCH}" = "aarch64" ]; then echo 'VSCode-linux-arm64' elif [ "${CARCH}" = "armv7h" ]; then echo 'VSCode-linux-armhf' else echo 'VSCode-linux-x64' fi } package() { install -d "${pkgdir}/opt/${_pkgname}" install -d "${pkgdir}/usr/bin" install -d "${pkgdir}/usr/share/"{applications,pixmaps,mime/packages,licenses/${_pkgname}} install -m644 "${srcdir}/$(_pkg)/resources/app/LICENSE.rtf" "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE.rtf" install -m644 "${srcdir}/$(_pkg)/resources/app/resources/linux/code.png" "${pkgdir}/usr/share/pixmaps/${_pkgname}.png" install -m644 "${srcdir}/code.desktop" "${pkgdir}/usr/share/applications/code.desktop" install -m644 "${srcdir}/code-url-handler.desktop" "${pkgdir}/usr/share/applications/code-url-handler.desktop" install -m644 "${srcdir}/code-workspace.xml" "${pkgdir}/usr/share/mime/packages/${pkgname}-workspace.xml" install -Dm 644 "${srcdir}/$(_pkg)/resources/completions/bash/code" "${pkgdir}/usr/share/bash-completion/completions/code" install -Dm 644 "${srcdir}/$(_pkg)/resources/completions/zsh/_code" "${pkgdir}/usr/share/zsh/site-functions/_code" cp -r "${srcdir}/$(_pkg)/"* "${pkgdir}/opt/${_pkgname}" # Launcher install -m755 "${srcdir}/${_pkgname}-bin.sh" "${pkgdir}/usr/bin/code" # setuid on chrome-sandbox # Uncomment if using a kernel without user namespaces, like linux-hardened # chmod u+s "${pkgdir}/opt/${_pkgname}/chrome-sandbox" }