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

100 lines
3.0 KiB
Bash
Raw Permalink Normal View History

2022-11-24 21:26:54 +01:00
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
2023-07-20 20:28:34 +02:00
EAPI=8
2022-11-24 21:26:54 +01:00
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="
2023-12-25 09:20:55 +01:00
amd64? ( https://downloads.saleae.com/logic2/Logic-${PV}-linux-x64.AppImage )
2022-11-24 21:26:54 +01:00
"
LICENSE="Salea-EULA"
SLOT="0"
2023-12-25 09:20:55 +01:00
KEYWORDS="~amd64"
2022-11-24 21:26:54 +01:00
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() {
2023-12-25 10:28:25 +01:00
sed -i "/^Exec=/cExec=${MY_PN}" "${P}/Logic.desktop" \
|| die "Failed to patch desktop file"
2023-01-10 14:59:32 +01:00
sed -i "/^X-AppImage/d" "${P}/Logic.desktop" \
|| die "Failed to patch desktop file"
sed -i "s/^X-AppImage-Version=/Version=/" "${P}/Logic.desktop" \
|| die "Failed to patch desktop file"
2022-11-24 21:26:54 +01:00
default_src_prepare
}
src_install() {
2023-12-25 10:28:25 +01:00
dodir /opt/Saleae
2023-05-26 12:27:54 +02:00
mv ${P}/usr "${ED}"
2023-12-25 10:28:25 +01:00
mv "${P}" "${ED}/opt/Saleae/${MY_PN}"
mkdir -p "${ED}/usr/share/applications"
mv "${ED}/opt/Saleae/Logic/Logic.desktop" "${ED}/usr/share/applications/${MY_PN}.desktop"
rm "${ED}/opt/Saleae/${MY_PN}/Logic.png"
rm "${ED}/opt/Saleae/${MY_PN}/.DirIcon"
rm "${ED}/opt/Saleae/${MY_PN}/AppRun"
rm "${ED}/opt/Saleae/${MY_PN}/version"
rm -rf "${ED}/usr/lib/"
2022-11-24 21:26:54 +01:00
dodir /etc/udev/rules.d
2023-12-25 10:28:25 +01:00
install -Dm644 "${ED}/opt/Saleae/${MY_PN}/resources/linux-x64/99-SaleaeLogic.rules" "${ED}/etc/udev/rules.d/99-SaleaeLogic.rules"
# Fix permissions (example: 700->755, 640->644)
find "${ED}/opt/Saleae/${MY_PN}" -perm "/111" -exec chmod 755 \{\} \;
find "${ED}/opt/Saleae/${MY_PN}" ! -perm "/111" -exec chmod 644 \{\} \;
chmod 4755 "${ED}/opt/Saleae/${MY_PN}/chrome-sandbox"
mkdir -p "${ED}/usr/bin/"
ln -s "/opt/Saleae/${MY_PN}/Logic" "${ED}/usr/bin/${MY_PN}"
2022-11-24 21:26:54 +01:00
udev_reload
2023-12-25 10:28:25 +01:00
2022-11-24 21:26:54 +01:00
}