101 lines
2.1 KiB
Bash
101 lines
2.1 KiB
Bash
# Copyright 1999-2022 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
EAPI=8
|
|
|
|
inherit unpacker xdg
|
|
|
|
DESCRIPTION="Your entire server infrastructure at your fingertips"
|
|
HOMEPAGE="https://xpipe.io/"
|
|
SRC_URI="https://github.com/${PN}-io/${PN}/releases/download/${PV}/${PN}-installer-linux-x86_64.deb -> ${PN}-installer-linux-${PV}-x86_64.deb"
|
|
S="${WORKDIR}"
|
|
|
|
LICENSE="Apache-2.0"
|
|
SLOT="0"
|
|
KEYWORDS="-* ~amd64"
|
|
REQUIRED_USE="elibc_glibc"
|
|
RESTRICT="bindist mirror splitdebug strip test"
|
|
|
|
QA_PREBUILT="*"
|
|
|
|
BDEPEND="dev-util/patchelf"
|
|
|
|
RDEPEND="
|
|
>=app-accessibility/at-spi2-core-2.46.0:2
|
|
dev-libs/glib:2
|
|
media-libs/alsa-lib
|
|
media-libs/fontconfig
|
|
media-libs/freetype
|
|
media-libs/libglvnd
|
|
media-video/ffmpeg-compat
|
|
elibc_glibc? ( sys-libs/glibc )
|
|
virtual/zlib
|
|
x11-libs/cairo
|
|
x11-libs/gdk-pixbuf:2
|
|
x11-libs/gtk+:3
|
|
x11-libs/libX11
|
|
x11-libs/libXext
|
|
x11-libs/libXi
|
|
x11-libs/libXrender
|
|
x11-libs/libXtst
|
|
x11-libs/libXxf86vm
|
|
x11-libs/pango
|
|
"
|
|
|
|
src_install() {
|
|
cp -a opt usr "${ED}"/ || die
|
|
|
|
local runtime_libdir="${ED}/opt/xpipe/lib/runtime/lib"
|
|
local -a lib_search_dirs=(
|
|
"${EPREFIX}/usr/lib64"
|
|
"${EPREFIX}/usr/lib"
|
|
)
|
|
local dir plugin soname soname_dir rpath keep
|
|
|
|
for dir in "${EPREFIX}"/usr/lib/ffmpeg*/lib64 "${EPREFIX}"/usr/lib/ffmpeg*/lib; do
|
|
[[ -d ${dir} ]] && lib_search_dirs+=( "${dir}" )
|
|
done
|
|
|
|
for plugin in "${runtime_libdir}"/libavplugin*.so; do
|
|
keep=1
|
|
rpath="\$ORIGIN"
|
|
|
|
while read -r soname; do
|
|
soname_dir=
|
|
for dir in "${lib_search_dirs[@]}"; do
|
|
if [[ -e ${dir}/${soname} ]]; then
|
|
soname_dir=${dir}
|
|
break
|
|
fi
|
|
done
|
|
|
|
if [[ -z ${soname_dir} ]]; then
|
|
keep=0
|
|
break
|
|
fi
|
|
|
|
[[ :${rpath}: == *:${soname_dir}:* ]] || rpath+=":${soname_dir}"
|
|
done < <(readelf -d "${plugin}" | sed -n 's/.*Shared library: \[\(libav.*\.so[^]]*\)\].*/\1/p')
|
|
|
|
if [[ ${keep} == 1 ]]; then
|
|
patchelf --set-rpath "${rpath}" "${plugin}" || die
|
|
else
|
|
rm "${plugin}" || die
|
|
fi
|
|
done
|
|
|
|
dosym ../../opt/xpipe/bin/xpipe usr/bin/xpipe
|
|
}
|
|
|
|
pkg_preinst() {
|
|
xdg_pkg_preinst
|
|
}
|
|
|
|
pkg_postinst() {
|
|
xdg_pkg_postinst
|
|
}
|
|
|
|
pkg_postrm() {
|
|
xdg_pkg_postrm
|
|
}
|