|
| 1 | +# Template file for 'visual-studio-code' |
| 2 | +pkgname=visual-studio-code |
| 3 | +version=1.138.0 |
| 4 | +revision=1 |
| 5 | +archs="x86_64 aarch64" |
| 6 | +# The bundled Electron binary is excluded from the automatic shlib scan (see |
| 7 | +# skiprdeps below), so its runtime dependencies have to be listed by hand. |
| 8 | +depends="alsa-lib at-spi2-atk at-spi2-core atk cairo dbus-libs eudev-libudev |
| 9 | + expat glib gtk+3 libX11 libXcomposite libXdamage libXext libXfixes libXrandr |
| 10 | + libcups libgbm libsecret libxcb libxkbcommon nspr nss pango xdg-utils" |
| 11 | +short_desc="Microsoft-branded build of Visual Studio Code" |
| 12 | +maintainer="omemoji <me@omemoji.com>" |
| 13 | +license="custom:Microsoft-Software-License" |
| 14 | +homepage="https://code.visualstudio.com/" |
| 15 | +_baseurl="https://update.code.visualstudio.com/${version}" |
| 16 | +repository=nonfree |
| 17 | +restricted=yes |
| 18 | +nostrip=yes |
| 19 | +noshlibprovides=yes |
| 20 | +create_wrksrc=yes |
| 21 | +# Upstream's deb/rpm install to /usr/share/code, and bin/code falls back to that |
| 22 | +# path when it cannot resolve its own location; keep the layout as shipped. |
| 23 | +ignore_elf_dirs="/usr/share/code" |
| 24 | +# The bundled Electron and the MSAL broker link against libraries that ship |
| 25 | +# inside this package; they are not resolvable through the shlib map. |
| 26 | +skiprdeps="/usr/share/code/code |
| 27 | + /usr/share/code/resources/app/extensions/microsoft-authentication/dist/libmsalruntime.so |
| 28 | + /usr/share/code/resources/app/extensions/microsoft-authentication/dist/msal-node-runtime.node" |
| 29 | + |
| 30 | +case "$XBPS_TARGET_MACHINE" in |
| 31 | + x86_64) |
| 32 | + _debarch=amd64 |
| 33 | + distfiles="${_baseurl}/linux-deb-x64/stable>code-${version}-${_debarch}.deb" |
| 34 | + checksum=73389cdcef7e66171a2039d1e49b9530e5ed02937e6159d3e6af93484e63cbad |
| 35 | + ;; |
| 36 | + aarch64) |
| 37 | + _debarch=arm64 |
| 38 | + distfiles="${_baseurl}/linux-deb-arm64/stable>code-${version}-${_debarch}.deb" |
| 39 | + checksum=09760b73fb96ca19f8c6e483ec5b69123f34edd2c762cc9e0faf73fa3d400145 |
| 40 | + ;; |
| 41 | +esac |
| 42 | + |
| 43 | +do_install() { |
| 44 | + vcopy usr / |
| 45 | + |
| 46 | + # The SUID helper is only used when unprivileged user namespaces are |
| 47 | + # unavailable; Electron falls back to the namespace sandbox otherwise. |
| 48 | + chmod 4755 "${DESTDIR}/usr/share/code/chrome-sandbox" |
| 49 | + |
| 50 | + # Same symlink upstream's postinst creates. |
| 51 | + vmkdir usr/bin |
| 52 | + ln -s /usr/share/code/bin/code "${DESTDIR}/usr/bin/code" |
| 53 | + |
| 54 | + # /usr/share/appdata is deprecated in favour of /usr/share/metainfo, and |
| 55 | + # Void looks for zsh completions in site-functions. |
| 56 | + vmkdir usr/share/metainfo |
| 57 | + mv "${DESTDIR}"/usr/share/appdata/code.appdata.xml \ |
| 58 | + "${DESTDIR}"/usr/share/metainfo/ |
| 59 | + vcompletion usr/share/zsh/vendor-completions/_code zsh code |
| 60 | + rm -rf "${DESTDIR}"/usr/share/appdata \ |
| 61 | + "${DESTDIR}"/usr/share/zsh/vendor-completions |
| 62 | + |
| 63 | + vlicense usr/share/code/resources/app/LICENSE.rtf LICENSE.rtf |
| 64 | +} |
0 commit comments