app-editors/cursor: name changed and some optimizations

Signed-off-by: Leo Douglas <douglarek@gmail.com>
This commit is contained in:
Leo Douglas 2024-11-08 17:12:05 +08:00 committed by peeweep
parent 26ac060a78
commit e0f2ddb840
7 changed files with 121 additions and 73 deletions

View File

@ -95,7 +95,7 @@ github = "AppFlowy-IO/AppFlowy"
use_latest_release = true
github_account = "Linerre"
["app-editors/cursor-bin"]
["app-editors/cursor"]
source = "regex"
url = "https://download.todesktop.com/230313mzl4w4u92/latest-linux.yml"
regex = 'version:\s*(.*)'

View File

@ -1 +0,0 @@
DIST cursor-bin-0.42.4-x86_64.AppImage 162787450 BLAKE2B 731ccc8bc82b31e469b7a8e68f6d68c40a0e84047bc2e4ce874bdbea0e6ee5cc1bb76db126dd1241437b75e352aa7fe212d305c385a2d7dcb580ecfb7f751c33 SHA512 03c20afe2da993fb98ca5cba35cdacedbe193a730a2c38f9037c280238babaa5b91144c7bbcc85af98b8ca6ff5888cbfb6e6ac016b5604c8946fd7182fb10da0

View File

@ -1,63 +0,0 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
APPIMAGE="${P}-x86_64.AppImage"
inherit desktop xdg
DESCRIPTION="Cursor App - AI-first coding environment"
HOMEPAGE="https://www.cursor.com/"
SRC_URI="https://download.todesktop.com/230313mzl4w4u92/cursor-0.42.4-build-2410291z3bdg1dy-x86_64.AppImage -> ${APPIMAGE}"
LICENSE="cursor"
SLOT="0"
KEYWORDS="-* amd64"
RESTRICT="strip mirror bindist"
RDEPEND="sys-fs/fuse"
DEPEND="${RDEPEND}"
QA_PREBUILT="*"
src_unpack() {
mkdir -p "${S}" || die
cp "${DISTDIR}/${APPIMAGE}" "${S}" || die
cd "${S}" || die
chmod +x "${S}/${APPIMAGE}" || die
"${S}/${APPIMAGE}" --appimage-extract || die
}
src_install() {
cd "${S}/squashfs-root" || die
insinto /usr/share
doins -r ./usr/share/icons
local toremove=(
.DirIcon
cursor.desktop
cursor.png
AppRun
LICENSE.electron.txt
LICENSES.chromium.html
usr
)
rm -f -r "${toremove[@]}" || die
local apphome="/opt/${PN}"
insinto "${apphome}"
doins -r .
# Here, press +x as needed.
fperms +x "${apphome}/cursor"
fperms +x "${apphome}/chrome_crashpad_handler"
dosym -r "${apphome}/cursor" "/usr/bin/${PN}"
make_desktop_entry "${PN} --no-sandbox %U" Cursor cursor "Utility;" \
"X-AppImage-Version=${PV}\nMimeType=x-scheme-handler/cursor;"
}

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>douglarek@gmail.com</email>
<name>Leo Douglas</name>
</maintainer>
</pkgmetadata>

View File

@ -0,0 +1 @@
DIST cursor-0.42.4_x86_64.AppImage 162787450 BLAKE2B 731ccc8bc82b31e469b7a8e68f6d68c40a0e84047bc2e4ce874bdbea0e6ee5cc1bb76db126dd1241437b75e352aa7fe212d305c385a2d7dcb580ecfb7f751c33 SHA512 03c20afe2da993fb98ca5cba35cdacedbe193a730a2c38f9037c280238babaa5b91144c7bbcc85af98b8ca6ff5888cbfb6e6ac016b5604c8946fd7182fb10da0

View File

@ -0,0 +1,107 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
APPIMAGE="${P}_x86_64.AppImage"
inherit desktop pax-utils xdg optfeature
DESCRIPTION="Cursor App - AI-first coding environment"
HOMEPAGE="https://www.cursor.com/"
SRC_URI="https://download.todesktop.com/230313mzl4w4u92/${P}-build-2410291z3bdg1dy-x86_64.AppImage -> ${APPIMAGE}"
S="${WORKDIR}"
LICENSE="cursor"
SLOT="0"
KEYWORDS="-* amd64"
IUSE="egl kerberos wayland"
RESTRICT="bindist mirror strip"
RDEPEND="
>=app-accessibility/at-spi2-core-2.46.0:2
app-crypt/libsecret[crypt]
app-misc/ca-certificates
dev-libs/expat
dev-libs/glib:2
dev-libs/nspr
dev-libs/nss
media-libs/alsa-lib
media-libs/libglvnd
media-libs/mesa
net-misc/curl
sys-apps/dbus
sys-libs/zlib
sys-process/lsof
x11-libs/cairo
x11-libs/gtk+:3
x11-libs/libdrm
x11-libs/libX11
x11-libs/libxcb
x11-libs/libXcomposite
x11-libs/libXdamage
x11-libs/libXext
x11-libs/libXfixes
x11-libs/libxkbcommon
x11-libs/libxkbfile
x11-libs/libXrandr
x11-libs/libXScrnSaver
x11-libs/pango
x11-misc/xdg-utils
kerberos? ( app-crypt/mit-krb5 )
"
QA_PREBUILT="*"
src_unpack() {
cp "${DISTDIR}/${APPIMAGE}" "${S}" || die
chmod +x "${S}/${APPIMAGE}" || die
"${S}/${APPIMAGE}" --appimage-extract || die
}
src_install() {
cd "${S}/squashfs-root" || die
insinto /usr/share
doins -r ./usr/share/icons
local EXEC_EXTRA_FLAGS=()
if use wayland; then
EXEC_EXTRA_FLAGS+=( "--ozone-platform-hint=auto" "--enable-wayland-ime" )
fi
if use egl; then
EXEC_EXTRA_FLAGS+=( "--use-gl=egl" )
fi
sed -e "s|^Exec=.*|Exec=cursor ${EXEC_EXTRA_FLAGS[*]} %U|" \
cursor.desktop \
> "${T}/cursor.desktop" || die
rm -f -r \
AppRun \
cursor.desktop \
cursor.png \
.DirIcon \
LICENSE.electron.txt \
LICENSES.chromium.html \
resources/app/ThirdPartyNotices.txt \
usr || die
insinto "/opt/${PN}"
doins -r .
fperms 4711 "/opt/${PN}/chrome-sandbox"
fperms +x "/opt/${PN}/chrome_crashpad_handler"
pax-mark m "/opt/${PN}/cursor"
fperms +x "/opt/${PN}/cursor"
dosym -r "/opt/${PN}/cursor" "/usr/bin/cursor"
domenu "${T}/cursor.desktop"
}
pkg_postinst() {
xdg_pkg_postinst
optfeature "desktop notifications" x11-libs/libnotify
optfeature "keyring support inside cursor" "virtual/secret-service"
}

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>douglarek@gmail.com</email>
<name>Leo Douglas</name>
</maintainer>
<use>
<flag name="egl">Use EGL platform, enables smooth rending in high refresh rate monitors on X11/Xwayland</flag>
<flag name="wayland">Run in wayland mode under wayland sessions, xwayland otherwise. This flag doesn't affect x11 sessions.</flag>
</use>
</pkgmetadata>