Update RPM packaging for Conan.

As the previous code, this is pretty hacky.
This commit is contained in:
Julian Groß 2025-02-24 19:51:24 +01:00 committed by Edgar
parent 710a674d5d
commit 1be93973dd
No known key found for this signature in database
GPG key ID: 3C2E1F2C1C353131
2 changed files with 15 additions and 56 deletions

View file

@ -1,56 +1,31 @@
#!/bin/sh
# Copyright 2020-2021 Vircadia contributors.
# Copyright 2022-2024 Overte e.V.
# Copyright 2022-2025 Overte e.V.
# SPDX-License-Identifier: Apache-2.0
if [ "$OVERTE" = "" ]; then
OVERTE=`realpath ..`
fi
if [ "$OVERTE_USE_SYSTEM_QT" = "" ]; then
QT5_LIBS=`realpath ~/overte-files/qt/qt5-install/lib`
fi
# The regex below extracts the path from the VCPKG_INSTALL_ROOT variable. Said variable gets populated during the CMake step.
VCPKG_INSTALL_ROOT=`grep VCPKG_INSTALL_ROOT $OVERTE/build/vcpkg.cmake | perl -ne 'm/set\(VCPKG_INSTALL_ROOT\s+\"(.*?)\"/; print $1'`
# Remove minus character from version numbers, because rpmtool doesn't allow them.
VERSION=${RPMVERSION//-}
if [ "$OVERTE_USE_SYSTEM_QT" = "" ]; then
SOFILES=`ls \
$OVERTE/build/libraries/*/*.so \
$VCPKG_INSTALL_ROOT/lib/libnode.so* \
$OVERTE/qt5-install/lib/libQt5Network.so.*.*.* \
$OVERTE/qt5-install/lib/libQt5Core.so.*.*.* \
$OVERTE/qt5-install/lib/libQt5Widgets.so.*.*.* \
$OVERTE/qt5-install/lib/libQt5Gui.so.*.*.* \
$OVERTE/qt5-install/lib/libQt5WebSockets.so.*.*.* \
$OVERTE/qt5-install/lib/libQt5Qml.so.*.*.* \
$OVERTE/qt5-install/lib/libQt5Quick.so.*.*.* \
| sed 's/\./\\\./g' \
| paste -d'|' -s`
else
SOFILES=`ls \
$OVERTE/build/libraries/*/*.so \
$VCPKG_INSTALL_ROOT/lib/libnode.so* \
| sed 's/\./\\\./g' \
| paste -d'|' -s`
fi
# TODO: Handle Qt built by Conan
SOFILES=`ls \
$OVERTE/build/libraries/*/*.so \
$OVERTE/build/conanlibs/Release/libnode.so* \
| sed 's/\./\\\./g' \
| paste -d'|' -s`
if [ "$OVERTE_USE_SYSTEM_QT" = "" ]; then
DEPENDS=mesa-libGL,`ls \
$OVERTE/build/assignment-client/assignment-client \
$OVERTE/build/domain-server/domain-server \
$OVERTE/build/tools/oven/oven \
$OVERTE/build/libraries/*/*.so \
$VCPKG_INSTALL_ROOT/lib/libnode.so* \
$QT5_LIBS/libQt5Network.so.*.*.* \
$QT5_LIBS/libQt5Core.so.*.*.* \
$QT5_LIBS/libQt5Widgets.so.*.*.* \
$QT5_LIBS/libQt5Gui.so.*.*.* \
$QT5_LIBS/libQt5WebSockets.so.*.*.* \
$QT5_LIBS/libQt5Qml.so.*.*.* \
$QT5_LIBS/libQt5Quick.so.*.*.* \
$OVERTE/build/conanlibs/Release/libnode.so* \
$OVERTE/build/conanlibs/Release/libtbb.so* \
$OVERTE/build/assignment-client/plugins/*.so \
$OVERTE/build/assignment-client/plugins/*/*.so \
| xargs -I {} sh -c 'objdump -p {} | grep NEEDED' \
@ -62,25 +37,6 @@ DEPENDS=mesa-libGL,`ls \
| xargs rpm -qf --queryformat "%{NAME}\n" \
| sort | uniq \
| paste -d',' -s`
else
DEPENDS=mesa-libGL,`ls \
$OVERTE/build/assignment-client/assignment-client \
$OVERTE/build/domain-server/domain-server \
$OVERTE/build/tools/oven/oven \
$OVERTE/build/libraries/*/*.so \
$VCPKG_INSTALL_ROOT/lib/libnode.so* \
$OVERTE/build/assignment-client/plugins/*.so \
$OVERTE/build/assignment-client/plugins/*/*.so \
| xargs -I {} sh -c 'objdump -p {} | grep NEEDED' \
| awk '{print $2}' \
| sort | uniq \
| grep -E -v "^($SOFILES)$" \
| grep -v ^libGL \
| xargs -I {} sh -c "ldconfig -p | grep {} | tr ' ' '\n' | grep /" \
| xargs rpm -qf --queryformat "%{NAME}\n" \
| sort | uniq \
| paste -d',' -s`
fi
sudo yum install chrpath

View file

@ -1,5 +1,5 @@
# Copyright 2020-2021 Vircadia contributors.
# Copyright 2022-2024 Overte e.V.
# Copyright 2022-2025 Overte e.V.
# SPDX-License-Identifier: Apache-2.0
#OVERTE=~/Overte rpmbuild --target x86_64 -bb overte-server.spec
@ -50,7 +50,10 @@ install -d $RPM_BUILD_ROOT/opt/overte/lib
install -m 0644 -t $RPM_BUILD_ROOT/opt/overte/lib $OVERTE/build/libraries/*/*.so
strip --strip-all $RPM_BUILD_ROOT/opt/overte/lib/*
chrpath -d $RPM_BUILD_ROOT/opt/overte/lib/*
install -m 0644 -t $RPM_BUILD_ROOT/opt/overte/lib $VCPKG_INSTALL_ROOT/lib/libnode.so*
# hack: we get libnode.so.108 from conan-libs folder, because we don't know if it is available on the system.
install -m 0644 -t $RPM_BUILD_ROOT/opt/overte/lib $OVERTE/build/conanlibs/Release/libnode.so*
# hack: we get libttb.so.12 from conan-libs folder, because we don't know if it is available on the system.
install -m 0644 -t $RPM_BUILD_ROOT/opt/overte/lib $OVERTE/build/conanlibs/Release/libtbb.so*
%if "$OVERTE_USE_SYSTEM_QT" == ""
install -m 0644 -t $RPM_BUILD_ROOT/opt/overte/lib $QT5_LIBS/libQt5Network.so.*.*.*
install -m 0644 -t $RPM_BUILD_ROOT/opt/overte/lib $QT5_LIBS/libQt5Core.so.*.*.*