111 lines
2.5 KiB
Bash
111 lines
2.5 KiB
Bash
# Copyright 1999-2026 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
EAPI=8
|
|
|
|
inherit desktop xdg-utils
|
|
|
|
MY_PV="$(ver_cut 1)$(ver_cut 2)"
|
|
IDA_RUN_X64="ida-free-pc_${MY_PV}_x64linux.run"
|
|
IDA_RUN_ARM64="ida-free-pc_${MY_PV}_armlinux.run"
|
|
IDAPIN="idapin${MY_PV}.zip"
|
|
|
|
DESCRIPTION="IDA Free is the free edition of the Interactive DisAssembler"
|
|
HOMEPAGE="https://hex-rays.com/ida-free"
|
|
SRC_URI="
|
|
amd64? ( ${IDA_RUN_X64} )
|
|
arm64? ( ${IDA_RUN_ARM64} )
|
|
idapin? ( ${IDAPIN} )
|
|
"
|
|
S="${WORKDIR}/${P}"
|
|
|
|
LICENSE="IDA-EULA"
|
|
SLOT="0"
|
|
KEYWORDS="-* ~amd64 ~arm64"
|
|
IUSE="idapin"
|
|
|
|
RESTRICT="bindist fetch mirror strip"
|
|
|
|
BDEPEND="idapin? ( app-arch/unzip )"
|
|
RDEPEND="
|
|
dev-libs/glib:2
|
|
media-libs/fontconfig
|
|
media-libs/freetype
|
|
media-libs/libglvnd
|
|
sys-apps/dbus
|
|
x11-libs/libX11
|
|
x11-libs/libxcb
|
|
x11-libs/libxkbcommon
|
|
|| (
|
|
sys-apps/systemd
|
|
sys-apps/systemd-utils
|
|
)
|
|
"
|
|
|
|
src_unpack() {
|
|
local ida_run
|
|
|
|
case ${ARCH} in
|
|
amd64) ida_run=${IDA_RUN_X64} ;;
|
|
arm64) ida_run=${IDA_RUN_ARM64} ;;
|
|
*) die "unsupported arch: ${ARCH}" ;;
|
|
esac
|
|
|
|
mkdir -p "${S}" "${T}/home" "${T}/bin" || die
|
|
cp "${DISTDIR}/${ida_run}" "${T}/idafree.run" || die
|
|
chmod +x "${T}/idafree.run" || die
|
|
ln -s /bin/false "${T}/bin/rpm" || die
|
|
|
|
PATH="${T}/bin:${PATH}" HOME="${T}/home" XDG_DATA_HOME="${T}/home/xdg" \
|
|
"${T}/idafree.run" --mode unattended --unattendedmodeui none --prefix "${S}" || die
|
|
|
|
if use idapin; then
|
|
unzip -q "${DISTDIR}/${IDAPIN}" -d "${WORKDIR}/idapin" || die
|
|
fi
|
|
}
|
|
|
|
src_prepare() {
|
|
default
|
|
rm -f "${S}"/Uninstall* "${S}"/uninstall* || die
|
|
rm -f "${S}"/plugins/platforms/libqeglfs.so || die
|
|
}
|
|
|
|
src_install() {
|
|
local ida_dir="/opt/HexRays/IDAFree"
|
|
|
|
insinto "${ida_dir}"
|
|
doins -r "${S}"/.
|
|
fperms +x "${ida_dir}/ida" "${ida_dir}/picture_decoder"
|
|
|
|
if use idapin; then
|
|
insinto "${ida_dir}/idapin"
|
|
doins -r "${WORKDIR}/idapin/idapin"/.
|
|
fi
|
|
|
|
newicon "${S}"/appico.png ${PN}.png
|
|
|
|
dosym ../HexRays/IDAFree/ida /opt/bin/idafree
|
|
use amd64 && dosym ../HexRays/IDAFree/ida /opt/bin/idafree64
|
|
|
|
make_desktop_entry /opt/bin/idafree "IDA Free" ${PN} "Development;Debugger"
|
|
}
|
|
|
|
pkg_nofetch() {
|
|
einfo "Please download the IDA Free 9.3 SP2 Linux installer from:"
|
|
einfo " https://hex-rays.com/ida-free"
|
|
einfo
|
|
use amd64 && einfo "Place ${IDA_RUN_X64} in your distfiles directory."
|
|
use arm64 && einfo "Place ${IDA_RUN_ARM64} in your distfiles directory."
|
|
use idapin && einfo "Place ${IDAPIN} in your distfiles directory."
|
|
}
|
|
|
|
pkg_postinst() {
|
|
xdg_desktop_database_update
|
|
xdg_mimeinfo_database_update
|
|
}
|
|
|
|
pkg_postrm() {
|
|
xdg_desktop_database_update
|
|
xdg_mimeinfo_database_update
|
|
}
|