diff options
author | Adel KARA SLIMANE <adel.ks@zegrapher.com> | 2024-01-14 19:19:31 +0100 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2024-01-14 22:26:30 +0200 |
commit | 2c4aee0e7ed1a19b15e4e1975dde9189a9bd2351 (patch) | |
tree | 989f1563c793497c1457ba851beae33d1bc76991 /app-editors | |
parent | mail-filter/maildrop: fix again (diff) | |
download | gentoo-2c4aee0e7ed1a19b15e4e1975dde9189a9bd2351.tar.gz gentoo-2c4aee0e7ed1a19b15e4e1975dde9189a9bd2351.tar.bz2 gentoo-2c4aee0e7ed1a19b15e4e1975dde9189a9bd2351.zip |
app-editors/vscode: add 'wayland' USE flag
So we merge the two desktop entries that trip DEs
(at least KDE on X11) into one
Signed-off-by: Adel KARA SLIMANE <adel.ks@zegrapher.com>
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'app-editors')
-rw-r--r-- | app-editors/vscode/files/vscode-url-handler-wayland.desktop | 12 | ||||
-rw-r--r-- | app-editors/vscode/files/vscode-url-handler.desktop | 2 | ||||
-rw-r--r-- | app-editors/vscode/files/vscode-wayland.desktop | 18 | ||||
-rw-r--r-- | app-editors/vscode/files/vscode.desktop | 4 | ||||
-rw-r--r-- | app-editors/vscode/metadata.xml | 3 | ||||
-rw-r--r-- | app-editors/vscode/vscode-1.85.0-r1.ebuild (renamed from app-editors/vscode/vscode-1.85.0.ebuild) | 22 | ||||
-rw-r--r-- | app-editors/vscode/vscode-1.85.1-r1.ebuild (renamed from app-editors/vscode/vscode-1.85.1.ebuild) | 22 |
7 files changed, 40 insertions, 43 deletions
diff --git a/app-editors/vscode/files/vscode-url-handler-wayland.desktop b/app-editors/vscode/files/vscode-url-handler-wayland.desktop deleted file mode 100644 index a3214afa7d32..000000000000 --- a/app-editors/vscode/files/vscode-url-handler-wayland.desktop +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Name=VSCode - URL Handler -Comment=Editing evolved -GenericName=Code Editor -Exec=/usr/bin/vscode --enable-features=UseOzonePlatform --ozone-platform=wayland --open-url %U -Icon=vscode -Type=Application -NoDisplay=true -StartupNotify=true -Categories=Utility;TextEditor;Development;IDE; -MimeType=x-scheme-handler/vscode; -Keywords=vscode;code; diff --git a/app-editors/vscode/files/vscode-url-handler.desktop b/app-editors/vscode/files/vscode-url-handler.desktop index 73e3834801b4..fe65d7527069 100644 --- a/app-editors/vscode/files/vscode-url-handler.desktop +++ b/app-editors/vscode/files/vscode-url-handler.desktop @@ -2,7 +2,7 @@ Name=VSCode - URL Handler Comment=Editing evolved GenericName=Code Editor -Exec=/usr/bin/vscode --open-url %U +Exec=/usr/bin/vscode @exec_extra_flags@ --open-url %U Icon=vscode Type=Application NoDisplay=true diff --git a/app-editors/vscode/files/vscode-wayland.desktop b/app-editors/vscode/files/vscode-wayland.desktop deleted file mode 100644 index 1c12a97ffd01..000000000000 --- a/app-editors/vscode/files/vscode-wayland.desktop +++ /dev/null @@ -1,18 +0,0 @@ -[Desktop Entry] -Name=VSCode Wayland -Comment=Editing evolved -GenericName=Code Editor -Exec=/usr/bin/vscode --enable-features=UseOzonePlatform --ozone-platform=wayland --unity-launch %F -Icon=vscode -Type=Application -StartupNotify=false -StartupWMClass=Code -Categories=Utility;TextEditor;Development;IDE; -MimeType=text/plain;inode/directory;application/x-code-workspace; -Actions=new-empty-window; -Keywords=vscode;code; - -[Desktop Action new-empty-window] -Name=New Empty Window -Exec=/usr/bin/vscode --enable-features=UseOzonePlatform --ozone-platform=wayland --new-window %F -Icon=vscode diff --git a/app-editors/vscode/files/vscode.desktop b/app-editors/vscode/files/vscode.desktop index d648416a26ca..ec697eca68b6 100644 --- a/app-editors/vscode/files/vscode.desktop +++ b/app-editors/vscode/files/vscode.desktop @@ -2,7 +2,7 @@ Name=VSCode Comment=Editing evolved GenericName=Code Editor -Exec=/usr/bin/vscode --unity-launch %F +Exec=/usr/bin/vscode @exec_extra_flags@ --unity-launch %F Icon=vscode Type=Application StartupNotify=false @@ -14,5 +14,5 @@ Keywords=vscode;code; [Desktop Action new-empty-window] Name=New Empty Window -Exec=/usr/bin/vscode --new-window %F +Exec=/usr/bin/vscode @exec_extra_flags@ --new-window %F Icon=vscode diff --git a/app-editors/vscode/metadata.xml b/app-editors/vscode/metadata.xml index 5e8dfffc3faa..177d32d281e8 100644 --- a/app-editors/vscode/metadata.xml +++ b/app-editors/vscode/metadata.xml @@ -13,6 +13,9 @@ <email>proxy-maint@gentoo.org</email> <name>Proxy Maintainers</name> </maintainer> + <use> + <flag name="wayland">Run in wayland mode under wayland sessions, xwayland otherwise. This flag doesn't affect x11 sessions.</flag> + </use> <longdescription> Visual Studio Code is a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS and Linux. It diff --git a/app-editors/vscode/vscode-1.85.0.ebuild b/app-editors/vscode/vscode-1.85.0-r1.ebuild index dc88161cc376..e41624cd8829 100644 --- a/app-editors/vscode/vscode-1.85.0.ebuild +++ b/app-editors/vscode/vscode-1.85.0-r1.ebuild @@ -35,7 +35,7 @@ LICENSE=" " SLOT="0" KEYWORDS="-* amd64 ~arm ~arm64" -IUSE="kerberos" +IUSE="kerberos wayland" RESTRICT="mirror strip bindist" RDEPEND=" @@ -104,10 +104,22 @@ src_install() { dosym -r "/opt/${PN}/bin/code" "usr/bin/vscode" dosym -r "/opt/${PN}/bin/code" "usr/bin/code" - domenu "${FILESDIR}/vscode.desktop" - domenu "${FILESDIR}/vscode-url-handler.desktop" - domenu "${FILESDIR}/vscode-wayland.desktop" - domenu "${FILESDIR}/vscode-url-handler-wayland.desktop" + + local EXEC_EXTRA_FLAGS=() + if use wayland; then + EXEC_EXTRA_FLAGS+=( "--ozone-platform-hint=auto" ) + fi + + sed "s|@exec_extra_flags@|${EXEC_EXTRA_FLAGS[*]}|g" \ + "${FILESDIR}/vscode-url-handler.desktop" \ + > "${T}/vscode-url-handler.desktop" || die + + sed "s|@exec_extra_flags@|${EXEC_EXTRA_FLAGS[*]}|g" \ + "${FILESDIR}/vscode.desktop" \ + > "${T}/vscode.desktop" || die + + domenu "${T}/vscode.desktop" + domenu "${T}/vscode-url-handler.desktop" newicon "resources/app/resources/linux/code.png" "vscode.png" } diff --git a/app-editors/vscode/vscode-1.85.1.ebuild b/app-editors/vscode/vscode-1.85.1-r1.ebuild index dc88161cc376..e41624cd8829 100644 --- a/app-editors/vscode/vscode-1.85.1.ebuild +++ b/app-editors/vscode/vscode-1.85.1-r1.ebuild @@ -35,7 +35,7 @@ LICENSE=" " SLOT="0" KEYWORDS="-* amd64 ~arm ~arm64" -IUSE="kerberos" +IUSE="kerberos wayland" RESTRICT="mirror strip bindist" RDEPEND=" @@ -104,10 +104,22 @@ src_install() { dosym -r "/opt/${PN}/bin/code" "usr/bin/vscode" dosym -r "/opt/${PN}/bin/code" "usr/bin/code" - domenu "${FILESDIR}/vscode.desktop" - domenu "${FILESDIR}/vscode-url-handler.desktop" - domenu "${FILESDIR}/vscode-wayland.desktop" - domenu "${FILESDIR}/vscode-url-handler-wayland.desktop" + + local EXEC_EXTRA_FLAGS=() + if use wayland; then + EXEC_EXTRA_FLAGS+=( "--ozone-platform-hint=auto" ) + fi + + sed "s|@exec_extra_flags@|${EXEC_EXTRA_FLAGS[*]}|g" \ + "${FILESDIR}/vscode-url-handler.desktop" \ + > "${T}/vscode-url-handler.desktop" || die + + sed "s|@exec_extra_flags@|${EXEC_EXTRA_FLAGS[*]}|g" \ + "${FILESDIR}/vscode.desktop" \ + > "${T}/vscode.desktop" || die + + domenu "${T}/vscode.desktop" + domenu "${T}/vscode-url-handler.desktop" newicon "resources/app/resources/linux/code.png" "vscode.png" } |