Corrected issues with building and packaging

This commit is contained in:
Nav
2021-04-14 23:17:30 +01:00
parent d76b1e3f24
commit e79b3a42fb
8 changed files with 37 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.10)
project(Bloom LANGUAGES CXX VERSION 0.1)
project(Bloom LANGUAGES CXX VERSION 0.0.1)
set(CMAKE_VERBOSE_MAKEFILE off)
@@ -26,7 +26,8 @@ find_package(Qt5Xml)
find_package(Qt5Svg)
find_package(Qt5UiTools)
set(CMAKE_SKIP_BUILD_RPATH true)
# CMAKE_SKIP_BUILD_RPATH needs to be set to true to use Gammaray during development
set(CMAKE_SKIP_BUILD_RPATH false)
set(CMAKE_BUILD_RPATH_USE_ORIGIN true)
set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib")
set(CMAKE_BUILD_RPATH ${CMAKE_INSTALL_RPATH})
@@ -200,7 +201,6 @@ endif()
set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/release/")
install(TARGETS Bloom DESTINATION bin PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ)
install(FILES build/bin/bloom.json DESTINATION bin PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ) # Remove this
install(DIRECTORY build/bin/plugins DESTINATION "bin" DIRECTORY_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ)
install(DIRECTORY build/bin/platforms DESTINATION "bin" DIRECTORY_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ)
install(DIRECTORY build/resources DESTINATION "." DIRECTORY_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ)
@@ -211,7 +211,7 @@ set(CPACK_GENERATOR "DEB")
set(CPACK_DEBIAN_PACKAGE_NAME "Bloom")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "")
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/resources/packaging/description.txt CPACK_DEBIAN_PACKAGE_DESCRIPTION)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A Linux-based debug interface for embedded systems development")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A debug interface for embedded systems development on Linux")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Bloom Support <support@bloom.oscillate.io>")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://bloom.oscillate.io")
set(CPACK_PACKAGE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

View File

@@ -108,7 +108,7 @@ sudo nano /usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf
# You may also need to change the path to the compiler
# You may also need to supply an absolute path to the source (cmake gets a bit weird about this, sometimes)
cd /path/to/Bloom/build/cmake-build-debug/;
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=/usr/bin/g++-9 ./;
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=/usr/bin/g++-9 ../../;
```
- To build Bloom (debug):
```

View File

@@ -10,8 +10,8 @@ rm -fr "_CPack_Packages";
export CMAKE_PREFIX_PATH=/opt/Qt/5.12.10/gcc_64/
cd build/cmake-build-debug/ && cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=/usr/bin/g++-9 /home/nav/Projects/Bloom/
cd /home/nav/Projects/Bloom/ && cmake --build /home/nav/Projects/Bloom/build/cmake-build-debug --target clean
cd build/cmake-build-release/ && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=/usr/bin/g++-9 ../../
cd /home/nav/Projects/Bloom/ && cmake --build /home/nav/Projects/Bloom/build/cmake-build-release --target clean
cmake --build /home/nav/Projects/Bloom/build/cmake-build-debug --target Bloom
cmake --install /home/nav/Projects/Bloom/build/cmake-build-debug --target Bloom
cmake --build /home/nav/Projects/Bloom/build/cmake-build-release --target Bloom
cmake --install /home/nav/Projects/Bloom/build/cmake-build-release --target Bloom

View File

@@ -1 +1 @@
Bloom is a Linux-based debug interface for embedded systems development. Bloom supports most Microchip AVR8 targets, along with numerous EDBG-based debug tools.
A debug interface for embedded systems development on Linux. Bloom supports most Microchip AVR8 targets, along with numerous EDBG-based debug tools.

View File

@@ -2,12 +2,12 @@
BLOOM_UDEV_FILE_PATH=/etc/udev/rules.d/
if [ ! -f "${BLOOM_UDEV_FILE_PATH}/99-bloom.rules" ]; then
if [ ! -f "${BLOOM_UDEV_FILE_PATH}/99-bloom.rules" ] || [ ! -L "${BLOOM_UDEV_FILE_PATH}/99-bloom.rules" ] || [ ! -e "${BLOOM_UDEV_FILE_PATH}/99-bloom.rules" ]; then
sudo ln -s /opt/bloom/resources/UDevRules/99-bloom.rules "$BLOOM_UDEV_FILE_PATH";
fi
if [ -f "/usr/bin/bloom" ]; then
if [ -f "/usr/bin/bloom" ] || [ -L "/usr/bin/bloom" ] || [ -e "/usr/bin/bloom" ]; then
sudo rm /usr/bin/bloom;
fi

View File

@@ -2,10 +2,10 @@
BLOOM_UDEV_FILE_PATH=/etc/udev/rules.d/
if [ -f "${BLOOM_UDEV_FILE_PATH}/99-bloom.rules" ]; then
if [ -f "${BLOOM_UDEV_FILE_PATH}/99-bloom.rules" ] || [ -L "${BLOOM_UDEV_FILE_PATH}/99-bloom.rules" ] || [ -e "${BLOOM_UDEV_FILE_PATH}/99-bloom.rules" ]; then
sudo rm "$BLOOM_UDEV_FILE_PATH/99-bloom.rules";
fi
if [ -f "/usr/bin/bloom" ]; then
if [ -f "/usr/bin/bloom" ] || [ -L "/usr/bin/bloom" ] || [ -e "/usr/bin/bloom" ]; then
sudo rm /usr/bin/bloom;
fi

View File

@@ -51,7 +51,7 @@ void Insight::startup() {
std::string qtAppName = "Bloom";
char* appArguments[] = {qtAppName.data()};
auto appArgCount = 1;
// QCoreApplication::addLibraryPath(QString::fromStdString(Application::getApplicationDirPath() + "/plugins"));
QCoreApplication::addLibraryPath(QString::fromStdString(Application::getApplicationDirPath() + "/plugins"));
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);
this->application = new QApplication(appArgCount, appArguments);

View File

@@ -127,6 +127,28 @@ void InsightWindow::init(
this->ioUnavailableWidget->show();
}
/*
* Do not delete svgWidget. It seems like it's absolutely pointless, but it's really not. I know this is gross but
* I don't seem to have any other option.
*
* You see, we use Qt's SVG libraries for some icons and other graphics in the Insight window, but because these are
* all loaded via the .ui and .qss file (at runtime, by Qt), and the fact that we don't use QSvgWidget anywhere in
* our C++ code, the linker doesn't link the SVG library to the Bloom binary! This then leads to the failure of
* rendering SVG images at runtime.
*
* I've scowered the internet looking for a solution to this, but I've found nothing! There was one post on the
* Qt forum, where someone had the very same issue: https://forum.qt.io/topic/61875/cmake-is-not-linking but no
* helpful responses.
*
* The easy solution is finding an excuse to use the QSvgWidget class in our code, but we have no real requirement
* of that.
*
* So for now, I'm just going to create an instance to QSvgWidget() here. Doing so will force the linker to link
* the libQt5Svg library. This will need to remain here until I find a better solution, or an actual need for the
* QSVGWidget class in our code.
*/
auto svgWidget = QSvgWidget();
}
void InsightWindow::selectVariant(const TargetVariant* variant) {