blob: e58a23a10aab44408e31cde283607ed9fece9eae (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit desktop xdg
DESCRIPTION="Arduino IDE 2.x - A modern open-source IDE for Arduino development"
HOMEPAGE="https://www.arduino.cc/en/software https://github.com/arduino/arduino-ide"
SRC_URI="https://github.com/arduino/arduino-ide/releases/download/${PV}/arduino-ide_${PV}_Linux_64bit.zip"
S="${WORKDIR}"
LICENSE="AGPL-3"
SLOT="0"
KEYWORDS="-* ~amd64"
IUSE="egl wayland"
RESTRICT="mirror strip bindist"
RDEPEND="
|| (
sys-apps/systemd
sys-apps/systemd-utils
)
>=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
net-print/cups
sys-apps/dbus
virtual/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
"
BDEPEND="app-arch/unzip"
QA_PREBUILT="*"
src_install() {
# Install application files
mkdir -p "${ED}/opt/${PN}" || die
cp -r "${S}/arduino-ide_${PV}_Linux_64bit/"* "${ED}/opt/${PN}" || die
# Drop cortex-debug precompiled native modules: cross-arch arm/arm64
# variants never run on amd64, and the x64 variant links against
# libnode.so.72 which Electron does not ship. Cortex-debug falls back
# to non-native GDB driving when the modules are absent.
rm -rf "${ED}/opt/${PN}/resources/app/plugins/cortex-debug/extension/binary_modules" || die
# Fix chrome-sandbox permissions
fperms 4755 /opt/${PN}/chrome-sandbox
# Create symlink for the main executable
dosym ../../opt/${PN}/arduino-ide /usr/bin/arduino-ide
# Build exec flags based on USE flags
local EXEC_EXTRA_FLAGS=()
if use wayland; then
EXEC_EXTRA_FLAGS+=( "--ozone-platform-hint=auto" "--enable-wayland-ime" "--wayland-text-input-version=3" )
fi
if use egl; then
EXEC_EXTRA_FLAGS+=( "--use-gl=egl" )
fi
# Install desktop file with proper exec flags
sed "s|@exec_extra_flags@|${EXEC_EXTRA_FLAGS[*]}|g" \
"${FILESDIR}/${PN}.desktop" \
> "${T}/${PN}.desktop" || die
domenu "${T}/${PN}.desktop"
# Install icon
newicon "${ED}/opt/${PN}/resources/app/resources/icons/512x512.png" "${PN}.png"
}
pkg_postinst() {
xdg_pkg_postinst
elog "Arduino IDE 2.x has been installed to /opt/${PN}"
elog "You can start it by running 'arduino-ide' from the command line"
elog "or by selecting it from your application menu."
elog ""
elog "Note: Arduino IDE 2.x is a completely new application based on"
elog "Eclipse Theia, and can coexist with the classic Arduino IDE 1.x."
}
|