Removed RUNPATH from Bloom's binary (except for debug builds), and created invocation script
This commit is contained in:
@@ -13,10 +13,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
|
||||
|
||||
option(EXCLUDE_INSIGHT "Exclude the Insight component from this build" OFF)
|
||||
|
||||
set(CMAKE_SKIP_BUILD_RPATH false)
|
||||
set(CMAKE_BUILD_RPATH_USE_ORIGIN true)
|
||||
set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib:/usr/local/lib")
|
||||
set(CMAKE_BUILD_RPATH ${CMAKE_INSTALL_RPATH})
|
||||
set(CMAKE_SKIP_RPATH true)
|
||||
set(COMPILED_RESOURCES_BUILD_DIR ${CMAKE_BINARY_DIR}/compiled_resources/)
|
||||
|
||||
add_compile_definitions(BLOOM_VERSION="${CMAKE_PROJECT_VERSION}")
|
||||
@@ -41,6 +38,8 @@ if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
|
||||
# CMAKE_BUILD_RPATH needs to point to the local Qt installation, to use Gammaray during development.
|
||||
# This is because the distributed Qt binaries may not be compatible with the local installation of Gammaray
|
||||
# If you don't intend to use Gammaray, you can comment this out
|
||||
set(CMAKE_SKIP_RPATH false)
|
||||
set(CMAKE_SKIP_BUILD_RPATH false)
|
||||
set(CMAKE_BUILD_RPATH /opt/Qt/6.2.4/gcc_64/lib/)
|
||||
endif()
|
||||
|
||||
@@ -130,11 +129,6 @@ target_compile_options(
|
||||
PUBLIC $<$<CONFIG:DEBUG>:-fkeep-static-functions>
|
||||
)
|
||||
|
||||
target_link_options(
|
||||
Bloom
|
||||
PUBLIC [=[-Wl,-z,origin]=] #,--verbose
|
||||
)
|
||||
|
||||
if (${ENABLE_SANITIZERS})
|
||||
message(WARNING "Sanitizers have been enabled")
|
||||
|
||||
|
||||
7
build/packaging/bloom.sh.in
Normal file
7
build/packaging/bloom.sh.in
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
BloomInstallationDir=@BLOOM_INSTALLATION_PREFIX@
|
||||
|
||||
LD_LIBRARY_PATH=$BloomInstallationDir/lib:$LD_LIBRARY_PATH;
|
||||
export LD_LIBRARY_PATH;
|
||||
exec $BloomInstallationDir/bin/bloom "$@";
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
PLAYGROUND_DIR=@CMAKE_BINARY_DIR@/packaging/deb/playground;
|
||||
DEBIAN_DIR=${PLAYGROUND_DIR}/DEBIAN
|
||||
BLOOM_INSTALLATION_PREFIX=/opt/bloom/
|
||||
BLOOM_INSTALLATION_PREFIX=@BLOOM_INSTALLATION_PREFIX@/
|
||||
BLOOM_INSTALLATION_DIR=${PLAYGROUND_DIR}/${BLOOM_INSTALLATION_PREFIX}
|
||||
BLOOM_PACKAGE_PATH=@CMAKE_BINARY_DIR@/packaging/@BLOOM_PACKAGE_FILE_NAME@.deb
|
||||
|
||||
@@ -28,6 +28,9 @@ cp -a @CMAKE_BINARY_DIR@/packaging/deb/control ${DEBIAN_DIR}/;
|
||||
echo "Copying Bloom binary...";
|
||||
cp -a @CMAKE_BINARY_DIR@/bin/bloom ${BLOOM_INSTALLATION_DIR}/bin/;
|
||||
|
||||
echo "Copying Bloom invocation script...";
|
||||
cp -a @CMAKE_BINARY_DIR@/packaging/bloom.sh ${BLOOM_INSTALLATION_DIR}/bin/;
|
||||
|
||||
echo "Copying resources...";
|
||||
cp -a @CMAKE_BINARY_DIR@/resources ${BLOOM_INSTALLATION_DIR}/;
|
||||
cp -a @CMAKE_CURRENT_SOURCE_DIR@/build/distributed/fonts ${BLOOM_INSTALLATION_DIR}/resources/;
|
||||
@@ -48,8 +51,8 @@ chmod u=rwX,g=rX,o=rX -R ${BLOOM_INSTALLATION_DIR}/resources/;
|
||||
|
||||
chmod u=rw,g=r,o=r ${PLAYGROUND_DIR}/lib/udev/rules.d/99-bloom.rules;
|
||||
|
||||
echo "Creating symbolic link for Bloom binary..."
|
||||
ln -s -f ${BLOOM_INSTALLATION_PREFIX}./bin/bloom ${PLAYGROUND_DIR}/usr/bin/;
|
||||
echo "Creating symbolic link for Bloom's invocation script..."
|
||||
ln -s -f ${BLOOM_INSTALLATION_PREFIX}./bin/bloom.sh ${PLAYGROUND_DIR}/usr/bin/bloom;
|
||||
|
||||
echo "Building Debian package...";
|
||||
dpkg-deb --build ${PLAYGROUND_DIR} ${BLOOM_PACKAGE_PATH};
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
PLAYGROUND_DIR=@CMAKE_BINARY_DIR@/packaging/pkgbuild/playground;
|
||||
BUILD_ROOT_DIR=${PLAYGROUND_DIR}/build_root
|
||||
BLOOM_INSTALLATION_PREFIX=/opt/bloom/
|
||||
BLOOM_INSTALLATION_PREFIX=@BLOOM_INSTALLATION_PREFIX@/
|
||||
BLOOM_INSTALLATION_DIR=${BUILD_ROOT_DIR}/${BLOOM_INSTALLATION_PREFIX}
|
||||
BLOOM_PACKAGE_PATH=@CMAKE_BINARY_DIR@/packaging/@BLOOM_PACKAGE_FILE_NAME@.pkg.tar.gz
|
||||
|
||||
@@ -28,6 +28,9 @@ cp -a @CMAKE_BINARY_DIR@/packaging/pkgbuild/PKGBUILD ${PLAYGROUND_DIR}/;
|
||||
echo "Copying Bloom binary...";
|
||||
cp -a @CMAKE_BINARY_DIR@/bin/bloom ${BLOOM_INSTALLATION_DIR}/bin/;
|
||||
|
||||
echo "Copying Bloom invocation script...";
|
||||
cp -a @CMAKE_BINARY_DIR@/packaging/bloom.sh ${BLOOM_INSTALLATION_DIR}/bin/;
|
||||
|
||||
echo "Copying resources...";
|
||||
cp -a @CMAKE_BINARY_DIR@/resources ${BLOOM_INSTALLATION_DIR}/;
|
||||
cp -a @CMAKE_CURRENT_SOURCE_DIR@/build/distributed/fonts ${BLOOM_INSTALLATION_DIR}/resources/;
|
||||
@@ -51,8 +54,8 @@ chmod u=rwX,g=rX,o=rX -R ${BLOOM_INSTALLATION_DIR}/resources/;
|
||||
|
||||
chmod u=rw,g=r,o=r ${BUILD_ROOT_DIR}/usr/lib/udev/rules.d/99-bloom.rules;
|
||||
|
||||
echo "Creating symbolic link for Bloom binary..."
|
||||
ln -s -f ${BLOOM_INSTALLATION_PREFIX}./bin/bloom ${BUILD_ROOT_DIR}/usr/bin/;
|
||||
echo "Creating symbolic link for Bloom's invocation script..."
|
||||
ln -s -f ${BLOOM_INSTALLATION_PREFIX}./bin/bloom.sh ${BUILD_ROOT_DIR}/usr/bin/bloom;
|
||||
|
||||
echo "Building Arch package...";
|
||||
cd ${PLAYGROUND_DIR};
|
||||
|
||||
@@ -5,7 +5,7 @@ SPECS_DIR=${PLAYGROUND_DIR}/SPECS;
|
||||
SOURCES_DIR=${PLAYGROUND_DIR}/SOURCES;
|
||||
RELEASE_DIR_NAME=@BLOOM_PACKAGE_NAME_LOWER@-@CMAKE_PROJECT_VERSION@;
|
||||
RELEASE_DIR=${PLAYGROUND_DIR}/${RELEASE_DIR_NAME};
|
||||
BLOOM_INSTALLATION_PREFIX=/opt/bloom/
|
||||
BLOOM_INSTALLATION_PREFIX=@BLOOM_INSTALLATION_PREFIX@/
|
||||
BLOOM_INSTALLATION_DIR=${RELEASE_DIR}/${BLOOM_INSTALLATION_PREFIX}
|
||||
BLOOM_PACKAGE_PATH=@CMAKE_BINARY_DIR@/packaging/@BLOOM_PACKAGE_FILE_NAME@.rpm
|
||||
|
||||
@@ -37,6 +37,9 @@ cp -a @CMAKE_BINARY_DIR@/packaging/rpm/bloom.spec ${SPECS_DIR}/;
|
||||
echo "Copying Bloom binary...";
|
||||
cp -a @CMAKE_BINARY_DIR@/bin/bloom ${BLOOM_INSTALLATION_DIR}/bin/;
|
||||
|
||||
echo "Copying Bloom invocation script...";
|
||||
cp -a @CMAKE_BINARY_DIR@/packaging/bloom.sh ${BLOOM_INSTALLATION_DIR}/bin/;
|
||||
|
||||
echo "Copying resources...";
|
||||
cp -a @CMAKE_BINARY_DIR@/resources ${BLOOM_INSTALLATION_DIR}/;
|
||||
cp -a @CMAKE_CURRENT_SOURCE_DIR@/build/distributed/fonts ${BLOOM_INSTALLATION_DIR}/resources/;
|
||||
@@ -57,8 +60,8 @@ chmod u=rwX,g=rX,o=rX -R ${BLOOM_INSTALLATION_DIR}/resources/;
|
||||
|
||||
chmod u=rw,g=r,o=r ${RELEASE_DIR}/usr/lib/udev/rules.d/99-bloom.rules;
|
||||
|
||||
echo "Creating symbolic link for Bloom binary..."
|
||||
ln -s -f ${BLOOM_INSTALLATION_PREFIX}./bin/bloom ${RELEASE_DIR}/usr/bin/;
|
||||
echo "Creating symbolic link for Bloom's invocation script..."
|
||||
ln -s -f ${BLOOM_INSTALLATION_PREFIX}./bin/bloom.sh ${RELEASE_DIR}/usr/bin/bloom;
|
||||
|
||||
echo "Creating release tarball..."
|
||||
tar -zcvf ${SOURCES_DIR}/@BLOOM_PACKAGE_NAME_LOWER@-@CMAKE_PROJECT_VERSION@.tar.gz -C ${PLAYGROUND_DIR} ./${RELEASE_DIR_NAME}
|
||||
|
||||
@@ -3,9 +3,19 @@ set(BLOOM_PACKAGE_FILE_NAME "Bloom-${CMAKE_PROJECT_VERSION}-Linux-x86_64")
|
||||
set(BLOOM_PACKAGE_DESCRIPTION "Debugger for AVR-based embedded systems")
|
||||
set(BLOOM_PACKAGE_CONTACT "Nav Mohammed <support@bloom.oscillate.io>")
|
||||
|
||||
# All generated packages will install Bloom to BLOOM_INSTALLATION_PREFIX
|
||||
set(BLOOM_INSTALLATION_PREFIX "/opt/bloom")
|
||||
|
||||
string(TOLOWER ${BLOOM_PACKAGE_NAME} BLOOM_PACKAGE_NAME_LOWER)
|
||||
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/packaging/pkgbuild")
|
||||
|
||||
# Generate Bloom's invocation script
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/build/packaging/bloom.sh.in"
|
||||
"${CMAKE_BINARY_DIR}/packaging/bloom.sh"
|
||||
@ONLY
|
||||
)
|
||||
|
||||
# Generate the DEB control file and packaging script
|
||||
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/packaging/deb")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user