Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Part 2 - Keep addon introduced private shared libraries private to the addon #8385

Merged
merged 7 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions packages/addons/service/boblightd/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,20 @@ makeinstall_target() {
}

addon() {
mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/lib
cp -P ${PKG_BUILD}/.${TARGET_NAME}/src/.libs/libboblight.so* ${ADDON_BUILD}/${PKG_ADDON_ID}/lib
mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/lib.private
cp -P ${PKG_BUILD}/.${TARGET_NAME}/src/.libs/libboblight.so* ${ADDON_BUILD}/${PKG_ADDON_ID}/lib.private

mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/bin
cp -P ${PKG_BUILD}/.${TARGET_NAME}/src/boblightd ${ADDON_BUILD}/${PKG_ADDON_ID}/bin
cp -P ${PKG_BUILD}/.${TARGET_NAME}/src/boblight-constant ${ADDON_BUILD}/${PKG_ADDON_ID}/bin
if [ "${DISPLAYSERVER}" = "x11" ]; then
cp -P ${PKG_BUILD}/.${TARGET_NAME}/src/boblight-X11 ${ADDON_BUILD}/${PKG_ADDON_ID}/bin
fi
cp -P ${PKG_BUILD}/.${TARGET_NAME}/src/boblightd ${ADDON_BUILD}/${PKG_ADDON_ID}/bin
cp -P ${PKG_BUILD}/.${TARGET_NAME}/src/boblight-constant ${ADDON_BUILD}/${PKG_ADDON_ID}/bin
if [ "${DISPLAYSERVER}" = "x11" ]; then
cp -P ${PKG_BUILD}/.${TARGET_NAME}/src/boblight-X11 ${ADDON_BUILD}/${PKG_ADDON_ID}/bin
fi
patchelf --add-rpath '$ORIGIN/../lib.private' ${ADDON_BUILD}/${PKG_ADDON_ID}/bin/boblight-*

mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/config
cp -R ${PKG_DIR}/config/boblight.conf ${ADDON_BUILD}/${PKG_ADDON_ID}/config
if [ "${DISPLAYSERVER}" = "x11" ]; then
cp -R ${PKG_DIR}/config/boblight.X11.sample ${ADDON_BUILD}/${PKG_ADDON_ID}/config
fi
cp -R ${PKG_DIR}/config/boblight.conf ${ADDON_BUILD}/${PKG_ADDON_ID}/config
if [ "${DISPLAYSERVER}" = "x11" ]; then
cp -R ${PKG_DIR}/config/boblight.X11.sample ${ADDON_BUILD}/${PKG_ADDON_ID}/config
fi
}
4 changes: 3 additions & 1 deletion packages/addons/service/lcdd/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ addon() {

cp -PR ${PKG_INSTALL}/etc/LCDd.conf ${ADDON_BUILD}/${PKG_ADDON_ID}/config/
cp -PR ${PKG_INSTALL}/usr/lib ${ADDON_BUILD}/${PKG_ADDON_ID}/lib/
patchelf --add-rpath '$ORIGIN/../../lib.private' ${ADDON_BUILD}/${PKG_ADDON_ID}/lib/lcdproc/glcd.so
cp -PR ${PKG_INSTALL}/usr/sbin ${ADDON_BUILD}/${PKG_ADDON_ID}/bin/

cp -L $(get_install_dir serdisplib)/usr/lib/libserdisp.so.2 ${ADDON_BUILD}/${PKG_ADDON_ID}/lib/
mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/lib.private
cp -L $(get_install_dir serdisplib)/usr/lib/libserdisp.so.2 ${ADDON_BUILD}/${PKG_ADDON_ID}/lib.private

sed -e "s|^DriverPath=.*$|DriverPath=/storage/.kodi/addons/service.lcdd/lib/lcdproc/|" \
-e "s|^#Foreground=.*$|Foreground=no|" \
Expand Down
7 changes: 4 additions & 3 deletions packages/addons/service/minidlna/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ pre_configure_target() {

addon() {
mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/bin
cp -P ${PKG_INSTALL}/usr/sbin/minidlnad ${ADDON_BUILD}/${PKG_ADDON_ID}/bin
cp -P ${PKG_INSTALL}/usr/sbin/minidlnad ${ADDON_BUILD}/${PKG_ADDON_ID}/bin
patchelf --add-rpath '$ORIGIN/../lib.private' ${ADDON_BUILD}/${PKG_ADDON_ID}/bin/minidlnad

mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/lib
cp -p $(get_install_dir libexif)/usr/lib/libexif.so.12 ${ADDON_BUILD}/${PKG_ADDON_ID}/lib
mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/lib.private
cp -p $(get_install_dir libexif)/usr/lib/libexif.so.12 ${ADDON_BUILD}/${PKG_ADDON_ID}/lib.private
}
4 changes: 2 additions & 2 deletions packages/addons/service/tigervnc/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ makeinstall_target() {
# find ${1}.so.[0-9]* in ${2} and copy it to dest
_pkg_copy_lib() {
find "${2}/usr/lib" -regextype sed -regex ".*/${1}\.so\.[0-9]*" \
-exec cp {} "${ADDON_BUILD}/${PKG_ADDON_ID}/lib" \;
-exec cp {} "${ADDON_BUILD}/${PKG_ADDON_ID}/lib.private" \;
}

addon() {
mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/{bin,lib}
mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/{bin,lib.private}

cp ${PKG_BUILD}/.${TARGET_NAME}/unix/vncconfig/vncconfig \
${PKG_BUILD}/.${TARGET_NAME}/unix/vncpasswd/vncpasswd \
Expand Down
2 changes: 2 additions & 0 deletions packages/addons/service/tigervnc/source/bin/tigervnc.start
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ then
cp "$ADDON_DIR/config/passwd" "$ADDON_HOME/passwd"
fi

LD_LIBRARY_PATH=$ADDON_DIR/lib.private:$LD_LIBRARY_PATH

x0vncserver -PasswordFile="$ADDON_HOME/passwd" -rfbport="$vnc_port"
6 changes: 4 additions & 2 deletions packages/addons/service/tvheadend42/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ post_makeinstall_target() {
}

addon() {
mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/{bin,lib}
mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/bin

cp ${PKG_DIR}/addon.xml ${ADDON_BUILD}/${PKG_ADDON_ID}

Expand All @@ -124,7 +124,9 @@ addon() {
cp -P $(get_install_dir comskip)/usr/bin/comskip ${ADDON_BUILD}/${PKG_ADDON_ID}/bin

if [ "${TARGET_ARCH}" = "x86_64" ]; then
cp -P $(get_install_dir x265)/usr/lib/libx265.so.199 ${ADDON_BUILD}/${PKG_ADDON_ID}/lib
mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/lib.private
cp -P $(get_install_dir x265)/usr/lib/libx265.so.199 ${ADDON_BUILD}/${PKG_ADDON_ID}/lib.private
patchelf --add-rpath '$ORIGIN/../lib.private' ${ADDON_BUILD}/${PKG_ADDON_ID}/bin/{comskip,tvheadend}
fi

# dvb-scan files
Expand Down
5 changes: 3 additions & 2 deletions packages/addons/service/vdr-addon/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ PKG_ADDON_REQUIRES="pvr.vdr.vnsi:0.0.0 script.config.vdr:0.0.0"

addon() {
# create dirs
mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/{bin,lib,plugin,locale}
mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/{bin,lib.private,plugin,locale}
mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/config/epgsources
mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/config/plugins/{eepg,epgfixer,epgsearch,streamdev-server,vnsiserver}
mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/res/plugins/{live,restfulapi}
Expand Down Expand Up @@ -53,6 +53,7 @@ addon() {
vnsiserver wirbelscan wirbelscancontrol xmltv2vdr; do
cp -PR $(get_build_dir vdr-plugin-${pkg})/libvdr*.so.* ${ADDON_BUILD}/${PKG_ADDON_ID}/plugin
done
patchelf --add-rpath '$ORIGIN/../lib.private' ${ADDON_BUILD}/${PKG_ADDON_ID}/plugin/libvdr-live.so.*

# copy locale (omit ddci, dummydevice, robotv)
for pkg in dvbapi eepg epgfixer epgsearch iptv live restfulapi satip vnsiserver wirbelscan \
Expand All @@ -67,7 +68,7 @@ addon() {
$(get_build_dir vdr-plugin-streamdev)/server/locale/* \
${ADDON_BUILD}/${PKG_ADDON_ID}/locale

cp -PL $(get_install_dir tntnet)/usr/lib/libtntnet.so.13 ${ADDON_BUILD}/${PKG_ADDON_ID}/lib
cp -PL $(get_install_dir tntnet)/usr/lib/libtntnet.so.13 ${ADDON_BUILD}/${PKG_ADDON_ID}/lib.private

cp -P $(get_build_dir vdr)/vdr ${ADDON_BUILD}/${PKG_ADDON_ID}/bin/vdr.bin
cp -PR $(get_build_dir vdr)/locale/* ${ADDON_BUILD}/${PKG_ADDON_ID}/locale
Expand Down
5 changes: 3 additions & 2 deletions packages/addons/tools/flirc_util/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ make_target() {
}

addon() {
mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/{bin,lib}
mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/{bin,lib.private}
cp -P ${PKG_BUILD}/build/flirc_util ${ADDON_BUILD}/${PKG_ADDON_ID}/bin/
cp -P $(get_install_dir hidapi)/usr/lib/libhidapi-hidraw.so* ${ADDON_BUILD}/${PKG_ADDON_ID}/lib
patchelf --add-rpath '$ORIGIN/../lib.private' ${ADDON_BUILD}/${PKG_ADDON_ID}/bin/flirc_util
cp -P $(get_install_dir hidapi)/usr/lib/libhidapi-hidraw.so* ${ADDON_BUILD}/${PKG_ADDON_ID}/lib.private
}