linamh/sci-electronics/saleae-logic-bin/saleae-logic-bin-2.3.55.ebuild
2022-11-19 21:49:12 +01:00

93 lines
2.8 KiB
Bash

# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
MULTILIB_COMPAT=( abi_x86_64 )
inherit appimage chromium-2 desktop pax-utils multilib-build xdg udev
DESCRIPTION="Debug hardware like the pros."
HOMEPAGE="https://www.saleae.com/"
SRC_URI="
amd64? ( https://downloads.saleae.com/logic2/Logic-${PV}-master.AppImage )
"
LICENSE="Salea-EULA"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""
RESTRICT="bindist mirror splitdebug strip"
RDEPEND="
app-accessibility/at-spi2-atk[${MULTILIB_USEDEP}]
app-accessibility/at-spi2-core[${MULTILIB_USEDEP}]
dev-libs/atk[${MULTILIB_USEDEP}]
dev-libs/expat[${MULTILIB_USEDEP}]
dev-libs/glib[${MULTILIB_USEDEP}]
dev-libs/nspr[${MULTILIB_USEDEP}]
dev-libs/nss[${MULTILIB_USEDEP}]
x11-libs/cairo[${MULTILIB_USEDEP}]
x11-libs/gdk-pixbuf[${MULTILIB_USEDEP}]
x11-libs/pango[${MULTILIB_USEDEP}]
net-print/cups[${MULTILIB_USEDEP}]
|| ( sys-devel/base-gcc[cxx] sys-devel/gcc[cxx] )
sys-apps/dbus[${MULTILIB_USEDEP}]
x11-libs/gtk+[${MULTILIB_USEDEP}]
x11-libs/libX11[${MULTILIB_USEDEP}]
x11-libs/libXcomposite[${MULTILIB_USEDEP}]
x11-libs/libXcursor[${MULTILIB_USEDEP}]
x11-libs/libXdamage[${MULTILIB_USEDEP}]
x11-libs/libXext[${MULTILIB_USEDEP}]
x11-libs/libXfixes[${MULTILIB_USEDEP}]
x11-libs/libXi[${MULTILIB_USEDEP}]
x11-libs/libXrandr[${MULTILIB_USEDEP}]
x11-libs/libXrender[${MULTILIB_USEDEP}]
x11-libs/libXtst[${MULTILIB_USEDEP}]
media-libs/alsa-lib[${MULTILIB_USEDEP}]
sys-libs/glibc[${MULTILIB_USEDEP}]
x11-libs/libXScrnSaver[${MULTILIB_USEDEP}]
x11-libs/libxcb[${MULTILIB_USEDEP}]
"
S="${WORKDIR}"
QA_PREBUILT="opt/Saleae/${PN}/Logic opt/Saleae/${PN}/libffmpeg.so opt/Saleae/${PN}/libnode.so"
MY_PN=Logic
pkg_setup() {
chromium_suid_sandbox_check_kernel_config
}
src_prepare() {
rm -r ${P}/usr/lib
sed -i 's/^Exec=AppRun/Exec=${MY_PN}/' "${P}/Logic.desktop" \
|| die "Failed to patch desktop file"
default_src_prepare
}
src_install() {
cp -a ${P}/usr "${ED}"
rm -f ${P}/.DirIcon
dodir /opt/Saleae/Logic
find ${P} -type d -exec chmod 755 {} \;
find ${P} -type f -exec chmod 644 {} \;
find ${P} -type f -name "*.so*" -print0 |xargs -0 chmod +x
find ${P}/resources/linux/pythonlibs/bin -type f -print0 |xargs -0 chmod +x
find ${P}/resources/app.asar.unpacked/node_modules/@saleae/graph-interface/bin -type f -print0 |xargs -0 chmod +x
chmod +x ${P}/Logic
cp -a ${P}/* "${ED}"/opt/Saleae/Logic || die "Failed to move directory"
# remove chrome-sandbox binary, users should use kernel namespaces
# https://bugs.gentoo.org/692692#c18
rm "${ED}"/opt/Saleae/Logic/chrome-sandbox || die
dosym ../../opt/Saleae/Logic/Logic /usr/bin/Logic
domenu "${ED}"/opt/Saleae/Logic/Logic.desktop
doicon "${ED}"/opt/Saleae/Logic/Logic.png
dodir /etc/udev/rules.d
cat "${ED}"/opt/Saleae/Logic/resources/linux/99-SaleaeLogic.rules > "${ED}"/etc/udev/rules.d/99-SaleaeLogic.rules
udev_reload
}