vscode: unbreak.

This commit is contained in:
Toby Merz 2019-01-21 09:10:03 +01:00 committed by maxice8
parent 84b09abed3
commit e82ed01104
4 changed files with 20 additions and 6 deletions

View file

@ -1,6 +1,9 @@
if [ "$UPDATE" = "no" ]; then
case "$ACTION" in
post)
if [ -d usr/lib/code-oss ]; then
rm -rf usr/lib/code-oss
fi
if [ -d usr/share/code-oss ]; then
rm -rf usr/share/code-oss
fi

View file

@ -0,0 +1,12 @@
diff --git a/resources/linux/bin/code.sh b/resources/linux/bin/code.sh
index 55f50b6f1c14..16b73343e6ea 100755
--- a/resources/linux/bin/code.sh
+++ b/resources/linux/bin/code.sh
@@ -26,7 +26,7 @@ else
VSCODE_PATH="$(dirname $(readlink -f $0))/.."
else
# else use the standard install location
- VSCODE_PATH="/usr/share/@@NAME@@"
+ VSCODE_PATH="/usr/lib/@@NAME@@"
fi
fi

View file

@ -22,7 +22,7 @@ index f93060d565bd..d511dd86489d 100644
Comment=Code Editing. Redefined.
GenericName=Text Editor
-Exec=/usr/share/@@NAME@@/@@NAME@@ --unity-launch %F
+Exec=/usr/bin/sh -c '[ -e "${HOME}/.config/Code - OSS/.libgl_always_software" ] && export LIBGL_ALWAYS_SOFTWARE=1; /usr/share/@@NAME@@/@@NAME@@ --unity-launch %F'
+Exec=/usr/bin/sh -c '[ -e "${HOME}/.config/Code - OSS/.libgl_always_software" ] && export LIBGL_ALWAYS_SOFTWARE=1; /usr/lib/@@NAME@@/@@NAME@@ --unity-launch %F'
Icon=@@ICON@@
Type=Application
StartupNotify=true
@ -31,5 +31,5 @@ index f93060d565bd..d511dd86489d 100644
[Desktop Action new-empty-window]
Name=New Empty Window
-Exec=/usr/share/@@NAME@@/@@NAME@@ --new-window %F
+Exec=/usr/bin/sh -c '[ -e "${HOME}/.config/Code - OSS/.libgl_always_software" ] && export LIBGL_ALWAYS_SOFTWARE=1; /usr/share/@@NAME@@/@@NAME@@ --new-window %F'
+Exec=/usr/bin/sh -c '[ -e "${HOME}/.config/Code - OSS/.libgl_always_software" ] && export LIBGL_ALWAYS_SOFTWARE=1; /usr/lib/@@NAME@@/@@NAME@@ --new-window %F'
Icon=@@ICON@@

View file

@ -12,7 +12,6 @@ homepage="https://code.visualstudio.com/"
distfiles="https://github.com/Microsoft/vscode/archive/${version}.tar.gz"
checksum=7bf1c9c3c2814146906a6e38188d2f3284e128929e27c2c2dd0bcd7c6422be5e
patch_args="-Np1"
broken="https://build.voidlinux.org/builders/x86_64_builder/builds/14182/steps/shell_3/logs/stdio"
# Due to electron
only_for_archs="i686 x86_64"
@ -41,10 +40,10 @@ do_build() {
}
do_install() {
vmkdir usr/share/code-oss
vcopy ../VSCode-linux-${_ARCH}/* usr/share/code-oss
vmkdir usr/lib/code-oss
vcopy ../VSCode-linux-${_ARCH}/* usr/lib/code-oss
vmkdir usr/bin
ln -sf /usr/share/code-oss/bin/code-oss ${DESTDIR}/usr/bin/
ln -sf /usr/lib/code-oss/bin/code-oss ${DESTDIR}/usr/bin/
vmkdir usr/share/applications
ln -sf /usr/share/code-oss/resources/app/resources/linux/code.desktop ${DESTDIR}/usr/share/applications/code-oss.desktop
vmkdir usr/share/pixmaps