net-p2p/qbittorrent-enhanced: add 5.0.2.10, drop 5.0.0.10
[gentoo-zh.git] / app-editors / cursor / cursor-0.42.5.ebuild
blob5266be34676e36802c945294f0c72f1431f97bf5
1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 APPIMAGE="${P}_x86_64.AppImage"
8 inherit desktop pax-utils xdg optfeature
10 DESCRIPTION="Cursor App - AI-first coding environment"
11 HOMEPAGE="https://www.cursor.com/"
12 SRC_URI="https://download.todesktop.com/230313mzl4w4u92/${P}-build-24111460bf2loz1-x86_64.AppImage -> ${APPIMAGE}"
13 S="${WORKDIR}"
15 LICENSE="cursor"
17 SLOT="0"
18 KEYWORDS="-* amd64"
19 IUSE="egl kerberos wayland"
20 RESTRICT="bindist mirror strip"
22 RDEPEND="
23         >=app-accessibility/at-spi2-core-2.46.0:2
24         app-crypt/libsecret[crypt]
25         app-misc/ca-certificates
26         dev-libs/expat
27         dev-libs/glib:2
28         dev-libs/nspr
29         dev-libs/nss
30         media-libs/alsa-lib
31         media-libs/libglvnd
32         media-libs/mesa
33         net-misc/curl
34         sys-apps/dbus
35         sys-libs/zlib
36         sys-process/lsof
37         x11-libs/cairo
38         x11-libs/gtk+:3
39         x11-libs/libdrm
40         x11-libs/libX11
41         x11-libs/libxcb
42         x11-libs/libXcomposite
43         x11-libs/libXdamage
44         x11-libs/libXext
45         x11-libs/libXfixes
46         x11-libs/libxkbcommon
47         x11-libs/libxkbfile
48         x11-libs/libXrandr
49         x11-libs/libXScrnSaver
50         x11-libs/pango
51         x11-misc/xdg-utils
52         kerberos? ( app-crypt/mit-krb5 )
55 QA_PREBUILT="*"
57 src_unpack() {
58         cp "${DISTDIR}/${APPIMAGE}" "${S}" || die
59         chmod +x "${S}/${APPIMAGE}" || die
60         "${S}/${APPIMAGE}" --appimage-extract || die
63 src_install() {
64         cd "${S}/squashfs-root" || die
66         insinto /usr/share
67         doins -r ./usr/share/icons
69         local EXEC_EXTRA_FLAGS=()
70         if use wayland; then
71                 EXEC_EXTRA_FLAGS+=( "--ozone-platform-hint=auto" "--enable-wayland-ime" )
72         fi
73         if use egl; then
74                 EXEC_EXTRA_FLAGS+=( "--use-gl=egl" )
75         fi
77         sed -e "s|^Exec=.*|Exec=cursor ${EXEC_EXTRA_FLAGS[*]} %U|" \
78                 cursor.desktop \
79                 > "${T}/cursor.desktop" || die
81         rm -f -r \
82                 AppRun \
83                 cursor.desktop \
84                 cursor.png \
85                 .DirIcon \
86                 LICENSE.electron.txt \
87                 LICENSES.chromium.html \
88                 resources/app/ThirdPartyNotices.txt \
89                 usr || die
91         insinto "/opt/${PN}"
92         doins -r .
94         fperms 4711 "/opt/${PN}/chrome-sandbox"
95         fperms +x "/opt/${PN}/chrome_crashpad_handler"
96         fperms +x "/opt/${PN}/cursor"
97         pax-mark m "/opt/${PN}/cursor"
99         dosym -r "/opt/${PN}/cursor" "/usr/bin/cursor"
100         domenu "${T}/cursor.desktop"
103 pkg_postinst() {
104         xdg_pkg_postinst
105         optfeature "desktop notifications" x11-libs/libnotify
106         optfeature "keyring support inside cursor" "virtual/secret-service"