linamh/sci-electronics/saleae-logic-bin/saleae-logic-bin-2.3.47.ebuild

93 lines
2.9 KiB
Bash
Raw Normal View History

2021-06-30 18:45:43 +02:00
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
2021-07-01 13:56:41 +02:00
MULTILIB_COMPAT=( abi_x86_64 )
2022-03-20 18:42:52 +01:00
inherit appimage chromium-2 desktop pax-utils multilib-build xdg udev
2021-06-30 18:45:43 +02:00
DESCRIPTION="Debug hardware like the pros."
HOMEPAGE="https://www.saleae.com/"
SRC_URI="
amd64? ( https://downloads.saleae.com/logic2/Logic-${PV}-master.AppImage )
"
LICENSE="EULA"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""
2021-07-01 13:56:41 +02:00
RESTRICT="bindist mirror splitdebug strip"
2021-06-30 18:45:43 +02:00
RDEPEND="
2021-07-01 13:56:41 +02:00
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}]
2021-06-30 18:45:43 +02:00
"
S="${WORKDIR}"
QA_PREBUILT="opt/Saleae/${PN}/Logic opt/Saleae/${PN}/libffmpeg.so opt/Saleae/${PN}/libnode.so"
2021-07-01 13:56:41 +02:00
MY_PN=Logic
pkg_setup() {
chromium_suid_sandbox_check_kernel_config
}
2021-06-30 18:45:43 +02:00
src_prepare() {
rm -r ${P}/usr/lib
2021-07-01 13:56:41 +02:00
sed -i 's/^Exec=AppRun/Exec=${MY_PN}/' "${P}/Logic.desktop" \
2021-06-30 18:45:43 +02:00
|| die "Failed to patch desktop file"
default_src_prepare
}
src_install() {
2021-07-01 13:56:41 +02:00
cp -a ${P}/usr "${ED}"
2021-06-30 18:45:43 +02:00
rm -f ${P}/.DirIcon
dodir /opt/Saleae/Logic
2021-07-01 16:49:09 +02:00
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/linux-x64-76 -type f -print0 |xargs -0 chmod +x
chmod +x ${P}/Logic
2021-07-01 13:56:41 +02:00
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
2021-06-30 18:45:43 +02:00
2021-07-01 13:56:41 +02:00
dosym ../../opt/Saleae/Logic/Logic /usr/bin/Logic
domenu "${ED}"/opt/Saleae/Logic/Logic.desktop
doicon "${ED}"/opt/Saleae/Logic/Logic.png
2022-03-20 18:42:52 +01:00
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
2021-06-30 18:45:43 +02:00
}